This form is definitely one that Chojun Miyagi created after he returned from training in China. He presented it in 1921 as a 'softer' version of the 'harder' Sanchin. It was to represent the ju (soft) aspect of Goju ryu karate. Precisely where Master Miyagi got his inspiration from though is a matter of some conjecture. Conventional history tells us that it developed out of Rokusho, a White Crane kung fu form. Five of the six hand positions detailed in the Bubishi - The Six Hands of the Shaolin Style - occur in the form. These were hand positions used to deliver accurate blows that could be deadly.
Another theory though is that Master Miyagi based it on a form - unknown at the present time - that he learned while in Fuzhou or that it is based on something (also presently unknown if true) he studied with Master Gokenki, a White Crane master actively teaching on Okinawa between 1912-1940.
Another idea (that I came across from Kancho Nenad Djurdjevic, based in Australia) is that the kata amalgamated and supplemented techniques that were practiced individually as 'basic' techniques at the Kodo training hall located in Fuzhou and used by Okinawan ex-pats. These movements, while no doubt based on kung fu techniques, were isolated from forms and simply practiced as we perform kihon today. This is a very interesting theory and from the information available it seems to me that an investigation of some of the Shotokan kata from this point of view may be worth undertaking.
Master Morio Higaonna performing Tensho