CN104219299B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN104219299B
CN104219299B CN201410429299.2A CN201410429299A CN104219299B CN 104219299 B CN104219299 B CN 104219299B CN 201410429299 A CN201410429299 A CN 201410429299A CN 104219299 B CN104219299 B CN 104219299B
Authority
CN
China
Prior art keywords
private
common protocol
data
protocol
agreement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410429299.2A
Other languages
Chinese (zh)
Other versions
CN104219299A (en
Inventor
张少伟
左景龙
於一飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201410429299.2A priority Critical patent/CN104219299B/en
Publication of CN104219299A publication Critical patent/CN104219299A/en
Application granted granted Critical
Publication of CN104219299B publication Critical patent/CN104219299B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The disclosure, about a kind of data transmission method and device, belongs to Internet technical field.Comprise: receive data waiting for transmission; Send if data are destination servers, then the common protocol adopted during transmission data is converted to private agreement, adopt the private agreement after conversion to send the data to client, after by private protocol conversion being common protocol by client, then data are processed; If data be client send, then by transmission data private protocol conversion be common protocol, adopt conversion after common protocol send the data to destination server, by destination server, data are processed.The disclosure can solve the complicated and problem that cost is high of a set of proprietary protocol of exploitation, reaches the effect of saving transmission cost.

Description

Data transmission method and device
Technical field
The disclosure relates to Internet technical field, particularly a kind of data transmission method and device.
Background technology
The host-host protocol of present webpage is mainly based upon on HTTP (Hypertexttransferprotocol, HTML (Hypertext Markup Language)) protocol basis.Owing to there is a large amount of code repeated in the code of http protocol, add user access needed for the flow that takies and bandwidth, therefore, need to be optimized host-host protocol when transmitting data.
A kind of data transmission method that correlation technique provides comprises: when there is proxy server in network, network request is sent to proxy server by proprietary protocol by client; Network request is transmitted to external network by http protocol by proxy server; Feedback information is sent to proxy server by http protocol by external network; Feedback information is sent to client by proprietary protocol by proxy server.Owing to passing through 2G (SecondGeneration between client and proxy server, Generation Mobile Telecommunication System technology)/3G (ThirdGeneration, G mobile communication)/4G (ForthGeneration, forth generation mobile communication technology) network connection, therefore, flow and bandwidth by using the proprietary protocol of conversion can save user.
Summary of the invention
When using proprietary protocol to transmit data for solving between proxy server and client, need to develop a set of agreement, very complicated, and the problem that cost is too high, present disclose provides a kind of data transmission method and device.
According to the first aspect of disclosure embodiment, a kind of data transmission method is provided, comprises:
Receive data waiting for transmission;
Send if described data are destination servers, then the common protocol adopted during the described data of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Send if described data are clients, then by transmission described data private protocol conversion be common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server.
Optionally, described the common protocol that adopts during the described data of transmission is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
Optionally, the described private protocol conversion by the described data of transmission is common protocol, comprising:
Read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
Optionally, described method, also comprises:
Obtain and storage protocol is changed the mechanism, described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
According to the second aspect of disclosure embodiment, a kind of data transmission method is provided, comprises:
Obtain data waiting for transmission;
If described data are the data that will send to proxy server, then common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Common protocol is adopted to send to proxy server if described data are destination servers, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed.
Optionally, described common protocol is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
Optionally, described is described common protocol by described private protocol conversion, comprising:
Read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
Optionally, described method, also comprises:
Obtain and storage protocol is changed the mechanism, described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
According to the third aspect of disclosure embodiment, a kind of data transmission device is provided, comprises:
Data reception module, is configured to receive data waiting for transmission;
First transport module, be configured to when described data are destination server transmissions, the common protocol adopted during the described data received by the described data reception module of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Second transport module, be configured to when described data are client transmissions, the private protocol conversion of the described data received by the described data reception module of transmission is common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server.
Optionally, described first transport module, comprising:
First replaces submodule, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Code deletion submodule, is configured to read the deleting mechanism prestored, searches the public code meeting described deleting mechanism in described common protocol, delete described public code, obtains described private agreement.
Optionally, described second transport module, comprising:
Second replaces submodule, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Code adds submodule, be configured to read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
Optionally, described device, also comprises:
Mechanism acquisition module, is configured to obtain and storage protocol is changed the mechanism, and described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
According to the fourth aspect of disclosure embodiment, a kind of data transmission device is provided, comprises:
Data acquisition module, is configured to obtain data waiting for transmission;
First transport module, be configured to when the described data that described data acquisition module gets are the data that will send to proxy server, common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Second transport module, be configured to when the described data that described data acquisition module gets be destination server adopt common protocol to send to proxy server time, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed.
Optionally, described first transport module, comprising:
First replaces submodule, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Code deletion submodule, is configured to read the deleting mechanism prestored, searches the public code meeting described deleting mechanism in described common protocol, delete described public code, obtains described private agreement.
Optionally, described second transport module, comprising:
Second replaces submodule, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Code adds submodule, be configured to read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
Optionally, described device, also comprises:
Mechanism acquisition module, is configured to obtain and storage protocol is changed the mechanism, and described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
According to the 5th aspect of disclosure embodiment, a kind of data transmission device is provided, comprises:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive data waiting for transmission;
Send if described data are destination servers, then the common protocol adopted during the described data of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Send if described data are clients, then by transmission described data private protocol conversion be common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server.
According to the 6th aspect of disclosure embodiment, a kind of data transmission device is provided, comprises:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Obtain data waiting for transmission;
If described data are the data that will send to proxy server, then common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Common protocol is adopted to send to proxy server if described data are destination servers, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect:
By the common protocol that adopts during transmission data is converted to private agreement, adopt the private agreement after conversion to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed; Or, by transmission data private protocol conversion be common protocol, the common protocol after conversion is adopted to send the data to destination server, data are processed according to common protocol by destination server, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transmission cost.
Should be understood that, it is only exemplary that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in specification and to form the part of this specification, shows and meets embodiment of the present disclosure, and is used from specification one and explains principle of the present disclosure.
Fig. 1 is the implementation environment schematic diagram involved by each exemplary embodiment of the present disclosure.
Fig. 2 is the flow chart of a kind of data transmission method according to an exemplary embodiment.
Fig. 3 is the flow chart of a kind of data transmission method according to an exemplary embodiment.
Fig. 4 is the flow chart of a kind of data transmission method according to another exemplary embodiment.
Fig. 5 is the flow chart of a kind of data transmission method according to another exemplary embodiment.
Fig. 6 is the structured flowchart of a kind of data transmission device according to an exemplary embodiment.
Fig. 7 is the structured flowchart of a kind of data transmission device according to another exemplary embodiment.
Fig. 8 is the structured flowchart of a kind of data transmission device according to an exemplary embodiment.
Fig. 9 is the structured flowchart of a kind of data transmission device according to another exemplary embodiment.
Figure 10 is the block diagram of a kind of device for transfer of data according to an exemplary embodiment.
Figure 11 is the block diagram of a kind of device for transfer of data according to an exemplary embodiment.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Execution mode described in following exemplary embodiment does not represent all execution modes consistent with the disclosure.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present disclosure are consistent.
Fig. 1 is the implementation environment schematic diagram involved by each exemplary embodiment of the present disclosure, and as shown in Figure 1, this implementation environment comprises client 101, proxy server 102 and destination server 103.Wherein, client 101, proxy server 102 and destination server 103 can be applied in the cloud accelerating network access architectures based on CDN (ContentDeliveryNetwork, content distributing network) technology.
By needing the mode consuming customer flow to connect between client 101 and proxy server 102.Such as, connected by 2G/3G/4G network between client 101 and proxy server; Or, by Dial-up Network connection etc. between client 101 and proxy server 102.Client 101 for sending data to proxy server 102, or, the data that client 101 forwards for Receiving Agent server 102.
Connected by cable network between proxy server 102 and destination server 103.Wherein, the data that destination server 103 forwards for Receiving Agent server 102, or destination server 103 is for sending data to proxy server 102.Proxy server 102 or destination server 103 can be one or multiple servers, can also be cloud computing centers.In other words, proxy server 102 or destination server 103 can be realized by a station server; Also can be combined by multiple servers and realize, every station server bears identical or different functions, such as have the server for registering and logging in, for preserve user's head portrait server, for preserve configuration information server, for preserving server of picture or video etc.; Proxy server 102 or destination server 103 also can adopt cloud computing center to realize, and cloud computing center is the virtual computing platforms that whole piece service cluster is formed.
Fig. 2 is the flow chart of a kind of data transmission method according to an exemplary embodiment, and the present embodiment to be applied in the implementation environment shown in Fig. 1 with this data transmission method and to be described to destination server transmission data instance by proxy server with client.As shown in Figure 2, this data transmission method comprises the following steps.
In step 201, client obtains data waiting for transmission.
Wherein, data waiting for transmission can be the information of user's input that client receives, and also can be the information of the third party device importing that client receives, the present embodiment be construed as limiting the source of data.
In step 202., if data are the data that will send to proxy server, then common protocol is converted to private agreement by client, adopts the private agreement after conversion to send the data to proxy server.
Generally, common protocol is adopted to carry out transfer of data between client and proxy server.Owing to comprising a large amount of annotations in common protocol and repeating label, add the data volume of transmission, make the transmission speed of data slow and traffic consumes large, therefore, common protocol can be converted to private agreement by client, adopts the private agreement after conversion to transmit data.
In step 203, proxy server receives data to be transmitted.
In step 204, send if data are clients, then the private protocol conversion of transmission data is common protocol by proxy server, adopts the common protocol after conversion to send the data to destination server, is processed by destination server according to common protocol to data.
Due between proxy server and destination server be adopt common protocol carry out transfer of data, therefore, in order to enable destination server receive data, it is common protocol that proxy server also needs private protocol conversion, adopts common protocol to send the data to destination server.Destination server, after employing common protocol receives data, processes data.
In sum, the data transmission method that the disclosure provides, by receiving the data that client sends, by transmission data private protocol conversion be common protocol, the common protocol after conversion is adopted to send the data to destination server, data are processed according to common protocol by destination server, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol can solve the complicated and problem that cost is high of a set of proprietary protocol of exploitation, reach the effect of saving transmission cost.
Fig. 3 is the flow chart of a kind of data transmission method according to an exemplary embodiment, and the present embodiment to be applied in the implementation environment shown in Fig. 1 with this data transmission method and to be described to client transmissions data instance by proxy server with destination server.As shown in Figure 3, this data transmission method comprises the following steps.
In step 301, proxy server receives data waiting for transmission.
In step 302, send if data are destination servers, then the common protocol adopted during transmission data is converted to private agreement by proxy server, adopts the private agreement after conversion to send the data to client.
Due between proxy server and destination server be adopt common protocol carry out transfer of data, therefore, data are received in order to enable proxy server, destination server adopts common protocol to send the data to proxy server, and proxy server adopts common protocol to receive data waiting for transmission.
Generally, common protocol is adopted to carry out transfer of data between client and proxy server.Owing to comprising a large amount of annotations in common protocol and repeating label, add the data volume of transmission, make the transmission speed of data slow and traffic consumes large, therefore, common protocol can be converted to private agreement by proxy server, adopts the private agreement after conversion to transmit data.
In step 303, client obtains data waiting for transmission.
In step 304, common protocol is adopted to send to proxy server if data are destination servers, after common protocol is converted to private agreement by proxy server, the private agreement after conversion is adopted to send, then private protocol conversion is common protocol by client, processes data according to the common protocol after conversion.
Private protocol conversion is common protocol by client, and processes data according to common protocol.
In sum, the data transmission method that the disclosure provides, by the common protocol adopted during transmission data is converted to private agreement, the private agreement after conversion is adopted to send the data to client, be common protocol by client by private protocol conversion, according to common protocol, data are processed, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transmission cost.
Fig. 4 is the flow chart of a kind of data transmission method according to another exemplary embodiment, and the present embodiment to be applied in the implementation environment shown in Fig. 1 with this data transmission method and to be described to destination server transmission data instance by proxy server with client.As shown in Figure 4, this data transmission method comprises the following steps.
In step 401, client obtains data waiting for transmission.
Wherein, data waiting for transmission can be the information of user's input that client receives, and also can be the information of the third party device importing that client receives, the present embodiment be construed as limiting the source of data.
In step 402, client obtains and storage protocol is changed the mechanism, and this protocol conversion mechanism comprises at least one in mapping mechanism and deleting mechanism.
Protocol conversion mechanism is used to indicate the transformational relation between common protocol and private agreement.Wherein, common protocol is widely used procotol in network, such as, and HTTP, HTTPS (HypertextTransferProtocolSecure, Hyper text transfer security protocol), FTP (FileTransferProtocol, file transfer protocol (FTP)) etc.Private agreement is the agreement obtained after changing common protocol.Wherein, the byte number of private agreement is less than the byte number of common protocol.
In the present embodiment, protocol conversion mechanism comprises at least one in mapping mechanism and deleting mechanism.Wherein, mapping mechanism is the corresponding relation between public label and private label, is used to indicate and public label is replaced with corresponding private label.The public code that deleting mechanism is used to indicate satisfying condition is deleted.Public code refers to the code included by common protocol, and public label refers to the label included by common protocol, and private label refers to the label replaced public label.
Wherein, protocol conversion mechanism can be arranged by developer, and uploads in client.Client can obtain protocol conversion mechanism when receiving data waiting for transmission at every turn, or, client can after getting protocol conversion mechanism, buffer memory is carried out to this protocol conversion mechanism, then upper once receive data waiting for transmission time, client can read protocol conversion mechanism from buffer memory, to improve acquisition efficiency.Optionally, client can also be modified to protocol conversion mechanism under the instruction of developer.
It should be added that, step 402 can perform after step 401, also can perform before step 401, and can also perform with step 401, the present embodiment does not limit the execution sequence between step 401 and step 402 simultaneously.
In step 403, if data are the data that will send to proxy server, then client reads the mapping mechanism prestored, search private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or, read the deleting mechanism prestored, in common protocol, search the public code meeting deleting mechanism, public code is deleted, obtain private agreement; The private agreement after conversion is adopted to send the data to proxy server.
In the present embodiment, if data are the data that will send to proxy server, then common protocol is converted to private agreement by client, adopts the private agreement after conversion to send the data to proxy server.That is, client reads the mapping mechanism prestored, and searches private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or, read the deleting mechanism prestored, in common protocol, search the public code meeting deleting mechanism, public code is deleted, obtain private agreement; The private agreement after conversion is adopted to send the data to proxy server.
Generally, common protocol is adopted to carry out transfer of data between client and proxy server.Owing to comprising a large amount of annotations in common protocol and repeating label, add the data volume of transmission, make that the transmission speed of data is slow and traffic consumes is large, therefore, common protocol can be converted to private agreement by client, adopt the private agreement after conversion to compress the data volume of transmission, both can improve the transmission speed of data, also can save flow.Wherein, the byte number of private agreement is less than the byte number of common protocol.
In the present embodiment, client can use the mapping mechanism in protocol conversion mechanism and deleting mechanism that common protocol is converted to private agreement, and flow process is as follows:
First, when common protocol is converted to private agreement by client use mapping mechanism, client can read corresponding public label and private label from mapping mechanism, the public label read is searched in common protocol, this public label is replaced with the private label read, obtain private agreement.Wherein, the byte number of private label is less than the byte number of corresponding public label.
For example, loading from mapping mechanism for the client to public label & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;And private label & lt;ME = CTC = HCH = G1 & gt;, the client can take all public agreement & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;Replace with & lt;ME = CTC = HCH = G1 & gt;;Or, the client also reads from the mapping mechanism to public label & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>And private label & lt;D>& lt;D>Helloworld</ d>& lt;/ d>, the client can take all public agreement & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>Replace with & lt;D>& lt;D>Helloworld</ d>& lt;/ d>.
Obviously, the byte number of <ME=CTC=HCH=G1> label is less than <METAhttp-equiv=Content-Typecontent=" text/html, charset=gb2312 " the byte number of > label, the byte number of <d><dGreatT.Grea T.GThelloworld</d>LEssT.LTssT .LT/d> label is less than the byte number of <div><divGreatT. GreaT.GThelloworld</div>LEssT .LTssT.LT/div> label, therefore, by public label being converted to the less private label of byte number, common protocol can be converted to the less private agreement of byte number.
Because mapping mechanism can comprise at least one pair of public label and private label, therefore, the agreement obtained is defined as private agreement after public labels be included in mapping mechanism all in common protocol can being replaced with corresponding private label by client.
The second, when common protocol is converted to private agreement by client use deleting mechanism, client can read deleting mechanism, searches the public code meeting this deleting mechanism from common protocol, deletes the public code found, and obtains private agreement.
Such as, when common protocol is HTTP, developer can summarize the feature of useless HTTP head, and obtain the condition for determining useless HTTP head, this condition is defined as deleting mechanism by client.When client determines useless HTTP head according to deleting mechanism in common protocol, can delete this useless HTTP head.Or developer can summarize the feature of annotation information, obtain the condition for determining annotation information, this condition is defined as deleting mechanism by client.When client determines annotation information according to this deleting mechanism in common protocol, can delete this annotation information.
Obviously, useless HTTP head and annotation information are deleted, the byte number of common protocol can be reduced, obtain the private agreement that byte number is less.
Because deleting mechanism can be at least one, therefore, the public code meeting each deleting mechanism in common protocol can be deleted by client, and the agreement obtained is defined as private agreement.
3rd, client can also use mapping mechanism and deleting mechanism that common protocol is converted to private agreement simultaneously.Wherein, the flow process that client uses mapping mechanism common protocol to be converted to private agreement refers to the description of first, and the flow process that client uses deleting mechanism common protocol to be converted to private agreement refers to the description of second point, does not repeat herein.
In the present embodiment, client, by using protocol conversion mechanism, can adopt private agreement to carry out transfer of data, and need not develop a set of new agreement between client and proxy server, reaches the effect of saving transfer resource and transmission cost.
In step 404, proxy server receives data waiting for transmission.
In step 405, proxy server obtains and storage protocol is changed the mechanism, and this protocol conversion mechanism comprises at least one in mapping mechanism and interpolation mechanism.
Wherein, protocol conversion mechanism is used to indicate the transformational relation between common protocol and private agreement.Proxy server can be identical with the obtain manner of client to protocol conversion mechanism to the obtain manner of protocol conversion mechanism, refers to the description in step 402.
Proxy server obtains the machine-processed at least one comprised in mapping mechanism and interpolation mechanism of the protocol conversion stored in proxy server.Wherein, add the machine-processed public code be used to indicate deleting to reduce.
It should be added that, step 405 can perform after step 404, also can perform before step 404, and can also perform with step 404, the present embodiment does not limit the execution sequence between step 404 and step 405 simultaneously.
In a step 406, send if data are clients, then proxy server reads the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtains common protocol; Or, read the interpolation mechanism prestored, add mechanism and comprise interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to by adding code, obtaining common protocol; Adopt the common protocol after conversion to send the data to destination server, according to common protocol, data are processed by destination server.
In the present embodiment, send if data are clients, then the private protocol conversion of transmission data is common protocol by proxy server, adopts the common protocol after conversion to send the data to destination server, is processed by destination server according to common protocol to data.Namely, proxy server reads the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtain common protocol, the byte number of private label is less than the byte number of corresponding public label; Or, read the interpolation mechanism prestored, add mechanism and comprise interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to by adding code, obtaining common protocol; Adopt the common protocol after conversion to send the data to destination server, according to common protocol, data are processed by destination server.
Due between proxy server and destination server be adopt common protocol carry out transfer of data, therefore, in order to enable destination server receive data, it is common protocol that proxy server also needs private protocol conversion, adopts common protocol to send the data to destination server.Destination server, after employing common protocol receives data, processes data.
In the present embodiment, proxy server can use the mapping condition in protocol conversion mechanism and add mechanism is common protocol by private protocol conversion, and flow process is as follows:
First, proxy server use mapping mechanism by private protocol conversion for common protocol time, proxy server can read corresponding public label and private label from mapping mechanism, the private label read is searched in private agreement, this private label is replaced with the public label read, obtain common protocol.Wherein, the byte number of private label is less than the byte number of corresponding public label.
For example, the proxy server to read from the mapping mechanism of private label & lt;ME = CTC = HCH = G1 & gt;And utility tags & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;, then the proxy server can take all private agreement & lt;ME = CTC = HCH = G1 & gt;Replace with & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;;Also from the mapping mechanism with a proxy server or read into private label & lt;D>& lt;D>Helloworld</ d>& lt;/ d>And utility tags & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>, then the proxy server can take all private agreement & lt;D>& lt;D>Helloworld</ d>& lt;/ d>Replace with & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>.
The agreement obtained is defined as common protocol after private labels be included in mapping mechanism all in private agreement can being replaced with corresponding public label by proxy server.
The second, proxy server use add mechanism by private protocol conversion for common protocol time, proxy server can read add mechanism, in private agreement, add the public code of deletion, obtain common protocol.Wherein, add machine-processed corresponding with deleting mechanism, and interpolation mechanism comprise interpolation code and the point of addition of interpolation code in private agreement.
Such as, when adding mechanism and comprising point of addition in private protocol header of useless HTTP head and this useless HTTP head, proxy server can add the content of this useless HTTP head to point of addition place.Or when adding mechanism and comprising point of addition in private agreement of annotation information and this annotation information, proxy server can add the content of this annotation information to point of addition place.
Due to add mechanism can at least one, therefore, proxy server can by meet each add mechanism proprietary code add in private agreement, the agreement obtained is defined as common protocol.
3rd, proxy server can also use mapping mechanism simultaneously and add mechanism is common protocol by private protocol conversion.Wherein, proxy server uses mapping mechanism the flow process that private protocol conversion is common protocol to be referred to the description of first, and the flow process that private protocol conversion is common protocol by proxy server use interpolation mechanism refers to the description of second point, does not repeat herein.
In sum, the data transmission method that the disclosure provides, by receiving the data that client sends, by transmission data private protocol conversion be common protocol, the common protocol after conversion is adopted to send the data to destination server, data are processed according to common protocol by destination server, wherein, the byte number of private agreement is less than the byte number of common protocol, common protocol can be converted to the less private agreement of byte number, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, both can avoid transmitting between proxy server and client the wasting of resources that common protocol head causes, also the complicated and problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transfer resource and transmission cost.
In addition, change the mechanism by obtaining also storage protocol, make client directly according to the protocol conversion mechanism stored, common protocol can be converted to private agreement, private protocol conversion can be directly common protocol according to the protocol conversion mechanism stored by proxy server, improves conversion efficiency by the acquisition efficiency improving protocol conversion mechanism.
Fig. 5 is the flow chart of a kind of data transmission method according to another exemplary embodiment.The present embodiment to be applied in the implementation environment shown in Fig. 1 with this data transmission method and to be described to client transmissions data instance by proxy server with destination server.As shown in Figure 5, this data transmission method comprises the following steps.
In step 501, proxy server receives data waiting for transmission.
In step 502, proxy server obtains and storage protocol is changed the mechanism, and this protocol conversion mechanism comprises at least one of mapping mechanism and deleting mechanism.
Protocol conversion mechanism is used to indicate the transformational relation between common protocol and private agreement.Wherein, common protocol is widely used procotol in network, such as, and HTTP, HTTPS, FTP etc.Private agreement is the agreement obtained after changing common protocol.Wherein, the byte number of private agreement is less than the byte number of common protocol.
In the present embodiment, protocol conversion mechanism comprises at least one in mapping mechanism and deleting mechanism.Wherein, mapping mechanism is the corresponding relation between public label and private label, is used to indicate and public label is replaced with corresponding private label.The public code that deleting mechanism is used to indicate satisfying condition is deleted.Public code refers to the code included by common protocol, and public label refers to the label included by common protocol, and private label refers to the label replaced public label.
Wherein, protocol conversion mechanism can be arranged by developer, and uploads in proxy server.Proxy server can obtain protocol conversion mechanism when receiving data waiting for transmission at every turn, or, proxy server can after getting protocol conversion mechanism, buffer memory is carried out to this protocol conversion mechanism, then upper once receive data waiting for transmission time, proxy server can read protocol conversion mechanism from buffer memory, to improve acquisition efficiency.Optionally, proxy server can also be modified to protocol conversion mechanism under the instruction of developer.
It should be added that, step 502 can perform after step 501, also can perform before step 501, and can also perform with step 501, the present embodiment does not limit the execution sequence between step 501 and step 502 simultaneously.
In step 503, send if data are destination servers, then proxy server reads the mapping mechanism prestored, search private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or, read the deleting mechanism prestored, in common protocol, search the public code meeting deleting mechanism, public code is deleted, obtain private agreement, adopt the private agreement after conversion to send the data to client.
In the present embodiment, send if data are destination servers, then common protocol is converted to private agreement by proxy server, adopts the private agreement after conversion to send the data to client.That is, proxy server reads the mapping mechanism prestored, and searches private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or, read the deleting mechanism prestored, in common protocol, search the public code meeting deleting mechanism, public code is deleted, obtain private agreement; The private agreement after conversion is adopted to send the data to client.
Generally, common protocol is adopted to carry out transfer of data between client and proxy server.Owing to comprising a large amount of annotations in common protocol and repeating label, add the data volume of transmission, make that the transmission speed of data is slow and traffic consumes is large, therefore, common protocol can be converted to private agreement by proxy server, adopt the private agreement after conversion to compress the data volume of transmission, both can improve the transmission speed of data, also can save flow.Wherein, the byte number of private agreement is less than the byte number of common protocol.
In the present embodiment, proxy server can use the mapping mechanism in protocol conversion mechanism and deleting mechanism that common protocol is converted to private agreement, and flow process is as follows:
First, when common protocol is converted to private agreement by proxy server use mapping mechanism, proxy server can read corresponding public label and private label from mapping mechanism, the public label read is searched in common protocol, this public label is replaced with the private label read, obtain private agreement.Wherein, the byte number of private label is less than the byte number of corresponding public label.
For example, the proxy server to read from the mapping mechanism of public label & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;And private label & lt;ME = CTC = HCH = G1 & gt;, then the proxy server can be all of the common agreement & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;Replace with & lt;ME = CTC = HCH = G1 & gt;;Also from the mapping mechanism with a proxy server or read into public label & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>And private label & lt;D>& lt;D>Helloworld</ d>& lt;/ d>, then the proxy server can be all of the common agreement & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>Replace with & lt;D>& lt;D>Helloworld</ d>& lt;/ d>.
Obviously, the byte number of <ME=CTC=HCH=G1> label is less than <METAhttp-equiv=Content-Typecontent=" text/html, charset=gb2312 " the byte number of > label, the byte number of <d><dGreatT.Grea T.GThelloworld</d>LEssT.LTssT .LT/d> label is less than the byte number of <div><divGreatT. GreaT.GThelloworld</div>LEssT .LTssT.LT/div> label, therefore, by public label being converted to the less private label of byte number, common protocol can be converted to the less private agreement of byte number.
Because mapping mechanism can comprise at least one pair of public label and private label, therefore, the agreement obtained is defined as private agreement after public labels be included in mapping mechanism all in common protocol can being replaced with corresponding private label by proxy server.
Second, when common protocol is converted to private agreement by proxy server use deleting mechanism, proxy server can read deleting mechanism, searches the public code meeting this deleting mechanism from common protocol, the public code found is deleted, obtains private agreement.
Such as, when common protocol is HTTP, developer can summarize the feature of useless HTTP head, and obtain the condition for determining useless HTTP head, this condition is defined as deleting mechanism by proxy server.When proxy server determines useless HTTP head according to deleting mechanism in common protocol, can delete this useless HTTP head.Or developer can summarize the feature of annotation information, obtain the condition that user determines annotation information, this condition is defined as deleting mechanism by proxy server.When proxy server determines annotation information according to this deleting mechanism in common protocol, can delete this annotation information.
Obviously, useless HTTP head and annotation information are deleted, the byte number of common protocol can be reduced, obtain the private agreement that byte number is less.
Because deleting mechanism can be at least one, therefore, the public code meeting each deleting mechanism in common protocol can be deleted by proxy server, and the agreement obtained is defined as private agreement.
3rd, proxy server can also use mapping mechanism and deleting mechanism that common protocol is converted to private agreement simultaneously.Wherein, the flow process that proxy server uses mapping mechanism common protocol to be converted to private agreement refers to the description of first, and the flow process that proxy server uses deleting mechanism common protocol to be converted to private agreement refers to the description of second point, does not repeat herein.
In the present embodiment, proxy server, by using protocol conversion mechanism, can adopt private agreement to carry out transfer of data, and need not develop a set of new agreement between client and proxy server, reaches the effect of saving transfer resource and transmission cost.
In step 504, client obtains data waiting for transmission.
In step 505, client obtains and storage protocol is changed the mechanism, and this protocol conversion mechanism comprises at least one in mapping mechanism and interpolation mechanism.
Wherein, protocol conversion mechanism is used to indicate the transformational relation between common protocol and private agreement.Client can be identical with the obtain manner of proxy server to protocol conversion mechanism to the obtain manner of protocol conversion mechanism, refers to the description in step 502.
Client obtains the machine-processed at least one comprised in mapping mechanism and interpolation mechanism of the protocol conversion stored in client.Wherein, add the machine-processed public code be used to indicate deleting to reduce.
It should be added that, step 505 can perform after step 504, also can perform before step 504, and can also perform with step 504, the present embodiment does not limit the execution sequence between step 504 and step 505 simultaneously.
In step 506, common protocol is adopted to send to proxy server if data are destination servers, after common protocol is converted to private agreement by proxy server, the private agreement after conversion is adopted to send, then client reads the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtains common protocol; Or, read the interpolation mechanism prestored, add mechanism and comprise interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to by adding code, obtaining common protocol, according to the common protocol after conversion, data being processed.
In the present embodiment, common protocol is adopted to send to proxy server if data are destination servers, after common protocol is converted to private agreement by proxy server, the private agreement after conversion is adopted to send, then the private protocol conversion of transmission data is common protocol by client, adopts the common protocol after conversion to process data.Namely, client reads the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtain common protocol, the byte number of private label is less than the byte number of corresponding public label; Or, read the interpolation mechanism prestored, add mechanism and comprise interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to by adding code, obtaining common protocol; The common protocol after conversion is adopted to process data.
In the present embodiment, client is after employing private agreement receives data, and also needing private protocol conversion is common protocol, adopts common protocol to process data.
In the present embodiment, client can use the mapping condition in protocol conversion mechanism and add mechanism is common protocol by private protocol conversion, and flow process is as follows:
First, client use mapping mechanism by private protocol conversion for common protocol time, client can read corresponding public label and private label from mapping mechanism, the private label read is searched in private agreement, this private label is replaced with the public label read, obtain common protocol.Wherein, the byte number of private label is less than the byte number of corresponding public label.
For example, loading from mapping mechanism for the client to private label & lt;ME = CTC = HCH = G1 & gt;And utility tags & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;, the client can take all private agreement & lt;ME = CTC = HCH = G1 & gt;Replace with & lt;METAhttp - equiv = Content - Typecontent = "text/HTML; charset = gb2312" & gt;;Or, the client also reads from the mapping mechanism to private label & lt;D>& lt;D>Helloworld</ d>& lt;/ d>And utility tags & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>, the client can take all private agreement & lt;D>& lt;D>Helloworld</ d>& lt;/ d>Replace with & lt;Div>& lt;Div>Helloworld</ div>& lt;/ div>.
The agreement obtained is defined as common protocol after private labels be included in mapping mechanism all in private agreement can being replaced with corresponding public label by client.
The second, client use add mechanism by private protocol conversion for common protocol time, client can read add mechanism, in private agreement, add the public code of deletion, obtain common protocol.Wherein, add machine-processed corresponding with deleting mechanism, and interpolation mechanism comprise interpolation code and the point of addition of interpolation code in private agreement.
Such as, when adding mechanism and comprising point of addition in private protocol header of useless HTTP head and this useless HTTP head, client can add the content of this useless HTTP head to point of addition place.Or when adding mechanism and comprising point of addition in private agreement of annotation information and this annotation information, client can add the content of this annotation information to point of addition place.
Due to add mechanism can at least one, therefore, client can by all meet each add mechanism proprietary code add in private agreement, the agreement obtained is defined as common protocol.
3rd, client can also use mapping mechanism simultaneously and add mechanism is common protocol by private protocol conversion.Wherein, client uses mapping mechanism the flow process that private protocol conversion is common protocol to be referred to the description of first, and the flow process that private protocol conversion is common protocol by client use interpolation mechanism refers to the description of second point, does not repeat herein.
In sum, the data transmission method that the disclosure provides, by the common protocol adopted during transmission data is converted to private agreement, the private agreement after conversion is adopted to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed, wherein, the byte number of private agreement is less than the byte number of common protocol, common protocol can be converted to the less private agreement of byte number, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, both can avoid transmitting between proxy server and client the wasting of resources that common protocol head causes, also the complicated and problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transfer resource and transmission cost.
In addition, change the mechanism by obtaining also storage protocol, make proxy server directly according to the protocol conversion mechanism stored, common protocol can be converted to private agreement, private protocol conversion can be directly common protocol according to the protocol conversion mechanism stored by client, improves conversion efficiency by the acquisition efficiency improving protocol conversion mechanism.
Fig. 6 is the structured flowchart of a kind of data transmission device according to an exemplary embodiment.As shown in Figure 6, this data transmission device comprises: data reception module 601, first transport module 602, second transport module 603.
This data reception module 601, is configured to receive data waiting for transmission;
This first transport module 602, be configured to when data are destination server transmissions, the common protocol adopted during the data received by transmission data reception module 601 is converted to private agreement, the private agreement after conversion is adopted to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed;
This second transport module 603, be configured to when data are client transmissions, the private protocol conversion of the data received by transmission data reception module 601 is common protocol, adopt the common protocol after conversion to send the data to destination server, according to common protocol, data are processed by destination server.
In sum, the data transmission device that the disclosure provides, by receiving the data that client sends, by transmission data private protocol conversion be common protocol, the common protocol after conversion is adopted to send the data to destination server, data are processed according to common protocol by destination server, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transmission cost.
Fig. 7 is the structured flowchart of a kind of data transmission device according to another exemplary embodiment.As shown in Figure 7, this data transmission device comprises: data reception module 601, first transport module 602, second transport module 603.
This data reception module 601, is configured to receive data waiting for transmission;
This first transport module 602, be configured to when data are destination server transmissions, the common protocol adopted during the data received by transmission data reception module 601 is converted to private agreement, the private agreement after conversion is adopted to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed;
This second transport module 603, be configured to when data are client transmissions, the private protocol conversion of the data received by transmission data reception module 601 is common protocol, adopt the common protocol after conversion to send the data to destination server, according to common protocol, data are processed by destination server.
Optionally, the first transport module 602, comprising: first replaces submodule 6021 and code deletion submodule 6022;
This first replacement submodule 6021, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or,
This code deletion submodule 6022, is configured to read the deleting mechanism prestored, searches the public code meeting deleting mechanism, delete public code in common protocol, obtain private agreement.
Optionally, the second transport module 603, comprising: second replaces submodule 6031 and code interpolation submodule 6032;
This second replacement submodule 6031, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtains common protocol; Or,
This code adds submodule 6032, is configured to read the interpolation mechanism prestored, and adds mechanism and comprises interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to, obtaining common protocol by adding code.
Optionally, the data transmission device in the present embodiment, also comprises: machine-processed acquisition module 604;
This machine-processed acquisition module 604, is configured to obtain and storage protocol is changed the mechanism, and protocol conversion mechanism comprises mapping mechanism, at least one in deleting mechanism and interpolation mechanism.
In sum, the data transmission device that the disclosure provides, by receiving the data that client sends, by transmission data private protocol conversion be common protocol, the common protocol after conversion is adopted to send the data to destination server, data are processed according to common protocol by destination server, wherein, the byte number of private agreement is less than the byte number of common protocol, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transmission cost.
In addition, change the mechanism by obtaining also storage protocol, make client directly according to the protocol conversion mechanism stored, common protocol can be converted to private agreement, private protocol conversion can be directly common protocol according to the protocol conversion mechanism stored by proxy server, improves conversion efficiency by the acquisition efficiency improving protocol conversion mechanism.
Fig. 8 is the structured flowchart of a kind of data transmission device according to an exemplary embodiment.As shown in Figure 8, this data transmission device comprises: data acquisition module 801, first transport module 802, second transport module 803.
This data acquisition module 801, is configured to obtain data waiting for transmission;
This first transport module 802, be configured to when the data that data acquisition module 801 gets are the data that will send to proxy server, common protocol is converted to private agreement, the private agreement after conversion is adopted to send the data to proxy server, after by private protocol translation being common protocol by proxy server, common protocol is adopted to send the data to destination server;
This second transport module 803, be configured to when the data that data acquisition module 801 gets be destination server adopt common protocol to send to proxy server time, after common protocol is converted to private agreement by proxy server, the private agreement after conversion is adopted to send, be then common protocol by private protocol conversion, according to the common protocol after conversion, data processed.
In sum, the data transmission device that the disclosure provides, by the common protocol adopted during transmission data is converted to private agreement, the private agreement after conversion is adopted to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of transmission cost.
Fig. 9 is the structured flowchart of a kind of data transmission device according to another exemplary embodiment.As shown in Figure 9, this data transmission device comprises: data acquisition module 801, first transport module 802, second transport module 803.
This data acquisition module 801, is configured to obtain data waiting for transmission;
This first transport module 802, be configured to when the data that data acquisition module 801 gets are the data that will send to proxy server, common protocol is converted to private agreement, the private agreement after conversion is adopted to send the data to proxy server, after by private protocol translation being common protocol by proxy server, common protocol is adopted to send the data to destination server;
This second transport module 803, be configured to when the data that data acquisition module 801 gets be destination server adopt common protocol to send to proxy server time, after common protocol is converted to private agreement by proxy server, the private agreement after conversion is adopted to send, be then common protocol by private protocol conversion, according to the common protocol after conversion, data processed.
Optionally, the first transport module 802, comprising: first replaces submodule 8021 and code deletion submodule 8022;
This first replacement submodule 8021, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in common protocol in mapping mechanism, the private label found is replaced public label corresponding in common protocol, obtains private agreement; Or,
This code deletion submodule 8022, is configured to read the deleting mechanism prestored, searches the public code meeting deleting mechanism, delete public code in common protocol, obtain private agreement.
Optionally, the second transport module 803, comprising: second replaces submodule 8031 and code interpolation submodule 8032;
This second replacement submodule 8031, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in private agreement in mapping mechanism, the public label found is replaced private label corresponding in private agreement, obtains common protocol; Or,
This code adds submodule 8032, is configured to read the interpolation mechanism prestored, and adds mechanism and comprises interpolation code and add the point of addition of code in private agreement, adding corresponding point of addition place to, obtaining common protocol by adding code.
Optionally, the data transmission device in the present embodiment, also comprises: machine-processed acquisition module 804;
This machine-processed acquisition module 804, is configured to obtain and storage protocol is changed the mechanism, and protocol conversion mechanism comprises mapping mechanism, at least one in deleting mechanism and interpolation mechanism.
In sum, the data transmission device that the disclosure provides, by the common protocol adopted during transmission data is converted to private agreement, the private agreement after conversion is adopted to send the data to client, after by private protocol conversion being common protocol by client, according to common protocol, data are processed, wherein, the byte number of private agreement is less than the byte number of common protocol, common protocol can be converted to private agreement, private protocol transmission data are adopted between proxy server and client, instead of between proxy server and client, develop a set of proprietary protocol, complicated and the problem that cost is high of a set of proprietary protocol of exploitation can be solved, reach the effect of saving transmission cost.
In addition, change the mechanism by obtaining also storage protocol, make proxy server directly according to the protocol conversion mechanism stored, common protocol can be converted to private agreement, private protocol conversion can be directly common protocol according to the protocol conversion mechanism stored by client, improves conversion efficiency by the acquisition efficiency improving protocol conversion mechanism.
Figure 10 is the block diagram of a kind of device 1000 for transfer of data according to an exemplary embodiment.Such as, device 1000 can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, flat-panel devices, Medical Devices, body-building equipment, personal digital assistant etc.
With reference to Figure 10, device 1000 can comprise following one or more assembly: processing components 1002, memory 1004, power supply module 1006, multimedia groupware 1008, audio-frequency assembly 1010, the interface 1012 of I/O (I/O), sensor cluster 1014, and communications component 1016.
The integrated operation of the usual control device 1000 of processing components 1002, such as with display, call, data communication, camera operation and record operate the operation be associated.Processing components 1002 can comprise one or more processor 1018 to perform instruction, to complete all or part of step of above-mentioned method.In addition, processing components 1002 can comprise one or more module, and what be convenient between processing components 1002 and other assemblies is mutual.Such as, processing components 1002 can comprise multi-media module, mutual with what facilitate between multimedia groupware 1008 and processing components 1002.
Memory 1004 is configured to store various types of data to be supported in the operation of device 1000.The example of these data comprises for any application program of operation on device 1000 or the instruction of method, contact data, telephone book data, message, picture, video etc.Memory 1004 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or CD.
The various assemblies that power supply module 1006 is device 1000 provide electric power.Power supply module 1006 can comprise power-supply management system, one or more power supply, and other and the assembly generating, manage and distribute electric power for device 1000 and be associated.
Multimedia groupware 1008 is included in the screen providing an output interface between device 1000 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises one or more touch sensor with the gesture on sensing touch, slip and touch panel.Touch sensor can the border of not only sensing touch or sliding action, but also detects the duration relevant with touch or slide and pressure.In certain embodiments, multimedia groupware 1008 comprises a front-facing camera and/or post-positioned pick-up head.When device 1000 is in operator scheme, during as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom ability.
Audio-frequency assembly 1010 is configured to export and/or input audio signal.Such as, audio-frequency assembly 1010 comprises a microphone (MIC), and when device 1000 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The audio signal received can be stored in memory 1004 further or be sent via communications component 1016.In certain embodiments, audio-frequency assembly 1010 also comprises a loud speaker, for output audio signal.
I/O interface 1012 is for providing interface between processing components 1002 and peripheral interface module, and above-mentioned peripheral interface module can be keyboard, some striking wheel, button etc.These buttons can include but not limited to: home button, volume button, start button and locking press button.
Sensor cluster 1014 comprises one or more transducer, for providing the state estimation of various aspects for device 1000.Such as, sensor cluster 1014 can detect the opening/closing state of device 1000, the relative positioning of assembly, such as assembly is display and the keypad of device 1000, the position of all right checkout gear 1000 of sensor cluster 1014 or device 1000 assemblies changes, the presence or absence that user contacts with device 1000, the variations in temperature of device 1000 orientation or acceleration/deceleration and device 1000.Sensor cluster 1014 can comprise proximity transducer, be configured to without any physical contact time detect near the existence of object.Sensor cluster 1014 can also comprise optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor cluster 1014 can also comprise acceleration transducer, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communications component 1016 is configured to the communication being convenient to wired or wireless mode between device 1000 and other equipment.Device 1000 can access the wireless network based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communications component 1016 receives from the broadcast singal of external broadcasting management system or broadcast related information via broadcast channel.In one exemplary embodiment, communications component 1016 also comprises near-field communication (NFC) module, to promote junction service.Such as, can based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 1000 can be realized, for performing said method by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components.
In the exemplary embodiment, additionally provide a kind of non-transitory computer-readable recording medium comprising instruction, such as, comprise the memory 1004 of instruction, above-mentioned instruction can perform said method by the processor 1018 of device 1000.Such as, non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.
Figure 11 is the block diagram of a kind of device 1100 for transfer of data according to an exemplary embodiment.Such as, device 1100 may be provided in a server.With reference to Figure 11, device 1100 comprises processing components 1122, and it comprises one or more processor further, and the memory resource representated by memory 1132, can such as, by the instruction of the execution of processing components 1122, application program for storing.The application program stored in memory 1132 can comprise each module corresponding to one group of instruction one or more.In addition, processing components 1122 is configured to perform instruction, to perform above-mentioned data transmission method.
Device 1100 can also comprise the power management that a power supply module 1126 is configured to final controlling element 1100, and a wired or wireless network interface 1150 is configured to device 1100 to be connected to network, and input and output (I/O) interface 1158.Device 1100 can operate the operating system based on being stored in memory 1132, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art, at consideration specification and after putting into practice disclosure herein, will easily expect other embodiment of the present disclosure.The application is intended to contain any modification of the present disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present disclosure and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Specification and embodiment are only regarded as exemplary, and true scope of the present disclosure and spirit are pointed out by claim below.
Should be understood that, the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.The scope of the present disclosure is only limited by appended claim.

Claims (14)

1. a data transmission method, is characterized in that, comprising:
Receive data waiting for transmission;
Send if described data are destination servers, then the common protocol adopted during the described data of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Send if described data are clients, then by transmission described data private protocol conversion be common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described the common protocol that adopts during the described data of transmission is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
2. method according to claim 1, is characterized in that, the described private protocol conversion by the described data of transmission is common protocol, comprising:
Read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
3. method according to claim 1 and 2, is characterized in that, described method, also comprises:
Obtain and storage protocol is changed the mechanism, described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
4. a data transmission method, is characterized in that, comprising:
Obtain data waiting for transmission;
If described data are the data that will send to proxy server, then common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Common protocol is adopted to send to proxy server if described data are destination servers, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described common protocol is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
5. method according to claim 4, is characterized in that, described is described common protocol by described private protocol conversion, comprising:
Read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
6. the method according to claim 4 or 5, is characterized in that, described method, also comprises:
Obtain and storage protocol is changed the mechanism, described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
7. a data transmission device, is characterized in that, comprising:
Data reception module, is configured to receive data waiting for transmission;
First transport module, be configured to when described data are destination server transmissions, the common protocol adopted during the described data received by the described data reception module of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Second transport module, be configured to when described data are client transmissions, the private protocol conversion of the described data received by the described data reception module of transmission is common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described first transport module, comprising:
First replaces submodule, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Code deletion submodule, is configured to read the deleting mechanism prestored, searches the public code meeting described deleting mechanism in described common protocol, delete described public code, obtains described private agreement.
8. device according to claim 7, is characterized in that, described second transport module, comprising:
Second replaces submodule, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Code adds submodule, be configured to read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
9. the device according to claim 7 or 8, is characterized in that, described device, also comprises:
Mechanism acquisition module, is configured to obtain and storage protocol is changed the mechanism, and described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
10. a data transmission device, is characterized in that, comprising:
Data acquisition module, is configured to obtain data waiting for transmission;
First transport module, be configured to when the described data that described data acquisition module gets are the data that will send to proxy server, common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Second transport module, be configured to when the described data that described data acquisition module gets be destination server adopt common protocol to send to proxy server time, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described first transport module, comprising:
First replaces submodule, be configured to read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Code deletion submodule, is configured to read the deleting mechanism prestored, searches the public code meeting described deleting mechanism in described common protocol, delete described public code, obtains described private agreement.
11. devices according to claim 10, is characterized in that, described second transport module, comprising:
Second replaces submodule, be configured to read the mapping mechanism prestored, search public label corresponding with each private label in described private agreement in described mapping mechanism, the public label found is replaced private label corresponding in described private agreement, obtain described common protocol; Or,
Code adds submodule, be configured to read the interpolation mechanism prestored, described interpolation mechanism comprises adds code and the point of addition of described interpolation code in described private agreement, described interpolation code is added to corresponding point of addition place, obtains described common protocol.
12. devices according to claim 10 or 11, it is characterized in that, described device, also comprises:
Mechanism acquisition module, is configured to obtain and storage protocol is changed the mechanism, and described protocol conversion mechanism comprises described mapping mechanism, at least one in described deleting mechanism and described interpolation mechanism.
13. 1 kinds of data transmission devices, is characterized in that, comprising:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive data waiting for transmission;
Send if described data are destination servers, then the common protocol adopted during the described data of transmission is converted to private agreement, adopt the private agreement after conversion that described data are sent to client, after by described private protocol conversion being described common protocol by described client, according to described common protocol, described data are processed;
Send if described data are clients, then by transmission described data private protocol conversion be common protocol, adopt the common protocol after conversion that described data are sent to destination server, according to described common protocol, described data are processed by described destination server;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described the common protocol that adopts during the described data of transmission is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
14. 1 kinds of data transmission devices, is characterized in that, comprising:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Obtain data waiting for transmission;
If described data are the data that will send to proxy server, then common protocol is converted to private agreement, adopt the private agreement after conversion that described data are sent to described proxy server, after by described private protocol translation being common protocol by described proxy server, adopt described common protocol that described data are sent to destination server;
Common protocol is adopted to send to proxy server if described data are destination servers, after described common protocol is converted to private agreement by described proxy server, the private agreement after conversion is adopted to send, be then described common protocol by described private protocol conversion, according to the described common protocol after conversion, described data processed;
Wherein, described common protocol is the procotol used in network, and described private agreement is the agreement obtained after changing common protocol, and the byte number of described private agreement is less than the byte number of common protocol;
Described common protocol is converted to private agreement, comprises:
Read the mapping mechanism prestored, search private label corresponding with each public label in described common protocol in described mapping mechanism, the private label found is replaced public label corresponding in described common protocol, obtain described private agreement; Or,
Read the deleting mechanism prestored, in described common protocol, search the public code meeting described deleting mechanism, described public code is deleted, obtain described private agreement.
CN201410429299.2A 2014-08-27 2014-08-27 Data transmission method and device Active CN104219299B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410429299.2A CN104219299B (en) 2014-08-27 2014-08-27 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410429299.2A CN104219299B (en) 2014-08-27 2014-08-27 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN104219299A CN104219299A (en) 2014-12-17
CN104219299B true CN104219299B (en) 2015-12-30

Family

ID=52100424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410429299.2A Active CN104219299B (en) 2014-08-27 2014-08-27 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN104219299B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306442B (en) * 2015-09-17 2018-12-25 物联智慧科技(深圳)有限公司 Proxy server and its instruction transmission method
CN108011902A (en) * 2016-10-31 2018-05-08 西安理邦科学仪器有限公司 The transmission method and system of a kind of physiological data
CN107682829A (en) * 2017-10-23 2018-02-09 深圳市沃特沃德股份有限公司 The data transmission method and device of mobile terminal
CN109859756B (en) * 2019-03-15 2021-10-01 北京金山云网络技术有限公司 Device control method, system, apparatus, edge computing device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402230A (en) * 2013-08-14 2013-11-20 杭州浦禾通信技术有限公司 Method and system for surfing Internet through mobile hot spots

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402230A (en) * 2013-08-14 2013-11-20 杭州浦禾通信技术有限公司 Method and system for surfing Internet through mobile hot spots

Also Published As

Publication number Publication date
CN104219299A (en) 2014-12-17

Similar Documents

Publication Publication Date Title
CN104506410A (en) Instant communication method and device
CN105100829A (en) Method and device for intercepting video content
KR102558111B1 (en) Active friend information display method, device, electronic equipment and storage medium
CN104301527A (en) Information acquisition method, device and system
CN105049213A (en) File signature method and device
CN104219299B (en) Data transmission method and device
CN112312222A (en) Video sending method and device and electronic equipment
CN105554064A (en) Method and device for setting head portrait
CN105095360A (en) Method and device for processing user requests for browser
CN110795412B (en) Log information processing method and device and storage medium
CN106792966B (en) Communication method and device
CN109525652B (en) Information sharing method, device, equipment and storage medium
CN105100199A (en) Method and device for transmitting cloud card
CN110619097A (en) Two-dimensional code generation method and device, electronic equipment and storage medium
CN112616053B (en) Transcoding method and device for live video and electronic equipment
CN104298430A (en) Telephone ordering method, device and system
CN105049251A (en) Access log processing method and system, and equipment
CN104572230A (en) Script file loading method, script file generating method and script file generating device
CN105100209A (en) Method and device for realizing cross domain access
CN105450507A (en) Method and device for sharing information in social network
CN105488095A (en) Search result access method, apparatus and system
CN105208107A (en) File downloading method, device, intelligent terminal and downloading device
CN111049732B (en) Push message display method and device, electronic equipment and medium
CN109981729B (en) File processing method and device, electronic equipment and computer readable storage medium
US9479470B2 (en) Method and system of providing an instant messaging service

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant