Data processing method and device based on HTTP (Hyper Text Transport Protocol), electronic equipment and medium

By encapsulating and processing data based on HTTP protocol and using WebSocket protocol for data transmission, the data transmission security problem caused by the openness of HTTP network library is solved, and higher data transmission security and reliability are achieved.

CN120075209APending Publication Date: 2025-05-30RIVER INFORMATION TECH SHANGHAI CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510280976.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Due to its openness, standard HTTP network libraries are vulnerable to attacks by cyber attackers, tampering and forgery, resulting in reduced security and reliability of data transmission.

Method used

By encapsulating and processing data based on HTTP protocol and using WebSocket protocol for data transmission, network attackers cannot monitor, intercept and tamper with data through traditional hook technology.

Benefits of technology

It effectively reduces the risk of man-in-the-middle attacks, improves the security and reliability of data transmission, prevents common cyber attacks, and ensures the integrity and privacy of user data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075209A_ABST
    Figure CN120075209A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on an HTTP protocol, electronic equipment and a medium, and relates to the technical field of data processing, in particular to the technical field of artificial intelligence such as big data and information flow. The specific implementation scheme is as follows: in response to transmission of data based on an HTTP protocol of a specified application, packaging the data based on the HTTP protocol to obtain packaged data; and on the basis of a WebSocket protocol, sending of the packaged data is carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and particularly to artificial intelligence technical fields such as big data and information flow. Background Art

[0002] With the in-depth development of the Internet, applications based on web technologies on terminals emerge in an endless stream. For example, web applications in browsers, web applications in web view controls (such as WebView, etc.), and web applications in mini-programs. When these web technology-based applications perform data transmission based on the HyperText Transfer Protocol (HTTP), they generally use the standard HTTP network library provided by the system to provide an Application Programming Interface (API) to implement HTTP interface services.

[0003] However, due to the openness of the standard HTTP network library, network attackers can intercept the HTTP interface services implemented by the HTTP network library to perform attack behaviors such as tampering, forgery, and simulation, resulting in a reduction in the security and reliability of data transmission. Summary of the Invention

[0004] The present disclosure provides a data processing method, apparatus, electronic device, and medium based on the HTTP protocol.

[0005] According to one aspect of the present disclosure, a data processing method based on the HTTP protocol is provided, including:

[0006] In response to the sending of data based on the HTTP protocol by a specified application, encapsulate the data based on the HTTP protocol to obtain encapsulated data;

[0007] Send the encapsulated data based on the WebSocket protocol.

[0008] According to another aspect of the present disclosure, another data processing method based on the HTTP protocol is provided, including:

[0009] In response to the reception of data based on the WebSocket protocol by a specified application, parse the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol;

[0010] Perform distribution processing according to the data based on the HTTP protocol.

[0011] According to still another aspect of the present disclosure, a data processing apparatus based on the HTTP protocol is provided, including:

[0012] An encapsulation unit, configured to perform encapsulation processing on the data based on the HTTP protocol in response to the sending of the data based on the HTTP protocol of a specified application, so as to obtain encapsulated data;

[0013] A sending unit, configured to send the encapsulated data based on the WebSocket protocol.

[0014] According to another aspect of the present disclosure, there is provided another data processing apparatus based on the HTTP protocol, including:

[0015] A parsing unit, configured to perform parsing processing on the data based on the WebSocket protocol in response to the reception of the data based on the WebSocket protocol of a specified application, so as to restore the encapsulated data based on the HTTP protocol;

[0016] A distribution unit, configured to perform distribution processing according to the data based on the HTTP protocol.

[0017] According to still another aspect of the present disclosure, there is provided an electronic device, including:

[0018] At least one processor; and

[0019] A memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the methods of the above-mentioned aspects and any possible implementation manners.

[0021] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause the computer to execute the methods of the above-mentioned aspects and any possible implementation manners.

[0022] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program, and the computer program realizes the methods of the above-mentioned aspects and any possible implementation manners when being executed by a processor.

[0023] As can be seen from the above technical solutions, on the one hand, embodiments of the present disclosure encapsulate the data based on the HTTP protocol in response to the sending of data of a specified application based on the HTTP protocol to obtain encapsulated data, and then send the encapsulated data based on the WebSocket protocol. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook techniques, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0024] As can be seen from the above technical solutions, on the other hand, embodiments of the present disclosure parse the data based on the WebSocket protocol in response to the reception of data of a specified application based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol, and then perform distribution processing according to the data based on the HTTP protocol. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook techniques, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0025] Through the above two aspects of technical solutions, embodiments of the present disclosure effectively improve the security and reliability of the data transmission process based on the HTTP protocol, and effectively prevent common network attack methods, such as malicious interception and tampering of hook techniques, thereby ensuring the integrity and privacy of user data.

[0026] In addition, by adopting the technical solution provided by the present disclosure, the data based on the HTTP protocol is encapsulated and the WebSocket protocol is used for data transmission, thereby avoiding the security risks that may be encountered in the traditional HTTP-based transmission method.

[0027] In addition, by adopting the technical solution provided by the present disclosure, the WebSocket protocol provides a more secure transmission channel to ensure that the transmitted data is not intercepted or modified.

[0028] In addition, by adopting the technical solution provided by the present disclosure, since the data based on the HTTP protocol is encapsulated and the transmitted data is transmitted through the transmission channel provided by the WebSocket protocol in an encrypted form, the data is always encrypted and transmitted through the WebSocket protocol, which can further effectively reduce the risk of man-in-the-middle attacks.

[0029] In addition, by adopting the technical solution provided by the present disclosure, the user experience can be effectively improved.

[0030] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood from the following description. Brief Description of the Drawings

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0032] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure;

[0033] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure;

[0034] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure;

[0035] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure;

[0036] Figure 5 is a block diagram of an electronic device for implementing the data processing method based on the HTTP protocol in the embodiments of the present disclosure. Detailed Description of the Embodiments

[0037] The following will describe exemplary embodiments of the present disclosure with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. It should be considered that they are merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted below.

[0038] Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts fall within the scope of protection of the present disclosure.

[0039] It should be noted that the terminals involved in the embodiments of the present disclosure may include, but are not limited to, intelligent devices such as computers (Personal Computers, PCs), mobile phones, personal digital assistants (Personal Digital Assistants, PDAs), wireless handheld devices, and tablet computers; the display devices may include, but are not limited to, devices with display functions such as personal computers and televisions.

[0040] In addition, the term "and / or" in this article is merely an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.

[0041] Currently, for websites, WeChat / Alipay mini-programs, and Webview services in mobile applications developed based on the JavaScript (JS) scripting language, in terms of HTTP data transmission technology, the standard HTTP network libraries provided by the system are generally used to provide APIs to implement HTTP interface services. For example, the XMLHttpRequest, window.fetch, window.Request, and submit provided by HyperText Markup Language 5 (H5), the wx.request provided by WeChat mini-programs, and the my.httpRequest provided by Alipay mini-programs.

[0042] Since the above-mentioned HTTP network libraries are all standard APIs provided by browsers and mini-programs, which are a kind of public technology and are visible to network attackers. Network attackers can use the hook technology of the JS scripting language to intercept each API provided by the HTTP network library, so that when a website or mini-program sends HTTP-based data, it enters the interception code logic of the network attacker, thereby performing attack behaviors such as tampering, forgery, and simulation on this data.

[0043] Based on the above problems, the present disclosure uses the WebSocket protocol technology to replace the traditional HTTP request / HTTP response for data communication based on the HTTP protocol, so that network attackers cannot use the traditional hook technology to perform attack behaviors such as data monitoring, interception, and tampering, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0044] The present disclosure specifically provides a technology for data transmission by replacing the traditional HTTP protocol with the WebSocket protocol. Through the encapsulation and encryption processing of data based on the HTTP protocol, the data is securely transmitted through the WebSocket protocol, avoiding the security vulnerabilities of the traditional HTTP protocol, especially the risk of data tampering or forgery by hackers using Hook technology. At the same time, it can greatly improve the security and reliability of data transmission, and at the same time provides flexible encapsulation and encryption methods to adapt to different application scenarios and requirements.

[0045] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure, as Figure 1 shown.

[0046] 101. In response to the sending of data based on the HTTP protocol for a specified application, perform encapsulation processing on the data based on the HTTP protocol to obtain encapsulated data.

[0047] In a specific implementation scenario, for the front end, the data based on the HTTP protocol for a specified application can be an HTTP request of the specified application; for the back end, the data based on the HTTP protocol for a specified application can be an HTTP response of the specified application.

[0048] Specifically, at the front end, the sending of data based on the HTTP protocol for a specified application can refer to initiating an HTTP request from the front end to a specific server. Before initiating the request, the request data can be encapsulated to ensure the security and integrity of the data.

[0049] Specifically, at the back end, the sending of data based on the HTTP protocol for a specified application can refer to returning an HTTP response from a specific server to the front end. When returning the response, the response data can be encapsulated to ensure the security and integrity of the data.

[0050] 102. Based on the WebSocket protocol, send the encapsulated data.

[0051] Once the data is encapsulated, subsequent transmission will be through the WebSocket protocol. Based on the WebSocket protocol, a persistent two-way connection can be established between the front end and the back end, and data is transmitted based on this two-way WebSocket connection. Since the connection based on the WebSocket protocol is persistent and data transmission can also be in a specific data format, it is difficult for network attackers to intercept and tamper with data through conventional hook techniques. This method makes the data more secure during transmission.

[0052] This method has lower latency and higher real-time performance compared to traditional HTTP requests / HTTP responses, making it suitable for application scenarios that require frequent interactions. Through the WebSocket protocol, the encapsulated data can be sent to the target server or returned to the front end securely and efficiently.

[0053] In this disclosure, the word "specified" in the specified application does not have a special meaning. It is just used to specify the current operation object, and it is an ordinary application. For example, a web application in a browser, a web application in a web view control (such as WebView, etc.), and a web application in a small program, etc.

[0054] The WebSocket protocol is a two-way communication protocol that can provide more efficient and real-time transmission. And since it is completely different from the traditional HTTP protocol, it avoids problems such as man-in-the-middle attacks and data tampering that are prone to occur in the HTTP protocol. In this process, the WebSocket protocol realizes real-time and secure data transmission between the client and the server by establishing a persistent connection.

[0055] So far, by using the WebSocket protocol technology to replace the traditional HTTP request / HTTP response, the data sending based on the HTTP protocol is completed.

[0056] By encapsulating the data based on the HTTP protocol, the data can be effectively formatted into a specific structure, which can maintain consistency and integrity during the data transmission process. Using the websocket protocol for data sending can achieve full-duplex communication, reduce latency, and improve the efficiency and real-time performance of data transmission.

[0057] It should be noted that part or all of the execution subject of 101 to 102 can be an application located on the local terminal, or can also be a functional unit such as a plugin or a software development kit (SDK) set in the application located on the local terminal, or can also be a service module in the network-side server, or can also be a distributed system on the network side. For example, a service module or a distributed system in a network-side data processing device based on the HTTP protocol, etc. This embodiment does not make a special limitation on this.

[0058] It can be understood that the specified application can be a native program (nativeApp) installed on the local terminal, or can also be a web program (webApp) of a browser on the local terminal, or can also be a web program in a web view control (such as WebView, etc.) on the local terminal, or can also be a web program in a small program on the local terminal. This embodiment does not make a limitation on this.

[0059] In this way, by responding to the sending of HTTP protocol-based data of a specified application, encapsulation processing is performed on the HTTP protocol-based data to obtain encapsulated data. Furthermore, based on the WebSocket protocol, the encapsulated data is sent. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook techniques, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0060] It should be noted that the present disclosure does not limit the specific manner of performing encapsulation processing on the HTTP protocol-based data in response to the sending of the HTTP protocol-based data of a specified application, and can be selected according to actual situations.

[0061] In the present disclosure, for the front end, existing HTTP request interfaces can be intercepted and replaced to implement a unified request method for HTTP protocol-based data. Specifically, it can be achieved by JavaScript code to intercept and replace the standard APIs provided by browsers or applets. For example, XMLHttpRequest, window.fetch, window.Request, window.HTMLFormElement.prototype.submit, document.addEventListener.click provided by browsers and web view controls (such as WebView, etc.), wx.request provided by WeChat applets, and my.httpRequest provided by Alipay applets. The specific implementation of the present disclosure can be achieved by rewriting the native interfaces or using the proxy pattern to intercept the initiation of HTTP requests and perform custom processing.

[0062] In the present disclosure, for the back end, existing HTTP response interfaces can be intercepted and replaced to implement a unified response method for HTTP protocol-based data. Specifically, it can be achieved by JavaScript code to intercept and replace the standard APIs provided by business servers. The specific implementation of the present disclosure can be achieved by rewriting the native interfaces or using the proxy pattern to intercept the initiation of HTTP responses and perform custom processing.

[0063] Optionally, in a possible implementation manner of this embodiment, in 101, a specific data format can be specifically adopted to perform encapsulation processing on the HTTP protocol-based data to obtain the encapsulated data.

[0064] In this implementation, in response to a data sending request of a specified application (such as a native application, a Web application, or a mini-program, etc.) based on the HTTP protocol, the data based on the HTTP protocol is encapsulated. In this process, the original data based on the HTTP protocol (such as the request method, Uniform Resource Locator (URL), request headers, request body, etc.) will be converted into a specific encapsulation format, which can effectively ensure that the data can be adapted to the WebSocket protocol during subsequent transmission.

[0065] This implementation does not limit the specific way of encapsulating data, and a specific data format can be selected according to the actual situation. A common way is to use the JavaScript Object Notation (JSON) format to encapsulate the data based on the HTTP protocol, and generate a JSON-format data packet as the carrier for transmitting data based on the WebSocket protocol subsequently.

[0066] Specifically, the JavaScript Object Notation (JSON) format can be adopted to encapsulate the data based on the HTTP protocol to obtain the encapsulated data in JSON format.

[0067] It should be noted that this disclosure does not limit the specific way of sending the encapsulated data based on the WebSocket protocol, and it can be selected according to the actual situation.

[0068] Optionally, in a possible implementation of this embodiment, in 102, specifically, the encapsulated data can be encrypted to obtain encrypted data, and then, the encrypted data can be sent based on the WebSocket protocol.

[0069] Specifically, the encapsulated data of the encapsulated JSON-format data can be encrypted to obtain encrypted data. Then, the encrypted data can be sent based on the WebSocket protocol. Through encrypted communication, it can be ensured that the data is not stolen or modified during transmission.

[0070] In addition, by encrypting the encapsulated data, it is ensured that even if the data is intercepted, hackers cannot easily decrypt and tamper with the data, further improving the transmission security.

[0071] In this implementation manner, before sending the encapsulated data, it is also possible to further select to encrypt the encapsulated data to enhance the security of the data. For example, the encapsulated JSON data can be encrypted through an encryption algorithm to generate encrypted data. The encrypted data can be sent based on the WebSocket protocol to further improve the security of data transmission and prevent the data from being eavesdropped, tampered with, or forged during the transmission process.

[0072] Due to the differences between the WebSocket protocol and the HTTP protocol, using the WebSocket protocol can effectively prevent the man-in-the-middle attacks that the traditional HTTP protocol is vulnerable to. Traditional HTTP requests / HTTP responses can be intercepted by hackers through the hook technology of the JS scripting language, and then the data can be modified and forged. However, by transmitting the encapsulated data through the WebSocket protocol, this risk can be greatly reduced.

[0073] In a specific implementation scenario, for the front end, the WebSocket protocol technology can be adopted to encapsulate an SDK for a secure network transmission protocol that implements the technical solution provided by the present disclosure, and the SDK can be integrated into web applications in websites, Webview services, and applets to achieve secure data transmission; for the back end, the WebSocket protocol technology can be adopted to deploy a service module for a secure network transmission protocol that implements the technical solution provided by the present disclosure, which can be deployed independently, or can also be integrated and deployed on the business servers of web applications in websites, Webview services, and applets to achieve secure data transmission.

[0074] In this embodiment, the reception processing of the encapsulated data, that is, the reception processing of the data based on the WebSocket protocol, can refer to the relevant content in the subsequent embodiments.

[0075] In this embodiment, by responding to the sending of HTTP protocol-based data of a specified application, the HTTP protocol-based data is encapsulated to obtain encapsulated data, and then, based on the WebSocket protocol, the encapsulated data is sent. Since the WebSocket protocol is used for HTTP protocol-based data communication, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook technology, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0076] In addition, by adopting the technical solution provided by the present disclosure, the HTTP protocol-based data is encapsulated and the WebSocket protocol is used for data transmission, thereby avoiding the security risks that the traditional HTTP protocol-based transmission method may encounter.

[0077] In addition, by adopting the technical solution provided by the present disclosure, a more secure transmission channel is provided using the WebSocket protocol to ensure that the transmitted data is not intercepted or modified.

[0078] In addition, by adopting the technical solution provided by the present disclosure, since the data based on the HTTP protocol is encapsulated and the transmitted data is transmitted through the transmission channel provided by the WebSocket protocol in an encrypted form, the data is always encrypted and transmitted through the WebSocket protocol, which can further effectively reduce the risk of man-in-the-middle attacks.

[0079] In addition, by adopting the technical solution provided by the present disclosure, the user experience can be effectively improved.

[0080] Figure 2 It is a schematic diagram according to the second embodiment of the present disclosure, as Figure 2 shown.

[0081] 201. In response to receiving the data based on the WebSocket protocol of a specified application, parse and process the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol.

[0082] In a specific implementation scenario, for the front end, the data based on the WebSocket protocol of a specified application can be data encapsulated with an HTTP response of the specified application and sent through the WebSocket protocol; for the back end, the data based on the WebSocket protocol of a specified application can be data encapsulated with an HTTP request of the specified application and sent through the WebSocket protocol.

[0083] Specifically, for the front end, the reception of the data based on the WebSocket protocol of a specified application can refer to data encapsulated with an HTTP response returned from a specific server to the front end and sent through the WebSocket protocol. When returning the response, the response data can be encapsulated to ensure the security and integrity of the data.

[0084] Specifically, for the back end, the reception of the data based on the WebSocket protocol of a specified application can refer to data encapsulated with an HTTP request initiated from the front end to a specific server and sent through the WebSocket protocol. Before initiating the request, the request data can be encapsulated to ensure the security and integrity of the data.

[0085] 202. Perform distribution processing according to the data based on the HTTP protocol.

[0086] In a specific implementation scenario, for the front - end, the data based on the HTTP protocol can be forwarded to the business processing logic of the specified application; for the back - end, the data based on the HTTP protocol can be forwarded to the business server of the specified application.

[0087] Specifically, in the front - end, the parsed data based on the HTTP protocol will be forwarded to the business processing logic of the specified application, so that the business processing logic can perform further operations or displays on the HTTP response data according to business requirements. For example, updating the user interface, storing data, etc.

[0088] Specifically, in the back - end, the parsed data based on the HTTP protocol will be forwarded to the business server of the specified application, which is the process of sending the HTTP request data to the server that actually processes the business.

[0089] Once the data is encapsulated and processed, subsequent transmissions will be carried out through the WebSocket protocol. Based on the WebSocket protocol, a persistent two - way connection can be established between the front - end and the back - end, and data transmission is carried out based on this two - way WebSocket connection. Since the connection based on the WebSocket protocol is persistent and data transmission can also be carried out in a specific data format, it is difficult for network attackers to intercept and tamper with data through conventional hook techniques. This method makes the data more secure during transmission.

[0090] At the receiving end, the encapsulated data can be further parsed and processed. By encapsulating and parsing the data, the security and integrity of data transmission can be improved, and potential security risks can be avoided. This method has lower latency and higher real - time performance compared with traditional HTTP requests / HTTP responses, and is suitable for application scenarios that require frequent interaction. Through the WebSocket protocol, the encapsulated data can be sent to the target server or returned to the front - end safely and efficiently.

[0091] In this disclosure, the word "specified" in the specified application has no special meaning. It is just to specify the current operation object, and it is an ordinary application. For example, web applications in browsers, web applications in web view controls (such as WebView, etc.), and web applications in applets, etc.

[0092] The WebSocket protocol is a two - way communication protocol that can provide more efficient and real - time transmission. And since it is completely different from the traditional HTTP protocol, it avoids problems such as man - in - the - middle attacks and data tampering that are prone to occur in the HTTP protocol. In this process, the WebSocket protocol realizes real - time and secure data transmission between the front - end and the back - end by establishing a persistent connection.

[0093] So far, by using the WebSocket protocol technology to replace the traditional HTTP request / HTTP response, the data reception based on the HTTP protocol is completed.

[0094] By encapsulating the data based on the HTTP protocol, the data can be effectively formatted into a specific structure, which can maintain consistency and integrity during the data transmission process. Using the websocket protocol for data reception can achieve full-duplex communication, reduce latency, and improve the efficiency and real-time performance of data transmission.

[0095] It should be noted that part or all of the execution subject of 201-202 can be an application located on the local terminal, or can also be a functional unit such as a plug-in or software development kit (SDK) set in the application located on the local terminal, or can also be a service module in the network-side server, or can also be a distributed system on the network side. For example, a service module or a distributed system in a data processing device based on the HTTP protocol on the network side, etc. This embodiment does not make special limitations on this.

[0096] It can be understood that the specified application can be a native app installed on the local terminal, or can also be a web app of a browser on the local terminal, or can also be a web app in a web view control (such as WebView, etc.) on the local terminal, or can also be a web app in a small program on the local terminal. This embodiment does not make limitations on this.

[0097] In this way, by responding to the reception of the data based on the WebSocket protocol of the specified application, the data based on the WebSocket protocol is parsed and processed to restore the encapsulated data based on the HTTP protocol. Furthermore, according to the data based on the HTTP protocol, distribution processing is performed. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook technologies, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0098] Through the technical solutions provided by the above two embodiments, by using the WebSocket protocol technology to replace the traditional HTTP request / HTTP response, the data sending and data reception based on the HTTP protocol are completed, effectively improving the security and reliability of the data transmission process based on the HTTP protocol, and effectively preventing common network attack methods, such as malicious interception and tampering of hook technologies, thereby ensuring the integrity and privacy of user data.

[0099] It should be noted that the present disclosure does not limit the specific manner of receiving the WebSocket protocol-based data in response to a specified application, parsing and processing the WebSocket protocol-based data to restore the encapsulated HTTP protocol-based data, which can be selected according to the actual situation.

[0100] In the present disclosure, for the front end, it is possible to receive WebSocket protocol-based data encapsulating an existing HTTP response, and implement a unified response manner for the HTTP protocol-based data. Specifically, it can be achieved by JavaScript code to intercept and replace the standard APIs provided by the browser or the applet. The specific implementation of the present disclosure can be achieved by rewriting the native interface method or using the proxy pattern to intercept the reception of the HTTP response and perform custom processing.

[0101] In the present disclosure, for the back end, it is possible to receive WebSocket protocol-based data encapsulating an existing HTTP request, and implement a unified request manner for the HTTP protocol-based data. Specifically, it can be achieved by JavaScript code to intercept and replace the standard APIs provided by the business server. The specific implementation of the present disclosure can be achieved by rewriting the native interface method or using the proxy pattern to intercept the reception of the HTTP request and perform custom processing.

[0102] Optionally, in a possible implementation manner of this embodiment, in 201, a specific data format can be specifically adopted to parse and process the WebSocket protocol-based data to restore the encapsulated HTTP protocol-based data.

[0103] Among them, the parsing and processing performed on the WebSocket protocol-based data can be the reverse processing of the encapsulation processing. If the encapsulated data is encrypted data after encryption processing, then before performing the reverse processing of the encapsulation processing, the parsing processing also needs to first perform the decryption processing corresponding to the encryption processing.

[0104] In a specific implementation scenario, for the front end, the WebSocket protocol technology can be used to encapsulate an SDK for implementing the secure network transmission protocol of the technical solution provided by the present disclosure, and the SDK can be integrated into the website, the Webview service, and the web application in the applet to achieve secure data transmission; for the back end, the WebSocket protocol technology can be used to deploy a service module for implementing the secure network transmission protocol of the technical solution provided by the present disclosure, which can be independently deployed or can also be integrated and deployed on the business server of the website, the Webview service, and the web application in the applet to achieve secure data transmission.

[0105] In this embodiment, for the encapsulation process of data based on the HTTP protocol, reference can be made to Figure 1 the relevant content in the corresponding embodiment.

[0106] In this embodiment, by responding to the reception of data based on the WebSocket protocol for a specified application, the data based on the WebSocket protocol is parsed to restore the encapsulated data based on the HTTP protocol. Furthermore, distribution processing is performed according to the data based on the HTTP protocol. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook techniques, effectively reducing the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0107] Through the above two aspects of technical solutions, the embodiments of the present disclosure effectively enhance the security and reliability of the data transmission process based on the HTTP protocol, effectively preventing common network attack methods, such as malicious interception and tampering by hook techniques, thereby ensuring the integrity and privacy of user data.

[0108] In addition, by adopting the technical solution provided by the present disclosure, the data based on the HTTP protocol is encapsulated and the WebSocket protocol is used for data transmission, thus avoiding the security risks that may be encountered in the traditional HTTP-based transmission method.

[0109] In addition, by adopting the technical solution provided by the present disclosure, the WebSocket protocol provides a more secure transmission channel to ensure that the transmitted data is not intercepted or modified.

[0110] In addition, by adopting the technical solution provided by the present disclosure, since the data based on the HTTP protocol is encapsulated and the transmitted data is transmitted through the transmission channel provided by the WebSocket protocol in an encrypted form, the data is always encrypted and transmitted through the WebSocket protocol, which can further effectively reduce the risk of man-in-the-middle attacks.

[0111] In addition, by adopting the technical solution provided by the present disclosure, the user experience can be effectively improved.

[0112] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited by the described action sequence, because according to the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present disclosure.

[0113] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure, as Figure 3 shown. The HTTP protocol-based data processing apparatus 300 of this embodiment may include an encapsulation unit 301 and a sending unit 302. Among them, the encapsulation unit 301 is configured to perform encapsulation processing on the HTTP protocol-based data in response to the sending of the HTTP protocol-based data of a specified application to obtain encapsulated data; the sending unit 302 is configured to send the encapsulated data based on the WebSocket protocol.

[0115] It should be noted that part or all of the HTTP protocol-based data processing apparatus of this embodiment may be an application located on a local terminal, or may also be a functional unit such as a plug-in or a software development kit (SDK) set in an application located on a local terminal, or may also be a service module in a network-side server, or may also be a distributed system on the network side. For example, a service module or a distributed system in an HTTP protocol-based data processing platform on the network side, etc. This embodiment does not make a special limitation on this.

[0116] It can be understood that the application may be a native program (nativeApp) installed on the local terminal, or may also be a web program (webApp) of a browser on the local terminal. This embodiment does not make a limitation on this.

[0117] Optionally, in a possible implementation manner of this embodiment, the encapsulation unit 301 may specifically be configured to perform encapsulation processing on the HTTP protocol-based data in a specific data format to obtain the encapsulated data.

[0118] Optionally, in a possible implementation manner of this embodiment, the sending unit 302 may specifically be configured to encrypt the encapsulated data to obtain encrypted data; and send the encrypted data based on the WebSocket protocol.

[0119] It should be noted that Figure 1 the method in the corresponding embodiment may be implemented by the data processing device based on the HTTP protocol provided in this embodiment. For a detailed description, reference may be made to Figure 1 the relevant content in the corresponding embodiment, which will not be elaborated here.

[0120] In this embodiment, in response to the sending of the data based on the HTTP protocol of a specified application, the encapsulation unit encapsulates the data based on the HTTP protocol to obtain encapsulated data, so that the sending unit can send the encapsulated data based on the WebSocket protocol. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook technologies, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0121] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure, as Figure 4 shown. The data processing device 400 based on the HTTP protocol in this embodiment may include a parsing unit 401 and a distribution unit 402. Among them, the parsing unit 401 is configured to parse the data based on the WebSocket protocol in response to the reception of the data based on the WebSocket protocol of a specified application, so as to restore the encapsulated data based on the HTTP protocol; the distribution unit 402 is configured to perform distribution processing according to the data based on the HTTP protocol.

[0122] It should be noted that part or all of the data processing device based on the HTTP protocol in this embodiment may be an application located on the local terminal, or may also be a functional unit such as a plug-in or software development kit (SDK) set in the application located on the local terminal, or may also be a service module in the network-side server, or may also be a distributed system on the network side. For example, a service module or a distributed system in the data processing platform based on the HTTP protocol on the network side, etc. This embodiment does not make special limitations on this.

[0123] It can be understood that the application can be a native program (nativeApp) installed on a local terminal, or can also be a web program (webApp) of a browser on the local terminal. This embodiment does not limit this.

[0124] Optionally, in a possible implementation manner of this embodiment, the parsing unit 401 may specifically be used to parse and process the data based on the WebSocket protocol in a specific data format to restore the encapsulated data based on the HTTP protocol.

[0125] It should be noted that Figure 2 The method in the corresponding embodiment can be implemented by the data processing device based on the HTTP protocol provided in this embodiment. For a detailed description, reference can be made to Figure 2 the relevant content in the corresponding embodiment, which will not be elaborated here.

[0126] In this embodiment, in response to the reception of the data based on the WebSocket protocol of a specified application, the parsing unit parses and processes the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol, so that the distribution unit can perform distribution processing according to the data based on the HTTP protocol. Since the WebSocket protocol is used for data communication based on the HTTP protocol, network attackers cannot perform attack behaviors such as data monitoring, interception, and tampering through traditional hook technologies, which can effectively reduce the risk of man-in-the-middle attacks, thereby improving the security and reliability of data transmission.

[0127] In the technical solution of the present disclosure, the acquisition, storage, and application of the data based on the HTTP protocol, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0128] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0129] Figure 5 FIG. shows a schematic block diagram of an exemplary electronic device 500 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital assistant, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0130] As Figure 5 shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0131] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disc, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0132] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 executes the various methods and processes described above, such as the data processing method based on the HTTP protocol. For example, in some embodiments, the data processing method based on the HTTP protocol can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the data processing method based on the HTTP protocol described above can be executed. Alternatively, in other embodiments, the computing unit 501 can be configured to execute the data processing method based on the HTTP protocol by any other appropriate means (e.g., by means of firmware).

[0133] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0134] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.

[0135] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0137] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), the Internet, and blockchain network.

[0138] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS"). The server can also be a server of a distributed system, or a server combined with blockchain.

[0139] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0140] The above specific embodiments do not constitute a limitation to the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. A data processing method based on HTTP protocol, characterized in that: include: In response to the sending of the data based on the HTTP protocol by the specified application, encapsulation processing is performed on the data based on the HTTP protocol to obtain encapsulated data; The encapsulated data is sent based on the WebSocket protocol.

2. The method according to claim 1, characterized in that The encapsulating the data based on the HTTP protocol to obtain encapsulated data includes: The data based on the HTTP protocol is encapsulated by adopting a specific data format to obtain the encapsulated data.

3. The method according to claim 1 or 2, characterized in that: The sending of the encapsulated data based on the WebSocket protocol includes: Encrypting the encapsulated data to obtain encrypted data; The encrypted data is sent based on the WebSocket protocol.

4. A data processing method based on HTTP protocol, characterized in that: include: In response to receiving the data based on the WebSocket protocol of the specified application, parsing and processing the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol; Distribution processing is performed according to the data based on the HTTP protocol.

5. The method according to claim 4, characterized in that The parsing and processing of the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol includes: The WebSocket protocol-based data is parsed and processed using a specific data format to restore the encapsulated HTTP protocol-based data.

6. A data processing device based on HTTP protocol, characterized in that: include: an encapsulation unit, configured to, in response to the sending of the data based on the HTTP protocol by the specified application, encapsulate the data based on the HTTP protocol to obtain encapsulated data; The sending unit is used to send the encapsulated data based on the WebSocket protocol.

7. The method according to claim 6, characterized in that The packaging unit is specifically used for The data based on the HTTP protocol is encapsulated by adopting a specific data format to obtain the encapsulated data.

8. The device according to claim 6 or 7, characterized in that The sending unit is specifically used for encrypting the encapsulated data to obtain encrypted data; and The encrypted data is sent based on the WebSocket protocol.

9. A data processing device based on HTTP protocol, characterized in that: include: A parsing unit, configured to, in response to receiving the data based on the WebSocket protocol of the specified application, parse and process the data based on the WebSocket protocol to restore the encapsulated data based on the HTTP protocol; The distribution unit is used to perform distribution processing according to the data based on the HTTP protocol.

10. The device according to claim 9, characterized in that The analysis unit is specifically used for The WebSocket protocol-based data is parsed and processed using a specific data format to restore the encapsulated HTTP protocol-based data.

11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.

13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Data capture method and device, equipment, storage medium and product

    CN120811955A