Task processing method, device and computing equipment

By performing preset position comparison and grouping processing on the fields of the exhaustive task in the distributed virtual currency system, the problem of high power consumption is solved, the task process is simplified, and the energy consumption of the equipment is reduced.

CN114995988BActive Publication Date: 2025-09-16CANAAN CREATIVE (SH) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210358422.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2016-10-21
Publication Date
2025-09-16
Estimated Expiration
2036-10-21

AI Technical Summary

Technical Problem

In the prior art, the exhaustive task of the distributed virtual currency system needs to be completed by a computer cluster, resulting in high power consumption.

Method used

By performing preset position character comparison on the fields of the exhaustive task at the local high-level node, the fields with consistent comparison results are grouped into the same field group, and the groups and distribution are performed using nodes with different processing speeds to simplify the hash calculation process.

Benefits of technology

It reduces the power consumption of equipment, improves comparison efficiency, balances node load, and ensures the timeliness of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114995988B_ABST
    Figure CN114995988B_ABST
Patent Text Reader

Abstract

The present invention discloses a task processing method and apparatus for simplifying the task process and reducing device power consumption. The method comprises: receiving an exhaustive task sent by a server; generating a first preset number of fields for completing the exhaustive task based on the exhaustive task type; comparing characters at preset positions in all fields through a local high-level node; grouping the fields based on the comparison results; wherein fields with consistent comparison results are within the same field group. The technical solution provided by the present invention enables characters at preset positions in fields within the same field group to share the calculation results of the preset positions, thereby simplifying the hash calculation process, that is, simplifying the task process, and reducing device power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application date of the original application is October 21, 2016; the application number of the original application is 201610920060.4; the invention name of the original application is: A task processing method and device. Technical Field

[0002] The present invention relates to the field of Internet technology, and in particular to a task processing method and device. Background Art

[0003] Centralized currency systems, which rely entirely on the credit of central system providers, have significant drawbacks. Consequently, decentralized, distributed virtual currency systems are attracting increasing attention.

[0004] In a distributed virtual currency system, users can obtain encrypted digital currency by completing exhaustive tasks issued by the system's backend server through corresponding task processing devices. The exhaustive tasks record historical transaction data, task difficulty, timestamp and other information in the virtual currency system. When the user receives the exhaustive task, a field corresponding to the exhaustive task is generated based on the information contained in the exhaustive task. The field contains immutable subfields and variable subfields.

[0005] The task processing device obtains multiple different fields by continuously changing the characters in the variable subfield, and verifies whether the hash value of each field meets the requirements through the hash algorithm. When a hash value that meets the requirements is obtained through verification, it is determined that the exhaustive task is completed, and the field corresponding to the hash value is reported to the server. When a hash value that meets the requirements is not obtained, the characters in the variable subfield are continued to be changed to obtain more different fields, and the verification is continued until the field corresponding to the hash value that meets the requirements is obtained or the instruction to end the task is obtained.

[0006] Due to the large length of variable subfields, the number of fields corresponding to the exhaustive task is extremely large, and the probability of completing the task is very low. Therefore, completing such tasks usually requires a computer cluster with high processing power. However, even using a computer cluster to complete such exhaustive tasks consumes a lot of power. Therefore, how to propose a task processing method to simplify the calculation process and reduce power consumption is a technical problem that needs to be solved urgently. Summary of the Invention

[0007] The present invention provides a task processing method and device for simplifying the task process and reducing equipment power consumption.

[0008] The present invention provides a task processing method, comprising:

[0009] Receive the exhaustive task sent by the server;

[0010] Generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type;

[0011] Compare the characters at preset positions in all fields through the local high-level nodes;

[0012] The fields are grouped according to the comparison results; wherein, fields with consistent comparison results are in the same field group.

[0013] The beneficial effect of the present invention is that the fields with consistent preset position comparison results are divided into the same field group, so that the characters at the preset positions of the fields in the same field group can share the calculation results of the preset positions, that is, the characters at the preset positions only need to be verified once, which simplifies the hash calculation process, that is, simplifies the task process, and reduces the power consumption of the device.

[0014] In one embodiment, the characters at predetermined positions in all fields are compared by a local high-level node, including:

[0015] Determining whether the first preset number is greater than a second preset number;

[0016] When the first preset number is greater than the second preset number, the characters at the preset positions in all fields are compared by the local master node;

[0017] When the first preset number is smaller than the second preset number, the characters at preset positions in all fields are compared by the local first-level sub-node, wherein the processing speed of the local first-level sub-node is smaller than the processing speed of the local main node.

[0018] The beneficial effects of this embodiment are: when the number of fields is large, the comparison is performed through the local main node with the highest processing speed, which speeds up the comparison speed; when the number of fields is small, the comparison is performed through the first-level child node with a processing speed second only to the main node, which reduces the waste and wear of high-performance equipment performance.

[0019] In one embodiment, after grouping the fields according to the comparison results, the method further includes:

[0020] Send the grouped fields to the secondary child node.

[0021] The beneficial effects of this embodiment are:

[0022] In one embodiment, when there are multiple field groups and secondary child nodes, sending the grouped fields to the secondary child nodes includes:

[0023] Get the number of fields in each field group;

[0024] The field groups are sent to different secondary child nodes respectively according to the number of fields in each field group, wherein the number of fields in the field group is positively correlated with the processing speed of the corresponding secondary child node.

[0025] The beneficial effect of this embodiment is that each field group is assigned to a secondary sub-node whose processing speed is positively correlated with the number of fields in the field group, thereby ensuring that the task progress of all secondary sub-nodes remains synchronized as much as possible, thereby fully utilizing the device performance of all secondary sub-nodes and balancing the load of all secondary sub-nodes.

[0026] In one embodiment, before generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type, the method further includes:

[0027] Obtain the processing speed of the second-level child node, where the processing speed of the second-level child node is lower than the processing speed of the local high-level node;

[0028] The first preset number is determined according to the processing speed, wherein the processing speed is proportional to the first preset number.

[0029] The beneficial effect of this embodiment is that the number of fields used to complete the exhaustive task is determined according to the processing speed of the second-level child node, ensuring that after the field is sent to the second-level child node, the second-level child node can quickly and timely complete the verification of the field, thereby ensuring the timeliness of the task.

[0030] The present invention is also used to provide a task processing device, comprising:

[0031] The receiving module is used to receive the exhaustive task sent by the server;

[0032] A generating module, configured to generate a first preset number of fields for completing the exhaustive task according to the exhaustive task type;

[0033] The comparison module is used to compare the characters at preset positions in all fields through local high-level nodes;

[0034] The grouping module is used to group the fields according to the comparison results; wherein the fields with consistent comparison results are in the same field group.

[0035] In one embodiment, the comparison module includes:

[0036] a judging submodule, configured to judge whether the first preset number is greater than a second preset number;

[0037] A first comparison submodule, configured to compare characters at preset positions in all fields through a local master node when the first preset number is greater than a second preset number;

[0038] The second comparison submodule is used to compare the characters at preset positions in all fields through the local first-level sub-node when the first preset number is less than the second preset number, wherein the processing speed of the local first-level sub-node is less than the processing speed of the local main node.

[0039] In one embodiment, the apparatus further comprises:

[0040] The sending module is used to group the fields according to the comparison result and then send the grouped fields to the secondary child node.

[0041] In one embodiment, the sending module includes:

[0042] An acquisition submodule, used for acquiring the number of fields in each field group when there are multiple field groups and secondary child nodes;

[0043] The sending submodule is configured to send the field groups to different secondary subnodes respectively according to the number of fields in each field group, wherein the number of fields in the field group is positively correlated with the processing speed of the corresponding secondary subnode.

[0044] In one embodiment, the apparatus further comprises:

[0045] an acquisition module, configured to acquire a processing speed of a second-level sub-node before generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type, wherein the processing speed of the second-level sub-node is less than the processing speed of the local high-level node;

[0046] A determination module is configured to determine the first preset number according to the processing speed, wherein the processing speed is proportional to the first preset number.

[0047] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0048] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0050] Figure 1 is a flowchart showing a task processing method according to an exemplary embodiment;

[0051] Figure 2 is a flowchart showing a task processing method according to an exemplary embodiment;

[0052] Figure 3 is a flowchart showing a task processing method according to an exemplary embodiment;

[0053] Figure 4 is a flowchart showing a task processing method according to an exemplary embodiment;

[0054] Figure 5 is a block diagram of a task processing device according to an exemplary embodiment;

[0055] Figure 6 is a block diagram of a task processing device according to an exemplary embodiment;

[0056] Figure 7 is a block diagram of a task processing device according to an exemplary embodiment;

[0057] Figure 8 is a block diagram of a task processing device according to an exemplary embodiment;

[0058] Figure 9 The figure is a block diagram of a task processing device according to an exemplary embodiment. DETAILED DESCRIPTION

[0059] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0060] Figure 1 is a flowchart of a task processing method according to an exemplary embodiment. Figure 1 As shown, the method can be implemented by a computer cluster, and the method can be implemented as the following steps S101-S104:

[0061] In step S101, an exhaustive task sent by a server is received;

[0062] In step S102, a first preset number of fields for completing the exhaustive task is generated according to the exhaustive task type;

[0063] In step S103, characters at preset positions in all fields are compared by local high-level nodes;

[0064] In step S104, the fields are grouped according to the comparison results; fields with consistent comparison results are in the same field group.

[0065] In this embodiment, when receiving an exhaustive task sent by a server, where the exhaustive task involves obtaining encrypted digital currency and includes information such as historical transaction data, task difficulty, and timestamps from the virtual currency system, the master node in the cluster randomly generates multiple fields for completing the exhaustive task based on the task type. These fields include immutable subfields, such as those used to identify information such as historical transaction data, and mutable subfields. Of the multiple fields generated by the master node for completing the exhaustive task, the immutable subfields remain the same, while the mutable subfields are randomly altered through exhaustive enumeration. By randomly altering the mutable subfields, multiple different fields for completing the exhaustive task are generated.

[0066] It should be noted that the hash values ​​of these fields are obtained through hash calculation. When a hash value is less than a specific number, the field corresponding to the hash value is the field that meets the exhaustive task.

[0067] However, since the length of the variable subfield is relatively large, the computational difficulty is very high during the hash calculation process, thereby causing a large power consumption.

[0068] In order to reduce power consumption, in this solution, characters at specific positions in a field are compared, and fields with consistent comparison results are grouped into the same field group.

[0069] For example, the length of the variable subfield in each field is 8. The characters corresponding to the first four bits of the 8-bit variable subfield are compared, and fields with the same characters corresponding to the first four bits of the variable subfield are grouped together. When hashing the same field group, since the first four bits of the variable subfields are the same, the parts of the variable subfields that share the same characters are hashed once to obtain the same calculation results. This same calculation result can then be reused in the calculation of each field in the field group. That is, after obtaining the same calculation results, each field only needs to calculate the results corresponding to the last four bits of the variable subfield, thereby reducing power consumption.

[0070] It should be noted that the setting of the specific position in the field is not limited to the above examples, and the user can freely set it according to actual needs.

[0071] In addition, since each field needs to be compared with all other fields, assuming that the above comparison process is processed in parallel by N devices with a processing speed of 1, not only do these N devices need to communicate during the comparison process so that each field in each device can be compared with all other fields, but after the comparison is completed, the comparison results obtained by these N devices need to be summarized. Therefore, not only does parallel processing require additional communication costs, but after the comparison is completed, a summary is also required. Therefore, the processing speed of N devices with a processing speed of 1 cannot reach N in parallel, and thus the effect of parallel comparison is not ideal. However, if the comparison process is centralized by a device with a processing speed of N, the processing speed can reach N. Therefore, in this embodiment, the comparison process for characters at preset positions in the field is completed by high-level nodes with higher processing speeds, which can effectively improve the efficiency of the comparison.

[0072] The beneficial effect of the present invention is that the fields with consistent preset position comparison results are divided into the same field group, so that the characters at the preset positions of the fields in the same field group can share the verification results, that is, the characters at the preset positions only need to be verified once, which simplifies the hash calculation process, that is, simplifies the task process, and reduces the power consumption of the device.

[0073] In one embodiment, Figure 2 As shown, the above step S103 can be implemented as the following steps S201-S203:

[0074] In step S201, it is determined whether the first preset number is greater than the second preset number;

[0075] In step S202, when the first preset number is greater than the second preset number, the characters at the preset positions in all fields are compared by the local master node;

[0076] In step S203, when the first preset number is less than the second preset number, the characters at the preset positions in all fields are compared by the local first-level sub-node, wherein the processing speed of the local first-level sub-node is less than the processing speed of the local main node.

[0077] In this embodiment, a second preset number threshold is reasonably set according to the processing speed of the local main node and the processing speed of the first-level child node to determine whether the number of fields generated by the main node is greater than the threshold. When the number of fields generated by the main node is greater than the threshold, the main node with the highest processing speed is used to compare the characters at the preset positions in all fields; when the number of fields generated by the main node is less than the threshold, the first-level child node with a processing speed lower than the main node can also complete the comparison of the characters at the preset positions in all fields within a short time, then the local first-level child node is used to compare the characters at the preset positions in all fields. In this way, it will not affect the execution of other tasks by the main node, and it also avoids the waste of high-performance equipment and wear and tear on high-performance equipment, which can reduce costs to a certain extent.

[0078] The beneficial effects of this embodiment are: when the number of fields is large, the comparison is performed through the local main node with the highest processing speed, which speeds up the comparison speed; when the number of fields is small, the comparison is performed through the first-level child node with a processing speed second only to the main node, which reduces the waste and wear of high-performance equipment performance.

[0079] In one embodiment, Figure 3 As shown, after the above step S104, the method can also be implemented as the following step S301:

[0080] In step S301, the grouped fields are sent to the second-level child nodes.

[0081] For example, the grouped fields are sent to the local second-level child node, and the hash values ​​of these fields are calculated by the second-level child node. Every time the hash value of a field is calculated, it is verified whether the calculated hash value meets the requirements. When a hash value that meets the requirements is obtained, it is determined that the exhaustive task is completed, and the field corresponding to the hash value that meets the requirements is the required field.

[0082] It should be noted that when the field corresponding to the hash value that meets the requirements is obtained, the second-level child node will report the verification result to the first-level child node, which will report it to the main node, and then the main node will report it to the server that issued the exhaustive task.

[0083] In one embodiment, Figure 4 As shown, when there are multiple field groups and secondary child nodes, the above step S301 can also be implemented as the following steps S401-S402:

[0084] In step S401, the number of fields in each field group is obtained;

[0085] In step S402 , the field groups are sent to different second-level child nodes according to the number of fields in each field group. The number of fields in a field group is positively correlated with the processing speed of the corresponding second-level child node.

[0086] In this embodiment, when there are multiple field groups and secondary child nodes, the number of fields in each field group is obtained, and these field groups are sent to different secondary child nodes respectively.

[0087] Since the processing speeds of the second-level child nodes may vary, before sending these field groups to different second-level child nodes according to the number of fields in each field group, it is necessary to obtain the processing speeds of these second-level child nodes (the specific acquisition process is described in detail below). After obtaining the processing speeds of the second-level child nodes, the field groups with more fields are sent to the second-level child nodes with faster processing speeds, and the field groups with fewer fields are sent to the second-level child nodes with slower processing speeds.

[0088] For example, there are four secondary child nodes A, B, C, and D in the cluster, with corresponding processing speeds of 1, 2, 4, and 5 respectively. The unit of processing speed is (million times / second).

[0089] At this point, if the number of field groups and the number of second-level child nodes are respectively four field groups, a, b, c, and d, the number of fields in field group a is 12 million, the number of fields in field group b is 50 million, the number of fields in field group c is 35 million, and the number of fields in field group d is 22 million. Since this embodiment stipulates that the number of fields in a field group is positively correlated with the processing speed of the corresponding second-level child node, according to calculations, field group a is sent to second-level child node A, field group b is sent to second-level child node D, field group c is sent to second-level child node C, and field group d is sent to second-level child node B.

[0090] In addition, since the variable subfields of a field are random, the number of field groups is uncontrollable. It is possible that the number of field groups is greater than the number of second-level child nodes, or it may be less than the number of second-level child nodes.

[0091] When the number of field groups is greater than the number of second-level child nodes, since this solution is intended to reduce the calculation process of second-level child nodes, fields with the same preset position characters are placed in the same field group and sent to the same second-level child node. At this time, it is obviously inappropriate to let a second-level child node process two field groups at the same time. In this solution, when the number of field groups is greater than the number of second-level child nodes, the field groups are divided into multiple batches for processing. For example, when a second-level child node processes the first batch, the processing progress of each second-level child node is monitored. When a second-level child node completes processing, the field group corresponding to the second-level child node in the second batch is sent to the second-level child node, and so on.

[0092] When the number of field groups is less than the number of second-level child nodes, for example, when there are only three field groups a, b and c, the number of fields in field group a is 10 million, the number of fields in field group b is 50 million, and the number of fields in field group c is 60 million, then field group a can be assigned to the second-level child node A, field group b can be assigned to the second-level child node D, and field group c can be divided into two equal parts and assigned to the second-level child nodes B and C, among which the second-level child node B is assigned 20 million fields and the second-level child node C is assigned 40 million fields.

[0093] The beneficial effect of this embodiment is that each field group is assigned to a secondary sub-node whose processing speed is positively correlated with the number of fields in the field group, thereby ensuring that the task progress of all secondary sub-nodes remains synchronized as much as possible, thereby fully utilizing the device performance of all secondary sub-nodes and balancing the load of all secondary sub-nodes.

[0094] In one embodiment, before the above step S102, the method may also be implemented as the following steps A1-A2:

[0095] In step A1, the processing speed of the second-level child node is obtained, wherein the processing speed of the second-level child node is lower than the processing speed of the local high-level node;

[0096] In step A2, a first preset number is determined according to a processing speed, wherein the processing speed is proportional to the first preset number.

[0097] When the master node generates the field indicating that the user has completed an exhaustive task, the processing capacity of each processing node must be considered in advance to ensure timely completion of the task. Therefore, in this embodiment, the processing speed of the secondary sub-nodes is first obtained. The processing speed of the secondary sub-nodes can be obtained in the following three ways, but is not limited to:

[0098] Method 1

[0099] The correspondence between each processor model and processing speed can be pre-stored locally. In this way, when the processing speed of a second-level sub-node needs to be obtained, the processor model of the second-level sub-node can be obtained, and the processing speed of the second-level sub-node can be determined based on the pre-stored correspondence between the processor model and processing speed.

[0100] Method 2

[0101] The number of processing chips in the processor of the second-level sub-node can be obtained. The proportional coefficient between the number of similar processing chips and the computing speed is a fixed value, so the processing speed of the second-level sub-node can be determined according to the number of processing chips.

[0102] Method 3

[0103] During each task processing, the master node can record the processing speed of each second-level subnode in each task based on the size of the corresponding subtask and the actual time it took to complete the subtask. This speed is then used as historical data. Upon receiving an exhaustive task from the server, the master node can retrieve this historical data and use it to determine the processing speed of the second-level subnodes. For example, the master node can use the average of the processing speeds of each second-level subnode across all previous task processing processes as the processing speed of each second-level subnode, or use the processing speed of each second-level subnode in the most recent task processing process as the processing speed of each second-level subnode in the current task processing process.

[0104] The total processing speed of all secondary subnodes is calculated according to the processing speed of each secondary subnode, and the first preset number is calculated according to the total processing speed and the expected task completion time, that is, the number of fields to be generated for completing the exhaustive task is calculated.

[0105] The beneficial effect of this embodiment is that the number of fields used to complete the exhaustive task is determined according to the processing speed of the second-level child node, ensuring that after the field is sent to the second-level child node, the second-level child node can quickly and timely complete the verification of the field, thereby ensuring the timeliness of the task.

[0106] Figure 5 is a block diagram of a task processing device according to an exemplary embodiment. Figure 5 As shown, the device can be implemented by a computer cluster, including the following modules:

[0107] Receiving module 51, used for receiving the exhaustive task sent by the server;

[0108] A generating module 52, configured to generate a first preset number of fields for completing the exhaustive task according to the exhaustive task type;

[0109] A comparison module 53 is used to compare characters at preset positions in all fields through local high-level nodes;

[0110] The grouping module 54 is used to group the fields according to the comparison results; wherein the fields with the same comparison results are in the same field group.

[0111] In one embodiment, Figure 6 As shown, the comparison module 53 includes:

[0112] A judging submodule 61 is configured to judge whether the first preset number is greater than the second preset number;

[0113] A first comparison submodule 62 is configured to compare characters at preset positions in all fields via a local master node when the first preset number is greater than the second preset number;

[0114] The second comparison submodule 63 is used to compare the characters at preset positions in all fields through the local first-level sub-node when the first preset number is less than the second preset number, wherein the processing speed of the local first-level sub-node is less than the processing speed of the local main node.

[0115] In one embodiment, Figure 7 As shown, the device also includes:

[0116] The sending module 71 is configured to group the fields according to the comparison result and then send the grouped fields to the secondary child nodes.

[0117] In one embodiment, Figure 8 As shown, the sending module 71 includes:

[0118] The acquisition submodule 81 is used to obtain the number of fields in each field group when there are multiple field groups and secondary child nodes;

[0119] The sending submodule 82 is configured to send the field groups to different secondary subnodes according to the number of fields in each field group. The number of fields in a field group is positively correlated with the processing speed of the corresponding secondary subnode.

[0120] In one embodiment, Figure 9 As shown, the device also includes:

[0121] an acquisition module 91 configured to acquire a processing speed of a second-level child node before generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type, wherein the processing speed of the second-level child node is lower than the processing speed of the local high-level node;

[0122] The determination module 92 is configured to determine a first preset number according to a processing speed, wherein the processing speed is proportional to the first preset number.

[0123] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0124] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0125] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0127] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A task processing method, characterized in that: include: Receive the exhaustive task sent by the server; Generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type; Compare characters at preset positions in all fields using local high-level nodes, including: Determining whether the first preset number is greater than a second preset number; When the first preset number is greater than the second preset number, the characters at the preset positions in all fields are compared by the local master node; When the first preset number is less than the second preset number, characters at preset positions in all fields are compared by a local first-level sub-node, wherein a processing speed of the local first-level sub-node is less than a processing speed of a local master node, and the local high-level node includes a local master node and a first-level sub-node; The fields are grouped according to the comparison results; wherein the fields with the same comparison results are in the same field group; Calculate the characters at preset positions in any field in the same field group and obtain the calculation results; The calculation results are reused and the fields in any same field group are calculated.

2. The method according to claim 1, wherein After grouping the fields according to the comparison results, the method further includes: Send the grouped fields to the secondary child node.

3. The method according to claim 2, wherein When there are multiple field groups and secondary child nodes, sending the grouped fields to the secondary child nodes includes: Get the number of fields in each field group; The field groups are sent to different secondary child nodes respectively according to the number of fields in each field group, wherein the number of fields in the field group is positively correlated with the processing speed of the corresponding secondary child node.

4. The method according to claim 2, wherein Before generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type, the method further includes: Obtain the processing speed of the second-level child node, where the processing speed of the second-level child node is lower than the processing speed of the local high-level node; The first preset number is determined according to the processing speed, wherein the processing speed is proportional to the first preset number.

5. A task processing device, characterized in that: include: The receiving module is used to receive the exhaustive task sent by the server; A generating module, configured to generate a first preset number of fields for completing the exhaustive task according to the exhaustive task type; A comparison module is used to compare characters at preset positions in all fields through local high-level nodes. The comparison module includes: a judging submodule, configured to judge whether the first preset number is greater than a second preset number; A first comparison submodule, configured to compare characters at preset positions in all fields through a local master node when the first preset number is greater than a second preset number; a second comparison submodule, configured to compare characters at preset positions in all fields using a local first-level subnode when the first preset number is less than a second preset number, wherein a processing speed of the local first-level subnode is lower than a processing speed of a local master node, and the local high-level node includes a local master node and a first-level subnode; A grouping module, configured to group the fields according to the comparison results; wherein fields with consistent comparison results are in the same field group; The calculation module is used to calculate the characters at preset positions in the fields in any same field group and obtain calculation results, reuse the calculation results and calculate the fields in the any same field group.

6. The device according to claim 5, characterized in that The device further comprises: The sending module is used to group the fields according to the comparison result and then send the grouped fields to the secondary child node.

7. The device according to claim 6, characterized in that The sending module includes: An acquisition submodule, used for acquiring the number of fields in each field group when there are multiple field groups and secondary child nodes; The sending submodule is configured to send the field groups to different secondary subnodes respectively according to the number of fields in each field group, wherein the number of fields in the field group is positively correlated with the processing speed of the corresponding secondary subnode.

8. The device according to claim 6, wherein The device further comprises: an acquisition module, configured to acquire a processing speed of a second-level child node before generating a first preset number of fields for completing the exhaustive task according to the exhaustive task type, wherein the processing speed of the second-level child node is less than a processing speed of a local high-level node; A determination module is configured to determine the first preset number according to the processing speed, wherein the processing speed is proportional to the first preset number.

9. A computing device, characterized in that The computing device is loaded with computer program instructions, so that the computing device executes the task processing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Optimizing method, device and circuit for Hash computing chip of bitcoin proof of work

    CN105245327A

  • Task processing method, device and system

    CN105912399A