Asymmetric encryption processing method and device, electronic equipment and storage medium
By asynchronously processing asymmetric encryption requests, the program blockage caused by asymmetric encryption calculations is solved, and other tasks can be handled while waiting for the result, improving product functions and customer experience.
Patent Information
- Application Number
- CN202410969099.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, there is program blockage during asymmetric encryption calculations, which affects the call of other application tasks and affects product functions and customer experience.
Using the asynchronous processing method, when receiving the client's diagnostic request, the encryption module is called for verification processing, and the maximum waiting time is set to obtain verification results according to the preset time period. If it is not completed within the maximum waiting time, send preset information and update the waiting time until the result of verification or failure of verification is obtained to avoid blockage of the program.
Through asynchronous processing, other tasks are allowed to be processed while waiting for the results of asymmetric encryption processing, avoiding calls that affect other application tasks, and improving program responsiveness and customer experience.
Smart Images

Figure CN119011204A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for processing asymmetric encryption. Background Art
[0002] Digital signatures and asymmetric encryption are used in the information security functions of automotive electronics. Using asymmetric encryption for digital signatures can solve the key distribution and identity authentication problems, but asymmetric encryption itself has a big problem, that is, its processing speed is much lower than symmetric encryption, only a few hundredths of symmetric encryption. It takes hundreds of milliseconds to complete an asymmetric encryption signature verification calculation.
[0003] In the prior art, when performing asymmetric encryption calculations, after receiving a diagnostic request, the encryption module needs to give the final processing result within one processing cycle. During this process, the server needs to wait for the processing result in a loop. At this time, the program is blocked, causing the program to be unable to execute other application tasks during this processing, affecting product functions and customer experience. Summary of the invention
[0004] In view of this, the present application provides an asymmetric encryption processing method, device, electronic device and storage medium to solve the problem in the prior art that when performing asymmetric encryption calculations, there is program blockage, which affects the calling of other application tasks.
[0005] To achieve the above objectives, this application provides the following technical solutions:
[0006] The first aspect of the present application discloses a method for processing asymmetric encryption, comprising:
[0007] When receiving a diagnostic request sent by a client, calling an encryption module to verify the diagnostic request; wherein the diagnostic request is an asymmetric encrypted diagnostic request;
[0008] Set the maximum waiting time for replying to the client;
[0009] Obtaining a verification result according to a preset time period; wherein the verification result includes verification not completed, verification passed, or verification failed;
[0010] If a verification result of passing or failing the verification is obtained within the maximum waiting time, the obtained verification result is sent to the client;
[0011] If only an incomplete verification processing result is obtained within the maximum waiting time, the preset information is sent to the client and the maximum waiting time is updated, and the process returns to execute the verification processing result according to the preset time period until a verification processing result of passing or failing the verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and a final response cannot be given temporarily.
[0012] Optionally, in the above method, obtaining the verification processing result according to a preset time period includes:
[0013] According to the time period, query the encryption module for the verification processing result, and set the maximum query waiting time for each query;
[0014] If the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified, the verification processing result is verification passed;
[0015] If the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails, the verification processing result is verification failure;
[0016] If the query waiting time reaches the maximum query waiting time and the diagnosis request verification is not completed, the verification processing result is verification is not completed.
[0017] Optionally, in the above method, the calling of the encryption module to perform verification processing on the diagnostic request includes:
[0018] Obtaining the encrypted file in the diagnosis request;
[0019] Calling the encryption module to find out the public key corresponding to the encrypted file;
[0020] The encryption module is called to decrypt the encrypted file using the public key.
[0021] Optionally, in the above method, updating the maximum waiting time includes:
[0022] The preset update factor is multiplied by the maximum waiting time to obtain the updated maximum waiting time.
[0023] Optionally, the above method, after querying the encryption module for the verification processing result according to the time period and setting the maximum query waiting time for each query, further includes:
[0024] When the query waiting time reaches the maximum query waiting time, it is determined whether there are other tasks that need to be executed;
[0025] If it is determined that there are other tasks that need to be executed, threads corresponding to the other tasks are called to process the other tasks.
[0026] The second aspect of the present application further discloses an asymmetric encryption processing device, comprising:
[0027] A calling unit, configured to call the encryption module to perform verification processing on the diagnostic request when receiving the diagnostic request sent by the client; wherein the diagnostic request is a diagnostic request processed by asymmetric encryption;
[0028] A setting unit, used to set a maximum waiting time for replying to the client;
[0029] An acquisition unit, used to acquire a verification processing result according to a preset time period; wherein the verification processing result includes verification incomplete, verification passed, or verification failed;
[0030] A sending unit, configured to send the obtained verification processing result to the client if a verification processing result of passing or failing the verification is obtained within the maximum waiting time;
[0031] A loop unit is used to send preset information to the client and update the maximum waiting time if only a verification processing result of incomplete verification is obtained within the maximum waiting time, and return to execute the verification processing result according to the preset time period, until a verification processing result of passed or failed verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and a final response cannot be given temporarily.
[0032] Optionally, in the above device, the acquisition unit includes:
[0033] A query subunit, used to query the encryption module for the verification processing result according to the time period, and set a maximum query waiting time for each query;
[0034] A first determining unit, configured to determine that the verification processing result is verification passed if the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified;
[0035] A second determining unit, configured to determine that the verification processing result is verification failure if the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails;
[0036] The third determining unit is configured to determine that the verification processing result is verification incomplete if the query waiting time reaches the maximum query waiting time and the diagnosis request verification is incomplete.
[0037] Optionally, in the above-mentioned device, the calling unit includes:
[0038] An acquisition subunit, used for acquiring the encrypted file in the diagnosis request;
[0039] A first calling subunit is used to call the encryption module to find out the public key corresponding to the encrypted file;
[0040] The second calling subunit is used to call the encryption module to decrypt the encrypted file using the public key.
[0041] Optionally, in the above-mentioned device, the circulation unit comprises:
[0042] The updating subunit is used to multiply the preset updating factor by the maximum waiting time to obtain the updated maximum waiting time.
[0043] Optionally, the above-mentioned device, the circulation unit, further comprises:
[0044] A judging unit, configured to judge whether there are other tasks to be executed when the query waiting time reaches the maximum query waiting time;
[0045] The processing unit is used to call threads corresponding to other tasks and process the other tasks if it is determined that there are other tasks that need to be executed.
[0046] The third aspect of the present application discloses an electronic device, comprising:
[0047] one or more processors;
[0048] a storage device having one or more programs stored thereon;
[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of the first aspects of the present application.
[0050] A fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any one of the first aspects of the present application is implemented.
[0051] It can be seen from the above technical scheme that in an asymmetric encryption processing method provided by the present application, when a diagnostic request sent by a client is received, an encryption module is called to verify the diagnostic request. At the same time, the maximum waiting time for replying to the client is set. Then, according to the preset time period, the verification processing result is obtained. If the verification processing result of passing or failing the verification is obtained within the maximum waiting time, the obtained verification processing result is sent to the client. If only the verification processing result of the verification that is not completed is obtained within the maximum waiting time, the preset information and the maximum waiting time are updated to the client, and the verification processing result is obtained according to the preset time period until the verification processing result of passing or failing the verification is obtained. It can be seen that when the present application performs asymmetric encryption processing, an asynchronous processing method is adopted to obtain the verification processing result according to the preset time period. When the verification processing is not completed after waiting for a certain period of time, other tasks can be processed first, without affecting the calling processing of other tasks, and the verification processing result is obtained again in the next time period. The problem of program blockage and affecting the calling of other application tasks in the prior art when performing asymmetric encryption calculation is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0053] Figure 1 A flowchart of an asymmetric encryption processing method disclosed in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of a process for performing security access authentication disclosed in another embodiment of the present application;
[0055] Figure 3 A schematic diagram of an application process of an asymmetric encryption algorithm disclosed in another embodiment of the present application;
[0056] Figure 4 This is a flowchart of an implementation of step S103 disclosed in another embodiment of the present application;
[0057] Figure 5 This is an overall flow chart of asymmetric encryption diagnosis request processing disclosed in another embodiment of the present application;
[0058] Figure 6 A schematic diagram of an asymmetric encryption processing device disclosed in another embodiment of the present application;
[0059] Figure 7 A schematic diagram of an electronic device disclosed in another embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0062] Furthermore, in this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0063] From the background technology, it can be seen that in the prior art, when performing asymmetric encryption calculations, after receiving a diagnostic request, the encryption module needs to give the final processing result within one processing cycle. During this process, the server needs to wait for the processing result in a loop. At this time, the program is blocked, resulting in the program being unable to execute other application tasks during this processing, affecting product functions and customer experience.
[0064] In view of this, the present application provides an asymmetric encryption processing method, device, electronic device and storage medium to solve the problem in the prior art that when performing asymmetric encryption calculations, there is program blockage, which affects the calling of other application tasks.
[0065] The present application embodiment provides a method for processing asymmetric encryption, such as Figure 1 As shown, specifically including:
[0066] S101. Upon receiving a diagnosis request sent by a client, an encryption module is called to verify the diagnosis request; wherein the diagnosis request is an asymmetric encrypted diagnosis request.
[0067] It should be noted that when the server receives the diagnostic request sent by the client, the server triggers the user interface (i.e., user-defined function) through the main function of the diagnostic service, and calls the encryption module (e.g., Hardware security module, HSE for short) to verify the diagnostic request, i.e., perform asymmetric encryption calculation. Here, the server takes the controller as an example, and the client takes the diagnostic instrument as an example. The diagnostic request is an asymmetric encrypted diagnostic request. If the diagnostic request is a request to verify a digital signature, the encryption module performs the digital signature verification operation to obtain the signature verification result.
[0068] In real-car application scenarios, to prevent malicious attacks, the controller usually sets up an authentication process before responding to vehicle function-related services such as function configuration or software upgrades to ensure that external access is authorized. Asymmetric encryption is based on mathematically difficult problems to ensure confidentiality. In the process of secure access authentication between the diagnostic instrument and the controller as the server, Figure 2 shown.
[0069] Optionally, in another embodiment of the present application, an implementation of calling the encryption module to perform verification processing on the diagnosis request in step S101 may include:
[0070] Get the encrypted file in the diagnostic request.
[0071] Call the encryption module to find out the public key corresponding to the encrypted file.
[0072] Call the encryption module to decrypt the encrypted file using the public key.
[0073] It should be noted that the keys used for encryption and decryption in asymmetric encryption algorithms are different, namely, public keys (i.e. keys that can be made public) and private keys (in digital signatures, private keys are held by the sender and cannot be sent to others). Digital signatures are an application form of asymmetric encryption. The private key encrypts the plaintext using the digest generated by the hash algorithm to generate a digital signature, and the public key is used to decrypt and verify the signature. The application process of asymmetric encryption algorithms can be found in Figure 3 Therefore, after receiving the diagnosis request sent by the client, the encrypted file in the diagnosis request is first obtained, and then the encryption module finds the public key corresponding to the encrypted file and uses the public key to decrypt the encrypted file. If the decryption is successful, the verification is passed, and if the decryption is unsuccessful, the verification fails.
[0074] S102: Set the maximum waiting time for replying to the client.
[0075] It should be noted that a maximum waiting time P2 for replying to the client is set, and within the maximum waiting time, a reply on the processing status of the diagnosis request needs to be given to the client.
[0076] S103. Obtain verification processing results according to a preset time period; wherein the verification processing results include verification incomplete, verification passed, or verification failed.
[0077] It should be noted that according to the preset time period, the verification processing status of the diagnostic request is queried from the encryption module to obtain the verification processing result. Among them, the verification processing results include verification incomplete, verification passed or verification failed. This time period is the scheduling period of the main function of the diagnostic service, and the typical value is 5ms or 10ms. This process adopts asynchronous processing. If it is not completed after waiting for a certain period of time, other tasks will be processed first. When the main function of the diagnostic service is polled again, the verification processing status of the diagnostic request will be queried from the encryption module again. If it is completed, the final diagnostic response will be replied.
[0078] Optionally, in another embodiment of the present application, an implementation of step S103 is as follows: Figure 4 As shown, it may include:
[0079] S401. Query the encryption module for verification processing results according to a time period, and set a maximum query waiting time for each query.
[0080] It should be noted that after calling the encryption module to verify the diagnostic request, the query operation of the encryption module's verification result is initiated, and a maximum query waiting time is set at the same time. Because the loop waiting is a blocking process, in order to avoid affecting other task call processing, the maximum query waiting time can be set to the us level to avoid delays in the processing of other application tasks due to long waiting time, for example, 100us. Within the maximum query waiting time, the encryption module needs to return a query result.
[0081] Optionally, in another embodiment of the present application, after executing step S401, the following may also be included:
[0082] When the query waiting time reaches the maximum query waiting time, it is determined whether there are other tasks that need to be executed.
[0083] If it is determined that there are other tasks that need to be executed, the threads corresponding to the other tasks are called to process the other tasks.
[0084] It should be noted that when the query waiting time reaches the maximum query waiting time, it is determined whether there are other tasks that need to be executed at this time. If there are other tasks that need to be executed, the thread that can execute the task is determined and the thread is called to process the task to avoid affecting product functions and customer experience.
[0085] S402: If the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified, the verification processing result is verification passed.
[0086] It should be noted that from the time the query is initiated, if the query waiting time does not reach the maximum query waiting time, the encryption module verification operation has been completed, and the query result returned by the encryption module is DCM_OK, which means that the verification is successful, then the verification processing result is successful.
[0087] S403: If the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails, the verification processing result is verification failure.
[0088] It should be noted that, from the time the query is initiated, if the query waiting time does not reach the maximum query waiting time, the encryption module verification operation has been completed, and the query result returned by the encryption module is DCM_NOT_OK, which means that the verification failed. Then the verification processing result is verification failed.
[0089] S404: If the query waiting time reaches the maximum query waiting time and the diagnosis request verification is not completed, the verification processing result is verification is not completed.
[0090] It should be noted that, from the time the query is initiated, if the query waiting time reaches the maximum query waiting time, and the encryption module verification operation is still not completed, the encryption module returns DCM_PENDING, which means that the diagnostic request is still being processed and the final response cannot be given temporarily, then the verification processing result is verification is not completed.
[0091] S104: If a verification processing result of passing or failing the verification is obtained within the maximum waiting time, the obtained verification processing result is sent to the client.
[0092] It should be noted that if a verification processing result of verification passing or verification failing is obtained within the maximum waiting time, it means that the verification operation of the encryption module has been completed, and the verification result is sent to the client.
[0093] S105. If only an incomplete verification processing result is obtained within the maximum waiting time, the preset information and the updated maximum waiting time are sent to the client, and the verification processing result is obtained according to the preset time period until a verification processing result of passing or failing the verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and a final response cannot be given temporarily.
[0094] It should be noted that if only the verification processing result of the uncompleted verification is obtained within the maximum waiting time P2, it means that the verification processing of the diagnostic request has not been completed at this time. In order to avoid timeout and no response, before the maximum waiting time is reached, a preset information is sent to the client, and the preset information is used to prompt that the diagnostic request is being processed and the final response cannot be given temporarily. The specific content of the preset information can be set according to the actual situation, such as 0x78 (NRC code, i.e. Negativeresponse code negative response code). At the same time, the maximum waiting time P2 of the reply client is updated to P2*, because under normal circumstances, the final response needs to be replied before the P2 time expires. When the controller replies 0x78, the waiting time is updated from P2 time to P2*. If the final response cannot be replied before the P2* time expires, it is necessary to reply 0x78 again to avoid P2* timeout, because timeout means that the client's request has not received a final response. Then return to execute S103 until the verification processing result of passing or failing the verification is obtained, indicating that the encryption module verification operation has been completed, then stop the loop and send the final verification processing result to the client. This method can avoid affecting the calling of other application tasks when processing asymmetric encryption calculations, and ensure the real-time operation of the program itself and the response service.
[0095] Optionally, in another embodiment of the present application, an implementation of updating the maximum waiting time in step S105 may include:
[0096] Multiply the preset update factor by the maximum waiting time to obtain the updated maximum waiting time.
[0097] It should be noted that the update factor can be set according to actual conditions, such as 1 or 1.2, etc. Then the maximum waiting time P2 is multiplied by the update factor to obtain the updated maximum waiting time P2*.
[0098] For ease of understanding, in another embodiment of the present application, taking the diagnostic instrument and the controller as an example, the overall process of asymmetric encryption diagnostic request processing is as follows: Figure 5As shown. First, the diagnostic instrument sends a diagnostic request to the controller. After receiving the diagnostic request, the controller triggers the user-defined callback function through the main function of the diagnostic service, and requests the encryption module to perform asymmetric encryption calculations. If the asymmetric encryption calculation is to verify the digital signature, the execution result may be signature verification passed or failed. Then query whether the encryption calculation is completed. The waiting time of the entire query process does not exceed 100us (that is, the maximum query waiting time). If the encryption calculation is not completed when the waiting time reaches 100us, the encryption module sends DCM_PENDING to the diagnostic service, indicating that the current diagnostic request is being processed and the final response cannot be given temporarily. At this time, the time to receive the diagnostic request is about to reach the P2 time and the encryption module has not yet given the final verification result. The P2 time refers to the maximum waiting time required to reply after receiving the request message. It is necessary to reply 0x78 to the diagnostic instrument to prompt the diagnostic instrument controller that the request has been received and the final response is being processed. The diagnostic device needs to wait. At the same time, the time for the diagnostic instrument to wait for the response to the diagnostic request is changed from P2 time to P2* time. P2* time refers to the maximum waiting time required to reply after receiving the 0x78 reply. After that, according to the scheduling cycle of the diagnostic service main function, when the diagnostic service main function is polled again, the user-defined function is triggered again through the diagnostic service main function to query whether the encryption calculation has been completed, and the waiting time is also no more than 100us. At this time, the encryption calculation is still not completed, so DCM_PENDING is sent to the diagnostic service again. At this time, it is far from the P2* time, so there is no need to reply 0x78. At the next scheduling cycle of the diagnostic service main function, the user-defined function is triggered again through the diagnostic service main function to query whether the encryption calculation has been completed, and the waiting time is also no more than 100us. At this time, the encryption calculation has been completed, and the verification result is that the signature verification has passed, so DCM_OK is replied to the diagnostic service. After the diagnostic service receives the verification result of the signature verification passing, it sends the verification result to the diagnostic instrument.
[0099] In a processing method for asymmetric encryption provided by an embodiment of the present application, when a diagnostic request sent by a client is received, an encryption module is called to perform verification processing on the diagnostic request. At the same time, the maximum waiting time for replying to the client is set. Then, according to a preset time period, the verification processing result is obtained. If a verification processing result of passing or failing the verification is obtained within the maximum waiting time, the obtained verification processing result is sent to the client. If only a verification processing result of an uncompleted verification is obtained within the maximum waiting time, the preset information and the updated maximum waiting time are sent to the client, and the verification processing result is obtained according to the preset time period until the verification processing result of passing or failing the verification is obtained. It can be seen from this that when the present application performs asymmetric encryption processing, an asynchronous processing method is adopted to obtain the verification processing result according to a preset time period. When the verification processing is not completed after waiting for a certain period of time, other tasks can be processed first without affecting the calling processing of other tasks, and the verification processing result is obtained again in the next time period. The problem of program blockage and affecting the calling of other application tasks in the prior art when performing asymmetric encryption calculation is solved.
[0100] Another embodiment of the present application also provides an asymmetric encryption processing device, such as Figure 6 As shown, specifically including:
[0101] The calling unit 601 is used to call the encryption module to verify the diagnosis request when receiving the diagnosis request sent by the client; wherein the diagnosis request is an asymmetric encrypted diagnosis request.
[0102] The setting unit 602 is used to set the maximum waiting time for replying to the client.
[0103] The acquisition unit 603 is used to acquire the verification processing result according to a preset time period; wherein the verification processing result includes verification incomplete, verification passed or verification failed.
[0104] The sending unit 604 is used to send the obtained verification processing result to the client if the verification processing result of passing or failing the verification is obtained within the maximum waiting time.
[0105] The loop unit 605 is used to send preset information to the client and update the maximum waiting time if only the verification processing result of incomplete verification is obtained within the maximum waiting time, and return to execute according to the preset time period to obtain the verification processing result until the verification processing result of passing or failing the verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and the final response cannot be given temporarily.
[0106] In this embodiment, the specific execution process of the calling unit 601, the setting unit 602, the obtaining unit 603, the sending unit 604, and the loop unit 605 can be found in the corresponding Figure 1 The content of the method embodiment will not be repeated here.
[0107] In an asymmetric encryption processing device provided by an embodiment of the present application, when the calling unit 601 receives a diagnostic request sent by a client, the encryption module is called to verify the diagnostic request. At the same time, the setting unit 602 sets the maximum waiting time for replying to the client. Then the acquisition unit 603 obtains the verification processing result according to the preset time period. If the verification processing result of passing or failing the verification is obtained within the maximum waiting time, the sending unit 604 sends the obtained verification processing result to the client. If only the verification processing result of the uncompleted verification is obtained within the maximum waiting time, the loop unit 605 sends the preset information and updates the maximum waiting time to the client, and returns to execute according to the preset time period to obtain the verification processing result until the verification processing result of passing or failing the verification is obtained. It can be seen from this that when performing asymmetric encryption processing, the present application adopts an asynchronous processing method to obtain the verification processing result according to the preset time period. When the verification processing is not completed after waiting for a certain period of time, other tasks can be processed first without affecting the calling processing of other tasks, and the verification processing result is obtained again in the next time period. The invention solves the problem in the prior art that when performing asymmetric encryption calculation, there is program blockage, which affects the calling of other application tasks.
[0108] Optionally, in another embodiment of the present application, an implementation of the acquisition unit 603 includes:
[0109] The query subunit is used to query the encryption module for the verification processing results according to the time period and set the maximum query waiting time for each query.
[0110] The first determining unit is configured to determine that the verification processing result is verification passed if the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified.
[0111] The second determining unit is configured to determine that the verification processing result is verification failure if the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails.
[0112] The third determining unit is configured to determine that the verification processing result is verification incomplete if the query waiting time reaches the maximum query waiting time and the diagnosis request verification is incomplete.
[0113] In this embodiment, the specific execution process of the query subunit, the first determination unit, the second determination unit and the third determination unit can be found in the corresponding Figure 4The content of the method embodiment will not be repeated here.
[0114] Optionally, in another embodiment of the present application, an implementation of the calling unit 601 includes:
[0115] The acquisition subunit is used to obtain the encrypted file in the diagnosis request.
[0116] The first calling subunit is used to call the encryption module to find out the public key corresponding to the encrypted file.
[0117] The second calling subunit is used to call the encryption module to decrypt the encrypted file using the public key.
[0118] In this embodiment, the specific execution process of the acquisition subunit, the first calling subunit, and the second calling subunit can be found in the above-mentioned corresponding method embodiment content, which will not be repeated here.
[0119] Optionally, in another embodiment of the present application, an implementation of the circulation unit 605 includes:
[0120] The updating subunit is used to multiply the preset updating factor by the maximum waiting time to obtain the updated maximum waiting time.
[0121] In this embodiment, the specific execution process of the updating subunit can refer to the corresponding method embodiment content above, which will not be repeated here.
[0122] Optionally, in another embodiment of the present application, the asymmetric encryption processing device may further include:
[0123] The judging unit is used to judge whether there are other tasks to be executed when the query waiting time reaches the maximum query waiting time.
[0124] The processing unit is used to call threads corresponding to other tasks and process other tasks if it is determined that there are other tasks that need to be executed.
[0125] In this embodiment, the specific execution process of the judgment unit and the processing unit can refer to the corresponding method embodiment content above, which will not be repeated here.
[0126] Another embodiment of the application also provides an electronic device, such as Figure 7 As shown, specifically including:
[0127] One or more processors 701.
[0128] The storage device 702 stores one or more programs.
[0129] When one or more programs are executed by one or more processors 701 , the one or more processors 701 implement any one of the methods in the above embodiments.
[0130] Another embodiment of the present application further provides a computer storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, any one of the methods in the above embodiments is implemented.
[0131] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0132] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0133] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing asymmetric encryption, characterized in that: include: When receiving a diagnostic request sent by a client, calling an encryption module to verify the diagnostic request; wherein the diagnostic request is an asymmetric encrypted diagnostic request; Set the maximum waiting time for replying to the client; Obtaining a verification result according to a preset time period; wherein the verification result includes verification not completed, verification passed, or verification failed; If a verification result of passing or failing the verification is obtained within the maximum waiting time, the obtained verification result is sent to the client; If only an incomplete verification processing result is obtained within the maximum waiting time, the preset information is sent to the client and the maximum waiting time is updated, and the process returns to execute the verification processing result according to the preset time period, until a verification processing result of passing or failing the verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and a final response cannot be given temporarily.
2. The method according to claim 1, characterized in that The obtaining of the verification processing result according to the preset time period includes: According to the time period, query the encryption module for the verification processing result, and set the maximum query waiting time for each query; If the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified, the verification processing result is verification passed; If the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails, the verification processing result is verification failure; If the query waiting time reaches the maximum query waiting time and the diagnosis request verification is not completed, the verification processing result is verification is not completed.
3. The method according to claim 1, characterized in that The calling encryption module to perform verification processing on the diagnosis request includes: Obtaining the encrypted file in the diagnosis request; Calling the encryption module to find out the public key corresponding to the encrypted file; The encryption module is called to decrypt the encrypted file using the public key.
4. The method according to claim 1, characterized in that: The updating of the maximum waiting time includes: The preset update factor is multiplied by the maximum waiting time to obtain the updated maximum waiting time.
5. The method according to claim 2, characterized in that: After querying the encryption module for the verification processing result according to the time period and setting the maximum query waiting time for each query, the method further includes: When the query waiting time reaches the maximum query waiting time, it is determined whether there are other tasks that need to be executed; If it is determined that there are other tasks that need to be executed, threads corresponding to the other tasks are called to process the other tasks.
6. A processing device for asymmetric encryption, characterized in that: include: A calling unit, configured to call the encryption module to perform verification processing on the diagnostic request when receiving the diagnostic request sent by the client; wherein the diagnostic request is a diagnostic request processed by asymmetric encryption; A setting unit, used to set a maximum waiting time for replying to the client; An acquisition unit, used to acquire a verification processing result according to a preset time period; wherein the verification processing result includes verification incomplete, verification passed, or verification failed; A sending unit, configured to send the obtained verification processing result to the client if a verification processing result of passing or failing the verification is obtained within the maximum waiting time; A loop unit is used to send preset information to the client and update the maximum waiting time if only a verification processing result of incomplete verification is obtained within the maximum waiting time, and return to execute the verification processing result according to the preset time period, until a verification processing result of passed or failed verification is obtained; wherein the preset information is used to prompt that the diagnostic request is being processed and a final response cannot be given temporarily.
7. The device according to claim 6, characterized in that The acquisition unit comprises: A query subunit, used to query the encryption module for the verification processing result according to the time period, and set a maximum query waiting time for each query; A first determining unit, configured to determine that the verification processing result is verification passed if the query waiting time does not reach the maximum query waiting time and the diagnosis request has been verified; A second determining unit, configured to determine that the verification processing result is verification failure if the query waiting time does not reach the maximum query waiting time and the diagnosis request verification fails; The third determining unit is configured to determine that the verification processing result is verification incomplete if the query waiting time reaches the maximum query waiting time and the diagnosis request verification is incomplete.
8. The device according to claim 6, characterized in that The calling unit comprises: An acquisition subunit, used for acquiring the encrypted file in the diagnosis request; A first calling subunit is used to call the encryption module to find out the public key corresponding to the encrypted file; The second calling subunit is used to call the encryption module to decrypt the encrypted file using the public key.
9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.
10. A computer storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
