Task allocation method and device, electronic equipment, storage medium and chip

By segmenting the data to be processed in the Leighton-Micali signature scheme and allocating tasks according to the ratio of the computing speed of the hash module to the processor and the number of hash operations, the problem of unbalanced task allocation is solved, and efficient computing of the hash module and the processor is achieved.

CN119988004BActive Publication Date: 2026-01-09BEIJING X RING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510034466.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2026-01-09
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

In the Leighton-Micali signature scheme, the uneven distribution of tasks leads to the underutilization of the computing power of the hash module and the processor, affecting processing efficiency.

Method used

By segmenting the data to be processed, and based on the hash operation rate ratio between the hash module and the processor and the number of hash operations for each segment, the hash processing task is precisely allocated to the hash module and/or the processor to ensure that the workload matches the operation rate.

Benefits of technology

It achieves balanced task allocation, maximizes the computing power of the hash module and the processor, and significantly improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988004B_ABST
    Figure CN119988004B_ABST
Patent Text Reader

Abstract

The application provides a task allocation method and device, electronic equipment, a storage medium and a chip. The method comprises the following steps: segmenting to-be-processed data to obtain at least one segmented data; and allocating hash processing tasks of the segmented data to a hash module and / or a processor according to a hash operation rate ratio between the hash module and the processor and according to a hash operation number of each segmented data. Through task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing tasks can be accurately allocated to the hash module and / or the processor, so that the task amount borne by each of the hash module and the processor is matched with the operation rate thereof. This allocation mode not only balances the task allocation, but also maximizes the operation capacity of the hash module and the processor, thereby significantly improving the processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a task allocation method and device, electronic equipment, storage medium and chip. BACKGROUND

[0002] Leighton-Micali signature (LMS) is one of the most representative schemes in Hash-Based Signature (HBS). In the signature and verification scenarios, multiple hash operations are required for each segmented data of the to-be-signed data. However, the number of hash operations for each segmented data may be the same or different. If the hash processing tasks of the segmented data are simply allocated according to the number of the segmented data, the problem of unbalanced task allocation exists. SUMMARY

[0003] The present application aims to at least solve one of the technical problems in the related art to some extent.

[0004] To this end, the present application provides a task allocation method and device, electronic equipment, storage medium and chip to achieve balanced task allocation, fully utilize the computing capacity of the hash module and the processor, and improve the processing efficiency.

[0005] An embodiment of the present application provides a task allocation method, including:

[0006] segmenting the to-be-processed data to obtain at least one segmented data;

[0007] allocating the hash processing tasks of the segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the number of hash operations of each segmented data.

[0008] Another embodiment of the present application provides a task allocation device, including:

[0009] a segmentation module, configured to segment the to-be-processed data to obtain at least one segmented data;

[0010] a distribution module, configured to allocate the hash processing tasks of the segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the number of hash operations of each segmented data.

[0011] Another aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to the preceding aspect when executing the program.

[0012] Another aspect of the present application provides a non-transitory computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method according to the preceding aspect.

[0013] Another aspect of the present application provides a chip, comprising a processing circuit, wherein the processing circuit is configured to implement the method according to the preceding aspect.

[0014] Another aspect of the present application provides a computer program product, comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the method according to the preceding aspect.

[0015] The task allocation method, device, electronic device, storage medium and chip provided by the present application perform segmented processing on the to-be-processed data to obtain at least one segmented data, allocate the hash processing tasks of each segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the hash operation times of each segmented data, and perform task allocation based on the hash operation rate ratio between the hash module and the processor. In this way, the hash processing tasks can be accurately allocated to the hash module and / or the processor, so as to ensure that the task amount borne by each of them matches the operation rate thereof. This allocation manner not only realizes the balance of task allocation, but also maximizes the operation capacity of the hash module and the processor, thereby significantly improving the processing efficiency.

[0016] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0017] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the following drawings, in which:

[0018] Figure 1 A flowchart of a task allocation method provided by an embodiment of the present application;

[0019] Figure 2 A flowchart of another task allocation method provided by an embodiment of the present application;

[0020] Figure 3 A flowchart of another task allocation method provided by an embodiment of the present application;

[0021] Figure 4 Another task allocation method provided by an embodiment of the present application is shown in the flowchart.

[0022] Figure 5 A task allocation device provided by an embodiment of the present application is shown in the structural diagram.

[0023] Figure 6 A structure of an electronic device provided by an embodiment of the present application is shown in the structural diagram.

[0024] Figure 7 A structure of a chip provided by an embodiment of the present application is shown in the structural diagram. DETAILED DESCRIPTION

[0025] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.

[0026] In modern computer technology, system security is a key feature, in which cryptography algorithm is the core technology in the security field, and plays a key role in ensuring the authenticity, integrity and confidentiality of system and user data. Cryptography algorithm provides security services such as encryption, decryption, signature and verification for data through complex mathematical operations and logical design.

[0027] The current widely used security algorithm for digital signature authentication includes ECDSA (Elliptic Curve Digital Signature Algorithm), RSAPSS (RSA (Rivest-Shamir-Adleman, a kind of asymmetric encryption algorithm) Probabilistic Signature Scheme), the security of these public key cryptography algorithms is based on the well-known mathematical problems. For example, the security of ECDSA is based on the difficulty of discrete elliptic curve logarithm problem, and the security of RSA is based on the complexity of large integer factorization problem.

[0028] However, with the rapid development of quantum computing technology, the security of traditional cryptography algorithms has been severely challenged. Cryptography algorithms based on large integer factorization difficulty and discrete logarithm difficulty are no longer secure with the assistance of quantum computers. For example, shor quantum algorithm can crack the above mathematical problems in polynomial time, so the above algorithms are considered to be no longer secure after the quantum computing era.

[0029] In the related art, hash algorithms can play an obvious role in resisting quantum attacks, and LMS is one of the most representative schemes in hash-based signature schemes (HBS). In the signature and verification scenarios, the LMS needs to perform multiple hash operations on each segmented data of the to-be-signed data. However, the number of hash operations on each segmented data may be the same or different. If the hash processing tasks of the segmented data are simply allocated according to the number of the segmented data, there is an imbalance in task allocation. Moreover, most of the operations in the LMS scheme are implemented by hardware modules, and the computing power of the processor is not utilized.

[0030] Therefore, the present application provides a task allocation method. The to-be-processed data is segmented to obtain at least one segmented data. The hash processing tasks of the segmented data are allocated to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the number of hash operations of each segmented data. By allocating the tasks based on the hash operation rate ratio between the hash module and the processor, the hash processing tasks can be accurately allocated to the hash module and / or the processor, ensuring that the amount of tasks carried by each of them matches their own operation rate. This allocation method not only balances the task allocation, but also maximizes the computing power of the hash module and the processor, thereby significantly improving the processing efficiency.

[0031] The task allocation method, device, electronic device, storage medium, and chip of the embodiments of the present application are described below with reference to the accompanying drawings.

[0032] Figure 1 A flowchart of a task allocation method provided by an embodiment of the present application is shown.

[0033] The task allocation method of the embodiments of the present application is executed by a task allocation device. The task allocation device can be applied to any electronic device to enable the electronic device to perform a task allocation function.

[0034] The electronic device can be any device with computing power, such as a mobile terminal, which can be a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and the like, and can have various operating systems, touch screens, and / or display screens.

[0035] The task allocation method of the embodiments of the present application can also be executed by a chip.

[0036] The chip includes a neural network processor (NPU), a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a field-programmable gate array (FPGA), a system on a chip (SOC), a reduced instruction set computer (RISC), and the like, which are not listed one by one.

[0037] As shown in Figure 1 The method can include the following steps:

[0038] Step 101, segmenting the to-be-processed data to obtain at least one segmented data.

[0039] The to-be-processed data can be any form of data, including but not limited to text data, image data, numerical data, and the like.

[0040] In this embodiment, by segmenting the to-be-processed data, the to-be-processed data can be divided into at least one segmented data, thereby allowing parallel processing of each segmented data and improving processing efficiency.

[0041] The size and number of segments can be determined based on various influencing factors, including but not limited to the nature of the to-be-processed data, processing requirements, and the like.

[0042] As an example, for text data such as a long article or a large number of log records, the size and number of segments can be determined based on the structure and content of the text. For example, if the article is organized by paragraphs, each paragraph can be a segment, in addition, if the text contains a large number of keywords or content that needs to be frequently searched, the text can be divided into smaller units. For image data, the size and number of segments can be determined based on the resolution and features of the image. For example, when processing high-resolution images, the image can be divided into multiple smaller regions (such as image blocks), in addition, if the image contains multiple objects or scenes, the image can be divided according to the boundaries of the objects or changes in the scenes.

[0043] As another example, in order to meet the real-time processing requirement, the to-be-processed data can be divided into smaller segments for quick processing. Alternatively, in order to meet the accuracy processing requirement, the to-be-processed data can be divided into smaller segments to reduce errors and improve accuracy, for example, when the to-be-processed data is transaction data in the financial field, in order to meet the accuracy processing requirement, the transaction data can be divided into smaller time periods (such as minute level).

[0044] At step 102, the hash processing tasks of each segment data are allocated to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the hash operation number of each segment data.

[0045] In the formula, the hash operation rate ratio between the hash module and the processor is the ratio between the hash operation rate of the hash module and the hash operation rate of the processor, and the hash operation rate of the hash module and the hash operation rate of the processor respectively represent the number of hash operations that can be completed by the two in unit time.

[0046] In the formula, the hash module is a hash module externally attached to the current system architecture. The current system architecture refers to the overall structure of the software or hardware environment that is currently running or will be running, including operating system, hardware device, middleware, application program and other components. External attachment refers to adding or integrating additional components, modules or devices to the system outside or on the basis of the original system to enhance or expand the function of the system.

[0047] As an example, n hash modules can be externally attached to the current system, that is, n hash modules are additionally added or integrated in the current system architecture to enhance or expand the hash operation capability of the system.

[0048] In the formula, the number of hash modules can be adaptively configured according to actual hardware and software conditions.

[0049] Compared with the LMS scheme in which the number of hardware modules is mostly fixed, for multiple parameter types in the LMS parameter set, there must be a situation that part of the hardware modules are idle under a certain parameter type, for example, assuming that 34 hash modules are used, and the 34 hash modules just correspond to the parameter type LMOTS_SHA256_N32_W8, for other parameter types such as LMOTS_SHA256_N32_W1, at this time p = 265, the last round will have 27 hash modules idle, which has an additional power consumption overhead. In the embodiment of the application, the number of hash modules is adaptively configured according to actual hardware and software conditions, which can effectively reduce the idle of hash modules and reduce hardware cost and power consumption.

[0050] In the formula, the hash operation number of each segment data can be the same or different, which is not limited in the embodiment.

[0051] In this embodiment, by allocating tasks to each segmented data according to the hash operation rate ratio between the hash module and the processor and the hash operation times of each segmented data, it can be ensured that the hash module and the processor respectively undertake the task amount matching their operation rates when processing hash operations, achieving balanced task allocation while fully utilizing the operation capacity of the hash module and the processor and improving processing efficiency.

[0052] As an example, assuming that the hash operation rate ratio between the hash module and the processor is 1: m, and the hash module and the processor are both allocated hash processing tasks of corresponding segmented data, then m times of hash operations can be allocated to each hash module and 1 time of hash operation can be allocated to the processor before each operation is enabled, and then the operations are started at the same time. As a result, when the processor ends the operation, each hash module also just ends the operation. Compared with the case where only one hash module performs hash operation, the operation time of ((n-1)*m+1) / (m*n+1) can be saved, and compared with the case where only the processor performs hash operation, the operation time of (n*m) / (m*n+1) can be saved.

[0053] It should be noted that the number of hash operations to be performed in the hash processing task allocated to any hash module or processor can exceed the number of hash operations performed by the hash module or processor in a single execution.

[0054] As an example, the hash module 1 is allocated the hash processing task of the first segmented data and the hash processing task of the second segmented data, wherein the hash operation times of the first segmented data is 6, the hash operation times of the second segmented data is 4, and the hash operation rate ratio between the hash module and the processor is 1:4. Therefore, the hash module 1 will only perform the first 4 hash operations of the hash operation times required by the first segmented data in the first round of hash operation, and then continue to perform the hash operations that have not been performed in the next round of hash operation (for example, in the second round of hash operation, the last 2 hash operations of the hash operation times required by the first segmented data and the first 2 hash operations of the hash operation times required by the second segmented data are performed, and so on).

[0055] It should be noted that the hash module 1 performs the hash operation in the above examples in a certain order, so that through the explicit order, repeated processing can be avoided and no processing is missed. However, it can also be executed out of order as long as all executions are guaranteed. For example, the hash module 1 can perform 4 hash operations on the first segmented data in the first round of hash operation, perform 4 hash operations on the second segmented data in the second round of hash operation, perform the remaining 2 hash operations on the first segmented data in the third round of hash operation, or perform according to other out-of-order execution schemes, which are not limited in this embodiment.

[0056] In some embodiments, the number of hash operations of each segmented data is obtained by using the following determination process, which includes: in the signature scenario, determining the number of hash operations of each segmented data in the signature scenario according to the target parameters of the hash processing and each segmented data using a target function; or in the signature verification scenario, determining the number of hash operations of each segmented data in the signature verification scenario according to the number of hash operations of each segmented data in the signature scenario and the target parameters of the hash processing in the signature scenario.

[0057] As an example, in the signature scenario, the number of hash operations of each segmented data (a[0], …, a[p-1]) can be calculated according to w, Q through the formula a = coef (Q||Cksm (Q), i, w), wherein w is the target parameter of the hash processing, and w takes the value of 1, 2, 4, 8; Q is the data to be processed, and the segmented processing of the data to be processed Q can obtain p-1 segmented data, and the value of p is related to w, w = 1, p = 265; w = 2, p = 133; w = 4, p = 67; w = 8, p = 34; i refers to the i-th segmented data. In the signature verification scenario, the number of hash operations of each segmented data (b[0], …, b[p-1]) can be calculated according to a[0], …, a[p-1] and w, wherein b[i] = 2 w -1-a[i].

[0058] In the task allocation method of the embodiments of the present application, the data to be processed is segmented to obtain at least one segmented data, and the hash processing tasks of each segmented data are allocated to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the number of hash operations of each segmented data. Through the task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing tasks can be accurately allocated to the hash module and / or the processor, so that the task amount carried by each of them matches the operation rate of itself. This allocation method not only realizes the balance of task allocation, but also maximizes the operation capacity of the hash module and the processor, thereby significantly improving the processing efficiency.

[0059] Based on the above embodiments, Figure 2 Another task allocation method provided by the embodiments of the present application is shown in the flowchart, which illustrates how to allocate the hash processing tasks of each segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and the hash operation times of each segmented data, as shown in Figure 2 The method comprises the following steps:

[0060] Step 201, performing segmented processing on the to-be-processed data to obtain at least one segmented data.

[0061] In step 201, the related explanations and descriptions in the foregoing embodiments can be referred to for the same principles, which will not be described here again.

[0062] Step 202, determining the hash processing condition of the hash module according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segmented data, wherein the hash processing condition is used to indicate the ability of the hash module to process the hash processing task.

[0063] In the present embodiment, by comprehensively considering the hash operation rate ratio between the hash module and the processor (reflecting the processing speed of the hash module), the number of hash modules (determining the parallel processing ability) and the hash operation times of each segmented data (reflecting the actual data processing demand), the hash processing condition of the hash module is determined, which can make the determined hash processing condition more accurate and reasonable, and can more accurately indicate the ability of the hash module to process the hash processing task, thereby providing a strong basis for subsequent task allocation.

[0064] Step 203, allocating the hash processing tasks of each segmented data to the hash module and / or the processor according to the hash operation times of each segmented data and the hash processing condition of the hash module.

[0065] In the present embodiment, the hash processing tasks of each segmented data can be evenly allocated to the hash module and / or the processor according to the task demand (the hash operation times of each segmented data) and the ability of the hash module to process the hash processing task (the hash processing condition of the hash module), thereby ensuring the rationality and efficiency of task allocation, avoiding the situation that the hash processing tasks are concentrated in some hash modules to cause overload while the hash modules without allocated hash processing tasks are idle, and improving the processing efficiency.

[0066] The task allocation method of the embodiments of the present application comprises the following steps: segmenting the to-be-processed data to obtain at least one segment data; determining a hash processing condition of the hash module according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segment data, wherein the hash processing condition is used to indicate the capability of the hash module in processing the hash processing task; and allocating the hash processing task of each segment data to the hash module and / or the processor according to the hash operation times of each segment data and the hash processing condition of the hash module. By comprehensively considering the hash operation rate ratio between the hash module and the processor, the number of hash modules and the hash operation times of each segment data, the hash processing condition of the hash module can be determined more accurately, so that the task allocation is based on the capability of the hash module in processing the hash processing task (the hash processing condition) and the task demand (the hash operation times of each segment data), which can effectively ensure the rationality and efficiency of the task allocation, avoid the situation that some hash modules are overloaded due to the concentration of hash processing tasks and some hash modules are idle, and improve the processing efficiency.

[0067] Based on the above embodiments, Figure 3 The flowchart of another task allocation method provided by the embodiments of the present application is shown in FIG. 6, which illustrates how to allocate the hash processing task of each segment data to the hash module and / or the processor according to the hash operation times of each segment data and the hash processing condition of the hash module. As shown in FIG. 6, the method comprises the following steps: Figure 3

[0068] Step 301: segmenting the to-be-processed data to obtain at least one segment data.

[0069] Step 302: determining a hash processing condition of the hash module according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segment data, wherein the hash processing condition is used to indicate the capability of the hash module in processing the hash processing task.

[0070] In the embodiments of the present application, the to-be-processed data is segmented to obtain at least one segment data, and the hash processing condition of the hash module is determined according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segment data, wherein the hash processing condition is used to indicate the capability of the hash module in processing the hash processing task.

[0071] Step 303: for any hash module, determining the target segment data of the hash module from the at least one segment data according to the hash processing condition of the hash module, wherein the cumulative value of the hash operation times of the target segment data satisfies the hash processing condition of the hash module.

[0072] ​In this embodiment, for any hash module, part of the segment data can be selected from the at least one segment data according to the hash processing condition of the hash module, the cumulative value of the hash operation times of the part of the segment data is calculated, and it is determined whether the cumulative value meets the hash processing condition of the corresponding hash module. If it meets, the part of the segment data is determined as the target segment data of the corresponding hash module. If it does not meet, at least one segment data is selected again and the cumulative value is recalculated. It is determined whether the cumulative value after the recalculation meets the hash processing condition of the corresponding hash module. In this way, the cumulative value is calculated repeatedly.

[0073] In this embodiment, the selection of part of the segment data from the at least one segment data can be in a certain order or randomly, which is not limited in this embodiment.

[0074] As a possible implementation, the segment data is sorted according to the order in the to-be-processed data. For any hash module, the order of the unassigned segment data is obtained. According to the order, the hash operation times of the unassigned segment data are added one by one, and it is determined whether the cumulative value after each addition meets the hash processing condition of the hash module. In the case that the cumulative value after any addition meets the hash processing condition of the hash module, at least one segment data corresponding to the cumulative value is determined as the target segment data.

[0075] As an example, assuming that the segment data is y[0], …, y[p-1], and the hash operation times of the segment data are a[0], …, a[p-1], where a[0] is the hash operation times of the segment data y[0], a[1] is the hash operation times of the segment data y[1], and so on. Assuming that for the hash module 1, the order of the unassigned segment data obtained is y[0], …, y[p-1], then according to the order, the hash operation times of the unassigned segment data are added one by one, and it is determined whether the cumulative value after each addition meets the hash processing condition of the hash module. That is, a[0] and a[1] are added first, and it is determined whether the cumulative value meets the hash processing condition of the hash module. If it meets, a[0] and a[1] are the target segment data of the hash module 1. If it does not meet, a[0], a[1] and a[2] are added next, and it is determined whether the cumulative value meets the hash processing condition of the hash module. In this way, the cumulative value is calculated repeatedly.

[0076] In step 304, the hash processing task of each target segment data is assigned to the corresponding hash module, and the hash processing task of the segment data not assigned to any hash module is assigned to the processor.

[0077] In this embodiment, the hash processing tasks of the target segmented data corresponding to each hash module are allocated to the corresponding hash module, and the hash processing tasks of the segmented data not allocated to any hash module are allocated to the processor, so that each hash module and / or the processor can process an appropriate amount of tasks within the range allowed by its operation rate, thereby maximizing resource utilization.

[0078] In the task allocation method of the embodiments of the present application, the to-be-processed data is segmented to obtain at least one segmented data, the hash processing condition of the hash module is determined according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segmented data, wherein the hash processing condition is used to indicate the ability of the hash module to process the hash processing task, for any hash module, the target segmented data corresponding to the hash module is determined from the at least one segmented data according to the hash processing condition of the hash module, wherein the cumulative value of the hash operation times of the target segmented data meets the hash processing condition of the corresponding hash module, the hash processing tasks of each target segmented data are allocated to the corresponding hash module, and the hash processing tasks of the segmented data not allocated to any hash module are allocated to the processor. By accurately allocating the hash processing tasks of the target segmented data corresponding to each hash module to the corresponding hash module, while ensuring that the unallocated tasks can be effectively taken over by the processor, relatively balanced allocation of the hash processing tasks is achieved, so that each hash module and / or the processor can operate at a speed close to its maximum operation rate, thereby significantly improving the processing efficiency.

[0079] Based on the above embodiments, Figure 4 The flowchart of another task allocation method provided by the embodiments of the present application illustrates how to determine the hash processing condition of the hash module according to the hash operation rate ratio, the number of hash modules and the hash operation times of each segmented data, as shown in Figure 4 The method comprises the following steps:

[0080] Step 401, the to-be-processed data is segmented to obtain at least one segmented data.

[0081] Wherein, step 401 can refer to the related explanation and description in the foregoing embodiments, the principle is the same, and details are not repeated here.

[0082] Step 402, the hash operation times of each segmented data are accumulated to obtain a hash times accumulation sum.

[0083] Step 403, the target index is determined according to the hash times accumulation sum, the hash operation rate ratio and the number of hash modules, wherein the target index is used to indicate the total efficiency of the hash operation of the hash module and the processor.

[0084] As a possible implementation manner, the hash processing amount is determined according to the hash operation rate ratio and the number of hash modules, wherein the hash processing amount is used to indicate the total hash processing amount of the hash modules and the processor; and a ratio between the hash number accumulation and the hash processing amount is determined as the target index.

[0085] Optionally, the process of determining the hash processing amount can adopt the following implementation manner: the relative hash operation rate of the hash modules and the relative hash operation rate of the processor are determined according to the hash operation rate ratio; the hash processing amount of the hash modules is obtained by multiplying the number of the hash modules and the relative hash operation rate of the hash modules; and the hash processing amount of the hash modules and the sum of the relative hash operation rate of the processor are determined as the hash processing amount.

[0086] As an example, assuming that the hash operation rate ratio between the hash modules and the processor is 1:m, the relative hash operation rate of the hash modules is m, and the relative hash operation rate of the processor is 1. Similarly, assuming that the hash operation rate ratio between the hash modules and the processor is 2:3, the relative hash operation rate of the hash modules is 3, and the relative hash operation rate of the processor is 2.

[0087] It should be noted that since the processor is only one, the hash processing amount of the processor is the product of the relative hash operation rate of the processor and 1, so that adding the hash processing amount of the hash modules and the relative hash operation rate of the processor can also obtain the hash processing amount used to indicate the total hash processing amount of the hash modules and the processor.

[0088] In step 404, the hash processing condition of the hash modules is determined according to the target index and the hash operation rate ratio.

[0089] As a possible implementation manner, the relative hash operation rate of the hash modules and the relative hash operation rate of the processor are determined according to the hash operation rate ratio; and the hash processing condition of the hash modules is determined according to the product between the target index and the relative hash operation rate of the hash modules.

[0090] As an example, the product between the target index and the relative hash operation rate of the hash modules greater than or equal to the target index can be determined as the hash processing condition of the hash modules.

[0091] It should be noted that since the target index is used to indicate the total efficiency of the hash modules and the processor in processing the hash operation, and the hash processing condition of the hash modules is the product between the target index and the relative hash operation rate of the hash modules, in this embodiment, the determined hash processing condition of the hash modules is used to indicate the ability of the hash modules in processing the hash processing task under the condition that the hash modules and the processor work together. Moreover, in this embodiment, the hash processing condition of each hash module is the same.

[0092] As an example, assuming that the hash operation rate ratio between the hash module and the processor is 1: m, the hash frequency accumulation sum is denoted by sum, and the number of hash modules is n, the relative hash operation rate of the hash module can be determined according to the hash operation rate ratio (1: m) between the hash module and the processor, which is m, and the relative hash operation rate of the processor is 1, so that the hash processing amount of the hash module (n*m) can be obtained by multiplying the number of hash modules (n) by the relative hash operation rate of the hash module (m), and then the hash processing amount (n*m+1) can be determined by summing the hash processing amount of the hash module (n*m) and the relative hash operation rate of the processor (1), and then the target index can be determined by the ratio between the hash frequency accumulation sum (sum) and the hash processing amount (n*m+1) Finally, the hash processing condition of the hash module is determined by the product between the target index and the relative hash operation rate of the hash module (m) The hash processing condition of the hash module is determined by the product between the target index and the relative hash operation rate of the hash module (m)

[0093] In step 405, the hash processing task of each segmented data is allocated to the hash module and / or the processor according to the hash operation frequency of each segmented data and the hash processing condition of the hash module.

[0094] In step 405, the hash processing task of each segmented data is allocated to the hash module and / or the processor according to the hash operation frequency of each segmented data and the hash processing condition of the hash module.

[0095] In the task allocation method of the embodiments of the present application, the to-be-processed data is segmented to obtain at least one segmented data, the hash operation frequencies of the segmented data are accumulated to obtain a hash frequency accumulation sum, the target index is determined according to the hash frequency accumulation sum, the hash operation rate ratio and the number of hash modules, the target index is used to indicate the total efficiency of the hash module and the processor in processing hash operation, the hash processing condition of the hash module is determined according to the target index and the hash operation rate ratio, and the hash processing task of each segmented data is allocated to the hash module and / or the processor according to the hash operation frequency of each segmented data and the hash processing condition of the hash module. By determining the total efficiency of the hash module and the processor in processing hash operation, the hash operation demand of the to-be-processed data can be more accurately understood by accumulating the hash operation frequencies of the segmented data, the total efficiency of the hash module and the processor in processing hash operation can be comprehensively evaluated by determining the target index, and then the hash processing condition of the hash module can be more accurate and reasonable based on the target index and the hash operation rate ratio, which can more accurately indicate the ability of the hash module in processing hash processing task.

[0096] In order to clearly illustrate the above-mentioned embodiments, examples are given as follows.

[0097] Assume that the current system is externally connected with n hash modules, and the hash operation rate ratio of the hash module and the processor (for example, cpu software) is 1: m. The task allocation process is as follows:

[0098] 1. According to w, Q, calculate a[0], …, a[p-1] by formula a = coef(Q||Cksm(Q), i, w).

[0099] In the signature scenario, the hash operation times (a[0], …, a[p-1]) of each segmented data in the signature scenario can be calculated according to w, Q by formula a = coef(Q||Cksm(Q), i, w), wherein w is a target parameter of hash processing, and w takes values of 1, 2, 4, and 8; Q is data to be processed, and p-1 segmented data can be obtained by segmenting the data to be processed Q, and the value of p is related to w, w = 1, p = 265; w = 2, p = 133; w = 4, p = 67; w = 8, p = 34; i refers to the i-th segmented data.

[0100] 2. When signing, calculate the sum of a[0], …, a[p-1] and mark it as sum(a).

[0101] 3. When verifying, calculate b[0], …, b[p-1], wherein b[i] = 2 w -1-a[i], and calculate sum(b).

[0102] 4. Calculate the target index Wherein, in the signature scenario, sum = sum(a); in the verification scenario, sum = sum(b).

[0103] 5. Task allocation: in the signature scenario, the array a is accumulated; in the verification scenario, the array b is accumulated. After each accumulation, it is judged whether the accumulated value meets the condition of being greater than or equal to m*ret. If it meets the condition, the hash processing task of the segmented data corresponding to the accumulated value is allocated to the hash module 1, that is, when the accumulated value a[0]+…+a[i] meets the condition of being greater than or equal to m*ret, the hash processing task of the segmented data corresponding to a[0], …, a[i] is allocated to the hash module 1, and then the data after a[i] in the array a is accumulated. After each accumulation, it is judged whether the accumulated value meets the condition of being greater than or equal to m*ret. If it meets the condition, the hash processing task of the segmented data corresponding to the accumulated value is allocated to the hash module 2, that is, when the accumulated value a[i+1]+…+a[i+j] meets the condition of being greater than or equal to m*ret, the hash processing task of the segmented data corresponding to a[[i+1], …, a[i+j] is allocated to the hash module 2. In this way, until each hash module is allocated to the hash processing task, the remaining hash processing task of the segmented data is given to the cpu software for hash calculation.

[0104] Wherein, before each time enabling operation, each hash module is allocated m times of hash tasks, and the cpu is allocated 1 time of hash task, both start operation at the same time, and when the software ends operation, the hardware also just ends operation.

[0105] The above scheme is based on the signature verification principle characteristics of LM-OTS signature, and can be applied to various scenarios using LMS and LM-OTS digital signature verification such as embedded and server. The above scheme has the following beneficial effects:

[0106] 1. For LM-OTS signature verification scenarios, parallel computing acceleration is realized, which is more general than pure key generation scenarios.

[0107] 2. The actual hardware and software can be adaptively configured, which reduces the idling of the hash module during signature verification and reduces hardware cost and power consumption. That is, it can adapt to different number of hash modules without too many hardware modules.

[0108] 3. According to the operation rate of the hash module and the cpu software hash, load balancing is realized to maximize efficiency.

[0109] 4. The hardware hash module and cpu software hash operation are used at the same time to fully utilize the full operation capacity. Compared with the scenario of only one hash module, the above scheme can save ((n-1)*m+1) / (m*n+1) time. Compared with the scenario of only cpu using software to do hash, the above scheme can save (n*m) / (m*n+1) time.

[0110] In order to realize the above embodiment, an embodiment of the present application further provides a task allocation device.

[0111] Figure 5 A structural schematic diagram of a task allocation device provided by an embodiment of the present application.

[0112] As shown in the figure, the device can include: Figure 5

[0113] The segmentation module 51 is configured to segment the to-be-processed data to obtain at least one segmented data.

[0114] The allocation module 52 is configured to allocate the hash processing task of each segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the hash operation times of each segmented data.

[0115] Further, in an implementation manner of the embodiment of the present application, the allocation module 52 includes:

[0116] ​determining unit, configured to determine a hash processing condition of the hash modules according to the hash operation rate ratio, the number of the hash modules and the hash operation times of each of the segmented data, wherein the hash processing condition is used to indicate an ability of the hash modules to process hash processing tasks;

[0117] an allocating unit, configured to allocate hash processing tasks of each of the segmented data to the hash modules and / or the processor according to the hash operation times of each of the segmented data and the hash processing condition of the hash modules.

[0118] Further, in an implementation form of the embodiment of the application, the allocating unit is further configured to:

[0119] for any of the hash modules, determine target segmented data corresponding to the hash module from the at least one segmented data according to the hash processing condition of the hash module, wherein an accumulated value of the hash operation times of the target segmented data satisfies the hash processing condition of the corresponding hash module;

[0120] allocate hash processing tasks of each of the target segmented data to the corresponding hash module, and allocate hash processing tasks of the segmented data not allocated to any of the hash modules to the processor.

[0121] Further, in an implementation form of the embodiment of the application, the segmented data are sorted according to an order in the to-be-processed data;

[0122] the allocating unit is further configured to:

[0123] for any of the hash modules, obtain an order of the unallocated segmented data;

[0124] according to the order, accumulate the hash operation times of the unallocated segmented data one by one, and determine whether an accumulated value after each accumulation satisfies the hash processing condition of the hash module;

[0125] in a case where the accumulated value after any of the accumulations satisfies the hash processing condition of the hash module, taking at least one segmented data corresponding to the accumulated value as the target segmented data.

[0126] Further, in an implementation form of the embodiment of the application, the determining unit is further configured to:

[0127] accumulate the hash operation times of each of the segmented data to obtain a hash times accumulated sum;

[0128] determine a target index according to the hash times accumulated sum, the hash operation rate ratio and the number of the hash modules, wherein the target index is used to indicate a total efficiency of the hash modules and the processor in processing hash operations;

[0129] According to the target index and the hash operation rate ratio, a hash processing condition of the hash module is determined.

[0130] Further, in an implementation manner of the embodiment of the present application, the determining unit is further configured to:

[0131] According to the hash operation rate ratio and the number of hash modules, a hash processing amount is determined, wherein the hash processing amount is used to indicate a total hash processing amount of the hash modules and the processor;

[0132] A ratio between the hash number accumulation and the hash processing amount is determined as the target index.

[0133] Further, in an implementation manner of the embodiment of the present application, the determining unit is further configured to:

[0134] According to the hash operation rate ratio, a relative hash operation rate of the hash module and a relative hash operation rate of the processor are determined;

[0135] The number of hash modules is multiplied by the relative hash operation rate of the hash module to obtain a hash processing amount of the hash module;

[0136] The hash processing amount of the hash module and a sum of the relative hash operation rates of the processor are determined as the hash processing amount.

[0137] Further, in an implementation manner of the embodiment of the present application, the determining unit is further configured to:

[0138] According to the hash operation rate ratio, a relative hash operation rate of the hash module and a relative hash operation rate of the processor are determined;

[0139] According to a product between the target index and the relative hash operation rate of the hash module, a hash processing condition of the hash module is determined.

[0140] Further, in an implementation manner of the embodiment of the present application, the apparatus further includes:

[0141] The determining module is configured to, in a signature scene, determine, according to each piece of segment data and a target parameter of hash processing, a hash operation number of each piece of segment data in the signature scene by using a target function;

[0142] Or,

[0143] In a signature verification scene, according to the hash operation number of each piece of segment data in the signature scene and the target parameter of hash processing in the signature scene, a hash operation number of each piece of segment data in the signature verification scene is determined.

[0144] It should be noted that the foregoing description of the method embodiment also applies to the device of this embodiment, which will not be repeated here.

[0145] The task allocation device of the embodiment of the present application processes the to-be-processed data in segments to obtain at least one segmented data, allocates the hash processing task of each segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the hash operation number of each segmented data, and precisely allocates the hash processing task to the hash module and / or the processor by task allocation based on the hash operation rate ratio between the hash module and the processor, so as to ensure that the task amount borne by each of them matches the operation rate thereof, which not only realizes the balance of task allocation, but also maximizes the operation capacity of the hash module and the processor, thereby significantly improving the processing efficiency.

[0146] To implement the above-mentioned embodiments, the present application further provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method as described in the foregoing method embodiments.

[0147] To implement the above-mentioned embodiments, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method as described in the foregoing method embodiments.

[0148] To implement the above-mentioned embodiments, the present application further provides a chip including a processing circuit, wherein the processing circuit is configured to implement the method as described in the foregoing method embodiments.

[0149] To implement the above-mentioned embodiments, the present application further provides a computer program product including a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the method as described in the foregoing method embodiments.

[0150] Figure 6 A structural schematic diagram of an electronic device is provided for the embodiment of the present application. For example, the electronic device 800 can be a mobile phone, a computer, a digital broadcast terminal, a message transmission device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0151] Referring to Figure 6 , the electronic device 800 can include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0152] The processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to complete the steps of the methods described above, in whole or in part. Moreover, the processing component 802 can include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0153] The memory 804 is configured to store various types of data to support the operations of the electronic device 800. Examples of these data include instructions to operate any applications or methods on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be realized by any type of volatile or non-volatile storage devices, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc, or optical disc.

[0154] The power component 806 provides power to the various components of the electronic device 800. The power component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0155] The multimedia component 808 includes a screen to provide an output interface between the electronic device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 808 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the electronic device 800 is in an operating mode, such as a shooting mode or a video mode. Each of the front camera and the back camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0156] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive an external audio signal when the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0157] The I / O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0158] The sensor component 814 includes one or more sensors for providing status assessments of various aspects of the electronic device 800. For example, the sensor component 814 can detect an open / closed position of the electronic device 800, relative positioning of components, such as a display and a keypad of the electronic device 800, a change of position of the electronic device 800 or a component of the electronic device 800, presence or absence of user contact with the electronic device 800, orientation or acceleration / deceleration of the electronic device 800, and temperature changes of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 814 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0159] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G, or 5G, or a combination thereof. In an example embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcasting management system via a broadcasting channel. In an example embodiment, the communication component 816 further includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technology.

[0160] In exemplary embodiments, the electronic device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements for performing the above-described methods.

[0161] In exemplary embodiments, a non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, is also provided, which can be executed by the processor 820 of the electronic device 800 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0162] To implement the above-described embodiments, the present application also proposes a chip, comprising: the chip comprises a processing circuit, and the processing circuit is configured to execute the method provided in the above-described embodiments.

[0163] Figure 7 A structural schematic diagram of a chip according to an embodiment of the present application is provided. Referring to FIG. 11, a structural schematic diagram of the chip 1100 is shown, but the present application is not limited thereto. Figure 7 The chip 1100 comprises a processing circuit 1101, and the processing circuit 1101 is configured to execute any of the above methods.

[0164] The chip 1100 comprises a processing circuit 1101, and the processing circuit 1101 is configured to execute any of the above methods.

[0165] In some embodiments, the chip 1100 further comprises one or more interface circuits 1102. Optionally, the interface circuit 1102 is connected with the memory 1103, and the interface circuit 1102 can be used to receive signals from the memory 1103 or other devices, and the interface circuit 1102 can be used to send signals to the memory 1103 or other devices. For example, the interface circuit 1102 can read instructions stored in the memory 1103 and send the instructions to the processing circuit 1101.

[0166] In some embodiments, the interface circuit 1102 performs at least one of the communication steps such as sending and / or receiving in the above-described methods, and the processing circuit 1101 performs other steps.

[0167] In some embodiments, the terms of interface circuit, interface, transceiver pin, and transceiver can be replaced with each other.

[0168] In some embodiments, the chip 1100 further comprises one or more memories 1103 for storing instructions. Optionally, all or part of the memory 1103 can be outside the chip 1100.

[0169] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. Moreover, the usage of the terms "first", "second" or "third" does not limit the quantity or order of the specific features, structures, materials or characteristics, but rather the terms are used to distinguish between different sets of the same or similar features, structures, materials or characteristics. Thus, a feature described as a "first" feature can also be a "second" feature, and vice versa.

[0170] Furthermore, the terms "first", "second", or the like, are used only to describe particular features, structures, materials, or characteristics, and do not imply or connote relative importance or a number of the specified features, structures, materials, or characteristics. Thus, a feature defined with "first", "second", or the like, can include at least one of the feature, either explicitly or implicitly. In the description of the application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined.

[0171] Any process or method descriptions or blocks in flow charts or otherwise described herein represent embodiments which can be managed as one or more modules, segments, or portions of code which include one or more steps for implementing specific logic functions or steps, and the terms in the description are used for causing or carrying out or upgrading of an action between other hardware under their control. The description of processes and methods of operations should be considered as merely illustrative, and not in any way limiting, of the scope of the application.

[0172] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of instructions to implement logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a computer- readable storage medium or a computer-readable signal medium. The computer- readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electrical connections), a portable computer diskette (a magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and stored in a computer memory.

[0173] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the various steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if implemented in hardware, the various steps or methods can be implemented in any one or combination of the following technologies, which are all well known in the art: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0174] Those of skill in the art would understand that information and signals can be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be referenced throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.

[0175] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0176] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A method of task allocation, characterized by, The method comprises the following steps: segmenting the to-be-processed data to obtain at least one segment data; accumulating the hash operation times of each segment data to obtain a hash times accumulation sum; determining a target index according to the hash times accumulation sum, a hash operation rate ratio between the hash module and the processor, and the number of hash modules, wherein the target index is used to indicate the total efficiency of the hash module and the processor in processing hash operations; determining a hash processing condition of the hash module according to the target index and the hash operation rate ratio, wherein the hash processing condition is used to indicate the ability of the hash module in processing hash processing tasks; allocating the hash processing tasks of each segment data to the hash module and / or the processor according to the hash operation times of each segment data and the hash processing condition of the hash module.

2. The method of claim 1, wherein, The step of allocating the hash processing tasks of each segment data to the hash module and / or the processor according to the hash operation times of each segment data and the hash processing condition of the hash module comprises the following steps: for any hash module, determining target segment data corresponding to the hash module from the at least one segment data according to the hash processing condition of the hash module, wherein the accumulated value of the hash operation times of the target segment data satisfies the hash processing condition of the corresponding hash module; allocating the hash processing tasks of each target segment data to the corresponding hash module, and allocating the hash processing tasks of the segment data which is not allocated to any hash module to the processor.

3. The method of claim 2, wherein, The segment data are sorted according to the order in the to-be-processed data. The step of determining target segment data corresponding to the hash module from the at least one segment data according to the hash processing condition of the hash module comprises the following steps: for any hash module, obtaining the order of the unallocated segment data; according to the order, accumulating the hash operation times of the unallocated segment data one by one, and determining whether the accumulated value after each accumulation satisfies the hash processing condition of the hash module; in the case that the accumulated value after any accumulation satisfies the hash processing condition of the hash module, taking at least one segment data corresponding to the accumulated value as the target segment data.

4. The method of claim 1, wherein, The step of determining a target index according to the hash times accumulation sum, the hash operation rate ratio, and the number of hash modules comprises the following steps: determining a hash processing amount according to the hash operation rate ratio and the number of hash modules, wherein the hash processing amount is used to indicate the total amount of hash processing of the hash module and the processor; determining the ratio between the hash times accumulation sum and the hash processing amount as the target index.

5. The method of claim 4, wherein, The step of determining a hash processing amount according to the hash operation rate ratio and the number of hash modules comprises the following steps: determining the relative hash operation rate of the hash module and the relative hash operation rate of the processor according to the hash operation rate ratio; multiplying the number of hash modules by the relative hash operation rate of the hash module to obtain the hash processing amount of the hash module. The sum of the hash processing amount of the hash module and the relative hash operation rate of the processor is determined as the hash processing amount.

6. The method of claim 1, wherein, The hash processing condition of the hash module is determined according to the target index and the hash operation rate ratio. The relative hash operation rate of the hash module and the relative hash operation rate of the processor are determined according to the hash operation rate ratio. The hash processing condition of the hash module is determined according to the product of the target index and the relative hash operation rate of the hash module.

7. The method of any one of claims 1-6, wherein, The hash operation times of each of the segmented data are obtained by the following determination process, and the determination process comprises: In the signature scenario, the hash operation times of each of the segmented data in the signature scenario are determined according to the segmented data and the target parameters of the hash processing in the signature scenario by using a target function. Or, In the signature verification scenario, the hash operation times of each of the segmented data in the signature verification scenario are determined according to the hash operation times of each of the segmented data in the signature scenario and the target parameters of the hash processing in the signature scenario.

8. A task allocation apparatus characterized by comprising: Comprise: The segmentation module is configured to segment the to-be-processed data to obtain at least one segmented data. The allocation module is configured to allocate the hash processing tasks of each of the segmented data to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and according to the hash operation times of each of the segmented data. The allocation module is specifically configured to: The hash operation times of each of the segmented data are accumulated to obtain a hash time accumulation sum. The target index is determined according to the hash time accumulation sum, the hash operation rate ratio and the number of the hash modules, wherein the target index is used to indicate the total efficiency of the hash module and the processor in processing hash operations. The hash processing condition of the hash module is determined according to the target index and the hash operation rate ratio, wherein the hash processing condition is used to indicate the ability of the hash module in processing hash processing tasks. The hash processing tasks of each of the segmented data are allocated to the hash module and / or the processor according to the hash operation times of each of the segmented data and the hash processing condition of the hash module.

9. An electronic device, comprising: The computer program is executed by the processor to implement the method in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-7. 11.A chip comprising processing circuitry, the processing circuitry being configured to implement the method in any one of claims 1-7 when executed.

12. A computer program product, characterised in that, The computer program or instructions are executed by the processor to implement the method in any one of claims 1-7.

Citation Information

Patent Citations

  • Technologies for managing allocation of accelerator resources

    CN109313584A

  • Dynamic allocation of cloud computing processors

    CN118715507A