CN112600919A - Equipment computing power evaluation method and system based on PoW consensus mechanism - Google Patents

Equipment computing power evaluation method and system based on PoW consensus mechanism Download PDF

Info

Publication number
CN112600919A
CN112600919A CN202011464087.XA CN202011464087A CN112600919A CN 112600919 A CN112600919 A CN 112600919A CN 202011464087 A CN202011464087 A CN 202011464087A CN 112600919 A CN112600919 A CN 112600919A
Authority
CN
China
Prior art keywords
equipment
evaluated
hash operation
time
calculation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011464087.XA
Other languages
Chinese (zh)
Other versions
CN112600919B (en
Inventor
刘伟伟
王洋
须成忠
叶可江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Institute of Advanced Technology of CAS
Original Assignee
Shenzhen Institute of Advanced Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Institute of Advanced Technology of CAS filed Critical Shenzhen Institute of Advanced Technology of CAS
Priority to CN202011464087.XA priority Critical patent/CN112600919B/en
Priority to PCT/CN2020/139637 priority patent/WO2022120995A1/en
Publication of CN112600919A publication Critical patent/CN112600919A/en
Application granted granted Critical
Publication of CN112600919B publication Critical patent/CN112600919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of information, and discloses a method and a system for evaluating equipment computing power based on a PoW consensus mechanism. The evaluation method comprises the following steps: selecting block chain computing equipment using a PoW consensus algorithm as equipment to be evaluated; finishing a hash operation problem, wherein the hash operation problem takes 0 string of beginning and sets the length of 0 string of beginning as a difficulty mark; the hash operation problem is classified as simpler or more difficult; counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time; and counting the time spent by the equipment to be evaluated to finish a more difficult hash operation problem. Aiming at block chain computing equipment based on a PoW consensus mechanism and existing heterogeneity, the invention respectively evaluates the block chain computing equipment with stronger calculation power and weaker calculation power according to the number of simpler hash calculation problems and the time spent on completing one more difficult hash calculation problem in unit time, and has stronger pertinence and better compatibility.

Description

Equipment computing power evaluation method and system based on PoW consensus mechanism
Technical Field
The invention relates to the technical field of information, in particular to a method and a system for evaluating equipment computing power based on a PoW consensus mechanism.
Background
At present, the block chain technology is a relatively advanced research field, and the block chain application ecology of bitcoin, Ether house and the like is more mature. As blockchain technology evolves, more and more blockchain-specific devices are being developed, such as blockchain computing cards, blockchain network cards, blockchain memory cards, and so on. Most of these blockchain-specific devices are specially optimized for the characteristics of blockchains based on the traditional computer architecture to adapt to some characteristics of blockchain systems. Blockchain computing cards are one of the most typical blockchain-specific computing devices.
The traditional general-purpose computing equipment emphasizes the universality of computing capacity during design, tends to be more balanced in the aspects of instruction design, dominant frequency, pipeline structure and the like, and meets the requirements of daily use, entertainment, office and the like. In contrast, a computing device specific to a blockchain does not need to compromise functional and usage balance, and only needs to be able to efficiently and accurately complete complex computing tasks specific to the blockchain system in terms of functions. Therefore, indexes such as floating point arithmetic performance and dominant frequency used for evaluating the traditional computing equipment are not completely suitable for the evaluation standard of the block chain specific equipment, and an evaluation standard of computing power needs to be redesigned to adapt to new computing requirements in a block chain system, so that the development and development of the block chain specific equipment are guided better.
The existing technical scheme comprises the following steps:
(1) and the scheme takes the floating-point operation performance as a performance evaluation index. The scheme is a common evaluation index in a traditional calculation power evaluation algorithm, and the basic principle is as follows: scientific calculation relates to a large amount of high-precision floating-point operations, and if one machine can complete more high-precision floating-point operations in unit time, the corresponding operational capability is stronger. The calculation power evaluation scheme has strong specificity and mainly aims at a scientific operation and ultra-large hybrid calculation architecture.
(2) And calculating an acceleration ratio as a performance evaluation index. Compared with the scheme (1), the scheme avoids the limitation of a specific calculation task, and the basic principle is as follows: the computing power of a certain computer for a certain task is taken as a reference, and the computing power of other machines for the same task is measured as comparison data, so that the difference of the computing power of different computers for different tasks is obtained. The measurement index of this scheme is the ratio of different computers in time for the same calculation task.
Both of the above approaches have problems when computing power ratings specific to blockchain systems:
(1) the scheme taking the floating-point operation performance as the performance evaluation index mainly aims at two calculation structures of a general calculation framework and an ultra-large scientific calculation task machine, and takes the floating-point operation which can be completed in unit time as the index of calculation power evaluation. In the blockchain system using PoW as a consensus algorithm, the occupation ratio of floating point operations is small, and the main computational power consumption is concentrated on operations such as hash operation and shift operation. Therefore, evaluating block chain specific devices using floating point performance is inaccurate.
(2) Compared with the scheme of taking the calculation acceleration ratio as the performance evaluation index, the problem specific to hardware equipment and calculation tasks in the scheme (1) can be avoided, but the finally obtained calculation capacity evaluation index data is bound with a specific application program, and specific calculation behaviors cannot be analyzed from a hardware level. Therefore, although the calculation power evaluation algorithm is more targeted than the scheme (1), the calculation power evaluation algorithm also needs to be improved correspondingly.
In addition, both the above two schemes are directed to the traditional computing task, which is inconsistent with the operation instructions such as hash operation, shift operation, logic judgment and the like which are required to be used in a large amount by the PoW consensus algorithm. When designing the computation power evaluation algorithm specific to the blockchain system, the influence of the computation instructions on the computation speed and the computation result needs to be considered again.
Disclosure of Invention
The invention aims to provide a device calculation force evaluation method and system based on a PoW consensus mechanism aiming at the technical problems in the prior art, and the method and system are strong in pertinence and better in compatibility.
In order to solve the problems proposed above, the technical scheme adopted by the invention is as follows:
the invention provides an equipment computing power evaluation method based on a PoW consensus mechanism, which specifically comprises the following steps:
selecting block chain computing equipment using a PoW consensus algorithm as equipment to be evaluated;
finishing a hash operation problem, wherein the hash operation problem takes 0 string of beginning and sets the length of 0 string of beginning as a difficulty mark;
comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time;
counting the time spent by the equipment to be evaluated on completing a more difficult hash operation problem;
and integrating the completion number and the time to obtain the calculation power evaluation value of the equipment to be evaluated.
Further, the number of the hash operation problems which are relatively simple to complete in unit time is used as an evaluation index, and the method specifically includes the following steps:
generating a string of random data, and setting operation parameters including specific difficulty coefficients, operation time and start time;
sending the random data and the operation parameters to all the equipment to be evaluated;
after the starting time, the equipment to be evaluated starts to calculate the hash operation problem of the specified difficulty coefficient, and a calculation result is obtained and stored;
after the operation time is over, all calculation results of the equipment to be evaluated are verified and summarized;
and taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
Further, taking the time for solving a relatively difficult hash operation problem as an evaluation index specifically includes:
generating a string of random data, and setting operation parameters including specific difficulty coefficients and operation starting time;
sending the random data and the operation parameters to all the equipment to be evaluated;
after the starting time, the equipment to be evaluated starts to calculate the solution of the hash operation problem of the specified difficulty coefficient, and stores the calculation result;
verifying the solution of the obtained hash operation problem, and recording the time of receiving the solution;
and counting the duration time of the calculation process of the equipment to be evaluated, and taking the duration time of the calculation process as an index of calculation power evaluation.
Further, the computing of the hash operation problem based on the PoW consensus mechanism obtains a result, specifically:
if the difficulty coefficient of the hash operation problem is a, the solution is assumed to be s, and if the result obtained by taking s as the solution verification meets the difficulty coefficient a, s is the solution of the corresponding hash operation problem.
Further, the correctness of the obtained solution of the hash operation problem is verified, and whether the obtained solution meets the difficulty coefficient is verified, specifically:
if the difficulty coefficient of the hash operation problem is a, setting the corresponding solution as s; calculating the result of the hash operation problem by taking s as a parameter, intercepting the first a strings of the obtained result, and if the first a strings are the same as all 0 strings corresponding to the difficulty coefficient a, indicating that the result is correct, namely, an effective solution; if not, the result is wrong.
The invention also provides a system of the equipment computing power evaluation method based on the PoW consensus mechanism, which comprises the following steps:
a device selection module: the block chain computing equipment is used for selecting the block chain computing equipment using the PoW consensus algorithm as equipment to be evaluated;
difficulty setting module: the hash operation problem is used for finishing the hash operation, the hash operation problem takes 0 string of beginning, and the length of 0 string of beginning is set as a difficulty mark;
a hash problem dividing module: comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
the number counting module: the device and the method are used for counting the number of the simple hash operation problems completed by the device to be evaluated in unit time;
a time counting module: the method is used for counting the time spent by the equipment to be evaluated to finish a more difficult hash operation problem;
a comprehensive evaluation module: and the calculation capacity evaluation value of the equipment to be evaluated is obtained by integrating the completion number and the time spent.
Further, the number counting module includes:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients, operation time and start time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification summary module: the device is used for verifying and summarizing all calculation results of the equipment to be evaluated after the operation time is over;
an index determination module: and the method is used for taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
Further, the time statistic module comprises:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients and operation starting time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification recording module: the hash operation system is used for verifying the solution of the obtained hash operation problem and recording the time of receiving the solution;
an index determination module: the method is used for counting the duration time of the calculation process of the equipment to be evaluated, and the duration time of the calculation process is used as an index of calculation power evaluation.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods when executing the program.
The invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the steps of any of the methods.
Compared with the prior art, the invention has the beneficial effects that:
the equipment computing power evaluation method and system provided by the invention are used for evaluating the block chain computing equipment based on the PoW consensus mechanism by taking the computing speed of the hash problem as an evaluation index of the block chain computing equipment, and evaluating the block chain computing equipment with stronger computing power and weaker computing power respectively according to the number of simpler hash computing problems and the time spent on completing one more difficult hash computing problem in unit time and the heterogeneity of the block chain computing equipment, so that the pertinence is stronger, and the compatibility is better.
Drawings
In order to illustrate the solution of the invention more clearly, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are some embodiments of the invention, and that other drawings may be derived from these drawings by a person skilled in the art without inventive effort. Wherein:
fig. 1 is a flowchart of an apparatus computing power evaluation method based on a PoW consensus mechanism according to the present invention.
FIG. 2 is a flow chart of the present invention using the number of the hash operation completed problems as the evaluation index.
FIG. 3 is a flow chart of the present invention using the time taken to complete the hash operation as an evaluation index.
FIG. 4 is a schematic diagram of an apparatus computing power evaluation system based on a PoW consensus mechanism according to the present invention.
FIG. 5 is a schematic diagram of a number statistics module of the present invention.
FIG. 6 is a schematic diagram of the time statistic module of the present invention.
Fig. 7 is a schematic physical structure diagram of an electronic device according to the present invention.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Referring to fig. 1, the present invention provides an apparatus calculation power evaluation method based on a PoW consensus mechanism, and the evaluation method specifically includes:
step S1: and selecting the block chain computing equipment using the PoW consensus algorithm as the equipment to be evaluated.
Step S2: and finishing the hash operation problem, wherein the hash operation problem uses 0 string head, and the length of the 0 string head is set as a difficulty mark.
Step S3: and comparing the length of the beginning of the 0 string with the difficulty mark, and dividing the hash operation problem into simpler or more difficult.
Step S4: and counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time.
Step S5: and counting the time spent by the equipment to be evaluated to finish a more difficult hash operation problem.
Step S6: and (4) integrating the number of the completed simple hash operation problems in the step S4 and the time spent on the difficult hash operation problems in the step S4 to obtain the evaluation completion of the computing power evaluation value of the equipment to be evaluated.
In the embodiment of the present invention, in the block chain computing device using the PoW consensus algorithm, a condition for calculating a specific answer is to find a specific character string for the submitted data, so that a result obtained after a certain hash algorithm operation may begin with a certain specified number of 0 strings, such as 00007186CEA 8. The specified number of the 0 string heads is an index for evaluating the difficulty of a hash problem, the difficulty is positively correlated with the length of the 0 string heads, the difficulty is larger when the length of the 0 string heads is longer, and the difficulty is exponentially increased when the length of the 0 string is increased by 1. In addition, the same blockchain computing device finds the same answer under the same data, the same start string value and the same search direction.
Specifically, referring to fig. 2, taking the number of simpler hash operation problems that can be solved in a unit time as an evaluation index specifically includes:
step S41: an external evaluation system generates a string of random data, and sets operation parameters including specific difficulty coefficients, operation time and start time;
step S42: sending the random data and the operation parameters to all the equipment to be evaluated;
step S43: after the starting time, the equipment to be evaluated starts to calculate the hash operation problem of the specified difficulty coefficient, and a calculation result is obtained and stored; specifically, whether the result is overtime is judged every time one result is obtained, and if the result is not overtime, the result is recorded and stored; if the time is out, the record is not recorded.
Step S44: after the ending time is reached, namely the operation time is ended, packaging the obtained calculation results by the equipment to be evaluated, sending the packaged calculation results to an evaluation system, and verifying and summarizing all the calculation results by the evaluation system;
step S45: and taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
Specifically, referring to fig. 3, taking the time for solving a more difficult hash operation problem as an evaluation index specifically includes:
step S51: the evaluation system generates a string of random data and sets operation parameters including specific difficulty coefficients and operation starting time;
step S52: sending the random data and the operation parameters to all the equipment to be evaluated and starting;
step S53: after the starting time, the equipment to be evaluated starts to calculate the solution of the hash operation problem of the specified difficulty coefficient, and stores the calculation result;
step S54: packaging the calculated solution by the equipment to be evaluated, sending the packaged solution to an evaluation system, verifying the obtained solution of the hash operation problem, and recording the time of receiving the solution, namely the end time;
step S55: the evaluation system calculates the duration time of the calculation process of the equipment to be evaluated, and the duration time of the calculation process is used as an index for evaluating the calculation power of the equipment to be evaluated. Specifically, the final duration is calculated by subtracting the start time from the end time.
Further, based on the PoW consensus mechanism, calculating a hash operation problem to obtain a result, specifically:
if the difficulty coefficient of the hash operation problem is a, the solution is assumed to be s, and if the result obtained by taking s as the solution verification meets the difficulty coefficient a, s is the solution of the corresponding hash operation problem.
Further, the correctness of the obtained solution of the hash operation problem is verified, and whether the obtained solution meets the difficulty coefficient is verified, specifically:
if the difficulty coefficient of the hash operation problem is a, setting the corresponding solution as s; calculating the result of the hash operation problem by taking s as a parameter, intercepting the first a strings of the obtained result, and if the first a strings are the same as all 0 strings corresponding to the difficulty coefficient a, indicating that the result is correct, namely, an effective solution; if not, the result is wrong.
In the embodiment of the invention, under the same condition, the two calculation force evaluation indexes are in a direct proportional relation. In the two schemes, the time required for completing a difficult hash operation problem is a relatively accurate evaluation index. The greater the difficulty of the hash operation problem, the higher the reliability of the evaluation index. Due to the heterogeneous computing power of blockchain computing devices, some poorly computing blockchain computing devices may take a long time to compute a solution, while some very computationally intensive blockchain computing devices may have a small time gap between them in computing the same problem. This results in the inability to distinguish between very computationally intensive block chain computing devices, so the number of simple hash operations performed per unit time is balanced as a supplemental indicator.
Theoretically, the simpler the hash operation problem is, the more the number of solutions in unit time can distinguish the differences between the block chain computing devices with stronger computing power, and the more difficult the hash operation problem is, the more the differences between the block chain computing devices with poorer computing power can be distinguished.
In the embodiment of the invention, the calculation power evaluation is carried out on a plurality of block chain computing devices such as raspberry pi 4, raspberry pi 3b, i7-9700k, e3-1230-v5 and the like, and experiments prove that the evaluation indexes are feasible and the operation states of different block chain computing devices on a block chain system are stable and reliable.
The evaluation index of the computing power of the two devices to be evaluated is further described by specific examples.
(1) The time for solving a more difficult hash operation problem is calculated by the method, and four groups of data in tables 1 to 4 are obtained.
TABLE 1
Figure BDA0002829830620000101
TABLE 2
Figure BDA0002829830620000102
TABLE 3
Figure BDA0002829830620000111
TABLE 4
Figure BDA0002829830620000112
(2) The number of the simple hash operation problems completed in unit time is calculated by the method, the time is limited to 10s, the difficulty is set to 3-5 hash strings at the beginning of 0, and the results of the following tables 5-8 are obtained:
TABLE 5
Figure BDA0002829830620000113
Figure BDA0002829830620000121
TABLE 6
Figure BDA0002829830620000122
TABLE 7
Figure BDA0002829830620000123
TABLE 8
Figure BDA0002829830620000124
According to the experimental data, the number of the simple hash operation problems completed in unit time and the time spent for completing one difficult hash operation problem are used as the calculation power evaluation of the equipment to be evaluated, and the reliability and the effectiveness are achieved.
Referring to fig. 4, an embodiment of the present invention further provides an apparatus calculation power evaluation system based on a PoW consensus mechanism, where the evaluation system includes:
a device selection module: the method is used for selecting the block chain computing device using the PoW consensus algorithm as the device to be evaluated.
Difficulty setting module: the method is used for finishing the hash operation problem, the hash operation problem uses 0 string head, and the length of the 0 string head is set as a difficulty mark.
A hash problem dividing module: and comparing the length of the beginning of the 0 string with the difficulty mark, and dividing the hash operation problem into simpler or more difficult.
The number counting module: the method is used for counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time.
A time counting module: the method is used for counting the time spent by the equipment to be evaluated to complete a more difficult hash operation problem.
A comprehensive evaluation module: and the calculation capacity evaluation value of the equipment to be evaluated is obtained by integrating the completion number and the time spent.
Further, referring to fig. 5, the number counting module includes:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients, operation time and start time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification summary module: the device is used for verifying and summarizing all calculation results of the equipment to be evaluated after the operation time is over;
an index determination module: and the method is used for taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
Further, referring to fig. 6, the time counting module includes:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients and operation starting time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification recording module: the hash operation system is used for verifying the solution of the obtained hash operation problem and recording the time of receiving the solution;
an index determination module: the method is used for counting the duration time of the calculation process of the equipment to be evaluated, and the duration time of the calculation process is used as an index of calculation power evaluation.
Specifically, the system provided in the embodiment of the present invention is specifically configured to execute the method embodiment described above, and details of the method embodiment of the present invention are not described again.
Fig. 7 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 7, the electronic device may include: a processor (processor)301, a communication Interface (communication Interface)302, a memory (memory)303 and a communication bus 304, wherein the processor 301, the communication Interface 302 and the memory 303 complete communication with each other through the communication bus 304. The processor 301 may invoke a computer program stored on the memory 303 and executable on the processor 301 to perform the methods provided by the various embodiments described above, including, for example:
selecting block chain computing equipment using a PoW consensus algorithm as equipment to be evaluated;
finishing a hash operation problem, wherein the hash operation problem takes 0 string of beginning and sets the length of 0 string of beginning as a difficulty mark;
comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time;
counting the time spent by the equipment to be evaluated on completing a more difficult hash operation problem;
and integrating the completion number and the time to obtain the calculation power evaluation value of the equipment to be evaluated.
In addition, the logic instructions in the memory 303 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the method provided in the foregoing embodiments when executed by a processor, and the method includes:
selecting block chain computing equipment using a PoW consensus algorithm as equipment to be evaluated;
finishing a hash operation problem, wherein the hash operation problem takes 0 string of beginning and sets the length of 0 string of beginning as a difficulty mark;
comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time;
counting the time spent by the equipment to be evaluated on completing a more difficult hash operation problem;
and integrating the completion number and the time to obtain the calculation power evaluation value of the equipment to be evaluated.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
According to the equipment calculation power evaluation method and system based on the PoW consensus mechanism, provided by the embodiment of the invention, aiming at the block chain calculation equipment based on the PoW consensus mechanism, the calculation speed of a hash problem is used as an evaluation index for evaluating the block chain calculation equipment, and meanwhile, aiming at the heterogeneity of the block chain calculation equipment, different evaluation indexes are respectively designed for two types of block chain calculation equipment with stronger calculation power and weaker calculation power to balance the heterogeneity in time and difficulty, so that the equipment calculation power evaluation method and system based on the PoW consensus mechanism are stronger in pertinence and better in compatibility.
In the embodiment of the invention, the algorithm for the hash operation problem adopts the SHA256 encryption algorithm, and other encryption algorithms (such as MD5, SHA160 and the like) are also feasible, so that the evaluation process described above can be completed.
In the embodiment of the invention, the equipment calculation power evaluation based on the PoW consensus mechanism is also suitable for the consensus result evaluation of other block chain systems based on algorithms such as PoS and Ethereum.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (10)

1. A device calculation power evaluation method based on a PoW consensus mechanism is characterized by comprising the following steps: the evaluation method specifically comprises the following steps:
selecting block chain computing equipment using a PoW consensus algorithm as equipment to be evaluated;
finishing a hash operation problem, wherein the hash operation problem takes 0 string of beginning and sets the length of 0 string of beginning as a difficulty mark;
comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
counting the number of the simple hash operation problems completed by the equipment to be evaluated in unit time;
counting the time spent by the equipment to be evaluated on completing a more difficult hash operation problem;
and integrating the completion number and the time to obtain the calculation power evaluation value of the equipment to be evaluated.
2. The PoW consensus mechanism-based device computation power evaluation method of claim 1, wherein: the number of the simple hash operation problems completed in unit time is used as an evaluation index, and the evaluation index specifically comprises the following steps:
generating a string of random data, and setting operation parameters including specific difficulty coefficients, operation time and start time;
sending the random data and the operation parameters to all the equipment to be evaluated;
after the starting time, the equipment to be evaluated starts to calculate the hash operation problem of the specified difficulty coefficient, and a calculation result is obtained and stored;
after the operation time is over, all calculation results of the equipment to be evaluated are verified and summarized;
and taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
3. The PoW consensus mechanism-based device computation power evaluation method of claim 1 or 2, wherein: the time for solving a relatively difficult hash operation problem is used as an evaluation index, and the method specifically comprises the following steps:
generating a string of random data, and setting operation parameters including specific difficulty coefficients and operation starting time;
sending the random data and the operation parameters to all the equipment to be evaluated;
after the starting time, the equipment to be evaluated starts to calculate the solution of the hash operation problem of the specified difficulty coefficient, and stores the calculation result;
verifying the solution of the obtained hash operation problem, and recording the time of receiving the solution;
and counting the duration time of the calculation process of the equipment to be evaluated, and taking the duration time of the calculation process as an index of calculation power evaluation.
4. The PoW consensus mechanism-based device computation power evaluation method of claim 3, wherein: the hash operation problem is calculated based on the PoW consensus mechanism to obtain a result, which specifically comprises the following steps:
if the difficulty coefficient of the hash operation problem is a, the solution is assumed to be s, and if the result obtained by taking s as the solution verification meets the difficulty coefficient a, s is the solution of the corresponding hash operation problem.
5. The method of claim 4, wherein the method comprises: verifying the correctness of the obtained solution of the hash operation problem, and verifying whether the obtained solution meets the difficulty coefficient specifically comprises the following steps:
if the difficulty coefficient of the hash operation problem is a, setting the corresponding solution as s; calculating the result of the hash operation problem by taking s as a parameter, intercepting the first a strings of the obtained result, and if the first a strings are the same as all 0 strings corresponding to the difficulty coefficient a, indicating that the result is correct, namely, an effective solution; if not, the result is wrong.
6. A system based on the device computing power evaluation method based on the PoW consensus mechanism according to any one of claims 1 to 3, wherein: the system comprises:
a device selection module: the block chain computing equipment is used for selecting the block chain computing equipment using the PoW consensus algorithm as equipment to be evaluated;
difficulty setting module: the hash operation problem is used for finishing the hash operation, the hash operation problem takes 0 string of beginning, and the length of 0 string of beginning is set as a difficulty mark;
a hash problem dividing module: comparing the length of the beginning of the 0 string with the difficulty mark according to the length of the beginning of the 0 string, and classifying the hash operation problem as simpler or more difficult;
the number counting module: the device and the method are used for counting the number of the simple hash operation problems completed by the device to be evaluated in unit time;
a time counting module: the method is used for counting the time spent by the equipment to be evaluated to finish a more difficult hash operation problem;
a comprehensive evaluation module: and the calculation capacity evaluation value of the equipment to be evaluated is obtained by integrating the completion number and the time spent.
7. The PoW consensus mechanism-based device computation power evaluation system of claim 6, wherein: the number counting module comprises:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients, operation time and start time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification summary module: the device is used for verifying and summarizing all calculation results of the equipment to be evaluated after the operation time is over;
an evaluation index determination module: and the method is used for taking the collected data as a correct calculation power evaluation index of the equipment to be evaluated.
8. The PoW consensus mechanism-based device computation power evaluation system of claim 6, wherein: the time counting module comprises:
the data generation setting module: the system is used for generating a string of random data and setting operation parameters including specific difficulty coefficients and operation starting time;
a data sending module: the device is used for sending the random data and the operation parameters to all equipment to be evaluated;
the calculation and storage module: the hash operation problem used for the equipment to be evaluated to start to calculate the specified difficulty coefficient after the starting time, and the calculation result is obtained and stored;
a verification recording module: the hash operation system is used for verifying the solution of the obtained hash operation problem and recording the time of receiving the solution;
an index determination module: the method is used for counting the duration time of the calculation process of the equipment to be evaluated, and the duration time of the calculation process is used as an index of calculation power evaluation.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 5 are implemented when the processor executes the program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202011464087.XA 2020-12-10 2020-12-10 Equipment computing power evaluation method and system based on PoW consensus mechanism Active CN112600919B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011464087.XA CN112600919B (en) 2020-12-10 2020-12-10 Equipment computing power evaluation method and system based on PoW consensus mechanism
PCT/CN2020/139637 WO2022120995A1 (en) 2020-12-10 2020-12-25 Device computing power evaluation method and system based on pow consensus mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011464087.XA CN112600919B (en) 2020-12-10 2020-12-10 Equipment computing power evaluation method and system based on PoW consensus mechanism

Publications (2)

Publication Number Publication Date
CN112600919A true CN112600919A (en) 2021-04-02
CN112600919B CN112600919B (en) 2022-06-21

Family

ID=75192755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011464087.XA Active CN112600919B (en) 2020-12-10 2020-12-10 Equipment computing power evaluation method and system based on PoW consensus mechanism

Country Status (2)

Country Link
CN (1) CN112600919B (en)
WO (1) WO2022120995A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114062891A (en) * 2021-10-11 2022-02-18 深圳市德斯戈智能科技有限公司 Calculation force testing device based on AI chip
CN114978908A (en) * 2022-05-11 2022-08-30 量子科技长三角产业创新中心 Computing power network node evaluation and operation method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543911B (en) * 2022-10-26 2023-08-01 中国电子技术标准化研究院 Method for calculating computing capacity of heterogeneous computing equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018032371A1 (en) * 2016-08-13 2018-02-22 深圳市樊溪电子有限公司 Power consumption perception pow consensus mechanism for block chain
CN108900380A (en) * 2018-07-14 2018-11-27 上海分布信息科技有限公司 A kind of node administration method and its realize system
CN109412838A (en) * 2018-09-29 2019-03-01 吴志培 Server cluster host node selection method based on hash calculating and Performance Evaluation
CN110166541A (en) * 2019-05-14 2019-08-23 思力科(深圳)电子科技有限公司 Rendering method, relevant device and system based on block chain
CN110661867A (en) * 2019-09-25 2020-01-07 东北大学 Block chain consensus method based on improved workload certification and equity certification
CN110943869A (en) * 2019-12-16 2020-03-31 杭州复杂美科技有限公司 Block consensus and broadcast method, equipment and storage medium
CN111091258A (en) * 2018-10-24 2020-05-01 成都高新信息技术研究院 Weight-based block chain consensus computing method and system
CN111274110A (en) * 2020-01-20 2020-06-12 四川万物数创科技有限公司 Block chain-based edge device performance evaluation method, management method and medium
CN111432014A (en) * 2020-03-30 2020-07-17 上海玳鸽信息技术有限公司 Method and device for selecting main node in block chain consensus algorithm
CN111552573A (en) * 2020-05-06 2020-08-18 行星算力(深圳)科技有限公司 Block chain heterogeneous system and artificial intelligence computational power network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984470A (en) * 2018-06-19 2018-12-11 四川斐讯信息技术有限公司 A kind of FPGA mine machine calculates the lifting system and method for power
US20200313855A1 (en) * 2019-03-26 2020-10-01 Si Yin Consensus method for blockchain via virtual machine based hybrid delegated proof of stake and proof of work (vdposw)
CN110532092A (en) * 2019-08-21 2019-12-03 云湾科技(嘉兴)有限公司 Reso urce matching method, device and equipment
CN111736059B (en) * 2020-07-02 2022-08-26 深圳比特微电子科技有限公司 Chip testing method, testing equipment and testing system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018032371A1 (en) * 2016-08-13 2018-02-22 深圳市樊溪电子有限公司 Power consumption perception pow consensus mechanism for block chain
CN108900380A (en) * 2018-07-14 2018-11-27 上海分布信息科技有限公司 A kind of node administration method and its realize system
CN109412838A (en) * 2018-09-29 2019-03-01 吴志培 Server cluster host node selection method based on hash calculating and Performance Evaluation
CN111091258A (en) * 2018-10-24 2020-05-01 成都高新信息技术研究院 Weight-based block chain consensus computing method and system
CN110166541A (en) * 2019-05-14 2019-08-23 思力科(深圳)电子科技有限公司 Rendering method, relevant device and system based on block chain
CN110661867A (en) * 2019-09-25 2020-01-07 东北大学 Block chain consensus method based on improved workload certification and equity certification
CN110943869A (en) * 2019-12-16 2020-03-31 杭州复杂美科技有限公司 Block consensus and broadcast method, equipment and storage medium
CN111274110A (en) * 2020-01-20 2020-06-12 四川万物数创科技有限公司 Block chain-based edge device performance evaluation method, management method and medium
CN111432014A (en) * 2020-03-30 2020-07-17 上海玳鸽信息技术有限公司 Method and device for selecting main node in block chain consensus algorithm
CN111552573A (en) * 2020-05-06 2020-08-18 行星算力(深圳)科技有限公司 Block chain heterogeneous system and artificial intelligence computational power network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114062891A (en) * 2021-10-11 2022-02-18 深圳市德斯戈智能科技有限公司 Calculation force testing device based on AI chip
CN114978908A (en) * 2022-05-11 2022-08-30 量子科技长三角产业创新中心 Computing power network node evaluation and operation method and device
CN114978908B (en) * 2022-05-11 2023-09-26 量子科技长三角产业创新中心 Evaluation and operation method and device for computing power network node

Also Published As

Publication number Publication date
WO2022120995A1 (en) 2022-06-16
CN112600919B (en) 2022-06-21

Similar Documents

Publication Publication Date Title
CN112600919B (en) Equipment computing power evaluation method and system based on PoW consensus mechanism
CN107122669B (en) Method and device for evaluating data leakage risk
US20150088462A1 (en) Hardware performance evaluation method and server
CN104137078A (en) Operation management device, operation management method, and program
US8555290B2 (en) Apparatus and method for dynamic control of the number of simultaneously executing tasks based on throughput
CN110399377A (en) Optimization method, device, electronic equipment and the computer readable storage medium of SQL
CN109583731A (en) A kind of Risk Identification Method, device and equipment
CN111045912B (en) AI application performance evaluation method, device and related equipment
US20100036981A1 (en) Finding Hot Call Paths
CN106844423A (en) A kind of method and device of Data Detection
CN109255368A (en) Randomly select method, apparatus, electronic equipment and the storage medium of feature
US20150154103A1 (en) Method and apparatus for measuring software performance
CN107204856B (en) A kind of method and device detecting elliptic curve loophole
CN111679791B (en) Storage position selection method and device, terminal equipment and storage medium
CN111382052A (en) Code quality evaluation method and device and electronic equipment
CN114760190A (en) Service-oriented converged network performance anomaly detection method
US20210042519A1 (en) Method for evaluating vibrating sensation similarity, apparatus and storage medium
US8271981B2 (en) Detecting an extraordinary behavior
CN111274110B (en) Block chain-based edge device performance evaluation method, management method and medium
US20230025368A1 (en) Distributed transactional database consensus
CN110929501A (en) Text analysis method and device
US20220377109A1 (en) Crypto-jacking detection
CN110298690A (en) Object class purpose period judgment method, device, server and readable storage medium storing program for executing
CN116992221B (en) Fault detection method, device and equipment of operation and maintenance platform and storage medium
KR102244128B1 (en) Method and device for detecting attack on network hosts using network attack intensity calculation method based on computing resource capacity

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant