The invention of the crossbow seems to be a case of co-vergent evolution, as there is no evidence that the Qin/Han dynasty crossbows influenced their invention in Europe.
Bronze trigger mechanisms for crossbows in ancient China date back to about the 7th Century BC. Organic components for both the crossbow and the repeating crossbow date as far back as the 4th to 2nd centuries BC, in terms of the archaeological evidence. The textual evidence for crossbows from this period is also significant. We don't know how it evolved before the archaeological evidence, however, and I'll discuss that in a minute.
In the mediterranean sphere, the evolution of the crossbow seems to have come about in a different manner. In ancient Greece the invention of torsion powered antipersonnel and siege engines occurs some time around the 6th through 5th centuries BC. By the late 5th century BC, a handheld weapon known as the Gastraphetes had developed. This was not a proper crossbow, but a belly bow. Effectively it used the same ratcheting mechanism as the ballista or catapulta, but lacked the torsion springs and used a wooden prod instead. The User would press the nose into the ground with the bowstring locked into place by the trigger mechanism, and by pressing on the rear with their stomach/chest. It was fired from the hip in this same manner, with the rear pressed against their stomach, rather than aimed like a proper crossbow. For obvious reasons it seems the Gastraphetes didn't last long. It was slow and impractical to use against opponents armed with self-bows or composite bows, and offered little advantage over either training someone with a proper bow or just building and training a catapulta crew (the catapultae were typically the small "cheiroballista" or "scorpio" devices. They were differentiated from the Ballista by the orientation of the torsion springs, called Palintonos and Euthytonos respectively.)
The next evidence for crossbows comes from the Haute-Loire reliefs in the 3rd Century AD, which depict Romans in a hunting scene with what appear to be crossbows. It's suspected that a symmetrical Qum Darya-type composite bow was attached to the tiller, and that the device fired a full-length arrow rather than a bolt. This also suggests, alongside the textual evidence, that it evolved out of the standard wooden arrow guide. Vegetius mentions such things, which he calls an arcuballista - the "bow bolt thrower" - and manuballista - the "hand bolt thrower". Modern scholars suspect these don't refer to the crossbow and the 4th century cheiroballista (e.g. Orsova, Lyon), but to the wooden and leather arrow guide. The wooden arrow guide is evidenced later, known as the Solenarion in the Strategikon of Maurice, and mentioned later in Leo's Taktika as well as other "Byzantine"-era military texts. But the Roman-era crossbow survived - we have finds of roller nuts for Anglo-Saxon examples dating possibly as early as the 6th century, but definitively from the 8th Century, and the 9th century Granada crossbow is similar in general appearance albeit it has a prod the thickness of a 2x4.
So going back to what I mentioned earlier, we have an idea of how the crossbow evolved - it seems to have come from the wooden fixed arrow guide. The question is, we don't know if the fixed arrow guide was transmitted to Europe from central Asian steppes (arrow guides were probably a steppe nomad invention), or even if the Chinese crossbow also evolved out of an arrow guide.
I hope this answers your question.
The military European and Asian crossbows that we know well might both be descended from an earlier tradition of low-power hunting crossbows. We have no evidence where these might have originated, as they are widespread tribal hunting weapons, and might have see multiple re-inventions, in Asia (which is, in itself, very large and diverse), Europe, and Africa.
As for the later military crossbows, we don't have any good evidence that the European crossbows were influenced by Asian crossbows. But it has been suggested as a possibility.
A similar question was asked before, and my answer is in https://old.reddit.com/r/AskHistorians/comments/c8ohjw/short_answers_to_simple_questions_july_03_2019/eszwhne/?context=3