Invention content
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of sides of remote transmission data
Method, system and the mobile device being applicable in, for solving the restricted problem that different platform runs program in the prior art.
In order to achieve the above objects and other related objects, the present invention provides a kind of method of remote transmission data, including with
Lower step:Obtain the data text based on Tag Packaging;Based on current running environment, by what is parsed from the data text
Data are encapsulated in corresponding object;The object is transmitted by remote transmission corridors.
Preferably, described based on current running environment, the data parsed from the data text are encapsulated in accordingly
Object in mode include:Based on the identification information of acquired present procedure operation platform, selection is run with described program
The corresponding analysis program of environment, and the analysis program is run to execute:According to the label of root node in the data text, really
Fixed corresponding object;Data corresponding to each label under root node label described in the data text are loaded into and are determined
Object in.
Preferably, described to include in such a way that remote transmission corridors are transmitted by object:The object encapsulation is existed
Remote transmission client-side interface, the serializing mode supported according to current operation system carry out the object after encapsulation
Serializing, and sent by remote transmission corridors;Alternatively, by the object encapsulation in remote transmission services end interface,
And when receiving call request by the remote transmission corridors, the serializing mode supported according to current operation platform,
The object after encapsulation is serialized, and is sent by remote transmission corridors.
Preferably, the data text is encapsulated based on XML tag.
Based on above-mentioned purpose, the present invention also provides a kind of systems of remote transmission data, including:Acquisition module, for obtaining
Take the data text based on Tag Packaging;Package module, for that based on current running environment, will be parsed from the data text
The data gone out are encapsulated in corresponding object;Transmission module, for being transmitted the object by remote transmission corridors.
Preferably, the package module be used for the identification information based on acquired present procedure operation platform, selection with
The corresponding analysis program of described program running environment, and the analysis program is run to execute:According to root in the data text
The label of node determines corresponding object;By the number corresponding to each label under root node label described in the data text
According in object determined by being loaded into.
Preferably, the transmission module is used for the object encapsulation in remote transmission client-side interface, according to current behaviour
Make the serializing mode that system is supported, the object after encapsulation is serialized, and is given by remote transmission corridors
It sends;Alternatively, the transmission module is used for by the object encapsulation in remote transmission services end interface, and when by described remote
When journey transmission channel receives call request, the serializing mode supported according to current operation platform, described in after encapsulation
Object is serialized, and is sent by remote transmission corridors.
Preferably, the data text is encapsulated based on XML tag.
Based on above-mentioned purpose, the present invention also provides a kind of mobile devices, including:As above any remote transmission data
System.
As described above, method, system and the mobile device being applicable in of the remote transmission data of the present invention, have with following
Beneficial effect:The object parsed from label text is directly subjected to far call, and parse remote invocation of objects when
It waits according to current system environments, switchs to different platform language object, advantageously account for the limitation that different platform runs program;
The working efficiency of technical staff is improved simultaneously.
Specific implementation mode
Illustrate that embodiments of the present invention, those skilled in the art can be by this specification below by way of specific specific example
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It should be noted that the diagram provided in following embodiment only illustrates the basic structure of the present invention in a schematic way
Think, component count, shape and size when only display is with related component in the present invention rather than according to actual implementation in schema then
Draw, when actual implementation kenel, quantity and the ratio of each component can be a kind of random change, and its assembly layout kenel
It is likely more complexity.
Referring to Fig. 1, the present invention provides a kind of method of remote transmission data.The transmission method is mainly by Transmission system
To execute.The Transmission system can be applied in server-side, can also be applied in client.Wherein, the server-side is installation
There is the electronic equipment of remote transmission service end interface.The visitor end refers to being equipped with the electronics of remote transmission client-side interface to set
It is standby.It can be seen that may be server or mobile device as the electronic equipment of server-side and client.For example, in P2P
In framework, the mobile device for being equipped with remote transmission service end interface is server-side, is equipped with remote transmission client-side interface
Mobile device be client.Either server-side or client, may be by mode transmission data of the present invention,
And it is not limited by itself program operation platform and operating system.
In step sl, the Transmission system obtains the data text based on Tag Packaging.
Specifically, when the client where Transmission system described in user's operation is intended to transmit comprising most evidence, even big datas
When, each data preparation to be transmitted at the data text based on Tag Packaging and is supplied to the Transmission system.
Alternatively, the server-side where the Transmission system is based on acquired call request, the server-side will be passed
Defeated most evidence even big datas are organized into the data text based on Tag Packaging and are supplied to the Transmission system.
Wherein, the data text based on Tag Packaging can be the HTTP texts of HTTP Tag Packagings.Preferably, it is
More flexible configuration, the data text based on Tag Packaging are the data text encapsulated based on XML tag.
For example, the data text is as follows:
<Xml version=" 1.0 " encoding=" gb2312 ">
<Flower>
<Vendor>shop1</Vendor>
<Name>iris</Name>
<Price>$4.00</Price>
<Picked>pick up</Picked>
<cut>cut out</cut>
</Flower>
In step s 2, the Transmission system is based on current running environment, the number that will be parsed from the data text
According to being encapsulated in corresponding object.
Here, the running environment refers to present procedure operation platform comprising but be not limited to:JAVA platforms, IOS operations
System, Android operation system, windows operating systems etc..
Specifically, the Transmission system obtains the identification information of the operating system of present procedure operation, selection and the journey
The corresponding analysis program of sort run environment, and the analysis program is run to execute:According to root node in the data text
Label determines corresponding object;And by the data corresponding to each label under root node label described in the data text
In object determined by being loaded into.
Here, the identification information includes but not limited to the version number etc. of operation platform (or operating system).The transmission
Systematic selection corresponds to the analysis program of the identification information, and is run.
For example, described in the Transmission system according to the correspondence between preset each root node label and object, determines
The label of root node in data text<Flower>Corresponding Flower objects.XML text resolvers are recycled, described in extraction<
Flower>The Vendor in Flower objects, name, price attributes and Picked, the side cut are corresponded under root node in each label
Method, and these attributes and method data are loaded into the Flower objects, and execute step S3.
In step s3, the Transmission system is transmitted the object by remote transmission corridors.
Specifically, the Transmission system can be used http protocol etc. and be transmitted obtained object.
Preferably, if electronic equipment is client where the Transmission system, by the object encapsulation in remote transmission
Client-side interface, the serializing mode supported according to current operation system serialize the object after encapsulation, and
It is sent by remote transmission corridors.
For example, the Transmission system is carried out data transmission using RMI far calls.As client, the Transmission system
Stub classes are created, and by obtained Flower object encapsulations in the Stub classes, obtains corresponding Stub object handles and draws
Enter Socket remotely to be connected:Specifically, the serializing Processing Interface supported according to current operation platform, by the Stub
Object is into row buffer byte read-write operation.By corresponding Sokect attended operations, system bottom establish Transport into
Row communication.Wherein, if the operation platform is Android operation system, by inheriting Java.io.Serializable types,
By Stub objects by derived types such as inputstream, and outputstream into row buffer byte read-write operation.
If electronic equipment where the Transmission system is server-side, the object encapsulation is serviced in remote transmission and is terminated
In mouthful, and when receiving call request by the remote transmission corridors, the serializing supported according to current operation platform
The object after encapsulation is serialized, and is sent by remote transmission corridors by mode.
For example, the Transmission system is carried out data transmission using RMI far calls.As server-side, the Transmission system
It creates with the Flower objects of skeletons class wrappers in case calling.When the Transmission system receives corresponding Flower objects
Call request, then the Transmission system will with the skeletons object handles of skeletons class wrappers introduce Socket carry out
Long-range connection.
Here, being introduced into, the mode that Socket is remotely connected is identical with aforementioned exemplary, and this will not be detailed here.
Referring to Fig. 2, the present invention provides a kind of system of remote transmission data.The Transmission system, which can be applied, to be serviced
End, can also apply in client.Wherein, the server-side is to be equipped with the electronic equipment of remote transmission service end interface.Institute
It refers to the electronic equipment for being equipped with remote transmission client-side interface to state objective end.It can be seen that the electricity as server-side and client
Sub- equipment may be server or mobile device.For example, in P2P frameworks, the shifting of remote transmission service end interface is installed
Dynamic equipment is server-side, and the mobile device for being equipped with remote transmission client-side interface is client.Either server-side is also
It is client, may be by mode transmission data of the present invention and not by itself program operation platform and operating system
Limitation.
The Transmission system includes:Acquisition module, package module, transmission module.
The acquisition module is for obtaining the data text based on Tag Packaging.
Specifically, when the client where Transmission system described in user's operation is intended to transmit comprising most evidence, even big datas
When, each data preparation to be transmitted at the data text based on Tag Packaging and is supplied to the acquisition module.
Alternatively, the server-side where the Transmission system is based on acquired call request, the server-side will be passed
Defeated most evidence even big datas are organized into the data text based on Tag Packaging and are supplied to the acquisition module.
Wherein, the data text based on Tag Packaging can be the HTTP texts of HTTP Tag Packagings.Preferably, it is
More flexible configuration, the data text based on Tag Packaging are the data text encapsulated based on XML tag.
For example, the data text is as follows:
<Xml version=" 1.0 " encoding=" gb2312 ">
<Flower>
<Vendor>shop1</Vendor>
<Name>iris</Name>
<Price>$4.00</Price>
<Picked>pick up</Picked>
<cut>cut out</cut>
</Flower>
The package module is used to, based on current running environment, the data parsed from the data text be encapsulated in
In corresponding object.
Here, the running environment refers to present procedure operation platform comprising but be not limited to:JAVA platforms, IOS operations
System, Android operation system, windows operating systems etc..
Specifically, the package module obtains the identification information of the operating system of present procedure operation, selection and the journey
The corresponding analysis program of sort run environment, and the analysis program is run to execute:According to root node in the data text
Label determines corresponding object;And by the data corresponding to each label under root node label described in the data text
In object determined by being loaded into.
Here, the identification information includes but not limited to the version number etc. of operation platform (or operating system).The encapsulation
The analysis program of the corresponding identification information of module selection, and run.
For example, described in the package module according to the correspondence between preset each root node label and object, determines
The label of root node in data text<Flower>Corresponding Flower objects.XML text resolvers are recycled, described in extraction<
Flower>The Vendor in Flower objects, name, price attributes and Picked, the side cut are corresponded under root node in each label
Method, and these attributes and method data are loaded into the Flower objects, and execute transmission module.
The transmission module is for being transmitted the object by remote transmission corridors.
Specifically, the transmission module can be used http protocol etc. and be transmitted obtained object.
Preferably, if electronic equipment is client where the transmission module, by the object encapsulation in remote transmission
Client-side interface, the serializing mode supported according to current operation system serialize the object after encapsulation, and
It is sent by remote transmission corridors.
For example, the transmission module is carried out data transmission using RMI far calls.As client, the transmission module
Stub classes are created, and by obtained Flower object encapsulations in the Stub classes, obtains corresponding Stub object handles and draws
Enter Socket remotely to be connected:Specifically, the serializing Processing Interface supported according to current operation platform, by the Stub
Object is into row buffer byte read-write operation.By corresponding Sokect attended operations, system bottom establish Transport into
Row communication.Wherein, if the operation platform is Android operation system, by inheriting Java.io.Serializable types,
By Stub objects by derived types such as inputstream, and outputstream into row buffer byte read-write operation.
If electronic equipment where the transmission module is server-side, the object encapsulation is serviced in remote transmission and is terminated
In mouthful, and when receiving call request by the remote transmission corridors, the serializing supported according to current operation platform
The object after encapsulation is serialized, and is sent by remote transmission corridors by mode.
For example, the transmission module is carried out data transmission using RMI far calls.As server-side, the transmission module
It creates with the Flower objects of skeletons class wrappers in case calling.When the transmission module receives corresponding Flower objects
Call request, then the transmission module will with the skeletons object handles of skeletons class wrappers introduce Socket carry out
Long-range connection.
Here, being introduced into, the mode that Socket is remotely connected is identical with aforementioned exemplary, and this will not be detailed here.
In conclusion the object that the present invention parses XML directly carries out far call, and parsing far call pair
As when according to current system environments, switch to different platform language object, advantageously account for different platform to program run
Limitation.So the present invention effectively overcomes various shortcoming in the prior art and has high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology can all carry out modifications and changes to above-described embodiment without violating the spirit and scope of the present invention.Cause
This, institute is complete without departing from the spirit and technical ideas disclosed in the present invention by those of ordinary skill in the art such as
At all equivalent modifications or change, should by the present invention claim be covered.