WO2012088889A1 - 基于浏览器的数据通讯方法、设备和数据交互*** - Google Patents

基于浏览器的数据通讯方法、设备和数据交互*** Download PDF

Info

Publication number
WO2012088889A1
WO2012088889A1 PCT/CN2011/078293 CN2011078293W WO2012088889A1 WO 2012088889 A1 WO2012088889 A1 WO 2012088889A1 CN 2011078293 W CN2011078293 W CN 2011078293W WO 2012088889 A1 WO2012088889 A1 WO 2012088889A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
request
packet
request data
client
Prior art date
Application number
PCT/CN2011/078293
Other languages
English (en)
French (fr)
Inventor
王啸枫
唐炯
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to US13/976,523 priority Critical patent/US20130291089A1/en
Publication of WO2012088889A1 publication Critical patent/WO2012088889A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/289Intermediate processing functionally located close to the data consumer application, e.g. in same machine, in same home or in same sub-network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the present invention relates to the field of network technologies, and in particular, to a browser-based data communication method, device, and data interaction system.
  • BACKGROUND OF THE INVENTION With the development of the Internet, more and more users access information of interest through the network, and Flash files contain rich media such as simple animations, videos, presentations, applications, and connections between them. Relationship, by the attention of the majority of users. Whether it is a simple ordinary Flash animation or a complex Flash game, it is written by the client.
  • the browser interacts with the server to implement data communication. Specifically, the client initiates the request data based on the browser, receives the response data returned by the web server, and implements data communication between the client and the server through the Internet protocol.
  • the browser-based data communication method is that the client accesses the hypertext information stored on the web server through the Http (Hyper Text Transfer Protocol) protocol, and receives the webpage or other webpage sent by the web server through the Http protocol.
  • Http Hyper Text Transfer Protocol
  • Data content data communication.
  • the inventor has found that at least the following problems exist in the prior art:
  • the data is transmitted using the Http protocol during the communication interaction, and the transmitted data needs to load all the headers in the Http protocol.
  • the Http protocol specifies a lot of protocol fields, the amount of data transmitted is large, and the problem of occupying too much bandwidth is generated, and the processing capability of the data gradually becomes a bottleneck.
  • the embodiment of the present invention provides a browser-based data communication method, device, and data interaction system.
  • the technical solution is as follows:
  • a browser-based data communication method includes:
  • the sending the request data packet to the server includes:
  • the request packet is sent to the server through the Socket interface.
  • the method further includes: performing encryption processing on the request data packet according to the preset key.
  • the method before the sending the request data packet to the server, the method further includes:
  • the sending the request data packet to the server includes: The established connection is sent to the server.
  • the private protocol is specifically a protocol that includes a Socket request packet header of no more than thirty bytes.
  • a browser-based data communication method comprising:
  • the method further includes: acquiring the response data according to the request data;
  • the sending the response data packet to the client specifically includes:
  • the response packet is sent to the client through the Socket interface.
  • the method further includes:
  • the private protocol is specifically a protocol that includes a Socket request packet header of no more than thirty bytes.
  • a browser-based data interaction method is also provided, the method comprising:
  • the client receives the request data input by the user through the browser, generates the request data packet according to a preset private protocol, and sends the request data packet to the server;
  • the server receives the request packet, and verifies whether the header of the request packet is legal. If it is legal, the request packet generates the request data according to a preset private protocol.
  • a client is also provided, the client comprising:
  • a receiving unit configured to receive request data input by a user through a browser
  • a generating unit configured to generate a request data packet by using the request data received by the receiving unit according to a preset private protocol
  • a sending unit configured to send the request data packet generated by the generating unit to the server.
  • the sending unit is specifically configured to send the request data packet to the server through a Socket interface.
  • the client further includes:
  • the client further includes:
  • connection unit configured to send a connection request to the server by using a Hypertext Transfer Protocol (http) protocol before the sending unit sends the request data packet to the server, so that the server returns a response message to establish a connection with the server;
  • the sending unit is specifically configured to send the request data packet to the server according to the connection established by the connecting unit.
  • a server is further provided, where the server includes:
  • a receiving unit configured to receive a request data packet
  • a first verification unit configured to verify whether a header of the request data packet received by the receiving unit is legal
  • a first generating unit configured to: when the first verification unit verifies that the header of the request data packet is legal, generate the request data according to the preset private protocol.
  • the server further includes:
  • a second generating unit configured to acquire response data according to the request data generated by the first generating unit, and generate the response data packet according to the private protocol
  • a sending unit configured to send the response data packet generated by the second generating unit to the client.
  • the sending unit is specifically configured to send the response data packet to the client through a Socket interface.
  • the server further includes:
  • a second verification unit configured to verify, after the first verification unit verifies that the header of the request data packet is legal, whether the key of the request data packet is legal according to a preset key, and if the data is legal, perform the The first generating unit generates the request data packet according to a preset private protocol.
  • a browser-based data interaction system comprising: a client and a service
  • the client is as described above;
  • the server is as the server.
  • the technical solution provided by the embodiment of the present invention has the beneficial effects of: requesting a data generation request according to a private protocol.
  • the data packet is sent to the server, and the existing data is sent to the browser through the Http protocol, and the browser sends the request data to the server through the Http protocol, thereby reducing the intermediate link of the data communication.
  • the data communication process does not carry other protocol fields in the Http protocol, which reduces the amount of data transmitted, saves bandwidth, and improves data transmission efficiency.
  • FIG. 1 is a schematic diagram of a five-layer protocol structure of a TCP/IP (Transmission Control Protocol/Internet Protocol) protocol in the prior art
  • FIG. 2 is a flowchart of a browser-based data communication method provided in Embodiment 1 of the present invention.
  • FIG. 3 is a flowchart of a browser-based data communication method provided in Embodiment 2 of the present invention.
  • FIG. 4 is a flowchart of a browser-based data communication method provided in Embodiment 3 of the present invention.
  • FIG. 5 is a flowchart of a browser-based data communication method provided in Embodiment 4 of the present invention.
  • FIG. 6 is a flowchart of a browser-based data interaction method provided in Embodiment 5 of the present invention.
  • FIG. 7 is a schematic structural diagram of a client provided in Embodiment 6 of the present invention.
  • Embodiment 8 is a schematic structural diagram of another client provided in Embodiment 6 of the present invention.
  • Embodiment 6 of the present invention is a schematic structural diagram of still another client provided in Embodiment 6 of the present invention.
  • FIG. 10 is a schematic structural diagram of a server provided in Embodiment 7 of the present invention.
  • FIG. 11 is a schematic structural diagram of another server provided in Embodiment 7 of the present invention.
  • FIG. 12 is a schematic structural diagram of still another server provided in Embodiment 7 of the present invention.
  • FIG. 13 is a schematic structural diagram of a browser-based data interaction system provided in Embodiment 8 of the present invention. detailed description
  • Layers 1 and 2 are network interface layers, including hardware device drivers and media access protocols
  • Layer 3 is IP/ICMP (Internet Control Messages Protocol).
  • Internet Message Control Protocol Internet Message Control Protocol) interconnection network layer, including ARP (Address Resolution Protocol) Association
  • the RARP Reverse Address Resolution Protocol
  • Layer 4 is the transport layer, including the TCP (Transmission Control Protocol) protocol and the UDP (User Data Protocol) protocol.
  • the fifth layer is the application layer, including the DNS (Domain Name System) protocol, the FTP (File Transfer Protocol) protocol, the Http protocol, the TelNet (Telecommunications Network) protocol, and the prior art
  • the Layer 5 Http protocol performs data communication between the client and the server, and the embodiment of the present invention is an improvement and innovation at the fifth layer.
  • an embodiment of the present invention provides a browser-based data communication method, which specifically includes:
  • the method provided by the embodiment of the present invention generates a request data packet according to the private protocol, and sends the request data packet to the server, and sends the request data to the browser through the Http protocol, and the request is sent by the browser through the Http protocol.
  • the intermediate link of data communication is reduced.
  • the data communication process does not carry other protocol fields in the Http protocol, which reduces the amount of data transmitted, saves bandwidth, and improves data transmission efficiency.
  • an embodiment of the present invention provides a browser-based data communication method, which specifically includes:
  • the client sends a connection request to the server through the Http protocol, so that the server returns a response message to establish a connection with the server.
  • a Flash file is provided. After the browser loads the Flash file, the Flash file uses an XML (Extensible Markup Language) socket to connect to the security policy server to obtain a security policy file. After the file, the Flash file is authorized to use Socket to access a port of a private server. The Socket created by the Flash file can connect to the server. In this embodiment, the server is a private server.
  • XML Extensible Markup Language
  • the client can send a connection request to the private server through the Socket interface.
  • the client successfully establishes a private connection with the private server.
  • the connection between the client and the server through the XML Socket interface is taken as an example. In the actual application, other Socket connection modes may also be used, and the present invention is not limited herein.
  • the embodiment of the present invention is an invention created on the premise of a browser, and the user inputs the request data based on the browser, so that the request data can be sent to the server according to a preset private protocol, for example, the user.
  • the request data to be accessed is sent to the client through the browser, and the browser only serves as a bearer for the input request data, and the input data is not saved in the browser but stored on the client.
  • the Flash programming module is set on the client, and after the client receives the request data input by the user, the request data is generated by the Flash programming module to generate the Flash request data.
  • the client For the Flash file communication service provided by each website, the client generates the request data packet according to the preset private protocol, and the private protocol is a protocol for requesting the data packet header of the Socket containing not more than 30 bytes, and It is a protocol of binary byte stream.
  • the private protocol is not disclosed to the public, thus ensuring the security of data communication and avoiding data being arbitrarily falsified by illegal clients. And compared with the data of the prior art packaged by the Http protocol, the amount of data to be transmitted is significantly reduced.
  • the private protocol is pre-agreed by the client and the server. After the client packages and sends the request data to the server according to the preset private protocol, the server can process the request packet according to a preset private protocol and return the corresponding data packet. Reply to the packet.
  • the client After the client establishes a connection with the server, the client sends the data packet packaged according to the private protocol to the server according to the established connection, thereby completing communication from the client to the server.
  • the request can be sent through the Socket interface. data pack.
  • the method further includes: performing encryption processing on the request data packet according to a preset key; and correspondingly, sending the encrypted request data packet in step 204.
  • performing encryption processing on the request data packet according to a preset key By increasing the encryption of the request packet on the client, the security of the data transmission is protected, and the transmitted data is prevented from being arbitrarily falsified by the illegal client.
  • the client encrypts the request data packet according to the preset key, and may encrypt the packet header of the request data packet, or encrypt the packet body of the request data packet, and may also encrypt
  • the header and the packet of the request packet are separately encrypted, and the key for encrypting the header of the request packet and the key for encrypting the packet of the request packet may be different, which is not limited by the present invention.
  • the encryption step is an optimization step to encrypt the request packet, which can protect the security of the data transmission and prevent the transmitted data from being arbitrarily changed by the illegal client.
  • the packet of the request packet may be compressed to reduce the amount of data.
  • the data communication method provided by the embodiment of the present invention generates a request data packet according to the private protocol, and sends the request data packet to the server, and sends the request data to the browser through the Http protocol, and the browser passes the Http protocol.
  • the intermediate link of the data communication is reduced, and the other protocol fields in the Http protocol are not carried in the data communication process, and the header of the request data packet generated according to the private protocol is according to the Http protocol.
  • the generated request packet has about 2% of the header of the packet, which reduces the amount of data transmitted, saves bandwidth, and improves data transmission efficiency.
  • the transmission is performed according to the private protocol, instead of the explicit plaintext protocol, which improves the data communication.
  • Security even if the transmitted data is intercepted, there is no use value; in addition, the transmission of the request packet is encrypted, which further enhances the security of data communication.
  • an embodiment of the present invention provides another browser-based data communication method, which specifically includes: 301: receiving a request data packet;
  • the request packet Verify that the header of the request packet is legal. If it is legal, the request packet generates the request data according to a preset private protocol.
  • the method further includes: obtaining response data according to the request data, generating the response data packet according to the private protocol, and sending the response data packet to the client through the browser.
  • the method provided by the embodiment of the present invention generates a response data packet according to the private protocol and sends the response data packet to the client, and the existing method needs to be sent to the browser through the Http protocol, and the response packet is sent by the browser.
  • the data communication process does not carry other protocol fields in the Http protocol, which reduces the amount of data transmitted, saves bandwidth, and improves data transmission efficiency.
  • the embodiment of the present invention provides another browser-based data communication method, which specifically includes:
  • the server receives the request packet sent by the client, and processes the request packet according to a preset private protocol.
  • the private protocol is pre-agreed by the server and the client, and the private protocol is specifically included.
  • the 30-byte Socket requests the protocol of the packet header, and is a protocol of the binary byte stream.
  • the private protocol is not disclosed to the public, thus ensuring the security of the data communication, and avoiding the data being arbitrarily falsified by the illegal client.
  • step 402 Verify that the header of the received request packet is legal, if it is legal, go to step 403, otherwise go to step 409;
  • the server verifies the header of the request packet according to the verification manner pre-agreed by the client, and the specific verification manner is not limited in the embodiment of the present invention.
  • the server and the client can agree that the header contains some If the header of the data packet received by the server includes the content, it indicates that the packet header of the data packet is legal, and step 403 is performed; if the packet header of the data packet received by the server does not contain the content, the data packet is indicated. The header is invalid, returning invalid information to the client, and the step ends.
  • step 403 The server verifies whether the key of the request packet is legal according to the preset key, if the verification is legal, step 404 is performed, otherwise step 409 is performed;
  • the server verifies whether the key of the request packet is legal by decrypting the header and/or the body of the request packet by using a key pre-agreed with the client. If the decryption is successful, the request packet is verified. If the key is valid, step 404 is performed, otherwise the error information is returned to the client, and the step ends.
  • the embodiment of the present invention verifies whether the key of the request packet is legal, and is used to authenticate the validity of the request packet sent by the client. It also provides a basis for the identification of illegal data packets, and also raises the threshold for data forgery.
  • the server decrypts the header of the request packet successfully, it verifies that the key of the request packet is legal, and ensures that the request packet is from If the client only encrypts the packet requesting the packet, the server decrypts the packet requesting the packet successfully, indicating that the key of the request packet is legal; if the client requests the packet Both the header and the packet are encrypted. If the server decrypts the header and the packet of the request packet successfully, it verifies that the key of the request packet is legal. In other cases, the error message is returned to the client. End.
  • step 404 The server identifies whether the packet of the request packet needs to be decompressed, if necessary, step 405 is performed, otherwise step 406 is performed;
  • the server end decompresses accordingly.
  • step 406 is performed, otherwise an error message is returned to the client, and the step ends.
  • the specific implementation manner of the request packet generating request data by the server according to the preset private protocol is similar to the manner in which the client generates the request data packet according to the preset private protocol, and the present invention does not repeat here. .
  • the specific implementation manner of the response data packet generated by the server according to the preset private protocol is compared with the client according to the pre-preparation
  • the manner in which the private protocol is set to request the data generation request packet is similar, and the present invention does not limit the manner in which the response packet is generated.
  • the client can process the response data packet according to the preset private protocol, and complete communication from the server to the client, preferably through The Socket interface sends the response packet to the client, so that the user obtains the response packet through the browser.
  • the data communication method provided by the embodiment of the present invention generates a response data packet according to the private protocol and sends the response data packet to the client, and the existing first needs to be sent to the browser through the Http protocol, and the response packet is sent by the browser.
  • the intermediate link of the data communication is reduced, and the other protocol fields in the Http protocol are not carried in the data communication process, and the header of the request data packet generated according to the private protocol is the header of the request data packet generated according to the Http protocol.
  • Example 5 2% or so, reducing the amount of data transferred, also saving bandwidth, improving the efficiency of data transmission; and, according to the proprietary protocol for transmission, rather than the public clear text protocol, improve the security of data communication, even if the transmitted data is Interception has no use value; in addition, the transmission of the request packet is encrypted, which further enhances the security of data communication.
  • an embodiment of the present invention provides a browser-based data interaction method, which specifically includes:
  • the client receives the request data input by the user through the browser, generates the request data packet according to the preset private protocol, and sends the request data packet to the server.
  • the step achieves the effect that the request data packet can be run in the browser and can independently perform data interaction with the server;
  • the server receives the request packet, and verifies whether the header of the request packet is legal. If it is legal, the request packet generates the request data according to a preset private protocol.
  • the data interaction method provided by the embodiment of the present invention generates a request data packet by the client according to the private protocol, and sends the request data packet to the server, and the server generates the response data according to the received request data packet, and the response data is generated according to the private protocol.
  • the response data generates a response packet, which is sent to the client to complete the data interaction between the client and the server, and reduces the data communication compared with the existing data interaction between the client and the server through the Http protocol by the browser.
  • the data exchange does not carry other protocol fields in the Http protocol, and the header of the request packet (or response packet) generated according to the private protocol is a request packet (or a response packet) generated according to the Http protocol.
  • Example 6 about 2% of the header, reducing the amount of data transferred, also saving bandwidth, improving the efficiency of data transmission; and, according to the proprietary protocol for transmission, rather than the public clear text protocol, improve the security of data communication, even Transmitted data Being intercepted also has no use value.
  • an embodiment of the present invention provides a client, which specifically includes:
  • a receiving unit 601 configured to receive request data input by a user through a browser
  • the generating unit 602 is configured to generate a request data packet by using the request data received by the receiving unit 601 according to a preset private protocol.
  • the sending unit 603 is configured to send the request data packet generated by the generating unit 602 to the server.
  • the sending unit 603 is specifically configured to send the request packet to the server through the Socket interface.
  • the client further includes:
  • the encryption unit 604 is configured to perform encryption processing on the request data packet generated by the preset key pair generation unit 602.
  • the sending unit 603 is configured to send the encrypted request data packet to the server.
  • the client further includes:
  • the connecting unit 605 is configured to send a connection request to the server by using the Http protocol before the sending unit 603 sends the request data packet to the server, so that the server returns a response message to establish a connection with the server; correspondingly, the sending unit 603. Specifically, the request data packet is sent to the server according to the connection established by the connection unit 605.
  • the client provided by the embodiment of the present invention can generate the request data packet according to the private protocol, and send the request data packet to the server, so that the generated request data packet can be directly sent to the server, compared with the existing client.
  • the intermediate link of data communication also saves bandwidth and improves data transmission efficiency.
  • the data packet is encrypted and transmitted, which enhances the security of data communication.
  • an embodiment of the present invention provides a server, where the server includes: a receiving unit 701, configured to receive a request packet;
  • the first verification unit 702 is configured to verify whether the header of the request data packet received by the receiving unit 701 is legal.
  • the first generating unit 703 is configured to: when the first verification unit 702 verifies that the header of the request data packet is legal, according to a preset The private protocol generates the request data for the request packet.
  • the server further includes:
  • the second generating unit 704 is configured to acquire response data according to the request data generated by the first generating unit 703, and generate a response data packet according to the private protocol.
  • the sending unit 705 is configured to send the response data packet generated by the second generating unit 704 to the client. Further, the sending unit 705 is specifically configured to send the response data packet to the client through the Socket interface.
  • the server further includes:
  • the second verification unit 706 is configured to verify, after the first verification unit 702 verifies that the header of the request data packet is legal, whether the key of the request data packet is legal according to a preset key, and if it is legal, execute the first generation unit. 703 The step of generating the request data by the request packet according to a preset private protocol.
  • the server provided by the embodiment of the present invention can generate the response data packet according to the private protocol and send the response data packet to the client, and can directly send the generated response data packet to the client, which is reduced compared with the existing server.
  • the intermediate link of data communication also saves bandwidth and improves data transmission efficiency.
  • the transmission of the response data packet is encrypted, which enhances the security of data communication.
  • an embodiment of the present invention provides a browser-based data interaction system, where the data interaction system includes: a client 801 and a server 802;
  • the client 801 is the client provided in Embodiment 6 above;
  • the server 802 is the server provided in the above embodiment 7.
  • the data interaction system provided by the embodiment of the present invention generates a request data packet by the client according to the private protocol, and sends the request data packet to the server, and the server obtains the response data, and generates the response data packet according to the private protocol, and sends the response data packet.
  • the client complete the data interaction between the client and the server, compared with the existing data interaction between the client and the server through the Http protocol by the browser, the intermediate link of the data communication is reduced, and the data interaction is not It will carry other protocol fields in the Http protocol, and the header of the request packet (or response packet) generated according to the private protocol can reach about 2% of the header of the request packet (or response packet) generated by the Http protocol.
  • the data transmission amount is reduced, the bandwidth is saved, and the data transmission efficiency is improved.
  • the client and the server exchange data according to the private protocol, instead of the explicit plaintext protocol, thereby improving the security of data communication even if the transmission is performed.
  • the data is intercepted and has no use value; in addition, the number of requests Encrypted and transmitted packets (or response packets) enhance the security of data communications.
  • the client and the server provided by the foregoing embodiment are in the same concept as the data communication method embodiment, and the specific implementation process is described in the method embodiment, and details are not described herein again.
  • the serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

基于浏览器的数据通讯方法、 设备和数据交互*** 技术领域
本发明涉及网络技术领域, 特别涉及一种基于浏览器的数据通讯方法、 设备和数据交 互***。 背景技术 说 随着互联网的发展, 越来越多的用户通过网络获取自己感兴趣的信息, Flash文件由于 包含丰富的媒体, 如简单的动画、 视频、 演示文稿、 应用程序及它们之间的连接关系, 受 到广大用户的关注。 无论是简单普通的 Flash动画还是复杂的 Flash游戏, 都是由客户端通 书
过浏览器与服务端进行数据交互, 实现数据通讯, 具体地, 客户端基于浏览器发起请求数 据,接收 Web服务器返回的响应数据,并通过 Internet协议实现客户端与服务端的数据通讯。
目前, 基于浏览器的数据通讯方式是由客户端通过 Http (Hyper Text Transfer Protocol, 超文本传输协议)协议访问保存在 Web服务器上的超文本信息, 并通过 Http协议接收 Web 服务器发送的网页或其他数据内容, 进行数据通讯。
在实现本发明的过程中, 发明人发现现有技术至少存在以下问题: 客户端与 Web服务 器进行数据通讯时, 通讯交互过程中使用 Http协议传输数据, 传输的数据需要加载 Http协 议中的所有包头, 由于 Http协议规定很多协议字段, 导致了传输数据量大, 并产生占用过 多带宽问题, 且对数据的处理能力慢慢成为瓶颈。 发明内容
为了减少传输数据量并节省带宽, 同时提升对数据的处理能力, 本发明实施例提供了 一种基于浏览器的数据通讯方法、 设备和数据交互***。 所述技术方案如下:
一方面, 提供了一种基于浏览器的数据通讯方法, 所述方法包括:
接收用户通过浏览器输入的请求数据;
根据预设的私有协议将所述请求数据生成请求数据包;
将所述请求数据包发送给服务端。
进一步地, 所述将所述请求数据包发送给服务端, 具体包括:
通过 Socket接口将所述请求数据包发送给服务端。 可选地, 所述根据预设的私有协议将所述请求数据生成请求数据包之后, 还包括: 根据预设的密钥对所述请求数据包进行加密处理。
可选地, 所述将所述请求数据包发送给服务端之前, 还包括:
通过 Http协议向服务端发送连接请求, 使服务端返回应答信息, 以与服务端建立连接; 相应地, 所述将所述请求数据包发送给服务端, 具体包括: 将所述请求数据包根据建 立的连接发送给服务端。
优选地, 所述私有协议具体为包含不高于三十个字节的 Socket请求数据包头的协议。 另一方面, 还提供了一种基于浏览器的数据通讯方法, 所述方法包括:
接收请求数据包;
验证所述请求数据包的包头是否合法, 若合法, 则根据预设的私有协议将所述请求数 据包生成请求数据。
可选地, 所述根据预设的私有协议将所述请求数据包生成请求数据之后, 还包括: 根据所述请求数据获取应答数据;
根据所述私有协议将所述应答数据生成应答数据包;
将所述应答数据包发送给客户端。
进一步地, 所述将所述应答数据包发送给客户端, 具体包括:
通过 Socket接口将所述应答数据包发送给客户端。
可选地, 验证所述请求数据包的包头合法之后, 还包括:
根据预设的密钥验证所述请求数据包的密钥是否合法, 若合法, 则执行根据预设的私 有协议将所述请求数据包生成请求数据的步骤。
优选地, 所述私有协议具体为包含不高于三十个字节的 Socket请求数据包头的协议。 另一方面, 还提供了一种基于浏览器的数据交互方法, 所述方法包括:
客户端接收用户通过浏览器输入的请求数据, 根据预设的私有协议将所述请求数据生 成请求数据包, 并将所述请求数据包发送给服务端;
服务端接收请求数据包, 验证所述请求数据包的包头是否合法, 若合法, 则根据预设 的私有协议将所述请求数据包生成请求数据。 另一方面, 还提供了一种客户端, 所述客户端包括:
接收单元, 用于接收用户通过浏览器输入的请求数据; 生成单元, 用于根据预设的私有协议将所述接收单元接收的请求数据生成请求数据包; 发送单元, 用于将所述生成单元生成的请求数据包发送给服务端。
进一步地, 所述发送单元, 具体用于通过 Socket接口将所述请求数据包发送给服务端。 可选地, 所述客户端还包括:
加密单元, 用于根据预设的密钥对所述生成单元生成的请求数据包进行加密处理。 可选地, 所述客户端还包括:
连接单元, 用于在所述发送单元将所述请求数据包发送给服务端之前, 通过超文本传 输协议 Http协议向服务端发送连接请求, 使服务端返回应答信息, 以与服务端建立连接; 相应地, 所述发送单元, 具体用于将所述请求数据包根据所述连接单元建立的连接发 送给服务端。 另一方面, 还提供了一种服务端, 所述服务端包括:
接收单元, 用于接收请求数据包;
第一验证单元, 用于验证所述接收单元接收的请求数据包的包头是否合法;
第一生成单元, 用于当所述第一验证单元验证所述请求数据包的包头合法时, 根据预 设的私有协议将所述请求数据包生成请求数据。
可选地, 所述服务端还包括:
第二生成单元, 用于根据所述第一生成单元生成的请求数据获取应答数据, 并根据私 有协议将所述应答数据生成应答数据包;
发送单元, 用于将所述第二生成单元生成的应答数据包发送给客户端。
进一步地, 所述发送单元, 具体用于通过 Socket接口将所述应答数据包发送给客户端。 可选地, 所述服务端还包括:
第二验证单元, 用于在所述第一验证单元验证所述请求数据包的包头合法之后, 根据 预设的密钥验证所述请求数据包的密钥是否合法, 若合法, 则执行所述第一生成单元根据 预设的私有协议将所述请求数据包生成请求数据的步骤。 另一方面, 还提供了一种基于浏览器的数据交互***, 所述***包括: 客户端和服务
W;
所述客户端如上述客户端;
所述服务端如上述服务端。
本发明实施例提供的技术方案带来的有益效果是: 根据私有协议将请求数据生成请求 数据包, 并发送给服务端, 与现有的将请求数据通过 Http协议发送给浏览器, 并由浏览器 通过 Http协议将该请求数据发送给服务端的方式相比, 减少了数据通讯的中间环节, 数据 通讯过程中不会携带 Http协议中的其他协议字段, 减少了传输数据量, 也节省了带宽, 提 高了数据的传输效率。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所需要使用的 附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本 领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的 附图。
图 1是现有技术中 TCP/IP (Transmission Control Protocol/Internet Protocol, 传输控制协 议 /因特网互联协议) 协议的五层协议结构示意图;
图 2是本发明实施例 1中提供的基于浏览器的数据通讯方法流程图;
图 3是本发明实施例 2中提供的基于浏览器的数据通讯方法流程图;
图 4是本发明实施例 3中提供的基于浏览器的数据通讯方法流程图;
图 5是本发明实施例 4中提供的基于浏览器的数据通讯方法流程图;
图 6是本发明实施例 5中提供的基于浏览器的数据交互方法流程图;
图 7是本发明实施例 6中提供的客户端的结构示意图;
图 8是本发明实施例 6中提供的另一种客户端的结构示意图;
图 9是本发明实施例 6中提供的又一种客户端的结构示意图;
图 10是本发明实施例 7中提供的服务端的结构示意图;
图 11是本发明实施例 7中提供的另一种服务端的结构示意图;
图 12是本发明实施例 7中提供的又一种服务端的结构示意图;
图 13是本发明实施例 8中提供的基于浏览器的数据交互***的结构示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作 进一步地详细描述。
现有的 TCP/IP协议的五层结构如图 1所示, 其中, 第 1、 2层为网络接口层, 包括硬 件设备驱动和媒体访问协议, 第 3层为 IP/ICMP (Internet Control Messages Protocol, 互联 网信报控制协议)互连网络层, 包括 ARP (Address Resolution Protocol, 地址解析协议)协 议, RARP (Reverse Address Resolution Protocol, 反向地址转换协议) 协议, 第 4层为传输 层,包括 TCP (Transmission Control Protocol,传输控制协议)协议和 UDP(User Data Protocol, 用户数据报协议) 协议, 第 5层为应用层, 包括 DNS (Domain Name System, 域名***服 务) 协议、 FTP ( File Transfer Protocol , 文件传输协议) 协议、 Http 协议、 TelNet (Telecommunications Network, 远程登录) 协议, 现有技术通过第 5层的 Http协议进行客 户端和服务端的数据通讯, 本发明实施例是在第 5层上做的改进和创新。 实施例 1
参见图 2, 本发明实施例提供了一种基于浏览器的数据通讯方法, 具体包括:
101: 接收用户通过浏览器输入的请求数据;
102: 根据预设的私有协议将该请求数据生成请求数据包;
103: 将该请求数据包发送给服务端。
本发明实施例提供的方法, 根据私有协议将请求数据生成请求数据包, 并发送给服务 端, 与现有的将请求数据通过 Http协议发送给浏览器, 并由浏览器通过 Http协议将该请求 数据发送给服务端的方式相比,减少了数据通讯的中间环节,数据通讯过程中不会携带 Http 协议中的其他协议字段, 减少了传输数据量, 也节省了带宽, 提高了数据的传输效率。 实施例 2
参见图 3, 对于客户端而言, 本发明实施例提供了一种基于浏览器的数据通讯方法, 具 体包括:
201: 客户端通过 Http协议向服务端发送连接请求, 使服务端返回应答信息, 以与服务 端建立连接;
本实施例中提供了一种 Flash文件,浏览器加载了该 Flash文件后, Flash文件使用 XML (Extensible Markup Language, 可扩展标记语言) Socket连接安全策略服务器, 获取安全 策略文件, 当成功获取安全策略文件后, Flash文件就被授权可以使用 Socket访问某私有服 务器的某个端口,通过 Flash文件创建的 Socket,客户端可以连接服务端。本实施例中服务端 为私有服务器。
针对该步骤, 客户端可以通过 Socket接口向私有服务器发送连接请求, 当获取到私有 服务器返回的应答信息时, 客户端与私有服务器成功建立私有连接。 本发明实施例以客户 端与服务端通过 XML Socket接口建立连接为例进行说明, 实际应用中, 还可以采用其他的 Socket连接方式, 本发明在此不做限定。 202: 接收用户通过浏览器输入的请求数据;
具体地, 本发明实施例是在基于浏览器的前提下做出的发明创造, 由用户基于浏览器 输入请求数据, 从而能够根据预设的私有协议将该请求数据发送给服务端, 例如, 用户通 过浏览器将要进行访问的请求数据发送给客户端, 该浏览器只是作为输入请求数据的承载 物, 输入的数据并不保存在浏览器上, 而是保存在客户端。
203: 根据预设的私有协议将该请求数据生成请求数据包;
本发明实施例中在客户端设置 Flash编程模块,当客户端接收到用户输入的请求数据后, 该请求数据经过 Flash编程模块生成 Flash请求数据。 对于各网站提供的 Flash文件通讯服 务, 客户端根据预设的私有协议将该 Flash请求数据生成请求数据包, 该私有协议为包含不 高于三十个字节的 Socket请求数据包头的协议, 并且是二进制字节流的协议, 该私有协议 不对外公开, 因而保证了数据通讯的安全性, 避免了数据被非法客户端随意篡改。 并且和 现有技术通过 Http协议打包后的数据相比, 明显减少了要传输的数据量。 该私有协议在客 户端和服务端预先约定好, 客户端根据预设的私有协议将请求数据打包并发送给服务端后, 服务端能够根据预设的私有协议处理该请求数据包并返回相应的应答数据包。
204: 将请求数据包发送给服务端。
其中, 客户端与服务端建立连接后, 客户端将根据私有协议打包的数据包根据建立的 连接发送给服务端, 从而完成从客户端到服务端的通讯, 优选地, 可以通过 Socket接口发 送该请求数据包。
可选地, 本发明实施例步骤 203 之后还包括: 根据预设的密钥对该请求数据包进行加 密处理; 对应地, 步骤 204 中发送加密的请求数据包。 通过在客户端增加对请求数据包进 行加密的方式, 保护了数据传输的安全, 也避免了传输的数据被非法客户端随意篡改。
具体地, 生成请求数据包之后, 客户端根据预设的密钥对该请求数据包进行加密处理, 可以对请求数据包的包头进行加密, 也可以对请求数据包的包体进行加密, 还可以对请求 数据包的包头和包体分别进行加密, 对请求数据包的包头进行加密的密钥和对请求数据包 的包体进行加密的密钥可以不相同, 本发明对此不做限定。 该加密步骤为优化步骤, 对请 求数据包进行加密, 能够保护数据传输的安全, 也避免了传输的数据被非法客户端随意篡 改。
另外, 在步骤 204将请求数据包发送给服务端之前, 还可以对该请求数据包的包体进 行压缩处理, 以减小数据量。
本发明实施例提供的数据通讯方法, 根据私有协议将请求数据生成请求数据包, 并发 送给服务端, 与现有的将请求数据通过 Http协议发送给浏览器, 并由浏览器通过 Http协议 将该请求数据发送给服务端的方式相比, 减少了数据通讯的中间环节, 数据通讯过程中不 会携带 Http协议中的其他协议字段, 根据该私有协议生成的请求数据包的包头是根据 Http 协议生成的请求数据包的包头的 2%左右, 减少了传输数据量, 也节省了带宽, 提高了数据 的传输效率; 并且, 根据私有协议进行传输, 而非公开的明文协议, 提高了数据通讯的安 全性, 即使传输的数据被截获也没有利用价值; 另外, 对请求数据包加密后传输, 更加增 强了数据通讯的安全性。 实施例 3
参见图 4, 本发明实施例提供了另一种基于浏览器的数据通讯方法, 具体包括: 301: 接收请求数据包;
302: 验证请求数据包的包头是否合法, 若合法, 则根据预设的私有协议将请求数据包 生成请求数据。
其中, 该方法还包括: 根据该请求数据获取应答数据, 根据私有协议将该应答数据生 成应答数据包, 将该应答数据包通过浏览器发送给客户端。
本发明实施例提供的方法, 根据私有协议将应答数据生成应答数据包, 并发送给客户 端, 与现有的首先需要通过 Http协议发送给浏览器, 并由浏览器发送应答数据包的方式相 比, 减少了数据通讯的中间环节, 数据通讯过程中不会携带 Http协议中的其他协议字段, 减少了传输数据量, 也节省了带宽, 提高了数据的传输效率。 实施例 4
参见图 5, 对于服务端而言, 本发明实施例提供了另一种基于浏览器的数据通讯方法, 具体包括:
401: 接收请求数据包;
对于该步骤, 服务端接收客户端发送的请求数据包, 并根据预设的私有协议处理该请 求数据包, 该私有协议是由服务端和客户端预先约定的, 该私有协议具体为包含不高于三 十个字节的 Socket请求数据包头的协议, 并且是二进制字节流的协议, 该私有协议不对外 公开, 因而保证了数据通讯的安全性, 避免了数据被非法客户端随意篡改。
402: 验证接收的请求数据包的包头是否合法, 若合法, 则执行步骤 403, 否则执行步 骤 409;
具体地, 服务端根据与客户端预先约定的验证方式对请求数据包的包头进行验证, 本 发明实施例不对具体的验证方式进行限定。 例如, 服务端与客户端可以约定包头包含某内 容则表示合法, 若服务端接收的数据包的包头包含该内容, 则表示该数据包的包头合法, 执行步骤 403 ;若服务端接收的数据包的包头不包含该内容,则表示该数据包的包头不合法, 向客户端返回不合法信息, 步骤结束。
403: 服务端根据预设的密钥验证该请求数据包的密钥是否合法, 若验证合法, 则执行 步骤 404, 否则执行步骤 409;
其中, 服务端通过采用与客户端预先约定的密钥对请求数据包的包头和 /或包体进行解 密的方式, 验证请求数据包的密钥是否合法, 若解密成功, 则验证出请求数据包的密钥合 法, 执行步骤 404, 否则向客户端返回错误信息, 步骤结束; 本发明实施例验证请求数据包 的密钥是否合法, 是用来鉴别客户端发过来的请求数据包的合法性, 并对非法数据包的鉴 别提供了一定的依据, 同时也给数据伪造提升了门槛。
具体地, 若客户端仅对请求数据包的包头进行了加密, 则服务端对请求数据包的包头 解密成功时, 则验证出请求数据包的密钥合法, 且保证了该请求数据包是来自合法客户端; 若客户端仅对请求数据包的包体进行了加密, 则服务端对请求数据包的包体解密成功, 则 表明请求数据包的密钥合法; 若客户端对请求数据包的包头和包体均进行了加密, 则服务 端对请求数据包的包头和包体均解密成功时, 则验证出请求数据包的密钥合法; 其他情况 下, 则向客户端返回错误信息, 步骤结束。
404:服务端识别是否需要对请求数据包的包体进行解压缩,如果需要,则执行步骤 405, 否则执行步骤 406;
具体地, 如果客户端对该请求数据包的包体进行了压缩, 那么相应地服务端就要进行 解压缩。
405: 对请求数据包的包体进行解压缩;
实际应用中, 若服务端识别出需要对请求数据包的包体进行解压缩处理, 则根据与客 户端预设的解压缩方式,对请求数据包的包体进行解压缩,若解压缩成功,则执行步骤 406, 否则向客户端返回错误信息, 步骤结束。
406: 在不需要解压缩或解压缩成功时, 根据预设的私有协议将请求数据包生成请求数 据;
具体地, 服务端根据预设的私有协议将请求数据包生成请求数据的具体实现方式与客 户端根据预设的私有协议将请求数据生成请求数据包的方式相类似, 本发明在此不再赘述。
407: 根据请求数据获取应答数据, 并根据预设的私有协议将该应答数据生成应答数据 包;
具体地, 服务端根据预设的私有协议生成应答数据包的具体实现方式与客户端根据预 设的私有协议将请求数据生成请求数据包的方式相类似, 本发明不对生成应答数据包的方 式进行限定。
408: 将该应答数据包发送给客户端, 流程结束;
其中, 服务端将根据预设的私有协议生成的应答数据包发送给客户端后, 客户端能够 根据预设的私有协议处理该应答数据包, 完成从服务端到客户端的通讯, 优选地可以通过 Socket接口将该应答数据包发送给客户端, 以使用户通过浏览器获取到该应答数据包。
409: 向客户端返回错误信息, 流程结束。
本发明实施例提供的数据通讯方法, 根据私有协议将应答数据生成应答数据包, 并发 送给客户端, 与现有的首先需要通过 Http协议发送给浏览器, 并由浏览器发送应答数据包 的方式相比, 减少了数据通讯的中间环节, 数据通讯过程中不会携带 Http协议中的其他协 议字段, 根据该私有协议生成的请求数据包的包头是根据 Http协议生成的请求数据包的包 头的 2%左右, 减少了传输数据量, 也节省了带宽, 提高了数据的传输效率; 并且, 根据私 有协议进行传输, 而非公开的明文协议, 提高了数据通讯的安全性, 即使传输的数据被截 获也没有利用价值; 另外, 对请求数据包加密后传输, 更加增强了数据通讯的安全性。 实施例 5
参见图 6, 本发明实施例提供了一种基于浏览器的数据交互方法, 具体包括:
501: 客户端接收用户通过浏览器输入的请求数据, 根据预设的私有协议将该请求数据 生成请求数据包, 并将该请求数据包发送给服务端;
其中, 该步骤达到了该请求数据包既能在浏览器中运行, 又能独立与服务器进行数据 交互的效果;
502: 服务端接收请求数据包, 验证该请求数据包的包头是否合法, 若合法, 则根据预 设的私有协议将该请求数据包生成请求数据。
本发明实施例提供的数据交互方法, 通过客户端根据私有协议将请求数据生成请求数 据包, 并发送给服务端, 并由服务端根据接收的请求数据包生成应答数据, 且根据私有协 议将该应答数据生成应答数据包, 发送给客户端, 完成客户端与服务端之间的数据交互, 与现有的由浏览器通过 Http协议进行客户端与服务端的数据交互方式相比, 减少了数据通 讯的中间环节, 数据交互中不会携带 Http协议中的其他协议字段, 且根据该私有协议生成 的请求数据包(或应答数据包) 的包头是根据 Http协议生成的请求数据包(或应答数据包) 的包头的 2%左右, 减少了传输数据量, 也节省了带宽, 提高了数据的传输效率; 并且, 根 据私有协议进行传输, 而非公开的明文协议, 提高了数据通讯的安全性, 即使传输的数据 被截获也没有利用价值。 实施例 6
与实施例 2对应, 参见图 7, 本发明实施例提供了一种客户端, 具体包括:
接收单元 601, 用于接收用户通过浏览器输入的请求数据;
生成单元 602,用于根据预设的私有协议将接收单元 601接收的该请求数据生成请求数 据包;
发送单元 603, 用于将生成单元 602生成的请求数据包发送给服务端。
进一步地, 发送单元 603, 具体用于通过 Socket接口将该请求数据包发送给服务端。 可选地, 参见图 8, 该客户端还包括:
加密单元 604, 用于根据预设的密钥对生成单元 602生成的请求数据包进行加密处理; 相应地, 发送单元 603用于将该加密的请求数据包发送给服务端。
可选地, 参见图 9, 该客户端还包括:
连接单元 605, 用于在发送单元 603将该请求数据包发送给服务端之前, 通过 Http协 议向服务端发送连接请求, 使服务端返回应答信息, 以与服务端建立连接; 相应地, 发送 单元 603, 具体用于将该请求数据包根据连接单元 605建立的连接发送给服务端。
本发明实施例提供的客户端, 通过将请求数据根据私有协议生成请求数据包, 并发送 给服务端, 与现有的客户端相比, 能够将生成的请求数据包直接发送给服务端, 减少了数 据通讯的中间环节, 也节省了带宽, 提高了数据的传输效率; 另外, 对请求数据包加密后 传输, 增强了数据通讯的安全性。 实施例 7
与实施例 4对应, 参见图 10, 本发明实施例提供了一种服务端, 该服务端包括: 接收单元 701, 用于接收请求数据包;
第一验证单元 702, 用于验证接收单元 701接收的请求数据包的包头是否合法; 第一生成单元 703, 用于当第一验证单元 702验证该请求数据包的包头合法时, 根据预 设的私有协议将所述请求数据包生成请求数据。
可选地, 参见图 11, 该服务端还包括:
第二生成单元 704, 用于根据第一生成单元 703生成的请求数据获取应答数据, 并根据 私有协议将该应答数据生成应答数据包;
发送单元 705, 用于将第二生成单元 704生成的应答数据包发送给客户端。 进一步地, 发送单元 705, 具体用于通过 Socket接口将该应答数据包发送给客户端。 可选地, 参见图 12, 该服务端还包括:
第二验证单元 706, 用于在第一验证单元 702验证该请求数据包的包头合法之后, 根据 预设的密钥验证该请求数据包的密钥是否合法, 若合法, 则执行第一生成单元 703 根据预 设的私有协议将该请求数据包生成请求数据的步骤。
本发明实施例提供的服务端, 通过将应答数据根据私有协议生成应答数据包, 并发送 给客户端, 与现有的服务端相比, 能够将生成的应答数据包直接发送给客户端, 减少了数 据通讯的中间环节, 也节省了带宽, 提高了数据的传输效率; 另外, 对应答数据包加密后 传输, 增强了数据通讯的安全性。 实施例 8
参见图 13, 本发明实施例提供了一种基于浏览器的数据交互***, 该数据交互***包 括: 客户端 801和服务端 802;
其中, 客户端 801如上述实施例 6提供的客户端;
服务端 802如上述实施例 7提供的服务端。
本发明实施例提供的数据交互***, 通过客户端根据私有协议将请求数据生成请求数 据包, 并发送给服务端, 服务端获取应答数据, 且根据私有协议将该应答数据生成应答数 据包, 发送给客户端, 完成客户端与服务端之间的数据交互, 与现有的由浏览器通过 Http 协议进行客户端与服务端的数据交互方式相比, 减少了数据通讯的中间环节, 数据交互中 不会携带 Http协议中的其他协议字段, 且根据该私有协议生成的请求数据包 (或应答数据 包) 的包头最短能够达到 Http协议生成的请求数据包 (或应答数据包) 的包头的 2%左右, 减少了传输数据量, 也节省了带宽, 提高了数据的传输效率; 且, 客户端和服务端根据私 有协议进行数据交互, 而非公开的明文协议, 提高了数据通讯的安全性, 即使传输的数据 被截获也没有利用价值; 另外, 对请求数据包 (或应答数据包) 加密后传输, 增强了数据 通讯的安全性。 需要说明的是: 上述实施例提供的客户端和服务端在进行数据通讯时, 仅以上述各功 能模块的划分进行举例说明, 实际应用中, 可以根据需要而将上述功能分配由不同的功能 模块完成, 即将客户端和服务端的内部结构划分成不同的功能模块, 以完成以上描述的全 部或者部分功能。 另外, 上述实施例提供的客户端和服务端与数据通讯方法实施例属于同 一构思, 其具体实现过程详见方法实施例, 这里不再赘述。 上述本发明实施例序号仅仅为了描述, 不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完 成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读存储 介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种基于浏览器的数据通讯方法, 其特征在于, 所述方法包括:
接收用户通过浏览器输入的请求数据;
根据预设的私有协议将所述请求数据生成请求数据包;
将所述请求数据包发送给服务端。
2、 如权利要求 1所述的方法, 其特征在于, 所述将所述请求数据包发送给服务端, 具体 包括:
通过 Socket接口将所述请求数据包发送给服务端。
3、 如权利要求 1所述的方法, 其特征在于, 所述根据预设的私有协议将所述请求数据生 成请求数据包之后, 还包括:
根据预设的密钥对所述请求数据包进行加密处理。
4、 如权利要求 1所述的方法, 其特征在于, 所述将所述请求数据包发送给服务端之前, 还包括:
通过超文本传输协议 Http协议向服务端发送连接请求, 使服务端返回应答信息, 以与服 务端建立连接;
相应地, 所述将所述请求数据包发送给服务端, 具体包括: 将所述请求数据包根据建立 的连接发送给服务端。
5、 如权利要求 1-4任一项权利要求所述的方法, 其特征在于, 所述私有协议具体为包含 不高于三十个字节的 Socket请求数据包头的协议。
6、 一种基于浏览器的数据通讯方法, 其特征在于, 所述方法包括:
接收请求数据包;
验证所述请求数据包的包头是否合法, 若合法, 则根据预设的私有协议将所述请求数据 包生成请求数据。
7、 如权利要求 6所述的方法, 其特征在于, 所述根据预设的私有协议将所述请求数据包 生成请求数据之后, 还包括:
根据所述请求数据获取应答数据;
根据所述私有协议将所述应答数据生成应答数据包;
将所述应答数据包发送给客户端。
8、 如权利要求 7所述的方法, 其特征在于, 所述将所述应答数据包发送给客户端, 具体 包括:
通过 Socket接口将所述应答数据包发送给客户端。
9、 如权利要求 6所述的方法, 其特征在于, 验证所述请求数据包的包头合法之后, 还包 括- 根据预设的密钥验证所述请求数据包的密钥是否合法, 若合法, 则执行根据预设的私有 协议将所述请求数据包生成请求数据的步骤。
10、 如权利要求 6-9任一项权利要求所述的方法, 其特征在于, 所述私有协议具体为包 含不高于三十个字节的 Socket请求数据包头的协议。
11、 一种基于浏览器的数据交互方法, 其特征在于, 所述方法包括:
客户端接收用户通过浏览器输入的请求数据, 根据预设的私有协议将所述请求数据生成 请求数据包, 并将所述请求数据包发送给服务端;
服务端接收请求数据包, 验证所述请求数据包的包头是否合法, 若合法, 则根据预设的 私有协议将所述请求数据包生成请求数据。
12、 一种客户端, 其特征在于, 所述客户端包括:
接收单元, 用于接收用户通过浏览器输入的请求数据;
生成单元, 用于根据预设的私有协议将所述接收单元接收的请求数据生成请求数据包; 发送单元, 用于将所述生成单元生成的请求数据包发送给服务端。
13、 如权利要求 12所述的客户端, 其特征在于, 所述发送单元, 具体用于通过 Socket 接口将所述请求数据包发送给服务端。
14、 如权利要求 12所述的客户端, 其特征在于, 所述客户端还包括:
加密单元, 用于根据预设的密钥对所述生成单元生成的请求数据包进行加密处理。
15、 如权利要求 12所述的客户端, 其特征在于, 所述客户端还包括:
连接单元, 用于在所述发送单元将所述请求数据包发送给服务端之前, 通过超文本传输 协议 Http协议向服务端发送连接请求, 使服务端返回应答信息, 以与服务端建立连接;
相应地, 所述发送单元, 具体用于将所述请求数据包根据所述连接单元建立的连接发送 给服务端。
16、 一种服务端, 其特征在于, 所述服务端包括:
接收单元, 用于接收请求数据包;
第一验证单元, 用于验证所述接收单元接收的请求数据包的包头是否合法;
第一生成单元, 用于当所述第一验证单元验证所述请求数据包的包头合法时, 根据预设 的私有协议将所述请求数据包生成请求数据。
17、 如权利要求 16所述的服务端, 其特征在于, 所述服务端还包括:
第二生成单元, 用于根据所述第一生成单元生成的请求数据获取应答数据, 并根据私有 协议将所述应答数据生成应答数据包;
发送单元, 用于将所述第二生成单元生成的应答数据包发送给客户端。
18、 如权利要求 17所述的服务端, 其特征在于, 所述发送单元, 具体用于通过 Socket 接口将所述应答数据包发送给客户端。
19、 如权利要求 16所述的服务端, 其特征在于, 所述服务端还包括:
第二验证单元, 用于在所述第一验证单元验证所述请求数据包的包头合法之后, 根据预 设的密钥验证所述请求数据包的密钥是否合法, 若合法, 则执行所述第一生成单元根据预设 的私有协议将所述请求数据包生成请求数据的步骤。
20、 一种基于浏览器的数据交互***, 其特征在于, 所述***包括: 客户端和服务端; 所述客户端如上述权利要求 12-15中任一权利要求所述的客户端;
所述服务端如上述权利要求 16-19中任一权利要求所述的服务端。
PCT/CN2011/078293 2010-12-30 2011-08-11 基于浏览器的数据通讯方法、设备和数据交互*** WO2012088889A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/976,523 US20130291089A1 (en) 2010-12-30 2011-08-11 Data communication method and device and data interaction system based on browser

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010624611.5A CN102571892B (zh) 2010-12-30 2010-12-30 基于浏览器的数据通讯方法、客户端和数据交互***
CN201010624611.5 2010-12-30

Publications (1)

Publication Number Publication Date
WO2012088889A1 true WO2012088889A1 (zh) 2012-07-05

Family

ID=46382280

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/078293 WO2012088889A1 (zh) 2010-12-30 2011-08-11 基于浏览器的数据通讯方法、设备和数据交互***

Country Status (3)

Country Link
US (1) US20130291089A1 (zh)
CN (1) CN102571892B (zh)
WO (1) WO2012088889A1 (zh)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152410B (zh) * 2013-02-25 2015-09-23 广东欧珀移动通信有限公司 移动设备下载数据的方法及装置
CN103812859B (zh) * 2013-12-27 2017-05-03 北京天融信软件有限公司 网络准入方法、终端准入方法、网络准入装置和终端
CN103746990B (zh) * 2013-12-31 2018-02-27 梵飞(厦门)信息科技有限公司 一种移动终端中浏览器与客户端的数据交互***和方法
CN103905435A (zh) * 2014-03-14 2014-07-02 北京六间房科技有限公司 一种前端页面与后端服务器通信方法
CN105763583A (zh) * 2014-12-16 2016-07-13 博雅网络游戏开发(深圳)有限公司 与php进程通信的方法和***
CN104852955B (zh) * 2015-03-30 2018-09-21 新浪网技术(中国)有限公司 一种数据处理方法及***
CN106411812B (zh) 2015-07-27 2019-10-08 阿里巴巴集团控股有限公司 用户身份的验证方法、***和验证服务器
US11210406B2 (en) * 2016-07-15 2021-12-28 Seagate Technology Llc Encrypting system level data structures
CN106411907A (zh) * 2016-10-13 2017-02-15 广西咪付网络技术有限公司 一种数据传输方法和***
CN106850805A (zh) * 2017-02-06 2017-06-13 网宿科技股份有限公司 一种数据传输方法及装置
CN107094178B (zh) * 2017-05-11 2019-06-18 广东网金控股股份有限公司 一种互联网数据传输方法、装置以及服务器终端
US11587073B1 (en) * 2017-12-15 2023-02-21 Worldpay, Llc Systems and methods for encryption and decryption service for electronic transaction monitoring and reporting
CN109067720A (zh) * 2018-07-18 2018-12-21 山东渔翁信息技术股份有限公司 一种保护装置及风力发电***
CN111224864A (zh) * 2020-01-14 2020-06-02 平安国际智慧城市科技股份有限公司 消息传输方法、装置、计算机设备和存储介质
CN112532619B (zh) * 2020-11-26 2022-01-25 深圳前海景佑科技有限公司 Defix协议的生成、解析方法、客户端、服务器及***
CN114866348B (zh) * 2022-07-06 2022-09-20 深圳市金政软件技术有限公司 基于浏览器的数据传输方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002033563A1 (en) * 2000-10-17 2002-04-25 Broadcloud Communications, Inc. Wireless communications invisible proxy and hooking systems and methods
CN1988703A (zh) * 2006-12-01 2007-06-27 深圳市飞天网景通讯有限公司 基于可拍照移动终端实现信息交互式操作的方法
CN101827085A (zh) * 2010-02-23 2010-09-08 浪潮通信信息***有限公司 一种将pc上的it应用***转换为手机端可访问***的方法

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6920637B2 (en) * 1995-11-17 2005-07-19 Symbol Technologies, Inc. Method and apparatus for implementing alerts on a browser running on a portable handheld device
US6470386B1 (en) * 1997-09-26 2002-10-22 Worldcom, Inc. Integrated proxy interface for web based telecommunications management tools
US6775284B1 (en) * 2000-01-07 2004-08-10 International Business Machines Corporation Method and system for frame and protocol classification
US6973496B2 (en) * 2002-03-05 2005-12-06 Archduke Holdings, Inc. Concealing a network connected device
US6785719B1 (en) * 2002-08-06 2004-08-31 Digi International Inc. Distributed systems for providing secured HTTP communications over the network
US7389324B2 (en) * 2003-11-07 2008-06-17 Plaxo, Inc. Viral engine for network deployment
US20060095573A1 (en) * 2004-11-01 2006-05-04 Microsoft Corporation Delayed HTTP response
CN101046873A (zh) * 2006-03-29 2007-10-03 腾讯科技(深圳)有限公司 一种在网络游戏中发布网络广告的方法及装置
KR100901790B1 (ko) * 2006-12-04 2009-06-11 한국전자통신연구원 IPv4 네트워크 기반 IPv6 서비스 제공시스템에서의 제어 터널 및 다이렉트 터널 설정 방법
US9516128B2 (en) * 2007-12-13 2016-12-06 International Business Machines Corporation Generic remote connection to a command line interface application
CN101296255B (zh) * 2008-06-30 2012-09-05 腾讯科技(深圳)有限公司 网页浏览方法、***、代理服务器和手机浏览器
US20100169479A1 (en) * 2008-12-26 2010-07-01 Electronics And Telecommunications Research Institute Apparatus and method for extracting user information using client-based script
US20120102085A1 (en) * 2010-10-22 2012-04-26 Unisys Corp. Resource adapter for inbound and outbound communications in an application server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002033563A1 (en) * 2000-10-17 2002-04-25 Broadcloud Communications, Inc. Wireless communications invisible proxy and hooking systems and methods
CN1988703A (zh) * 2006-12-01 2007-06-27 深圳市飞天网景通讯有限公司 基于可拍照移动终端实现信息交互式操作的方法
CN101827085A (zh) * 2010-02-23 2010-09-08 浪潮通信信息***有限公司 一种将pc上的it应用***转换为手机端可访问***的方法

Also Published As

Publication number Publication date
CN102571892B (zh) 2016-02-24
US20130291089A1 (en) 2013-10-31
CN102571892A (zh) 2012-07-11

Similar Documents

Publication Publication Date Title
WO2012088889A1 (zh) 基于浏览器的数据通讯方法、设备和数据交互***
US7502925B2 (en) Method and apparatus for reducing TCP frame transmit latency
US9742806B1 (en) Accessing SSL connection data by a third-party
US8984268B2 (en) Encrypted record transmission
US7908472B2 (en) Secure sockets layer cut through architecture
US7228412B2 (en) Bufferless secure sockets layer architecture
US7827404B1 (en) Secure sockets layer proxy architecture
US7853781B2 (en) Load balancing secure sockets layer accelerator
US5657390A (en) Secure socket layer application program apparatus and method
US20050210243A1 (en) System and method for improving client response times using an integrated security and packet optimization framework
JP2018534884A (ja) クライアント−クラウドまたはリモートサーバーの安全なデータまたはファイル・オブジェクト暗号化ゲートウェイ
CN111628976B (zh) 一种报文处理方法、装置、设备及介质
WO2009115017A1 (zh) 网络认证服务***和方法
CN109040059B (zh) 受保护的tcp通信方法、通信装置及存储介质
CN112422560A (zh) 基于安全套接层的轻量级变电站安全通信方法及***
US20170317836A1 (en) Service Processing Method and Apparatus
CN113904809A (zh) 一种通信方法、装置、电子设备及存储介质
CN113055357B (zh) 单包验证通信链路可信的方法、装置、计算设备及存储介质
US11652910B2 (en) Data transmission method, device, and system
US20030046532A1 (en) System and method for accelerating cryptographically secured transactions
WO2023036348A1 (zh) 一种加密通信方法、装置、设备及介质
CN113645193B (zh) 网络安全防护方法、业务管理***及计算机可读存储介质
CN106464684B (zh) 业务处理方法及装置
CN117201200B (zh) 基于协议栈的数据安全传输方法
Kuihe et al. Implementation of improved VPN based on SSL

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11853987

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13976523

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06/11/2013)

122 Ep: pct application non-entry in european phase

Ref document number: 11853987

Country of ref document: EP

Kind code of ref document: A1