Data processing method, device, equipment and medium
By using coroutine mechanisms to handle HTTPS requests in parallel in the server, the problem of high CPU performance consumption by TLS handshake is solved, and more efficient resource utilization and performance improvement is achieved.
Patent Information
- Application Number
- CN202011027446.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-09-25
AI Technical Summary
When using HTTPS protocol for data communication, the TLS handshake process consumes high CPU performance, resulting in excessive CPU load, affecting the concurrent performance of the service server. Moreover, due to the unfixed number of requests, the performance of the accelerator card cannot be fully utilized, and there is inefficiency and resources. Problems of waste and excessive costs.
By receiving data requests from the application server in the server, and calling the acceleration device through the coroutine mechanism to perform encryption and decryption processing, releasing system resources, allowing other requests to be processed, parallel encryption and decryption processing of multiple data requests is realized, and computing resources are fully utilized. Acceleration device performance.
It improves data processing efficiency, improves resource utilization and the performance of acceleration devices, solves the problems of excessive CPU load and waste of resources, and reduces costs.
Smart Images

Figure CN114338629B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data communication technology, and more specifically, to a data processing method, device, equipment and medium. Background Art
[0002] With the continuous development of computer technology, especially cloud computing technology, Internet security issues have become increasingly prominent, and users are paying more and more attention to information security. Since the Hyper Text Transfer Protocol (HTTP) uses plain text to transmit information, it may lead to the leakage of private information and threaten information security. Therefore, at present, when performing data communication, Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS) is generally used, for example, Secure Sockets Layer (SSL) protocol or Transport Layer Security (TLS) protocol and other security protocols are used for data communication.
[0003] Currently, when using HTTPS protocols, such as TLS protocols for data communication, TLS handshake is a process that consumes a lot of CPU performance. This operation will cause excessive CPU load and affect the concurrent performance of the business server. Therefore, the following methods are generally used to unload the pressure on the application server CPU: local acceleration card mode, that is, directly connecting the application server to the acceleration card used to accelerate data encryption and decryption processing. The acceleration card encrypts and decrypts the HTTPS requests received by the application server to unload the pressure on the application server CPU.
[0004] However, since the number of HTTPS requests processed by each application server is not fixed, this method cannot fully utilize the performance of the accelerator card, and has problems such as low efficiency, waste of resources and high cost. Summary of the invention
[0005] One purpose of the embodiments of the present disclosure is to provide a new technical solution for encrypting and decrypting data requests, especially HTTPS requests.
[0006] According to a first aspect of the present disclosure, a data processing method is provided, which is applied to a server that performs encryption and decryption processing on a data request, and the method includes:
[0007] Receiving a first data request sent by a first application server;
[0008] In response to the first data request, calling an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request;
[0009] In the process of processing the first data request, a second data request sent by a second application server is received, and the acceleration device is called through a coroutine mechanism to perform encryption and decryption processing on the second data request.
[0010] Optionally, in response to the first data request, calling an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request includes:
[0011] Obtaining identification information of the first application server;
[0012] Acquire key information corresponding to the first application server according to the identification information;
[0013] According to the key information, an acceleration device is called through a coroutine mechanism to perform encryption and decryption processing on the first data request.
[0014] Optionally, the calling an acceleration device to perform encryption and decryption processing on the first data request through a coroutine mechanism according to the key information includes:
[0015] When the acceleration device is called to perform encryption and decryption processing on the first data request according to the key information, first identification information of a first event of performing encryption and decryption processing on the first data request returned by the acceleration device is obtained; and
[0016] Setting the state information of the first event to first state information indicating waiting for obtaining a processing result;
[0017] The first identification information and the first status information are stored in an event monitoring list in the form of a data pair, and the control right of the first event over system resources is released.
[0018] Optionally, the method further comprises:
[0019] Receiving a response message returned by the acceleration device;
[0020] Acquire first identification information of the first event from the response message;
[0021] When the state of the first event is found to be the first state information in the event monitoring list according to the first identification information, obtaining target result data obtained by encrypting and decrypting the first data request from the acceleration device according to the first identification information;
[0022] The target result data is returned to the first server.
[0023] Optionally, after acquiring the target result data, the method further includes:
[0024] The state of the event in the event monitoring list is set to second state information indicating that a processing result has been obtained.
[0025] Optionally, the data request includes an HTTPS request.
[0026] According to a second aspect of the present disclosure, another data processing method is also provided, which is applied to an application server and includes:
[0027] Receiving a data request sent by a terminal device;
[0028] In response to the data request, sending the data request to a server for encrypting and decrypting the data request;
[0029] Receive target result data returned by the server and corresponding to the data request.
[0030] According to a third aspect of the present disclosure, there is provided a data processing device, which is applied to a server for performing encryption and decryption processing on a data request, comprising:
[0031] A first data request receiving module, used to receive a first data request sent by a first application server;
[0032] A first data processing module, configured to, in response to the first data request, call an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request;
[0033] The second data processing module is used to receive a second data request sent by a second application server during processing of the first data request, and to call the acceleration device through a coroutine mechanism to perform encryption and decryption processing on the second data request.
[0034] According to a fourth aspect of the present disclosure, there is further provided an electronic device, comprising the apparatus according to the third aspect; or,
[0035] The electronic device comprises:
[0036] A memory for storing executable instructions;
[0037] A processor is used to operate the electronic device to execute the method as described in any one of the first aspect and the second aspect under the control of the instruction.
[0038] According to a fifth aspect of the present disclosure, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program that can be read and executed by a computer, and the computer program is used to execute the method described in any one of the first and second aspects when read and executed by the computer.
[0039] According to an embodiment of the present disclosure, by setting up a server for encrypting and decrypting data requests, after the server receives a first data request sent by a first application server, the server calls an acceleration device through a coroutine mechanism to encrypt and decrypt the first data request, so as to release the occupation of system resources when processing the request, so that during the process of processing the first data request, the server can also process the second data request sent by the second application server in parallel. The method sets up a server that centrally encrypts and decrypts data requests from multiple application servers, and through a coroutine mechanism, the server can perform data encryption and decryption on multiple data requests in parallel, so as to make full use of the computing resources of the server and the performance of the acceleration device, thereby improving data processing efficiency.
[0040] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0042] Figure 1 It is a schematic diagram of the structure of the existing encryption and decryption processing of data requests.
[0043] Figure 2 It is a structural diagram of encryption and decryption processing of a data request according to an embodiment.
[0044] Figure 3 The diagram is a schematic block diagram showing the hardware configuration of a server that can be used to implement a data processing method according to an embodiment.
[0045] Figure 4 It is a flowchart of a data processing method according to an embodiment.
[0046] Figure 5 is a flowchart of a data processing method according to another embodiment.
[0047] Figure 6 is a principle block diagram of a data processing device according to an embodiment.
[0048] Figure 7 is a schematic diagram of the hardware structure of an electronic device according to an embodiment. DETAILED DESCRIPTION
[0049] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0050] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0051] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0052] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0053] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0054] Please see Figure 1 , which is a schematic diagram of the existing structure for encrypting and decrypting data requests. Figure 1 As shown, after the application server 1100a receives a data request sent by the terminal device 1200, for example, an HTTPS request, in order to unload the pressure on the application server CPU, the application server 1100a is generally directly connected to an acceleration device 1300 for accelerating data encryption and decryption processing, and the application server 1100a calls the acceleration device 1300 through a corresponding interface function to perform encryption and decryption processing on the data request, wherein the acceleration device can be a hardware acceleration card based on QAT (Quick Assist Technology) technology; QAT technology is a hardware acceleration technology launched by Intel for network security and data storage. QAT supports encryption algorithms such as symmetric data encryption, asymmetric public key encryption, and data integrity, and can accelerate data encryption and decryption and digital signature processing.
[0055] Since the number of data requests received by a single application server is usually not fixed, the above method at least has the problem of waste of resources and low efficiency. In view of the above problems, the present disclosure provides a data processing method, please refer to Figure 2 , which is a schematic diagram of a structure for performing encryption and decryption processing on a data request according to an embodiment. Figure 2As shown, in a specific implementation, a server 1100b can be set up to centrally perform encryption and decryption processing on data requests, and the server 1100b can be connected to the acceleration device 1300. The server 1100b can centrally perform encryption and decryption processing on data requests from different application servers, such as 1100a, 1100c, etc. In particular, for HTTPS requests, the server 1100b can centrally manage digital certificates of one or more application servers, such as SSL certificates or TLS certificates. Digital certificates, and for HTTPS requests sent by the application servers, use the digital certificate corresponding to the application server to perform encryption and decryption and data signing on the HTTPS requests.
[0056] like Figure 2 As shown, the server 1100b can receive the first data request sent by the application server 1100a, and call the acceleration device 1300 through the coroutine mechanism to perform encryption and decryption processing on the first data request; at the same time, since the use of the coroutine mechanism can release the occupation of system resources when processing the first data request, the server 1100b can also receive the second data request sent by the application server 1100b during the process of processing the first data request, and can also call the acceleration device 1300 through the coroutine mechanism to perform encryption and decryption processing on the second data request at the same time. In this way, the server 1100b can process the first data request and the second data request in parallel, improve the resource utilization of the server 1100b, and improve the performance of the acceleration device 1300.
[0057] <Hardware Configuration>
[0058] Figure 3 The present invention is a schematic block diagram showing a hardware configuration of a data processing system that can be used to implement a data processing method according to an embodiment.
[0059] like Figure 3 As shown, the server 3000 may include a processor 3100, a memory 3200, an interface device 3300, a communication device 3400, a display device 3500, and an input device 3600. The processor 3100 may be, for example, a central processing unit CPU, etc. The memory 3200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 3300 may include, for example, a USB interface, a serial interface, etc. The communication device 3400 may be, for example, capable of wired or wireless communication. The display device 3500 may be, for example, a liquid crystal display screen. The input device 3600 may include, for example, a touch screen, a keyboard, etc.
[0060] In this embodiment, the server 3000 may be used to participate in implementing the data processing method according to any embodiment of the present disclosure.
[0061] As used in the embodiments of the present disclosure, the memory 3200 of the server 3000 is used to store instructions, and the instructions are used to control the processor 3100 to operate to support the implementation of the data processing method according to any embodiment of the present disclosure. A technician can design instructions according to the scheme disclosed in the present disclosure. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0062] It should be understood by those skilled in the art that although Figure 3 3 shows multiple devices of the server 3000, but the server 3000 of the embodiment of the present disclosure may only involve some of the devices, for example, only the processor 3100 and the memory 3200. This is well known in the art and will not be repeated here.
[0063] <Method Example 1>
[0064] Please see Figure 4 , which is a flow chart of a data processing method according to an embodiment. The data processing method provided in this embodiment can be applied to a server for encrypting and decrypting data requests, for example, Figure 3 In the server 3000 shown in FIG. 1 , in order to distinguish it from the application server in this embodiment, the server is referred to as “encryption and decryption server” in the following description. Figure 4 As shown, the method may include the following steps S4100-S4300, which are described in detail below.
[0065] Step S4100: receiving a first data request sent by a first application server.
[0066] The first data request is a data request sent by the first application server to the encryption and decryption server, and the data request includes data to be encrypted and decrypted. The "first" in the first application server and the first data request is used to distinguish it from other servers and other requests, rather than specifically referring to a certain data request.
[0067] The first data request may be an HTTPS request, for example, a data request based on the TLS protocol. Of course, in a specific implementation, the data request may also be a request containing data to be encrypted or decrypted. In this embodiment, unless otherwise specified, the first data request is an HTTPS request as an example for description.
[0068] Specifically, with the continuous development of cloud computing technology, when computing devices communicate data with each other, in order to improve data security, terminal devices can generally send data requests to application servers based on the HTTPS protocol. After the application server first receives the HTTPS data request sent by the terminal device, it generally performs an HTTPS handshake process first, so that the terminal device can verify the legitimacy of the application server, and the two parties can exchange key information to communicate data based on the key after the handshake is successful.
[0069] The following takes the TLS handshake protocol as an example to briefly explain the handshake process between the terminal device and the application server. The process generally includes: 1. client_hello, that is, the terminal device initiates a request to the application server in plain text, and the request includes at least one of the version information, the encryption suite candidate list, the compression algorithm candidate list, the random number random_C, and the extension field; 2. server_hello, which means that the application server returns the negotiation information result to the terminal device, which may specifically include the selected protocol version, the selected encryption suite, the selected compression algorithm, and the random number random_S, wherein the random number is used for key negotiation in subsequent processing; 3. server_certificate, the application server configures the corresponding digital certificate, which is used for the terminal device to verify the legitimacy of the application server and perform key negotiation based on the digital certificate; 4. server_hello_done, which is used to notify the terminal device that the server_hello information has been sent; 5. Certificate verification, the terminal device verifies the legitimacy of the digital certificate sent by the application server. If the certificate is verified, If the certificate is passed, subsequent communication will be carried out. Otherwise, prompts and operations will be given according to different error situations. Among them, the legitimacy verification includes at least one of the following: the credibility of the certificate chain, whether the certificate is revoked, the validity period, and whether the certificate matches the domain name used by the application server; 6. client_key_exchange, that is, after the terminal device completes the certificate verification, it calculates and generates a random number Pre-Master, encrypts it with the public key in the digital certificate, and sends the random number to the application server; 7. The terminal device calculates the negotiated key enc_key based on the obtained random numbers random_C, random_S and Pre-Master; 7. change_cipher_spec, the terminal device notifies the application server that subsequent communications will use the negotiated communication key and encryption algorithm for encrypted communication; 8. encrypted_handshake_message, the terminal device combines the hash values of all previous communication parameters and other relevant information to generate a piece of data, encrypts it with the negotiated key and algorithm, and then sends it to the application server for data and handshake verification;9. change_cipher_spec, the application server uses the private key in the digital certificate to decrypt the encrypted Pre-master data, and based on the two plaintext random numbers random_C and random_S exchanged before, also calculates the negotiated key. After that, the hash value of all previously received information is calculated, and then the encrypted_handshake_message sent by the terminal device is decrypted to verify the correctness of the data and key. After the verification is passed, the application server also sends change_cipher_spec to notify the terminal device that subsequent communications will use the negotiated key and algorithm for encrypted communication; 10. encrypted_handshake_message, the application server also combines all current communication parameter information to generate a piece of data and encrypts it with the negotiated key and algorithm and sends it to the terminal device; 11. The handshake ends, the terminal device calculates the hash value of all received information, and uses the negotiated key to decrypt the encrypted_handshake_message to verify the data and key sent by the application server. If the verification is passed, the handshake is completed; 12. After the handshake is completed, the negotiated key and algorithm can be used for encrypted communication between the terminal device and the application server. ;
[0070] It should be noted that, since the TLS handshake process between the terminal device and the application server is described in detail in the prior art, only a brief description is given in this embodiment, and the detailed processing is not repeated here.
[0071] According to the above description, it can be known that in the specific implementation, the encryption and decryption operations, especially the asymmetric encryption and decryption processing based on the public key-private key, are relatively time-consuming. In this embodiment, in order to improve data processing efficiency, the certificates of all application servers are centralized in the encryption and decryption server for unified management, and the encryption and decryption server is connected to the acceleration device. After any application server receives a data request sent by a terminal device, such as an HTTPS request, the data request can be forwarded to the decryption server for encryption and decryption processing.
[0072] Of course, in the specific implementation, when the application server sends the HTTPS request sent by the terminal device or other data request to be encrypted and decrypted to the encryption and decryption server, it can also re-package the data request based on the agreed protocol to increase the data transmission speed or perform data expansion. For example, the data request can be compressed or supplemented with other information based on the agreed protocol; after re-packaging, the re-packaged data request can be sent to the encryption and decryption server for the encryption and decryption server to perform data encryption and decryption processing.
[0073] Step S4200, in response to the first data request, calling an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request.
[0074] After the encryption / decryption server receives the first data request sent by the first application server, it can call the interface provided by the acceleration device to perform encryption / decryption processing on the data request; in addition, since data encryption / decryption, especially asymmetric encryption / decryption processing, is relatively time-consuming, in order to improve resource utilization and data processing efficiency, in this embodiment, the acceleration device can be called based on the coroutine mechanism to perform encryption / decryption processing on the first data request, so that the encryption / decryption processing can be performed on the first data request asynchronously, and the repeated generation and release of the same function call stack in two calls to the same interface function can be avoided, which is explained in detail below.
[0075] The coroutine mechanism allows a function containing multiple instruction statements to be executed from the first instruction statement of the multiple instruction statements every time, but to continue execution from the position where the last call was paused during the process of calling the function; specifically, when the coroutine function is called for the first time, a coroutine context will be allocated on the stack to save the return address of the initiator, entry parameters, local variables, and the location where control of system resources is released; when the coroutine calls the function again, the calling environment will be restored based on the saved coroutine context, and then the function will continue to execute from the position where the last execution was paused.
[0076] Specifically in this embodiment, in response to the first data request, the acceleration device is called through the coroutine mechanism to perform encryption and decryption processing on the first data request, including: obtaining identification information of the first application server; based on the identification information, obtaining key information corresponding to the first application server; based on the key information, the acceleration device is called through the coroutine mechanism to perform encryption and decryption processing on the first data request.
[0077] That is, through the identification information of the first application server, the digital certificate information of the first application server is queried in the digital certificate list centrally managed by the encryption and decryption server, and the public key is obtained from the queried digital certificate information; then, according to the public key, the acceleration device is called through the coroutine mechanism to perform encryption and decryption processing on the first data request.
[0078] Specifically, calling the acceleration device to perform encryption and decryption processing on the first data request through the coroutine mechanism according to the key information includes: when calling the acceleration device to perform encryption and decryption processing on the first data request according to the key information, obtaining the first identification information of the first event returned by the acceleration device for encryption and decryption processing of the first data request; and setting the status information of the first event to the first status information for indicating waiting for the processing result; storing the first identification information and the first status information in the form of a data pair in the event monitoring list, and releasing the control of the first event over the system resources.
[0079] In this embodiment, when the data request is an HTTPS request based on the TLS protocol, the acceleration device is called through the coroutine mechanism according to the public key to perform encryption and decryption processing on the first data request. Specifically, the interface function SSLdohandshake() provided by the open secure sockets layer protocol (OpenSSL, OpenSecureSocketsLayer) can be used to perform encryption and decryption processing through the acceleration device; when the acceleration device performs encryption and decryption calculations, a corresponding asynchronous task (asyncjob) is generated, and the corresponding processing engine is directly entered. For example, when the acceleration device is an acceleration card based on QAT technology, the processing engine can be QATEngine; after the processing engine receives the processing request, it notifies the encryption and decryption server through the OpenSSL asynchronous library to pause the current event and schedule the current call stack to return the corresponding asynchronous error code to the encryption and decryption server, wherein, in the encryption and decryption server In the server, a Web server, such as a Web server based on a Tengine application, can be used to receive data requests sent by an application server and monitor processing events of data requests; when the encryption and decryption server receives the first identification information of the first event returned by the acceleration device for encryption and decryption processing of the first data request and the returned asynchronous error code, the status information of the first event can be set to indicate the first status information for waiting to obtain the processing result, for example, it can be "-1"; and the first identification information and the first status information are stored in the event monitoring list in the form of a data pair; thereafter, the encryption and decryption server suspends the event to release the occupation of system resources by the event, so that the encryption and decryption server can continue to receive other data requests, for example, receive and process the second data request sent by the second application server, and also call the acceleration device through the coroutine mechanism to perform encryption and decryption processing on the second data request.
[0080] In addition, the method further includes: receiving a response message returned by the acceleration device; obtaining first identification information of the first event from the response message; when the state of the first event is found to be the first state information in the event monitoring list according to the first identification information, obtaining target result data obtained after data encryption and decryption processing of the first data request from the acceleration device according to the first identification information; and returning the target result data to the first server. And, the method further includes: setting the state of the event in the event monitoring list to the second state information indicating that the processing result has been obtained.
[0081] Specifically, after the processing engine of the acceleration device completes the data encryption and decryption processing on the first data request, it can return a response message to the encryption and decryption server to wake up the first event corresponding to the first data request. Afterwards, the calling environment of SSLdohandshake() is restored through the coroutine context saved by the coroutine mechanism when the event is suspended, and the interface function continues to be executed to obtain the target result data returned by the acceleration device corresponding to the first data request after the data encryption and decryption processing; afterward, the target result data can be returned to the first application server.
[0082] Step S4300: In the process of processing the first data request, a second data request sent by a second application server is received, and the acceleration device is called through a coroutine mechanism to perform encryption and decryption processing on the second data request.
[0083] According to the description in step S4200, after the encryption / decryption server calls the acceleration device to perform data encryption / decryption processing on the first data request and suspends the corresponding first event, since the system resources are released, the encryption / decryption server can continue to receive and process the second data request sent by the second application server while processing the first data request, and also use the coroutine mechanism to call the acceleration device to perform encryption / decryption processing on the second data request. For the detailed processing process, please refer to the corresponding description in S4200, which will not be repeated here.
[0084] According to the above steps S4100-S4300, the method of this embodiment sets up a server for encrypting and decrypting data requests. After the server receives the first data request sent by the first application server, it calls the acceleration device through the coroutine mechanism to encrypt and decrypt the first data request to release the occupation of system resources when processing the request, so that during the processing of the first data request, the server can also process the second data request sent by the second application server in parallel. The method sets up a server that centrally encrypts and decrypts data requests from multiple application servers, and through the coroutine mechanism, the server can perform data encryption and decryption on multiple data requests in parallel, so as to make full use of the computing resources of the server and the performance of the acceleration device, thereby improving data processing efficiency.
[0085] <Method Example 2>
[0086] Corresponding to the above method embodiment 1, in this embodiment, another data processing method is also provided, which can be applied to the application server. Figure 5 , which is a flow chart of a data processing method according to another embodiment. Figure 5 As shown, the method may include the following steps S5100-S5300, which are described in detail below.
[0087] Step S5100, receiving a data request sent by a terminal device.
[0088] Step S5200: In response to the data request, the data request is sent to a server for encrypting and decrypting the data request.
[0089] Step S5300, receiving target result data returned by the server and corresponding to the data request.
[0090] <Device Example>
[0091] Corresponding to the above method embodiment 1 and method embodiment 2, in this embodiment, a data processing device is also provided, which can be applied to a server that performs encryption and decryption processing on a data request, for example, Figure 3 In the server 3000 shown in FIG. Figure 6 As shown, the device 6000 may include a first data request receiving module 6100 , a first data processing module 6200 , and a second data processing module 6300 .
[0092] The first data request receiving module 6100 is used to receive a first data request sent by a first application server.
[0093] The first data processing module 6200 is used to respond to the first data request and call the acceleration device through the coroutine mechanism to perform encryption and decryption processing on the first data request.
[0094] In one embodiment, when the first data processing module 6200 calls an acceleration device through a coroutine mechanism to perform encryption and decryption on the first data request in response to the first data request, it can be used to: obtain identification information of the first application server; obtain key information corresponding to the first application server based on the identification information; and call an acceleration device through a coroutine mechanism to perform encryption and decryption on the first data request based on the key information.
[0095] In this embodiment, the first data processing module 6200 calls the acceleration device to perform encryption and decryption processing on the first data request through the coroutine mechanism according to the key information 2, which can be used to: when calling the acceleration device to perform encryption and decryption processing on the first data request according to the key information, obtain the first identification information of the first event returned by the acceleration device for encrypting and decrypting the first data request; and set the status information of the first event to the first status information for indicating waiting to obtain the processing result; store the first identification information and the first status information in the event monitoring list as a data pair, and release the control of the first event over system resources.
[0096] In this embodiment, the device 6000 also includes a target result data providing module, which is used to: receive a response message returned by the acceleration device; obtain first identification information of the first event from the response message; when, according to the first identification information, the status of the first event is queried in the event monitoring list as the first status information, obtain, according to the first identification information, from the acceleration device the target result data obtained after data encryption and decryption processing of the first data request; and return the target result data to the first server.
[0097] In this embodiment, the device 6000 further includes a status updating module, which is used to set the status of the event in the event monitoring list to second status information indicating that a processing result has been obtained.
[0098] The second data processing module 6300 is used to receive a second data request sent by a second application server during processing of the first data request, and to call the acceleration device through a coroutine mechanism to perform encryption and decryption processing on the second data request.
[0099] <Equipment Embodiment>
[0100] Corresponding to the above-mentioned method embodiment 1 and method embodiment 2, in this embodiment, an electronic device is also provided, which may include a data processing device 6000 according to any embodiment of the present disclosure, for implementing the data processing method of any embodiment of the present disclosure.
[0101] like Figure 7 As shown, the electronic device 7000 may also include a processor 7200 and a memory 7100, wherein the memory 7100 is used to store executable instructions; the processor 7200 is used to operate the electronic device according to the control of the instructions to execute the data processing method according to any embodiment of the present disclosure.
[0102] The various modules of the above device 7000 can be implemented by the processor 7200 running the instructions to execute the data processing method according to any embodiment of the present disclosure.
[0103] The electronic device 7000 may be a server. For example, the electronic device 7000 may be Figure 3 Server 3000, etc.
[0104] <Medium Example>
[0105] In this embodiment, a computer-readable storage medium is further provided, which stores a computer program that can be read and executed by a computer, and the computer program is used to execute the method described in any of the above embodiments of the present disclosure when read and executed by the computer.
[0106] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0107] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0108] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0109] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0110] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0111] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0112] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0113] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0114] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.
Claims
1. A data processing method, characterized in that: A server used for encrypting and decrypting data requests, characterized by comprising: Receiving a first data request sent by a first application server; In response to the first data request, calling an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request; During the process of processing the first data request, a second data request sent by a second application server is received, and the acceleration device is called through the coroutine mechanism to perform encryption and decryption processing on the second data request; wherein, when the acceleration device performs encryption and decryption processing, it generates a corresponding asynchronous task and directly enters the corresponding processing engine, and, after the processing engine receives a new data request, it notifies the server that performs encryption and decryption processing on the data request through the OpenSSL asynchronous library to pause the current event, and schedules the current call stack to return the corresponding asynchronous error code to the server that performs encryption and decryption processing on the data request.
2. The method according to claim 1, characterized in that In response to the first data request, calling an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request includes: Obtaining identification information of the first application server; Acquire key information corresponding to the first application server according to the identification information; According to the key information, an acceleration device is called through a coroutine mechanism to perform encryption and decryption processing on the first data request.
3. The method according to claim 2, characterized in that The step of calling an acceleration device to perform encryption and decryption processing on the first data request through a coroutine mechanism according to the key information includes: When the acceleration device is called to perform encryption and decryption processing on the first data request according to the key information, first identification information of a first event of performing encryption and decryption processing on the first data request returned by the acceleration device is obtained; and Setting the state information of the first event to first state information indicating waiting for obtaining a processing result; The first identification information and the first status information are stored in an event monitoring list in the form of a data pair, and the control right of the first event over system resources is released.
4. The method according to claim 3, characterized in that The method further comprises: Receiving a response message returned by the acceleration device; Acquire first identification information of the first event from the response message; When the state of the first event is found to be the first state information in the event monitoring list according to the first identification information, obtaining target result data obtained by encrypting and decrypting the first data request from the acceleration device according to the first identification information; The target result data is returned to the first application server.
5. The method according to claim 4, characterized in that After obtaining the target result data, the method further includes: The state of the event in the event monitoring list is set to second state information indicating that a processing result has been obtained.
6. The method according to claim 1, characterized in that The data request includes an HTTPS request.
7. A data processing method, characterized in that: Applicable to application servers, including: Receiving a data request sent by a terminal device; In response to the data request, the data request is sent to a server for encrypting and decrypting the data request; the server is used to execute the method according to any one of claims 1 to 6; Receive target result data returned by the server and corresponding to the data request.
8. A data processing device, characterized in that: Servers used to encrypt and decrypt data requests, including: A first data request receiving module, used to receive a first data request sent by a first application server; A first data processing module, configured to, in response to the first data request, call an acceleration device through a coroutine mechanism to perform encryption and decryption processing on the first data request; The second data processing module is used to receive a second data request sent by a second application server during the process of processing the first data request, and call the acceleration device through the coroutine mechanism to perform encryption and decryption processing on the second data request; wherein, when the acceleration device performs encryption and decryption processing, it generates a corresponding asynchronous task and directly enters the corresponding processing engine, and, after the processing engine receives a new data request, it notifies the server that performs encryption and decryption processing on the data request through the OpenSSL asynchronous library to pause the current event, and schedules the current call stack to return a corresponding asynchronous error code to the server that performs encryption and decryption processing on the data request.
9. An electronic device, characterized in that: The device comprising claim 8; or, The electronic device comprises: A memory for storing executable instructions; A processor is used to operate the electronic device to execute the method according to any one of claims 1 to 7 under the control of the instruction.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that can be read and executed by a computer, and the computer program is used to execute the method according to any one of claims 1 to 7 when being read and executed by the computer.
Citation Information
Patent Citations
HTTPS acceleration method and system based on content delivery network
CN110808989A
Homomorphic encryption unloading method based on Intel QAT
CN111538582A