Secure operation method and chip
By dividing the target computing task into subtasks and switching execution on multi-core heterogeneous chips, the hardware domain waiting problem in SoC is solved, and the response speed and user experience of the security module are improved.
Patent Information
- Application Number
- CN202410749336.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-27
AI Technical Summary
In an SoC, when a certain hardware domain uses a security module for encryption, decryption or data integrity verification for a long time, other hardware domains must wait for its computing tasks to be completed, resulting in large delays and reducing user experience and system security.
By dividing the target computing task into multiple subtasks, and switching to the next computing task after the security module completes one subtask, the hard isolation characteristics of multi-core heterogeneous chips are used to achieve the security module's response speed to computing requests in multiple hardware domains. promote.
This improves the response speed of the security module to computing requests from multiple hardware domains, improves user experience, and avoids the delay of waiting for all current computing tasks to be completed.
Smart Images

Figure CN118709237A
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a secure computing method and chip. Background Art
[0002] To improve security, most SoCs (System on Chip) have hardware security modules for secure computing. When the SoC is divided into multiple hardware domains, a security module is not configured for each hardware domain. Instead, a security module is usually set up in only one hardware domain, and the other hardware domains share the security module.
[0003] When a hardware domain uses a security module for a long time (for example, encryption and decryption of a large file or data integrity verification), other hardware domains must wait for the security module to complete the computing tasks of the hardware domain before they can use the security module, resulting in a large delay and reducing the user experience and system security. Summary of the invention
[0004] The embodiments of the present application provide a secure computing method and chip, which divide a target computing task into multiple subtasks to improve the response speed of a security module to computing requests of multiple hardware domains.
[0005] In a first aspect, a secure computing method is provided, which is applied to a chip with multi-core heterogeneous characteristics, wherein the chip includes multiple hardware domains that are hard-isolated from each other, and at least one of the hardware domains is provided with a security module for performing secure computing, and the method includes: the security module obtains computing requests sent by other hardware domains in the chip; if there are multiple computing requests, the security module determines a target computing request from each of the computing requests according to a preset arbitration rule; the security module determines an execution time of a target computing task corresponding to the target computing request, and if the execution time is greater than a preset time, the security module divides the target computing task into multiple subtasks; The security module executes each subtask of the target computing task and the next computing task corresponding to the next computing request according to a preset switching method, and the next computing request is a new target computing request determined from each computing request according to the preset arbitration rule; wherein the preset switching method includes: after each execution of a subtask of the target computing task, if the next computing task exists, executing the next computing task; after each execution of the next computing task or a subtask of the next computing task, if there is still an unexecuted subtask in the target computing task, executing the next subtask in the target computing task.
[0006] In a second aspect, a chip is provided, wherein the chip has a multi-core heterogeneous feature, the chip includes a plurality of hardware domains that are hard-isolated from each other, at least one of the hardware domains is provided with a security module for performing secure computing, the security module includes a scheduling submodule, an arbitration submodule and an operation submodule, the scheduling submodule is configured to: obtain computing requests sent by other hardware domains in the chip; if there are multiple computing requests, determine a target computing request from each of the computing requests using the arbitration submodule according to a preset arbitration rule; determine an execution time of a target computing task corresponding to the target computing request, and if the execution time is greater than the preset time, divide the target computing task into a plurality of subtasks; and use The operation submodule executes each subtask of the target operation task and the next operation task corresponding to the next operation request according to a preset switching method, and the next operation request is a new target operation request determined from each operation request by the arbitration submodule according to the preset arbitration rule; wherein the preset switching method includes: after each execution of a subtask of the target operation task, if the next operation task exists, executing the next operation task; after each execution of the next operation task or a subtask of the next operation task, if there is still an unexecuted subtask in the target operation task, executing the next subtask in the target operation task.
[0007] By applying the above technical solution, the target computing task is divided into multiple subtasks that can be paused and reloaded. When the security module completes executing a subtask, it can switch to executing the next computing task, avoiding the need to wait for the current computing task to be completed before responding to new computing tasks in other hardware domains, thereby improving the security module's response speed to computing requests from multiple hardware domains and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0009] Figure 1 A flowchart of a secure computing method according to an embodiment of the present application;
[0010] Figure 2 A flowchart of processing execution environment information of subtasks in an embodiment of the present application;
[0011] Figure 3 A flowchart of the next subtask in executing the target computing task in an embodiment of the present application;
[0012] Figure 4 A flowchart of determining execution environment information of a subtask according to an embodiment of the present application;
[0013] Figure 5 A schematic diagram of the principle of the secure computing method according to an embodiment of the present application;
[0014] Figure 6 A schematic diagram of the current process of processing multiple computing requests;
[0015] Figure 7 A schematic diagram of a process of processing multiple computing requests according to an embodiment of the present application;
[0016] Figure 8 This is a structural block diagram of the security module of an embodiment of the present application. DETAILED DESCRIPTION
[0017] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0018] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0019] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0020] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0021] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0022] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0023] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0024] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0025] Before describing the embodiments of the present application in detail, the technical names and terms involved in the embodiments of the present application are first described.
[0026] 1) Multi-core heterogeneity refers to a chip architecture design that integrates multiple processing cores (cores) and at least two of these cores are different in structure, function or performance. Some tasks may be more suitable for high-performance general-purpose processor cores, while other tasks may require more specialized processor cores to improve efficiency. Multi-core heterogeneity can better balance factors such as performance, power consumption and cost, and provide more flexible and efficient solutions.
[0027] 2) Hard isolation: The system on chip (SOC) integrates multiple hardware components, such as the central processing unit (CPU), memory controller, and graphics processing unit (GPU). These hardware resources are configured into multiple sets of different hardware components, called hardware domains. Each operating system runs independently in each hardware domain. Each hardware domain works independently to prevent mutual interference or influence, thereby improving the reliability, stability, and anti-interference ability of the SOC.
[0028] A secure computing method according to an embodiment of the present application divides a target computing task into a plurality of subtasks that can be paused and reloaded, thereby increasing the response speed of the security module to computing requests of multiple hardware domains and improving the user experience.
[0029] The method is applied to a chip with multi-core heterogeneous characteristics, wherein the chip includes a plurality of hardware domains that are hard-isolated from each other, and at least one of the hardware domains is provided with a security module for performing security operations, such as Figure 1 As shown, the method comprises the following steps:
[0030] Step S101: the security module obtains a computing request sent by other hardware domains in the chip.
[0031] In this embodiment, the chip has a multi-core heterogeneous feature, including multiple hardware domains that are hard-isolated from each other, and at least one hardware domain is provided with a security module for performing security operations. Security operations may include but are not limited to identity authentication, encrypted communication, data integrity verification, digital signatures and other operations. When other hardware domains need to perform security operations, they call the security module by sending a calculation request to the security module.
[0032] The other hardware domain that sends the operation request can be one hardware domain or multiple hardware domains. One other hardware domain can send one or more operation requests. Other hardware domains can use inter-core communication to send operation requests to the hardware domain where the security module is located, so that the security module obtains the operation request. Among them, inter-core communication refers to the communication between different hardware domains within the SoC, which can be asynchronously transmitted through the mailbox mechanism and realize data sharing across hardware domains through the shared memory mechanism.
[0033] Step S102 : if there are multiple computing requests, the security module determines a target computing request from the computing requests according to a preset arbitration rule.
[0034] In this embodiment, the operation request may be one or more. If there are multiple operation requests, the security module needs to process them in sequence. The security module is provided with a preset arbitration rule, and each operation request is arbitrated according to the preset arbitration rule to determine the target operation request that needs to be processed currently.
[0035] Optionally, the preset arbitration rules can be set according to the priority of the operation request, the arrival time of the operation request, or the priority of the hardware domain corresponding to the operation request, for example, the operation request with the highest priority is processed first, or the operation request that arrives first is processed first, or for operation requests of the same priority, the operation request that arrives first is processed first, etc.
[0036] Optionally, multiple preset arbitration rules may be set, and different preset arbitration rules correspond to the working modes of the chip. For example, different preset arbitration rules are used when the chip is in the working mode and the low power consumption mode.
[0037] Step S103, the security module determines the execution time of the target computing task corresponding to the target computing request, and if the execution time is greater than a preset time, the security module divides the target computing task into a plurality of subtasks.
[0038] In this embodiment, the security module determines the corresponding target computing task according to the target computing request, and determines the execution time of the target running task. If the execution time is longer than the preset time, it means that the target running task needs a long time to be executed. The security module divides the target computing task into multiple subtasks, and then switches to the next computing task corresponding to the next computing request after each subtask is executed. Each subtask may correspond to a different computing stage in the target computing task.
[0039] Optionally, the time required to process different amounts of data is different. The security module can determine the amount of data to be processed based on the target computing task, and determine the execution time of the target running task based on the amount of data to be processed. Alternatively, different types of security algorithms may also affect the execution time of the task. The security module can also determine the amount of data to be processed and the type of security algorithm to be used based on the target computing task, and determine the execution time based on the amount of data and the type of security algorithm.
[0040] In step S104, the security module executes each subtask of the target computing task and a next computing task corresponding to a next computing request according to a preset switching mode, wherein the next computing request is a new target computing request determined from the computing requests according to the preset arbitration rule.
[0041] In this embodiment, the next computing request is a new target computing request determined from each computing request according to a preset arbitration rule. For example, if there are three computing requests including request 1, request 2, and request 3, the target computing request determined from the three computing requests according to the preset arbitration rule is request 1, and the new target computing request determined from request 2 and request 3 according to the preset arbitration rule is request 3, then request 3 is the next computing request. Alternatively, when executing the computing task of request 1, request 4 is received, and the new target computing request determined from request 2, request 3, and request 4 according to the preset arbitration rule is request 4, then request 4 is the next computing request.
[0042] The preset switching method includes: after each execution of a subtask of the target computing task, if there is a next computing task, execute the next computing task; after each execution of the next computing task or a subtask of the next computing task, if there is an unexecuted subtask in the target computing task, execute the next subtask in the target computing task.
[0043] After dividing the target computing task into multiple subtasks, the security module starts to execute the subtasks of the target computing task and the next computing task corresponding to the next computing request alternately according to the preset switching method. After each execution of a subtask of the target computing task, if there is a next computing task, the execution of the current target computing task is suspended and the execution is switched to the next computing task.
[0044] Similar to the target computing task, if the execution time of the next computing task is longer than the preset time, the next computing task is also divided into multiple subtasks. When executing the next computing task, each subtask is executed in sequence. If the execution time of the next computing task is not longer than the preset time, the next computing task is directly executed. After the security module completes the execution of the next computing task or a subtask of the next computing task each time, if there are still unexecuted subtasks in the target computing task, the next subtask in the target computing task will continue to be executed.
[0045] It should be noted that the next subtask is relative to the subtask that has been executed this time in the target computing task. For example, if the target computing task is divided into subtask 1, subtask 2 and subtask 3 that need to be executed in sequence, if the subtask that has been executed this time is subtask 1, then the next subtask is subtask 2; if the subtask that has been executed this time is subtask 2, then the next subtask is subtask 3.
[0046] It can be understood that after the security module completes the execution of a subtask of the target computing task each time, if there is no next computing task and there are still unexecuted subtasks in the target computing task, it will continue to execute the next subtask of the target computing task; if there is no next computing task and there are no unexecuted subtasks in the target computing task, it will be determined that the target computing task has been completed.
[0047] It can be understood that after the security module completes the execution of the next computing task or a subtask of the next computing task each time, if there is no unexecuted subtask in the target computing task, it determines that the target computing task has been executed, and judges whether there is an unexecuted subtask in the next computing task and whether there is a new next computing task. If there is an unexecuted subtask in the next computing task and there is no new next computing task, the next subtask of the next computing task is executed; if there is a new next computing task, it switches to executing the new next computing task or the subtask of the new next computing task.
[0048] For example, if the security module obtains three computing requests, namely, request 1, request 2 and request 3, and the target computing request determined from each computing request according to the preset arbitration rule is request 1, the computing task of request 1 is divided into subtask 1, subtask 2 and subtask 3, request 2 is the next computing request, and the execution time of the computing task of request 2 is less than the preset time, then after the security module executes subtask 1, it switches to executing the computing task of request 2. After executing the computing task of request 2, the security module switches to executing subtask 2. At this time, request 3 is the next computing request, and the execution time of the computing task of request 3 is less than the preset time, after the security module executes subtask 2, it switches to executing the computing task of request 3. After executing the computing task of request 3, the security module switches to executing subtask 3, and ends after executing subtask 3.
[0049] If the execution time of the calculation task of request 2 is not less than the preset time, the calculation task of request 2 is divided into subtask 4 and subtask 5, and the execution time of the calculation task of request 3 is less than the preset time, then after the security module executes subtask 1, it switches to execute subtask 4. After executing subtask 4, the security module switches to execute subtask 2. At this time, request 3 is the next calculation request. After the security module executes subtask 2, it switches to execute the calculation task of request 3. After executing the calculation task of request 3, the security module switches to execute subtask 3. After executing subtask 3, the security module switches to execute subtask 5 and ends after executing subtask 5.
[0050] The secure computing method of the embodiment of the present application is applied to a chip with multi-core heterogeneous characteristics, the chip includes multiple hardware domains that are hard-isolated from each other, and at least one hardware domain is provided with a security module for performing secure computing, the method includes: the security module obtains computing requests sent by other hardware domains in the chip; if there are multiple computing requests, the security module determines the target computing request from each computing request according to a preset arbitration rule; the security module determines the execution time of the target computing task corresponding to the target computing request, if the execution time is greater than the preset time, the security module divides the target computing task into multiple subtasks; the security module executes each subtask of the target computing task and the next computing task corresponding to the next computing request according to a preset switching mode, and the next computing request is a new target computing request determined from each computing request according to the preset arbitration rule. By dividing the target computing task into multiple subtasks that can be paused and reloaded, when the security module completes a subtask, it can switch to executing the next computing task, avoiding the need to wait for the current computing task to be fully executed before responding to the new computing tasks of other hardware domains, thereby improving the response speed of the security module to computing requests of multiple hardware domains and improving the user experience.
[0051] In some embodiments of the present application, after each execution of a subtask of the target computing task, such as Figure 2 As shown, the following steps are also included:
[0052] Step S21: the security module determines the execution environment information corresponding to the executed subtask.
[0053] In this embodiment, the execution environment information is the context of the executed subtask, which represents the execution environment required to execute the subtask, for example, including the program counter, stack pointer, general registers and the like.
[0054] Step S22: the security module saves the execution environment information.
[0055] In this embodiment, the security module executes the next subtask in the target computing task according to the execution environment information. After each execution of a subtask of the target computing task, the security module determines the execution environment information corresponding to the executed subtask and saves the execution environment information. Subsequently, the next subtask in the target computing task is executed by reloading the execution environment information, thereby ensuring that the security module accurately executes the next subtask.
[0056] In some embodiments of the present application, the security module performs the steps of saving the execution environment information of the completed subtask and executing the next computing task in parallel, thereby improving efficiency.
[0057] In some embodiments of the present application, the security module stores the execution environment information, including:
[0058] The security module saves the execution environment information to a secure storage area of the hardware domain through a pipeline mode.
[0059] In this embodiment, pipelining is a process of pre-fetching and pre-storing, which can be implemented through registers. Saving the execution environment information through the pipeline mode can achieve smoother saving of the execution environment information, and by saving the execution environment information to the secure storage area of the hardware domain, it is ensured that only the security module can access the execution environment information, thereby further improving security.
[0060] In some embodiments of the present application, the next subtask in the target computing task is executed, such as Figure 3 As shown, the following steps are included:
[0061] Step S31: the security module loads the execution environment information through a pipeline mode.
[0062] In this embodiment, when executing the next subtask, the security module first loads the execution environment information through the pipeline mode.
[0063] Step S32: the security module executes the next subtask in the target computing task according to the execution environment information.
[0064] The security module executes the next subtask in the target computing task through the loaded execution environment information, thereby ensuring the smooth execution of each subtask and improving the task processing efficiency.
[0065] In this embodiment, the security module determines the execution environment information corresponding to the executed subtask, such as Figure 4 As shown, the following steps are included:
[0066] Step S41: the security module determines a target security algorithm corresponding to the target computing task.
[0067] In this embodiment, the execution environment information is related to the target security algorithm. The security module needs to determine the target security algorithm first. The security module can determine the target security algorithm corresponding to the target computing task based on the correspondence between different computing tasks and different security algorithms.
[0068] Step S42: The security module determines the execution environment information according to the target security algorithm.
[0069] After determining the target security algorithm, the security module can accurately determine the execution environment information according to the target security algorithm or the mode of the target security algorithm.
[0070] In the specific application scenario of this application, the execution environment information is the context. Taking the target security algorithm as the AES / SM4 algorithm as an example, the context corresponding to each mode is shown in Table 1.
[0071] Table 1
[0072]
[0073]
[0074] It can be seen from Table 1 that when the target security algorithm is the AES / SM4 algorithm and the ECB mode is used, since there is no context, the execution environment information corresponding to the executed subtask is not saved. When the target security algorithm is the AES / SM4 algorithm and other modes except the ECB mode are used, the execution environment information corresponding to the executed subtask needs to be saved.
[0075] In some embodiments of the present application, the security module executes the target computing task through a target security algorithm, and the target security algorithm includes a group symmetric encryption algorithm or a hash algorithm. When the target security algorithm is the group symmetric encryption algorithm, a single subtask corresponds to one or more first data blocks, and when the target security algorithm is the hash algorithm, a single subtask corresponds to one or more second data blocks.
[0076] In this embodiment, the security module performs the target computing task through the target security algorithm, and the target security algorithm includes a group symmetric encryption algorithm or a hash algorithm. The group symmetric encryption algorithm is an encryption technology that divides the plaintext data into blocks of fixed size, and then uses the same key to encrypt and decrypt each block, which can protect the confidentiality, integrity and availability of the data, and ensure that the data is not illegally accessed or tampered with during transmission and storage. The group symmetric encryption algorithm specifically includes DES (Data Encryption Standard), AES (Advanced Encryption Standard) and SM4, etc.
[0077] Hash algorithm, also known as HASH algorithm, is an algorithm that compresses a message of any length into an output of a fixed length. Its characteristic is that changes in input data will lead to changes in output results, but changes in output results will not affect the input data in turn. Therefore, HASH algorithm is widely used in data integrity verification, digital signatures, cryptography and other fields. Commonly used HASH algorithms include SHA-1, SHA-2, SM3, etc.
[0078] When the target security algorithm is a group symmetric encryption algorithm, a single subtask corresponds to one or more first data blocks, and a first data block corresponds to a group in the group symmetric encryption algorithm. When the target security algorithm is the hash algorithm, a single subtask corresponds to one or more second data blocks.
[0079] In a specific application scenario, when the group symmetric encryption algorithm uses the AES / SM4 algorithm, the first data block is 128 bits. When the hash algorithm uses SHA-2 or SHA-512, the second data block is 512 bits, and when the hash algorithm uses SHA-256 or SM3, the second data block is 256 bits. It can be seen that the first data block or the second data block is a data block with a very small amount of data, and the time for the security module to execute a single subtask is only about a few hundred nanoseconds to a few microseconds. Therefore, when the security module completes a subtask, it can switch to executing the next computing task, which can greatly reduce the delay in responding to computing requests.
[0080] Those skilled in the art may adopt other security algorithms that can be executed according to divided data blocks as target security algorithms as needed, which does not affect the protection scope of the present application.
[0081] In some embodiments of the present application, after determining the execution time of the target computing task corresponding to the target computing request, the security module further includes:
[0082] If the execution time is not greater than the preset time, the security module executes the target computing task, and after completing the target computing task, executes the next computing task.
[0083] In this embodiment, if the execution time of the target computing task is not greater than the preset time, it means that the execution time of the target computing task is short, and it does not need to be divided into multiple subtasks. The target computing task is directly executed. After the execution is completed, the next computing task is executed, thereby improving the computing efficiency.
[0084] In some embodiments of the present application, after obtaining the operation request sent by other hardware domains in the chip, the security module further includes:
[0085] If the number of the computing request is one, the security module executes the computing task corresponding to the computing request.
[0086] In this embodiment, if there is only one computing request, there is no need to perform task switching, and the security module executes the computing task corresponding to the computing request, thereby improving computing efficiency.
[0087] In order to further explain the technical idea of the present application, the technical solution of the present invention is now described in combination with specific application scenarios.
[0088] The embodiment of the present application provides a secure computing method, which is applied to a chip with multi-core heterogeneous characteristics, wherein the chip includes multiple hardware domains that are hard-isolated from each other, and at least one hardware domain is provided with a security module for performing secure computing, such as Figure 5 As shown, the security module is provided with a scheduling submodule, an arbitration submodule and an operation submodule, and the method comprises the following steps:
[0089] Step S201, the scheduling submodule obtains multiple computing requests (Req0, Req1, ..., Reqn) sent by other hardware domains in the chip.
[0090] Step S202 : the scheduling submodule determines a target computing request from each computing request using the arbitration submodule according to a preset arbitration rule.
[0091] Step S203, the scheduling submodule determines the execution time of the target computing task corresponding to the target computing request, and if the execution time is greater than the preset time, divides the target computing task into a plurality of subtasks.
[0092] Step S204 , the scheduling submodule uses the computing submodule to execute the subtasks of the target computing task and the next computing task corresponding to the next computing request in a preset switching manner.
[0093] The next operation request is a new target operation request determined by the scheduling submodule from each operation request using the arbitration submodule according to the preset arbitration rules. The operation submodule uses a group symmetric encryption algorithm or a hash algorithm to perform the operation task. The preset switching method includes: after each execution of a subtask of the target operation task, if there is a next operation task, execute the next operation task; after each execution of the next operation task or a subtask of the next operation task, if there is an unexecuted subtask in the target operation task, execute the next subtask in the target operation task.
[0094] Among them, after each execution of a subtask of the target computing task, the context (i.e., execution environment information) corresponding to the executed subtask is saved to the secure storage area of the hardware domain through the pipeline mode, and the context corresponding to each subtask includes context0, context1, ... contextn. When executing the next subtask in the target computing task, the corresponding context is loaded from the secure storage area through the pipeline mode, and the next subtask in the target computing task is executed according to the loaded context.
[0095] For example, if the obtained operation requests include Req0, Req1, and Req2, the execution time of the symmetric encryption task corresponding to Req0 is greater than the preset time, and the execution time of the symmetric encryption tasks corresponding to Req1 and Req2 is not greater than the preset time, then:
[0096] If we use the current method of processing multiple operation requests, such as Figure 6 As shown in the figure, the Req0 symmetric encryption task is executed first, and after the Req0 symmetric encryption task is completed, the Req1 symmetric encryption task is switched to be executed, and after the Req1 symmetric encryption task is completed, the Req2 symmetric encryption task is switched to be executed. Since the Req1 symmetric encryption task and the Req2 symmetric encryption task need to wait until the Req0 symmetric encryption task is completed before they can be executed, the delay in responding to Req1 and Req2 is relatively large.
[0097] If the security calculation method of the embodiment of the present application is used, Figure 7As shown, the Req0 symmetric encryption task is divided into multiple subtasks including Req0 subtask 1, Req0 subtask 2, and Req0 subtask 3. Req0 subtask 1 is executed first, and after Req0 subtask 1 is completed, it switches to executing the Req1 symmetric encryption task. After completing the Req1 symmetric encryption task, it switches to executing the Req0 subtask 2. After completing the Req0 subtask 2, it switches to executing the Req2 symmetric encryption task. After completing the Req2 symmetric encryption task, it switches to executing the Req0 subtask 3. It can be seen that after executing Req0 subtask 1, it can switch to executing the Req1 symmetric encryption task. After executing Req0 subtask 2, it can switch to executing the Req2 symmetric encryption task. It is realized that there is no need to wait for the Req0 symmetric encryption task to be fully executed before responding to the symmetric encryption tasks of Req1 and Req2, which greatly improves the speed of responding to Req1 and Req2.
[0098] By applying the above technical solution, the following technical effects are achieved:
[0099] 1) The switching of computing tasks between different hardware domains can be performed based on a subtask, which greatly speeds up the response speed of small data requests.
[0100] 2) Only a small amount of logic is added, the chip cost does not increase, and the overall performance is not reduced.
[0101] 3) The performance of executing large data computing tasks has not decreased.
[0102] 4) The delay in responding to multiple computing requests is reduced, improving the user experience.
[0103] The present application also proposes a chip having a multi-core heterogeneous characteristic. The chip includes a plurality of hardware domains that are hard-isolated from each other. At least one hardware domain is provided with a security module for performing security operations, such as Figure 8As shown, the security module includes a scheduling submodule 201, an arbitration submodule 202 and an operation submodule 203, and the scheduling submodule 201 is configured to: obtain operation requests sent by other hardware domains in the chip; if there are multiple operation requests, determine the target operation request from each operation request by using the arbitration submodule 202 according to the preset arbitration rule; determine the execution time of the target operation task corresponding to the target operation request, and if the execution time is greater than the preset time, divide the target operation task into multiple subtasks; use the operation submodule 203 to execute each subtask of the target operation task and the next operation task corresponding to the next operation request according to the preset switching mode, and the next operation request is a new target operation request determined from each operation request by using the arbitration submodule 202 according to the preset arbitration rule; wherein the preset switching mode includes: after each execution of a subtask of the target operation task, if there is a next operation task, execute the next operation task; after each execution of the next operation task or a subtask of the next operation task, if there is an unexecuted subtask in the target operation task, execute the next subtask in the target operation task.
[0104] In a specific application scenario, the security module also includes a storage submodule, and the scheduling submodule 201 is further configured to: after using the operation submodule 203 to execute a subtask of the target operation task, determine the execution environment information corresponding to the executed subtask; use the storage submodule to save the execution environment information; wherein the operation submodule 203 executes the next subtask in the target operation task based on the execution environment information obtained from the storage submodule.
[0105] In a specific application scenario, the scheduling submodule 201 is further configured to: save the execution environment information to a secure storage area of the hardware domain using the storage submodule in a pipeline mode.
[0106] In a specific application scenario, the scheduling submodule 201 is specifically configured to: load the execution environment information through a pipeline mode; and execute the next subtask in the target computing task according to the execution environment information.
[0107] In a specific application scenario, the scheduling submodule 201 is specifically configured to: determine a target safety algorithm corresponding to the target computing task; and determine the execution environment information according to the target safety algorithm.
[0108] In a specific application scenario, the operation submodule 203 executes the target operation task through a target security algorithm, and the target security algorithm includes a group symmetric encryption algorithm or a hash algorithm. When the target security algorithm is the group symmetric encryption algorithm, a single subtask corresponds to one or more first data blocks, and when the target security algorithm is the hash algorithm, a single subtask corresponds to one or more second data blocks.
[0109] In a specific application scenario, the scheduling submodule 201 is further configured to: if the execution duration is not greater than the preset duration, use the operation submodule 203 to execute the target operation task, and after executing the target operation task, execute the next operation task.
[0110] In a specific application scenario, the scheduling submodule 201 is further configured to: if the operation request is one, use the operation submodule 203 to execute the operation task corresponding to the operation request.
[0111] The chip of the embodiment of the present application has a multi-core heterogeneous feature, including multiple hardware domains that are hard-isolated from each other. At least one hardware domain is provided with a security module for performing secure operations. The security module includes a scheduling sub-module, an arbitration sub-module and an operation sub-module. By dividing the target operation task into multiple sub-tasks that can be paused and reloaded, when the security module completes executing a sub-task, it can switch to executing the next operation task, avoiding the need to wait for the current operation task to be completed before responding to new operation tasks of other hardware domains, thereby improving the response speed of the security module to the operation requests of multiple hardware domains and improving the user experience.
[0112] For other embodiments of a chip of the present application, please refer to the relevant embodiments of a secure computing method of the present application.
[0113] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0114] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A secure computing method, characterized in that: Applied to a chip with multi-core heterogeneous characteristics, the chip includes a plurality of hardware domains that are hard-isolated from each other, at least one of the hardware domains is provided with a security module for performing security computing, the method includes: The security module obtains operation requests sent by other hardware domains in the chip; If there are multiple computing requests, the security module determines a target computing request from each computing request according to a preset arbitration rule; The security module determines the execution time of the target computing task corresponding to the target computing request, and if the execution time is greater than a preset time, the security module divides the target computing task into a plurality of subtasks; The security module executes each subtask of the target computing task and a next computing task corresponding to a next computing request according to a preset switching mode, wherein the next computing request is a new target computing request determined from the computing requests according to the preset arbitration rule; Among them, the preset switching method includes: after each execution of a subtask of the target computing task, if the next computing task exists, execute the next computing task; after each execution of the next computing task or a subtask of the next computing task, if there are still unexecuted subtasks in the target computing task, execute the next subtask in the target computing task.
2. The secure computing method according to claim 1, wherein: After each execution of a subtask of the target computing task, the method further includes: The security module determines execution environment information corresponding to the executed subtask; The security module stores the execution environment information; The security module executes the next subtask in the target computing task according to the execution environment information.
3. The secure computing method according to claim 2, wherein: The security module stores the execution environment information, including: The security module saves the execution environment information to a secure storage area of the hardware domain through a pipeline mode.
4. The secure computing method according to claim 2, wherein: Executing the next subtask in the target computing task includes: The security module loads the execution environment information through a pipeline mode; The security module executes the next subtask in the target computing task according to the execution environment information.
5. The secure computing method according to claim 2, wherein: The security module determines execution environment information corresponding to the executed subtask, including: The security module determines a target security algorithm corresponding to the target computing task; The security module determines the execution environment information according to the target security algorithm.
6. The secure computing method according to claim 1, wherein: The security module executes the target computing task through a target security algorithm, and the target security algorithm includes a group symmetric encryption algorithm or a hash algorithm. When the target security algorithm is the group symmetric encryption algorithm, a single subtask corresponds to one or more first data blocks, and when the target security algorithm is the hash algorithm, a single subtask corresponds to one or more second data blocks.
7. The secure computing method according to claim 1, wherein: After determining the execution time of the target computing task corresponding to the target computing request, the security module further includes: If the execution time is not greater than the preset time, the security module executes the target computing task, and after completing the target computing task, executes the next computing task.
8. The secure computing method according to claim 1, wherein: After obtaining the operation request sent by other hardware domains in the chip, the security module further includes: If the number of the computing request is one, the security module executes the computing task corresponding to the computing request.
9. A chip, characterized in that: The chip has a multi-core heterogeneous feature, and includes a plurality of hardware domains that are hard-isolated from each other. At least one of the hardware domains is provided with a security module for performing security operations. The security module includes a scheduling submodule, an arbitration submodule, and an operation submodule. The scheduling submodule is configured as follows: Get the operation requests sent by other hardware domains in the chip; If there are multiple computing requests, the arbitration submodule is used to determine a target computing request from each computing request according to a preset arbitration rule; Determine the execution time of the target computing task corresponding to the target computing request, and if the execution time is greater than a preset time, divide the target computing task into a plurality of subtasks; Utilizing the computing submodule to execute each subtask of the target computing task and a next computing task corresponding to a next computing request in a preset switching manner, wherein the next computing request is a new target computing request determined from the computing requests by the arbitration submodule according to the preset arbitration rule; Among them, the preset switching method includes: after each execution of a subtask of the target computing task, if the next computing task exists, execute the next computing task; after each execution of the next computing task or a subtask of the next computing task, if there are still unexecuted subtasks in the target computing task, execute the next subtask in the target computing task.
10. The chip according to claim 9, characterized in that: The security module further includes a storage submodule, and the scheduling submodule is further configured to: After executing a subtask of the target computing task using the computing submodule, determining the execution environment information corresponding to the executed subtask; Using the storage submodule to save the execution environment information; The operation submodule executes the next subtask in the target operation task according to the execution environment information obtained from the storage submodule.
