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 assigning tasks according to the calculation rate ratio between the hash module and the processor, the problem of unbalanced task allocation is solved, and more efficient hashing processing is achieved.

CN119988004AActive Publication Date: 2025-05-13BEIJING X RING TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the Leighton-Micali signature scheme, the number of hash operations for each segment of data may be different, resulting in uneven task allocation and failing to fully utilize the processor's computing power.

Method used

By performing segmented processing of the data to be processed, and the hash processing tasks are accurately allocated to the hash module and/or processor according to the hash operation rate ratio between the hash module and the processor, as well as the hash operation times of each segmented data.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988004A_ABST
    Figure CN119988004A_ABST
Patent Text Reader

Abstract

The invention provides a task allocation method and device, electronic equipment, a storage medium and a chip, and the method comprises the steps: carrying out the segmentation processing of to-be-processed data, obtaining at least one piece of segmented data, and according to the Hash operation rate ratio between a Hash module and a processor and the Hash operation frequency of each piece of segmented data, carrying out the Hash operation of each piece of segmented data; hash processing tasks of the segmented data are allocated to the Hash module and / or the processor, and task allocation is performed based on the Hash operation rate ratio between the Hash module and the processor, so that the Hash processing tasks can be accurately allocated to the Hash module and / or the processor; the Hash modules and the processors are distributed to ensure that task loads borne by the Hash modules and the processors are matched with the computing rates of the Hash modules, the task distribution balance is achieved through the distribution mode, the computing capacities of the Hash modules and the processors are exerted to the maximum extent, and therefore the processing efficiency is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task allocation method, device, electronic device, storage medium and chip. Background Art

[0002] Leighton-Micali Signature (LMS) is one of the most representative schemes in Hash-Based Signature (HBS). In the signing and verification scenarios, it is necessary to perform multiple hash operations on each segment of the signature data. However, since the number of hash operations for each segment may be the same or different, if the hash processing tasks of the segmented data are allocated simply according to the number of segmented data, there is a problem of unbalanced task allocation. Summary of the invention

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

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

[0005] In one aspect, an embodiment of the present application provides a task allocation method, including:

[0006] Performing segmentation processing on the data to be processed to obtain at least one segmented data;

[0007] According to the hash operation rate ratio between the hash module and the processor, and according to the number of hash operations of each segment data, the hash processing task of each segment data is allocated to the hash module and / or the processor.

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

[0009] A segmentation module, used for segmenting the data to be processed to obtain at least one segmented data;

[0010] The allocation module is used to allocate the hash processing task of each segment 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 number of hash operations of each segment data.

[0011] Another aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above aspect is implemented.

[0012] Another aspect of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the aforementioned aspect is implemented.

[0013] Another aspect of the present application provides a chip, including a processing circuit, wherein the processing circuit is used to implement the method described in the aforementioned aspect.

[0014] Another aspect of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the method described in the aforementioned aspect.

[0015] The task allocation method, device, electronic device, storage medium and chip proposed in the present application perform segmented processing on the data to be processed to obtain at least one segmented data, and 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 the number of hash operations on each segmented data. By performing task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing task can be accurately allocated to the hash module and / or the processor to ensure that the amount of tasks each of them carries matches their own operation rate. This allocation method not only achieves balanced task allocation, but also maximizes the computing power of the hash module and the processor, thereby significantly improving processing efficiency.

[0016] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

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

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

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

[0021] Figure 4 A flowchart of another task allocation method provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of a task allocation device provided in an embodiment of the present application;

[0023] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0024] Figure 7 It is a schematic diagram of the structure of a chip proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0025] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0026] In modern computer technology, system security is a key feature, and cryptographic algorithms are the core technology in the security field, playing a key role in ensuring the authenticity, integrity and confidentiality of system and user data. Cryptographic algorithms provide security services such as encryption, decryption, signing and verification for data through complex mathematical operations and logical design.

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

[0028] However, with the rapid development of quantum computing technology, the security of traditional cryptographic algorithms has been severely challenged. Cryptographic algorithms based on the difficulty of factoring large integers and calculating discrete logarithms are no longer secure with the assistance of quantum computers. For example, Shor's quantum algorithm can solve the above mathematical problems in polynomial time, so the above algorithms are considered no longer secure after the quantum computing era.

[0029] In the related technologies, hash algorithms can play a significant role in combating quantum attacks. LMS is one of the most representative schemes in hash-based signature schemes (HBS). In the signature and verification scenarios, it is necessary to perform multiple hash operations on each segment of the signature data. However, since the number of hash operations for each segment may be the same or different, if the hash processing tasks of the segmented data are simply allocated according to the number of segmented data, there is a problem of unbalanced 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 brought into play.

[0030] Therefore, the present application proposes a task allocation method, which performs segmented processing on the data to be processed to obtain at least one segmented data, and 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 number of hash operations on each segmented data. By performing task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing task can be accurately allocated to the hash module and / or the processor to ensure that the task volume they each carry matches their own operation rate. This allocation method not only achieves balanced task allocation, but also maximizes the computing power of the hash module and the processor, thereby significantly improving processing efficiency.

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

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

[0033] The execution subject of the task allocation method in the embodiment of the present application is a task allocation device, which can be applied to any electronic device so that the electronic device can perform the task allocation function.

[0034] Among them, the electronic device can be any device with computing capabilities, such as a mobile terminal. The mobile terminal can be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0035] The execution subject of the task allocation method in the embodiment of the present application may also be a chip.

[0036] Among them, chips include neural network processor NPU, central processing unit (CPU), application-specific integrated circuit (ASIC), microprocessor (Digital Signal Processor, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), system on chip (System On AChip, SOC), reduced instruction set computer RISC (Reduced Instruction Set Computer, reduced instruction set computer), etc., which are not listed here one by one.

[0037] like Figure 1 As shown, the method may include the following steps:

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

[0039] The data to be processed may be in any form, including but not limited to text data, image data, numerical data, etc.

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

[0041] The size and number of segments may be determined based on a variety of influencing factors, including but not limited to the nature of the data to be processed, processing requirements, etc.

[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 in 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 segmented 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 segmented into multiple smaller areas (such as image blocks). In addition, if the image contains multiple objects or scenes, the image can be segmented according to the boundaries of the objects or the changes in the scenes.

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

[0044] Step 102: assigning 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 number of hash operations of each segmented data.

[0045] Among them, 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. 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] Among them, the hash module is a hash module plug-in of the current system architecture. The current system architecture refers to the overall structure of the software or hardware environment that is currently running or about to run, including various components such as the operating system, hardware devices, middleware, and applications. Plug-ins refer to adding or integrating additional components, modules, or devices outside the system or on the basis of the original system to enhance or expand the functions of the system.

[0047] As an example, the current system may be configured with n external hash modules, that is, in the current system architecture, n additional hash modules may be added or integrated to enhance or expand the hash computing capability of the system.

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

[0049] Compared with the LMS solution in which the number of hardware modules is mostly fixed, for the various parameter types in the LMS parameter set, there must be a situation where some hardware modules are idling under a certain parameter type. For example, assuming that 34 hash modules are used, the 34 hash modules only correspond to the parameter type of LMOTS_SHA256_N32_W8. For other parameter types such as LMOTS_SHA256_N32_W1, p=265 at this time, and 27 hash modules will be idling in the last round, resulting in additional power consumption overhead. In the embodiment of the present application, the number of hash modules is adaptively configured according to the actual hardware and software conditions, which can effectively reduce the idling of the hash modules and reduce hardware costs and power consumption.

[0050] The number of hash operations for each segmented data may be the same or different, and this is not limited in this embodiment.

[0051] In this embodiment, by assigning tasks to each segmented data based on the hash operation rate ratio between the hash module and the processor and the number of hash operations on each segmented data, it can be ensured that the hash module and the processor each undertake a task amount that matches their operation rate when processing hash operations, while achieving balanced task allocation and making full use of the computing power of the hash module and the processor to improve 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 assigned hash processing tasks for the corresponding segmented data, then before each operation is enabled, each hash module can be assigned m hash operations and the processor can be assigned 1 hash operation, and then the operations can be started at the same time. Therefore, when the processor finishes the operation, each hash module also finishes the operation. Compared with the case where only one hash module performs the hash operation, ((n-1)*m+1) computing time can be saved, and compared with the case where only the processor performs the hash operation, (n*m) / (m*n+1) computing time can be saved.

[0053] It should be noted that the number of hash operations required to be performed in a hash processing task assigned to any hash module or processor may exceed the number of hash operations performed in a single time.

[0054] As an example, hash module 1 is assigned a hash processing task for the first segmented data and a hash processing task for the second segmented data, wherein the number of hash operations for the first segmented data is 6, the number of hash operations for the second segmented data is 4, and the hash operation rate ratio between the hash module and the processor is 1:4. When hash module 1 performs hash operations in the first round, it will only perform the first 4 hash operations of the number of hash operations required for the first segmented data, and continue to perform the unperformed hash operations in subsequent rounds (for example, when performing hash operations in the second round, the last 2 hash operations of the number of hash operations required for the first segmented data are performed, and the first 2 hash operations of the number of hash operations required for the second segmented data are performed, and so on).

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

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

[0057] As an example, in the signature scenario, the number of hash operations (a[0],…,a[p-1]) for each segmented data in the signature scenario can be calculated based on w and Q by the formula a=coef(Q||Cksm(Q),i,w), where w is the target parameter of the hash processing, and the value of w is 1, 2, 4, 8; Q is the data to be processed, and the data to be processed Q is segmented to 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 (b[0],…,b[p-1]) for each segmented data in the signature verification scenario can be calculated based on a[0],…,a[p-1] and w, where b[i]=2 w -1-a[i].

[0058] In the task allocation method of the embodiment of the present application, the data to be processed is segmented to obtain at least one segmented data. The hash processing task of each segmented data is allocated to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and the number of hash operations on each segmented data. By performing task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing task can be accurately allocated to the hash module and / or the processor to ensure that the amount of tasks each of them carries matches their own computing rate. This allocation method not only achieves balanced task allocation, but also maximizes the computing power of the hash module and the processor, thereby significantly improving processing efficiency.

[0059] Based on the above embodiments, Figure 2 A flowchart of another task allocation method provided in an embodiment of the present application illustrates how 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 the number of hash operations of each segmented data, such as Figure 2 As shown, the method comprises the following steps:

[0060] Step 201 : segment the data to be processed to obtain at least one segment data.

[0061] Among them, step 201 can refer to the relevant explanations in the above-mentioned embodiment, and the principle is the same, which will not be repeated here.

[0062] Step 202, determining the hash processing conditions of the hash modules according to the hash operation rate ratio, the number of hash modules and the number of hash operations of each segmented data, wherein the hash processing conditions are used to indicate the ability of the hash modules to process hash processing tasks.

[0063] Among them, the hash operation rate ratio between the hash module and the processor reflects the rate at which the hash module performs hash operations, the number of hash modules reflects the amount of hash modules that can be processed in parallel, and the number of hash operations on each segmented data reflects the amount of hash operations on each segmented data. In this embodiment, the hash processing conditions of the hash module are determined 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 capability) and the number of hash operations on each segmented data (reflecting the actual needs of data processing). This can make the determined hash processing conditions more precise and reasonable, and can more accurately indicate the ability of the hash module to handle hash processing tasks, providing a strong basis for subsequent task allocation.

[0064] Step 203 , assigning the hash processing task of each segmented data to a hash module and / or a processor according to the number of hash operations of each segmented data and the hash processing condition of the hash module.

[0065] In this embodiment, the hash processing tasks of each segmented data can be evenly distributed to the hash modules and / or processors according to the task requirements (the number of hash operations for each segmented data) and the ability of the hash module to handle the hash processing tasks (the hash processing conditions of the hash module), thereby ensuring the rationality and efficiency of task allocation, avoiding the situation where hash processing tasks are concentrated in certain hash modules and causing overload while hash modules that are not assigned hash processing tasks are idle, and improving processing efficiency.

[0066] In the task allocation method of the embodiment of the present application, the data to be processed is segmented to obtain at least one segmented 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 number of hash operations 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, and the hash processing task of each segmented data is allocated to the hash module and / or the processor according to the number of hash operations of each segmented 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 number of hash operations of each segmented data, the hash processing condition of the hash module can be determined more accurately, so that the task allocation is performed based on the ability of the hash module to process the hash processing task (hash processing condition) and the task requirements (the number of hash operations of each segmented data), which can effectively ensure the rationality and efficiency of the task allocation, avoid the situation where the hash processing task is concentrated on some hash modules, resulting in overload, and the hash modules that are not allocated with hash processing tasks are idle, and improve the processing efficiency.

[0067] Based on the above embodiments, Figure 3 A flowchart of another task allocation method provided in an embodiment of the present application illustrates how to allocate the hash processing task of each segmented data to a hash module and / or a processor according to the number of hash operations of each segmented data and the hash processing conditions of the hash module, such as Figure 3 As shown, the method comprises the following steps:

[0068] Step 301, segment the data to be processed to obtain at least one segmented data.

[0069] Step 302, determining the hash processing conditions of the hash modules according to the hash operation rate ratio, the number of hash modules and the number of hash operations of each segmented data, wherein the hash processing conditions are used to indicate the ability of the hash modules to process hash processing tasks.

[0070] Among them, steps 301 to 302 can refer to the relevant explanations in the aforementioned embodiments, and the principles are the same, so they will not be repeated here.

[0071] Step 303, for any hash module, determine the target segmented data corresponding to the hash module from at least one segmented data according to the hash processing condition of the hash module, wherein the accumulated value of the number of hash operations of the target segmented data satisfies the hash processing condition of the corresponding hash module.

[0072] In this embodiment, for any hash module, according to the hash processing conditions of the hash module, part of the segmented data can be selected from at least one segmented data, the cumulative value of the number of hash operations of this part of the segmented data can be calculated, and it can be determined whether the cumulative value meets the hash processing conditions of the corresponding hash module. If so, it can be determined that this part of the segmented data is the target segmented data of the corresponding hash module. If not, at least one segmented data can be selected and re-accumulated to determine whether the accumulated value after re-accumulation meets the hash processing conditions of the corresponding hash module, and so on.

[0073] The selection of some segmented data from at least one segmented data may be performed in a certain order or randomly, which is not limited in this embodiment.

[0074] As a possible implementation method, each segmented data is sorted according to the order in the data to be processed. For any hash module, the sorting of the unallocated segmented data can be obtained. Based on the sorting, the number of hash operations of the unallocated segmented data is accumulated one by one, and it is determined whether the accumulated value after each accumulation meets the hash processing condition of the hash module. When the accumulated value after any accumulation meets the hash processing condition of the hash module, at least one segmented data corresponding to the accumulated value is used as the target segmented data.

[0075] As an example, assume that each segmented data is y[0],…,y[p-1], and the number of hash operations for each segmented data is a[0],…,a[p-1], where a[0] is the number of hash operations for segmented data y[0], and a[1] is the number of hash operations for segmented data y[1]. Similarly, assume that for hash module 1, the order of the unallocated segmented data obtained is y[0],…,y[p-1]. Then, based on the order, the number of hash operations for the unallocated segmented data can be accumulated one by one, and it can be determined whether the accumulated value after each accumulation satisfies the hash processing condition of the hash module. That is, a[0] and a[1] are first added to determine whether the accumulated value satisfies the hash processing condition of the hash module. If so, a[0] and a[1] are the target segmented data of hash module 1. If not, a[0], a[1] and a[2] are then added to determine whether the accumulated value satisfies the hash processing condition of the hash module, and so on.

[0076] Step 304 , assigning the hash processing task of each target segmented data to the corresponding hash module, and assigning the hash processing task of the segmented data not assigned to any hash module to the processor.

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

[0078] In the task allocation method of the embodiment of the present application, the data to be processed is segmented to obtain at least one segmented 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 number of hash operations 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, and for any hash module, the target segmented data of the corresponding hash processing module is determined from at least one segmented data according to the hash processing condition of the hash module, wherein the accumulated value of the number of hash operations of the target segmented data satisfies the hash processing condition of the corresponding hash module, and the hash processing task of each target segmented data is allocated to the corresponding hash module, and the hash processing task of the segmented data not allocated to any hash module is allocated to the processor. By accurately allocating the hash processing task of the target segmented data corresponding to each hash module to the corresponding hash module, and ensuring that the unallocated tasks can be effectively taken over by the processor, a relatively balanced allocation of hash processing tasks is achieved, so that each hash module and / or processor can run at a speed close to its maximum operation rate, thereby significantly improving the processing efficiency.

[0079] Based on the above embodiments, Figure 4 A flowchart of another task allocation method provided in an embodiment of the present application illustrates how to determine the hash processing conditions of the hash module according to the hash operation rate ratio, the number of hash modules and the number of hash operations for each segmented data, such as Figure 4 As shown, the method comprises the following steps:

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

[0081] Among them, step 401 can refer to the relevant explanations in the above-mentioned embodiments, and the principle is the same, which will not be repeated here.

[0082] Step 402: accumulate the number of hash operations for each segmented data to obtain a cumulative sum of the number of hash operations.

[0083] Step 403, determining a target index according to the accumulated sum of hash times, the hash operation rate ratio and the number of hash modules, wherein the target index is used to indicate the overall efficiency of hash modules and processors in processing hash operations.

[0084] As a possible implementation method, the hash processing amount is determined based on the hash operation rate ratio and the number of hash modules, where the hash processing amount is used to indicate the total amount of hash processing of the hash modules and the processor; and the ratio between the accumulated sum of hash times and the hash processing amount is determined as the target indicator.

[0085] Optionally, the process of determining the hash processing amount can be implemented as follows: determine the relative hash operation rate of the hash module and the relative hash operation rate of the processor based on the hash operation rate ratio; multiply 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; and determine the sum of the hash processing amount of the hash module and the relative hash operation rate of the processor as the hash processing amount.

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

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

[0088] Step 404, determining the hash processing conditions of the hash module according to the target index and the hash operation rate ratio.

[0089] As a possible implementation method, 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 between the target index and the relative hash operation rate of the hash module.

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

[0091] It should be noted that, since 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 the product of the target index and the relative hash operation rate of the hash module. Therefore, in this embodiment, the determined hash processing condition of the hash module is used to indicate the ability of the hash module to process hash processing tasks when the hash module 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 cumulative sum of hash times is represented by sum, and the number of hash modules is n, then according to the hash operation rate ratio between the hash module and the processor (1:m), it can be determined that the relative hash operation rate of the hash module is m, and the relative hash operation rate of the processor is 1, so that the number of hash modules (n) and the relative hash operation rate of the hash module (m) can be multiplied to obtain the hash processing capacity (n*m) of the hash module, and then the sum of the hash processing capacity (n*m) of the hash module and the relative hash operation rate (1) of the processor is determined as the hash processing capacity (n*m+1), and then the ratio between the cumulative sum of hash times (sum) and the hash processing capacity (n*m+1) is determined as the target indicator. Finally, the target index will be greater than or equal to The product of the relative hash operation rate (m) of the hash module is determined as the hash processing condition of the hash module.

[0093] Step 405 , assigning the hash processing task of each segmented data to a hash module and / or a processor according to the number of hash operations of each segmented data and the hash processing condition of the hash module.

[0094] Among them, step 405 can refer to the relevant explanations in the above-mentioned embodiment, and the principle is the same, which will not be repeated here.

[0095] In the task allocation method of the embodiment of the present application, the data to be processed is processed in segments to obtain at least one segmented data, the number of hash operations of each segmented data is accumulated to obtain the cumulative sum of the hash times, and the target index is determined according to the cumulative sum of the hash times, 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 module and the processor in processing the hash operation, the hash processing conditions of the hash module are determined according to the target index and the hash operation rate ratio, and the hash processing tasks of each segmented data are allocated to the hash module and / or the processor according to the number of hash operations of each segmented data and the hash processing conditions of the hash module. By determining the total efficiency of the hash module and the processor in processing the hash operation. By accumulating the number of hash operations of each segmented data, the hash operation requirements of the data to be processed can be more accurately understood, and by determining the target index, the total efficiency of the hash module and the processor in processing the hash operation can be comprehensively evaluated, and then the hash processing conditions of the hash module are determined based on the target index and the hash operation rate ratio, so that the determined hash processing conditions can be more accurate and reasonable, and the ability of the hash module to process the hash processing tasks can be more accurately indicated.

[0096] In order to clearly illustrate the above embodiment, an example is now given for illustration.

[0097] Assume that the current system has n hash modules installed externally, and the hash operation rate ratio of the hash module and the processor (such as CPU software) is 1:m. The task allocation process is as follows:

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

[0099] In the signature scenario, the number of hash operations (a[0],…,a[p-1]) for each segmented data in the signature scenario can be calculated based on w and Q through the formula a=coef(Q||Cksm(Q),i,w), where w is the target parameter of the hash processing and the value of w is 1, 2, 4, 8; Q is the data to be processed, and the data to be processed Q is segmented to obtain p-1 segmented data. 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 record it as sum(a).

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

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

[0103] 5. Task allocation: In the signature scenario, array a is accumulated; in the signature verification scenario, array b is accumulated. After each accumulation, determine whether the accumulated value satisfies greater than or equal to m*ret. If so, the hash processing task of the segmented data corresponding to the accumulated value that satisfies is assigned to hash module 1, that is, when the accumulated value a[0]+…+a[i] satisfies greater than or equal to m*ret, the hash processing task of the segmented data corresponding to a[0],…,a[i] is assigned to hash module 1. Then, the data after a[i] in array a is accumulated. After each accumulation, determine whether the accumulated value satisfies greater than or equal to m*ret. If so, the hash processing task of the segmented data corresponding to the accumulated value that satisfies is assigned to hash module 2. That is, when the accumulated value a[i+1]+…+a[i+j] satisfies greater than or equal to m*ret, the hash processing task of the segmented data corresponding to a[[i+1],…,a[i+j] is assigned to hash module 2. This process is repeated until each hash module is assigned a hash processing task, and then the hash processing tasks of the remaining segmented data are handed over to the CPU to use software for hash calculation.

[0104] Among them, before each operation is enabled, each hash module is assigned m hash tasks, and the CPU is assigned 1 hash task. The two start the operation at the same time. When the software ends the operation, the hardware also ends the operation.

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

[0106] 1. For the LM-OTS signature verification scenario, parallel computing acceleration is achieved, which is more versatile than the simple key generation scenario.

[0107] 2. It can be configured adaptively according to the actual hardware and software conditions, reducing the idle operation of the hash module during signature verification, reducing hardware costs and power consumption. That is, it can adapt to different numbers of hash modules and does not require too many hardware modules.

[0108] 3. According to the hash module and CPU software hash operation rate, load balancing is achieved to ensure maximum efficiency.

[0109] 4. Use hardware hash module and CPU software hash operation at the same time to give full play to the full computing power. Compared with the scenario with only one hash module, the above solution can save ((n-1)*m+1) / (m*n+1) time. Compared with the scenario with only CPU using software to do hash, the above solution can save (n*m) / (m*n+1) time.

[0110] In order to implement the above embodiment, the embodiment of the present application also proposes a task allocation device.

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

[0112] like Figure 5 As shown, the device may include:

[0113] A segmentation module 51, used for segmenting the data to be processed to obtain at least one segmented data;

[0114] The allocation module 52 is used to allocate the hash processing task of each segment 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 number of hash operations of each segment data.

[0115] Furthermore, in one implementation of the embodiment of the present application, the allocation module 52 includes:

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

[0117] The allocating unit is used to allocate the hash processing task of each segmented data to the hash module and / or the processor according to the number of hash operations of each segmented data and the hash processing condition of the hash module.

[0118] Furthermore, in an implementation of the embodiment of the present application, the allocation unit is further configured to:

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

[0120] The hash processing task of each target segmented data is assigned to a corresponding hash module, and the hash processing task of the segmented data not assigned to any hash module is assigned to the processor.

[0121] Furthermore, in an implementation of the embodiment of the present application, each of the segmented data is sorted according to the order in the data to be processed;

[0122] Allocation units are also used for:

[0123] For any of the hash modules, obtaining a ranking of unallocated segmented data;

[0124] According to the sorting, the number of hash operations of the unallocated segmented data is accumulated one by one, and it is determined whether the accumulated value after each accumulation satisfies the hash processing condition of the hash module;

[0125] In the case where the accumulated value after any accumulation satisfies the hash processing condition of the hash module, at least one segment data corresponding to the accumulated value is used as the target segment data.

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

[0127] Accumulate the number of hash operations for each segmented data to obtain a cumulative sum of the number of hash operations;

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

[0129] The hash processing condition of the hash module is determined according to the target index and the hash operation rate ratio.

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

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

[0132] The ratio between the accumulated sum of the hash times and the hash processing amount is determined as the target indicator.

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

[0134] Determining a relative hash operation rate of the hash module and a relative hash operation rate of the processor according to the hash operation rate ratio;

[0135] Multiplying the number of the hash modules by the relative hash operation rate of the hash modules to obtain the hash processing capacity of the hash modules;

[0136] 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.

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

[0138] Determining a relative hash operation rate of the hash module and a relative hash operation rate of the processor according to the hash operation rate ratio;

[0139] 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.

[0140] Furthermore, in one implementation of the embodiment of the present application, the above-mentioned device also includes:

[0141] A determination module, used to determine the number of hash operations for each of the segmented data in the signature scenario using an objective function according to each of the segmented data and a target parameter of the hash processing in the signature scenario;

[0142] or,

[0143] In the signature verification scenario, the number of hash operations for each segmented data in the signature verification scenario is determined according to the number of hash operations for each segmented data in the signature scenario and the target parameter of the hash processing in the signature scenario.

[0144] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and will not be repeated here.

[0145] In the task allocation device of the embodiment of the present application, the data to be processed is segmented to obtain at least one segmented data. The hash processing task of each segmented data is allocated to the hash module and / or the processor according to the hash operation rate ratio between the hash module and the processor and the number of hash operations on each segmented data. By performing task allocation based on the hash operation rate ratio between the hash module and the processor, the hash processing task can be accurately allocated to the hash module and / or the processor to ensure that the amount of tasks each of them carries matches their own computing rate. This allocation method not only achieves balanced task allocation, but also maximizes the computing power of the hash module and the processor, thereby significantly improving processing efficiency.

[0146] In order to implement the above embodiments, the present application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the above method embodiments is implemented.

[0147] In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the above method embodiments is implemented.

[0148] In order to implement the above embodiments, the present application further proposes a chip, including a processing circuit, wherein the processing circuit is used to implement the method described in the above method embodiments.

[0149] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the method described in the above method embodiments is implemented.

[0150] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0151] Reference Figure 6 , the electronic device 800 may 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 operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may 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 operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device 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 disk or optical disk.

[0154] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may 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 that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may 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), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0157] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0158] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also 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 exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also 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 technologies.

[0160] In an exemplary embodiment, the electronic device 800 may 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, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0161] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. 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 disk, an optical data storage device, etc.

[0162] In order to implement the above embodiments, the present application also proposes a chip, including: the chip includes a processing circuit, and the processing circuit is configured to execute the method provided in the above embodiments.

[0163] Figure 7 This is a schematic diagram of the structure of a chip proposed in an embodiment of the present application. Figure 7 The structure of the chip 1100 is shown, but is not limited to this.

[0164] The chip 1100 includes 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 includes one or more interface circuits 1102. Optionally, the interface circuit 1102 is connected to the memory 1103. 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 method, and the processing circuit 1101 performs other steps.

[0167] In some embodiments, terms such as interface circuit, interface, transceiver pin, and transceiver may be used interchangeably.

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

[0169] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0170] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0171] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0172] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0173] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0174] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0175] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0176] The storage medium mentioned above may 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 can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A task allocation method, characterized in that: include: Performing segmentation processing on the data to be processed to obtain at least one segmented data; According to the hash operation rate ratio between the hash module and the processor, and according to the number of hash operations of each segment data, the hash processing task of each segment data is allocated to the hash module and / or the processor.

2. The method according to claim 1, characterized in that The allocating the hash processing task of each segment 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 number of hash operations of each segment data comprises: Determining a hash processing condition of the hash module according to the hash operation rate ratio, the number of the hash modules and the number of hash operations of each of the segmented data, wherein the hash processing condition is used to indicate the ability of the hash module to process the hash processing task; According to the number of hash operations of each segmented data and the hash processing condition of the hash module, the hash processing task of each segmented data is allocated to the hash module and / or the processor.

3. The method according to claim 2, characterized in that The method of allocating the hash processing task of each segmented data to the hash module and / or the processor according to the number of hash operations of each segmented data and the hash processing condition of the hash module includes: For any of the hash modules, according to the hash processing condition of the hash module, determine the target segmented data corresponding to the hash module from the at least one segmented data, wherein the accumulated value of the number of hash operations of the target segmented data satisfies the hash processing condition of the corresponding hash module; The hash processing task of each target segmented data is assigned to a corresponding hash module, and the hash processing task of the segmented data not assigned to any hash module is assigned to the processor.

4. The method according to claim 3, characterized in that The segmented data are sorted according to the order in the data to be processed; The step of determining, for any of the hash modules, 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: For any of the hash modules, obtaining a ranking of unallocated segmented data; According to the sorting, the number of hash operations of the unallocated segmented data is accumulated one by one, and it is determined whether the accumulated value after each accumulation satisfies the hash processing condition of the hash module; In the case where the accumulated value after any accumulation satisfies the hash processing condition of the hash module, at least one segment data corresponding to the accumulated value is used as the target segment data.

5. The method according to claim 2, characterized in that The determining of the hash processing conditions of the hash modules according to the hash operation rate ratio, the number of the hash modules and the number of hash operations of each of the segmented data includes: Accumulate the number of hash operations for each segmented data to obtain a cumulative sum of the number of hash operations; Determine a target index according to the accumulated sum of the number of hash times, the hash operation rate ratio and the number of the hash modules, wherein the target index is used to indicate the overall efficiency of the hash module and the processor in processing the hash operation; The hash processing condition of the hash module is determined according to the target index and the hash operation rate ratio.

6. The method according to claim 5, characterized in that The determining of the target index according to the accumulated sum of the number of hash times, the hash operation rate ratio and the number of hash modules includes: Determining a hash processing amount according to the hash operation rate ratio and the number of the hash modules, wherein the hash processing amount is used to indicate a total amount of hash processing of the hash modules and the processor; The ratio between the accumulated sum of the hash times and the hash processing amount is determined as the target indicator.

7. The method according to claim 6, characterized in that The determining the hash processing amount according to the hash operation rate ratio and the number of the hash modules includes: Determining a relative hash operation rate of the hash module and a relative hash operation rate of the processor according to the hash operation rate ratio; Multiplying the number of the hash modules by the relative hash operation rate of the hash modules to obtain the hash processing capacity of the hash modules; 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.

8. The method according to claim 5, characterized in that The step of determining the hash processing condition of the hash module according to the target index and the hash operation rate ratio includes: Determining a relative hash operation rate of the hash module and a relative hash operation rate of the processor 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.

9. The method according to any one of claims 1 to 8, characterized in that The number of hash operations for each segmented data is obtained by the following determination process, which includes: In the signature scenario, according to each of the segmented data and the target parameters of the hash processing, the target function is used to determine the number of hash operations for each of the segmented data in the signature scenario; or, In the signature verification scenario, the number of hash operations for each segmented data in the signature verification scenario is determined according to the number of hash operations for each segmented data in the signature scenario and the target parameter of the hash processing in the signature scenario.

10. A task allocation device, characterized in that: include: A segmentation module, used for segmenting the data to be processed to obtain at least one segmented data; The allocation module is used to allocate the hash processing task of each segment 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 number of hash operations of each segment data.

11. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A chip, comprising a processing circuit, wherein the processing circuit is configured to implement the method according to any one of claims 1 to 9 when executed.

14. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Technologies for managing allocation of accelerator resources

    CN109313584A

  • Dynamic allocation of cloud computing processors

    CN118715507A

  • Methods and devices for tracking and measuring proof-of-work contributions in a mining pool

    US20220292489A1