Movatterモバイル変換


[0]ホーム

URL:


CN112600919B - A device computing power evaluation method and system based on PoW consensus mechanism - Google Patents

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

Info

Publication number
CN112600919B
CN112600919BCN202011464087.XACN202011464087ACN112600919BCN 112600919 BCN112600919 BCN 112600919BCN 202011464087 ACN202011464087 ACN 202011464087ACN 112600919 BCN112600919 BCN 112600919B
Authority
CN
China
Prior art keywords
evaluated
hash operation
equipment
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.)
Active
Application number
CN202011464087.XA
Other languages
Chinese (zh)
Other versions
CN112600919A (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 CASfiledCriticalShenzhen Institute of Advanced Technology of CAS
Priority to CN202011464087.XApriorityCriticalpatent/CN112600919B/en
Priority to PCT/CN2020/139637prioritypatent/WO2022120995A1/en
Publication of CN112600919ApublicationCriticalpatent/CN112600919A/en
Application grantedgrantedCritical
Publication of CN112600919BpublicationCriticalpatent/CN112600919B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

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 simpler 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

Translated fromChinese
一种基于PoW共识机制的设备算力评价方法及系统A device computing power evaluation method and system based on PoW consensus mechanism

技术领域technical field

本发明涉及信息技术领域,更具体的说,特别涉及一种基于PoW共识机制的设备算力评价方法及系统。The present invention relates to the field of information technology, and more specifically, to a device computing power evaluation method and system based on a PoW consensus mechanism.

背景技术Background technique

目前区块链技术是较为前沿的研究领域,比特币、以太坊等区块链应用生态越发成熟。随着区块链技术的发展,越来越多的区块链特定设备被开发出来,例如区块链计算卡、区块链网络卡、区块链存储卡等等。这些区块链特定设备大都是在传统的计算机架构基础上,针对区块链的特性进行了专门的优化,以适应区块链系统的一些特性。区块链计算卡是最典型的一种区块链特定的计算设备。At present, blockchain technology is a relatively cutting-edge research field, and the application ecology of blockchains such as Bitcoin and Ethereum is becoming more and more mature. With the development of blockchain technology, more and more blockchain-specific devices have been developed, such as blockchain computing cards, blockchain network cards, blockchain memory cards, and so on. Most of these blockchain-specific devices are based on the traditional computer architecture, and are specially optimized for the characteristics of the blockchain to adapt to some characteristics of the blockchain system. A blockchain computing card is the most typical blockchain-specific computing device.

传统的通用计算设备在设计时强调计算能力的通用性,在指令设计、主频、流水线结构等方面更趋向于均衡,兼顾日常使用、娱乐办公等需求。与之相区别,特定于区块链的计算设备并不需要兼顾功能和使用上的均衡性,在功能上只需要能够高效、准确的完成特定于区块链系统的复杂计算任务即可。因此,用来评价传统计算设备的浮点运算性能、主频等指标并不完全适用于区块链特定设备的评价标准,需要重新设计一种算力评价标准来适应区块链系统中新的计算需求,更好的指导区块链特定设备的开发和研制。Traditional general-purpose computing equipment emphasizes the versatility of computing power when designing, and tends to be more balanced in terms of command design, main frequency, and pipeline structure, taking into account the needs of daily use, entertainment and office work. In contrast, a blockchain-specific computing device does not need to take into account the balance of function and use, but only needs to be able to efficiently and accurately complete complex computing tasks specific to the blockchain system. Therefore, indicators such as floating-point operation performance and main frequency used to evaluate traditional computing equipment are not fully applicable to the evaluation criteria of specific blockchain devices. Calculate the requirements to better guide the development and development of specific equipment for the blockchain.

目前已有的技术方案包括:The existing technical solutions include:

(1)以浮点运算性能作为性能评价指标的方案。这类方案是传统的算力评价算法中常用的评价指标,其基本原理是:科学计算涉及到大量的高精度浮点运算,如果一台机器能够在单位时间内完成更多的高精度浮点运算,其相应的运算能力就越强。这种算力评价方案的特定性较强,主要针对科学运算、超大型混合计算架构。(1) A scheme that uses floating-point operation performance as a performance evaluation index. This type of scheme is a commonly used evaluation index in traditional computing power evaluation algorithms. The basic principle is that scientific computing involves a large number of high-precision floating-point operations. If a machine can complete more high-precision floating-point operations per unit time operation, the corresponding operation ability is stronger. This computing power evaluation scheme is highly specific, and is mainly aimed at scientific computing and ultra-large hybrid computing architectures.

(2)以计算加速比作为性能评价指标的方案。这种方案相比方案(1)免去了特定计算任务的限制,其基本原理是:以某一台计算机针对某一项任务的计算能力为基准,测量其他机器针对同一任务的计算能力为比较数据,从而得出不同计算机针对不同任务时的计算能力的差异。这一方案的测量指标是不同计算机针对同一计算任务计算时间上的比值。(2) The scheme using the calculation speedup ratio as the performance evaluation index. Compared with scheme (1), this scheme avoids the limitation of specific computing tasks. data, so as to draw the difference in the computing power of different computers for different tasks. The measurement index of this scheme is the ratio of the computing time of different computers for the same computing task.

当具体到特定于区块链系统的计算设备算力评价时,上述两种方案均存在一些问题:When it comes to the computing power evaluation of computing equipment specific to the blockchain system, there are some problems with the above two schemes:

(1)以浮点运算性能作为性能评价指标的方案主要针对的是通用计算架构和超大型科学计算任务机器两种计算结构,以单位时间内能够完成的浮点运算作为算力评价的指标。在以PoW作为共识算法的区块链系统中,浮点运算的占比很少,主要的算力消耗集中在hash运算、移位运算等操作上。因此,使用浮点运算性能来评价区块链特定设备是不准确的。(1) The scheme using floating-point operation performance as the performance evaluation index mainly aims at the two computing structures of general computing architecture and super-large scientific computing task machine, and uses the floating-point operation that can be completed in unit time as the evaluation index of computing power. In the blockchain system with PoW as the consensus algorithm, floating-point operations account for a small proportion, and the main computing power consumption is concentrated on operations such as hash operations and shift operations. Therefore, it is inaccurate to use floating-point performance to evaluate blockchain-specific devices.

(2)以计算加速比作为性能评价指标的方案相比之下能够避免方案(1)中特定于硬件设备和计算任务的问题,但是其最终得到的计算能力评价指标数据与具体的应用程序相绑定,未能从硬件层面分析具体计算行为。因此,这种算力评价算法虽然相对于方案(1)针对性更强,但是也需要进行相应的改进。(2) Compared with the scheme that uses the calculation speedup ratio as the performance evaluation index, the problems specific to hardware devices and computing tasks in the scheme (1) can be avoided, but the finally obtained computing power evaluation index data is consistent with the specific application program. Binding, failed to analyze the specific computing behavior from the hardware level. Therefore, although this computing power evaluation algorithm is more targeted than scheme (1), it also needs to be improved accordingly.

除此之外,上述两种方案都是针对于传统计算任务而言的,这与PoW共识算法所需要大量使用的hash运算、移位运算、逻辑判断等运算指令不符。在设计特定于区块链系统的算力评价算法时,需要重新考虑这些计算指令对运算速度、运算结果的影响。In addition, the above two solutions are aimed at traditional computing tasks, which are inconsistent with the hash operation, shift operation, logical judgment and other operation instructions that the PoW consensus algorithm needs to use a lot. When designing a computing power evaluation algorithm specific to a blockchain system, it is necessary to reconsider the impact of these computing instructions on the computing speed and computing results.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于针对现有技术存在的技术问题,提供一种基于PoW共识机制的设备算力评价方法及系统,其针对性强、兼容性也更好。The purpose of the present invention is to provide a device computing power evaluation method and system based on the PoW consensus mechanism, which has strong pertinence and better compatibility, aiming at the technical problems existing in the prior art.

为了解决以上提出的问题,本发明采用的技术方案为:In order to solve the problem proposed above, the technical scheme adopted in the present invention is:

本发明提供一种基于PoW共识机制的设备算力评价方法,该评价方法具体包括:The present invention provides a device computing power evaluation method based on PoW consensus mechanism, the evaluation method specifically includes:

选择使用PoW共识算法的区块链计算设备,作为待评价设备;Select a blockchain computing device using the PoW consensus algorithm as the device to be evaluated;

完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记;Complete the hash operation problem, the hash operation problem starts with a 0 string, and the length of the beginning of a 0 string is set as a difficulty mark;

根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的;According to the size of the length of the beginning of the 0 string, and compare it with the difficulty mark, the hash operation problem is divided into relatively simple or relatively difficult;

统计待评价设备在单位时间内完成较为简单的hash运算问题的个数;Count the number of relatively simple hash operation problems completed by the equipment to be evaluated in unit time;

统计待评价设备完成一个较为困难hash运算问题所花费的时间;Count the time it takes for the device to be evaluated to complete a difficult hash operation problem;

综合所述完成个数和花费时间,得到待评价设备的算力评价值。The computing power evaluation value of the device to be evaluated is obtained by synthesizing the number of completions and the time spent.

进一步的,所述以单位时间内完成较为简单的hash运算问题的个数作为评价指标,具体包括:Further, the number of relatively simple hash operation problems completed in unit time is used as the evaluation index, which specifically includes:

生成一串随机数据,并设定运算参数包括具体的难度系数、运算时间和开始时间;Generate a string of random data, and set operation parameters including specific difficulty coefficient, operation time and start time;

将所述随机数据和运算参数发送给所有的待评测设备;Send the random data and operation parameters to all devices to be evaluated;

待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;After the start time, the device to be evaluated starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it;

在运算时间结束之后,对待评测设备的所有计算结果进行验证汇总;After the calculation time is over, verify and summarize all the calculation results of the device to be evaluated;

将汇总后的数据作为待评测设备正确的算力评价指标。The aggregated data is used as the correct computing power evaluation index of the device to be evaluated.

进一步的,以解决一个较为困难的hash运算问题的时间作为评价指标,具体包括:Further, the time to solve a difficult hash operation problem is used as the evaluation index, including:

生成一串随机数据,并设定运算参数包括具体的难度系数、运算开始时间;Generate a string of random data, and set operation parameters including specific difficulty coefficient and operation start time;

将所述随机数据和运算参数发送给所有的待评测设备;Send the random data and operation parameters to all devices to be evaluated;

待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题的解,并将计算结果进行保存;After the start time, the device to be evaluated starts to calculate the solution of the hash operation problem with the specified difficulty coefficient, and saves the calculation result;

验证得到的hash运算问题的解,并记录接收到解的时间;Verify the obtained solution of the hash operation problem and record the time when the solution was received;

统计待评价设备计算过程持续的时间,以运算过程持续的时间作为算力评价的指标。Calculate the duration of the computing process of the device to be evaluated, and use the duration of the computing process as an index for computing power evaluation.

进一步的,所述基于PoW共识机制计算hash运算问题得到结果,具体为:Further, the result obtained by calculating the hash operation problem based on the PoW consensus mechanism is as follows:

若hash运算问题的难度系数为a,假设解为s,如果以s为解验证得到的结果满足难度系数a,则s为对应的hash运算问题的解。If the difficulty coefficient of the hash operation problem is a, and the solution is assumed to be s, if the result obtained by taking s as the solution to verify that the result satisfies the difficulty coefficient a, then s is the solution of the corresponding hash operation problem.

进一步的,验证所得到的hash运算问题的解的正确性,通过验证得到的解是否满足难度系数,具体为:Further, verify the correctness of the obtained solution of the hash operation problem, and verify whether the obtained solution satisfies the difficulty coefficient, specifically:

若hash运算问题的难度系数为a,设其对应的解为s;以s为参数计算hash运算问题的结果,将得到结果的前a个串截取,如果前a个串与难度系数为a对应的全0串相同,则表示结果正确,即为有效解;如果不相同,则表示结果错误。If the difficulty coefficient of the hash operation problem is a, let its corresponding solution be s; to calculate the result of the hash operation problem with s as the parameter, the first a string of the result will be intercepted. If the first a string corresponds to the difficulty coefficient of a If the strings of all 0s are the same, it means that the result is correct, that is, a valid solution; if they are not the same, it means that the result is wrong.

本发明还提供一种基于PoW共识机制的设备算力评价方法的系统,该系统包括:The present invention also provides a system for evaluating the computing power of devices based on the PoW consensus mechanism, the system comprising:

设备选择模块:用于选择使用PoW共识算法的区块链计算设备,作为待评价设备;Device selection module: used to select the blockchain computing device using the PoW consensus algorithm as the device to be evaluated;

难度设定模块:用于完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记;Difficulty setting module: used to complete the hash operation problem, the hash operation problem starts with a 0 string, and the length of the beginning of a 0 string is set as a difficulty mark;

hash问题划分模块:根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的;Hash problem division module: According to the size of the length of the beginning of the 0 string, and compare it with the difficulty mark, the hash operation problem is divided into relatively simple or relatively difficult;

个数统计模块:用于统计待评价设备在单位时间内完成较为简单的hash运算问题的个数;Number statistics module: used to count the number of relatively simple hash operation problems completed by the equipment to be evaluated in unit time;

时间统计模块:用于统计待评价设备完成一个较为困难hash运算问题所花费的时间;Time statistics module: used to count the time spent by the device to be evaluated to complete a difficult hash operation problem;

综合评价模块:用于综合所述完成个数和花费时间,得到待评价设备的算力评价值。Comprehensive evaluation module: used to synthesize the completed number and time spent to obtain the computing power evaluation value of the device to be evaluated.

进一步的,所述个数统计模块包括:Further, the number statistics module includes:

数据生成设定模块:用于生成一串随机数据,并设定运算参数包括具体的难度系数、运算时间和开始时间;Data generation setting module: used to generate a string of random data, and set operation parameters including specific difficulty coefficient, operation time and start time;

数据发送模块:用于将所述随机数据和运算参数发送给所有的待评测设备;Data sending module: used to send the random data and operation parameters to all devices to be evaluated;

计算保存模块:用于待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;Calculation and storage module: After the start time of the device to be evaluated, it starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it;

验证汇总模块:用于在运算时间结束之后,对待评测设备的所有计算结果进行验证汇总;Verification summary module: used to verify and summarize all calculation results of the device to be evaluated after the operation time is over;

指标确定模块:用于将汇总后的数据作为待评测设备正确的算力评价指标。Indicator determination module: used to use the aggregated data as the correct computing power evaluation indicator of the device to be evaluated.

进一步的,所述时间统计模块包括:Further, the time statistics module includes:

数据生成设定模块:用于生成一串随机数据,并设定运算参数包括具体的难度系数、运算开始时间;Data generation setting module: used to generate a string of random data, and set operation parameters including specific difficulty coefficient and operation start time;

数据发送模块:用于将所述随机数据和运算参数发送给所有的待评测设备;Data sending module: used to send the random data and operation parameters to all devices to be evaluated;

计算保存模块:用于待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;Calculation and storage module: After the start time of the device to be evaluated, it starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it;

验证记录模块:用于验证得到的hash运算问题的解,并记录接收到解的时间;Verification record module: used to verify the obtained solution of the hash operation problem, and record the time when the solution was received;

指标确定模块:用于统计待评价设备计算过程持续的时间,以运算过程持续的时间作为算力评价的指标。Index determination module: It is used to count the duration of the calculation process of the device to be evaluated, and the duration of the calculation process is used as the index of calculation power evaluation.

本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现任一项所述方法的步骤。The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of any one of the methods when the processor executes the program.

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现任一项所述方法的步骤。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of any one of the methods are implemented.

与现有技术相比,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:

本发明提供的设备算力评价方法及系统,针对基于PoW共识机制的区块链计算设备,以hash问题的运算速度作为评价区块链计算设备的评价指标,同时针对区块链计算设备的异构性,并分别以单位时间内完成较为简单的hash运算问题的个数、及完成一个较为困难hash运算问题所花费的时间,来分别对算力较强和算力较弱的区块链计算设备进行评价,其针对性更强、兼容性也更好。The device computing power evaluation method and system provided by the present invention are aimed at the blockchain computing device based on the PoW consensus mechanism, and the computing speed of the hash problem is used as the evaluation index for evaluating the blockchain computing device. The number of simple hash operation problems completed in unit time, and the time spent to complete a more difficult hash operation problem, respectively, to calculate the blockchain with strong computing power and weak computing power. The equipment is evaluated, which is more targeted and more compatible.

附图说明Description of drawings

为了更清楚地说明本发明中的方案,下面将对实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:In order to illustrate the solutions in the present invention more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention, which are common in the art. As far as technical personnel are concerned, other drawings can also be obtained based on these drawings without any creative effort. in:

图1为本发明基于PoW共识机制的设备算力评价方法的流程图。FIG. 1 is a flow chart of the device computing power evaluation method based on the PoW consensus mechanism of the present invention.

图2为本发明采用完成hash运算问题的个数作为评价指标的流程图。FIG. 2 is a flow chart of the present invention using the number of completed hash operation problems as an evaluation index.

图3为本发明采用完成hash运算问题所花费的时间作为评价指标的流程图。FIG. 3 is a flowchart of the present invention using the time taken to complete the hash operation problem as an evaluation index.

图4为本发明基于PoW共识机制的设备算力评价系统的原理图。FIG. 4 is a schematic diagram of the device computing power evaluation system based on the PoW consensus mechanism of the present invention.

图5为本发明个数统计模块的原理图。FIG. 5 is a schematic diagram of the number statistics module of the present invention.

图6为本发明时间统计模块的原理图。FIG. 6 is a schematic diagram of the time statistics module of the present invention.

图7为本发明电子设备的实体结构示意图。FIG. 7 is a schematic diagram of the physical structure of the electronic device of the present invention.

具体实施方式Detailed ways

为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully hereinafter with reference to the related drawings. Preferred embodiments of the invention are shown in the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that a thorough and complete understanding of the present disclosure is provided.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, 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 terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention.

参阅图1所示,本发明提供一种基于PoW共识机制的设备算力评价方法,该评价方法具体包括:Referring to Fig. 1, the present invention provides a device computing power evaluation method based on PoW consensus mechanism, the evaluation method specifically includes:

步骤S1:选择使用PoW共识算法的区块链计算设备,作为待评价设备。Step S1: Select a blockchain computing device using the PoW consensus algorithm as the device to be evaluated.

步骤S2:完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记。Step S2: Complete the hash operation problem, the hash operation problem starts with a 0 string, and a length of the beginning of the 0 string is set as a difficulty mark.

步骤S3:根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的。Step S3: According to the size of the length of the beginning of the 0-string, and comparing it with the difficulty mark, the hash operation problem is classified as relatively simple or relatively difficult.

步骤S4:统计待评价设备在单位时间内完成较为简单的hash运算问题的个数。Step S4: Count the number of relatively simple hash operation problems completed by the device to be evaluated in unit time.

步骤S5:统计待评价设备完成一个较为困难hash运算问题所花费的时间。Step S5: Counting the time taken by the device to be evaluated to complete a difficult hash operation problem.

步骤S6:综合步骤S4中简单hash运算问题的完成个数和步骤S4中困难hash运算问题的花费时间,得到待评价设备的算力评价值完成评价。Step S6: Combine the number of completed simple hash operation problems in step S4 and the time spent on difficult hash operation problems in step S4 to obtain the computing power evaluation value of the device to be evaluated to complete the evaluation.

本发明实施例中,使用PoW共识算法的区块链计算设备中,算得一个具体答案的条件是针对提交的数据找出一个特定的字符串,使得其以一定的hash算法运算后得到的结果可以某一个指定个数的0串作为开头,如00007186CEA8。而0串开头的指定个数是评价一个hash问题难度的指标,这个难度与0串开头的长度成正相关,使用0串开头的长度作为问题的难度系数,0串的长度越长,难度越大,且0串的长度每增加1,难度成指数倍增长。此外,相同区块链计算设备在同样的数据、同样的起始字符串值、同样的查找方向条件下,找到的答案是相同的。In the embodiment of the present invention, in the blockchain computing device using the PoW consensus algorithm, the condition for calculating a specific answer is to find a specific string for the submitted data, so that the result obtained by a certain hash algorithm can be A specified number of 0 strings are used as the beginning, such as 00007186CEA8. The specified number at the beginning of the 0 string is an indicator for evaluating the difficulty of a hash problem. This difficulty is positively related to the length of the beginning of the 0 string. The length at the beginning of the 0 string is used as the difficulty coefficient of the problem. The longer the length of the 0 string, the greater the difficulty. , and each time the length of the 0 string increases by 1, the difficulty increases exponentially. In addition, the same block chain computing device finds the same answer under the same data, the same starting string value, and the same search direction.

具体的,参阅图2所示,以单位时间内能解决的较为简单的hash运算问题的个数作为评价指标,具体包括:Specifically, referring to Figure 2, the number of relatively simple hash operation problems that can be solved per unit time is used as the evaluation index, which specifically includes:

步骤S41:外部的评价系统生成一串随机数据,并设定运算参数包括具体的难度系数、运算时间和开始时间;Step S41: the external evaluation system generates a string of random data, and sets the operation parameters including the specific difficulty coefficient, operation time and start time;

步骤S42:将所述随机数据和运算参数发送给所有的待评测设备;Step S42: Send the random data and operation parameters to all devices to be evaluated;

步骤S43:待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;具体的,每得到一个结果判断其是否超时,若未超时,则记录结果并保存;若超时,则不记录。Step S43: After the start time, the device to be evaluated starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it; specifically, each time a result is obtained, it is judged whether it has timed out, and if it has not timed out, the result is recorded and saved; If it times out, it will not be recorded.

步骤S44:在截止时间到达即运算时间结束之后,待评测设备将得到的计算结果进行打包,发送给评价系统,评价系统对所有的计算结果进行验证汇总;Step S44: After the deadline arrives, that is, the calculation time ends, the device to be evaluated packs the obtained calculation results and sends them to the evaluation system, and the evaluation system verifies and summarizes all the calculation results;

步骤S45:将汇总后的数据作为待评测设备正确的算力评价指标。Step S45: Use the aggregated data as the correct computing power evaluation index of the device to be evaluated.

具体的,参阅图3所示,以解决一个较为困难的hash运算问题的时间作为评价指标,具体包括:Specifically, as shown in Figure 3, the time to solve a difficult hash operation problem is used as the evaluation index, which specifically includes:

步骤S51:评价系统生成一串随机数据,并设定运算参数包括具体的难度系数、运算开始时间;Step S51: the evaluation system generates a string of random data, and sets the operation parameters including the specific difficulty coefficient and the operation start time;

步骤S52:将所述随机数据和运算参数发送给所有的待评测设备并开始;Step S52: Send the random data and operation parameters to all devices to be evaluated and start;

步骤S53:待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题的解,并将计算结果进行保存;Step S53: After the start time, the device to be evaluated starts to calculate the solution of the hash operation problem with the specified difficulty coefficient, and saves the calculation result;

步骤S54:待评测设备将算到的解进行打包,发送给评价系统,验证得到的hash运算问题的解,并记录接收到解的时间即结束时间;Step S54: the device to be evaluated packs the calculated solution, sends it to the evaluation system, verifies the obtained solution of the hash operation problem, and records the time when the solution is received, that is, the end time;

步骤S55:评价系统计算待评价设备计算过程持续的时间,以运算过程持续的时间作为待评价设备算力评价的指标。具体的,用结束时间减去开始时间计算出最终的持续时间。Step S55: The evaluation system calculates the duration of the computing process of the device to be evaluated, and uses the duration of the operation process as an index for evaluating the computing power of the device to be evaluated. Specifically, the final duration is calculated by subtracting the start time from the end time.

进一步的,所述基于PoW共识机制,计算hash运算问题得到结果,具体为:Further, based on the PoW consensus mechanism, calculating the hash operation problem to obtain the result, specifically:

若hash运算问题的难度系数为a,假设解为s,如果以s为解验证得到的结果满足难度系数a,则s为对应的hash运算问题的解。If the difficulty coefficient of the hash operation problem is a, and the solution is assumed to be s, if the result obtained by taking s as the solution to verify that the result satisfies the difficulty coefficient a, then s is the solution of the corresponding hash operation problem.

进一步的,验证所得到的hash运算问题的解的正确性,通过验证得到的解是否满足难度系数,具体为:Further, verify the correctness of the obtained solution of the hash operation problem, and verify whether the obtained solution satisfies the difficulty coefficient, specifically:

若hash运算问题的难度系数为a,设其对应的解为s;以s为参数计算hash运算问题的结果,将得到结果的前a个串截取,如果前a个串与难度系数为a对应的全0串相同,则表示结果正确,即为有效解;如果不相同,则表示结果错误。If the difficulty coefficient of the hash operation problem is a, let its corresponding solution be s; to calculate the result of the hash operation problem with s as the parameter, the first a string of the result will be intercepted. If the first a string corresponds to the difficulty coefficient of a If the strings of all 0s are the same, it means that the result is correct, that is, a valid solution; if they are not the same, it means that the result is wrong.

本发明实施例中,在相同条件下,上述两个算力评价指标成正比例关系。在这两个方案中,以完成一个较为困难hash运算问题所需要的时间是一个较为精确的评价指标。该hash运算问题的难度越大,这个评价指标的可靠度也越高。由于区块链计算设备计算能力的异构性,一些算力极差的区块链计算设备可能需要很长时间才能算出解,而一些算力很强的区块链计算设备之间可能算出同一个问题的时间差距不大。这就导致了无法在算力极强的区块链计算设备之间进行区分,因此以单位时间内完成较为简单的hash运算问题的个数,作为补充指标进行平衡。In the embodiment of the present invention, under the same conditions, the above two computing power evaluation indicators are in a proportional relationship. In these two schemes, the time required to complete a more difficult hash operation problem is a more accurate evaluation index. The greater the difficulty of the hash operation problem, the higher the reliability of this evaluation index. Due to the heterogeneity of computing power of blockchain computing devices, some blockchain computing devices with extremely poor computing power may take a long time to calculate the solution, while some blockchain computing devices with strong computing power may calculate the same solution. There is not much time gap for a question. This makes it impossible to distinguish between blockchain computing devices with extremely strong computing power. Therefore, the number of relatively simple hash operation problems completed per unit time is used as a supplementary indicator for balance.

理论上来说,越简单的hash运算问题在单位时间内的解决个数越能够区分算力较强的区块链计算设备之间的差异性,越困难的hash运算问题的解决时间越能够区分算力较差的区块链计算设备之间的差异性。Theoretically speaking, the simpler the number of hash operation problems solved per unit time, the more able to distinguish the differences between the blockchain computing devices with stronger computing power, and the more difficult the hash operation problem can be solved in terms of time. Differences between less powerful blockchain computing devices.

本发明实施例中,对树莓派4、树莓派3b、i7-9700k、e3-1230-v5等多个区块链计算设备进行算力评估,实验证明上述评价指标切实可行,对不同区块链计算设备在区块链系统上的运行状态稳定可靠。In the embodiment of the present invention, computing power is evaluated on multiple blockchain computing devices such as Raspberry Pi 4, Raspberry Pi 3b, i7-9700k, e3-1230-v5, etc. The operation status of blockchain computing equipment on the blockchain system is stable and reliable.

下面通过具体实施例来进一步说明上述两者待评价设备算力评价的指标。In the following, specific embodiments are used to further illustrate the above two indicators for evaluating the computing power of the devices to be evaluated.

(1)由上述方法计算解决一个较为困难的hash运算问题的时间,得到如表1~表4中四组数据。(1) Calculate the time to solve a difficult hash operation problem by the above method, and obtain four sets of data as shown in Table 1 to Table 4.

表1Table 1

Figure BDA0002829830620000101
Figure BDA0002829830620000101

表2Table 2

Figure BDA0002829830620000102
Figure BDA0002829830620000102

表3table 3

Figure BDA0002829830620000111
Figure BDA0002829830620000111

表4Table 4

Figure BDA0002829830620000112
Figure BDA0002829830620000112

(2)由上述方法计算在单位时间内完成较为简单的hash运算问题的个数,时间限定为10s,难度设定为3-5个0开头的hash串,得到如下表5~表8的结果:(2) Calculate the number of relatively simple hash operation problems completed in unit time by the above method, the time is limited to 10s, and the difficulty is set to 3-5 hash strings starting with 0, and the results in the following Tables 5 to 8 are obtained. :

表5table 5

Figure BDA0002829830620000113
Figure BDA0002829830620000113

Figure BDA0002829830620000121
Figure BDA0002829830620000121

表6Table 6

Figure BDA0002829830620000122
Figure BDA0002829830620000122

表7Table 7

Figure BDA0002829830620000123
Figure BDA0002829830620000123

表8Table 8

Figure BDA0002829830620000124
Figure BDA0002829830620000124

通过上述实验数据可以看出,本发明实施例通过将单位时间内完成较为简单的hash运算问题的个数、以及完成一个较为困难hash运算问题所花费的时间这两者作为待评价设备的算力评价,具有可靠性和有效性。It can be seen from the above experimental data that in the embodiment of the present invention, both the number of relatively simple hash operation problems completed per unit time and the time it takes to complete a relatively difficult hash operation problem are used as the computing power of the device to be evaluated. evaluation, with reliability and validity.

参阅图4所示,本发明实施例还提供一种基于PoW共识机制的设备算力评价系统,该评价系统包括:Referring to FIG. 4 , an embodiment of the present invention further provides a device computing power evaluation system based on a PoW consensus mechanism. The evaluation system includes:

设备选择模块:用于选择使用PoW共识算法的区块链计算设备,作为待评价设备。Device selection module: used to select the blockchain computing device using the PoW consensus algorithm as the device to be evaluated.

难度设定模块:用于完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记。Difficulty setting module: used to complete the hash operation problem, the hash operation problem starts with a 0 string, and a length of the beginning of the 0 string is set as a difficulty mark.

hash问题划分模块:根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的。Hash problem division module: According to the size of the length of the beginning of the 0 string, and compare it with the difficulty mark, the hash operation problem is divided into relatively simple or relatively difficult.

个数统计模块:用于统计待评价设备在单位时间内完成较为简单的hash运算问题的个数。Number statistics module: used to count the number of relatively simple hash operation problems completed by the device to be evaluated in unit time.

时间统计模块:用于统计待评价设备完成一个较为困难hash运算问题所花费的时间。Time statistics module: used to count the time spent by the device to be evaluated to complete a difficult hash operation problem.

综合评价模块:用于综合所述完成个数和花费时间,得到待评价设备的算力评价值。Comprehensive evaluation module: used to synthesize the completed number and time spent to obtain the computing power evaluation value of the device to be evaluated.

进一步的,参阅图5所示,所述个数统计模块包括:Further, referring to Figure 5, the number statistics module includes:

数据生成设定模块:用于生成一串随机数据,并设定运算参数包括具体的难度系数、运算时间和开始时间;Data generation setting module: used to generate a string of random data, and set operation parameters including specific difficulty coefficient, operation time and start time;

数据发送模块:用于将所述随机数据和运算参数发送给所有的待评测设备;Data sending module: used to send the random data and operation parameters to all devices to be evaluated;

计算保存模块:用于待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;Calculation and storage module: After the start time of the device to be evaluated, it starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it;

验证汇总模块:用于在运算时间结束之后,对待评测设备的所有计算结果进行验证汇总;Verification summary module: used to verify and summarize all calculation results of the device to be evaluated after the operation time is over;

指标确定模块:用于将汇总后的数据作为待评测设备正确的算力评价指标。Indicator determination module: used to use the aggregated data as the correct computing power evaluation indicator of the device to be evaluated.

进一步的,参阅图6所示,所述时间统计模块包括:Further, as shown in Figure 6, the time statistics module includes:

数据生成设定模块:用于生成一串随机数据,并设定运算参数包括具体的难度系数、运算开始时间;Data generation setting module: used to generate a string of random data, and set operation parameters including specific difficulty coefficient and operation start time;

数据发送模块:用于将所述随机数据和运算参数发送给所有的待评测设备;Data sending module: used to send the random data and operation parameters to all devices to be evaluated;

计算保存模块:用于待评测设备在开始时间之后,开始计算指定难度系数的hash运算问题,得到计算结果并进行保存;Calculation and storage module: After the start time of the device to be evaluated, it starts to calculate the hash operation problem of the specified difficulty coefficient, obtains the calculation result and saves it;

验证记录模块:用于验证得到的hash运算问题的解,并记录接收到解的时间;Verification record module: used to verify the obtained solution of the hash operation problem and record the time when the solution was received;

指标确定模块:用于统计待评价设备计算过程持续的时间,以运算过程持续的时间作为算力评价的指标。Index determination module: It is used to count the duration of the calculation process of the device to be evaluated, and the duration of the calculation process is used as the index of calculation power evaluation.

具体地,本发明实施例提供的系统具体用于执行上述方法实施例,本发明实施例对此不再进行赘述。Specifically, the system provided in the embodiment of the present invention is specifically used to execute the foregoing method embodiment, which is not repeated in this embodiment of the present invention.

图7为本发明实施例提供的一种电子设备的实体结构示意图,如图7所示,该电子设备可以包括:处理器(processor)301、通信接口(Communications Interface)302、存储器(memory)303和通信总线304,其中,处理器301,通信接口302,存储器303通过通信总线304完成相互间的通信。处理器301可以调用存储在存储器303上并可在处理器301上运行的计算机程序,以执行上述各实施例提供的方法,例如包括:FIG. 7 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present invention. As shown in FIG. 7 , the electronic device may include: a processor (processor) 301, a communications interface (Communications Interface) 302, and a memory (memory) 303 and acommunication bus 304 , wherein theprocessor 301 , thecommunication interface 302 , and thememory 303 communicate with each other through thecommunication bus 304 . Theprocessor 301 can call a computer program stored in thememory 303 and run on theprocessor 301 to execute the methods provided by the above embodiments, for example, including:

选择使用PoW共识算法的区块链计算设备,作为待评价设备;Select a blockchain computing device using the PoW consensus algorithm as the device to be evaluated;

完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记;Complete the hash operation problem, the hash operation problem starts with a 0 string, and the length of the beginning of a 0 string is set as a difficulty mark;

根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的;According to the size of the length of the beginning of the 0 string, and compare it with the difficulty mark, the hash operation problem is divided into relatively simple or relatively difficult;

统计待评价设备在单位时间内完成较为简单的hash运算问题的个数;Count the number of relatively simple hash operation problems completed by the equipment to be evaluated in unit time;

统计待评价设备完成一个较为困难hash运算问题所花费的时间;Count the time it takes for the device to be evaluated to complete a difficult hash operation problem;

综合所述完成个数和花费时间,得到待评价设备的算力评价值。The computing power evaluation value of the device to be evaluated is obtained by synthesizing the number of completions and the time spent.

此外,上述的存储器303中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in thememory 303 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of software products in essence, or parts that contribute to the prior art or parts of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的方法,例如包括:Embodiments of the present invention further provide a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to perform the methods provided by the foregoing embodiments, for example, including:

选择使用PoW共识算法的区块链计算设备,作为待评价设备;Select a blockchain computing device using the PoW consensus algorithm as the device to be evaluated;

完成hash运算问题,所述hash运算问题以0串开头,设定一个0串开头长度作为难度标记;Complete the hash operation problem, the hash operation problem starts with a 0 string, and the length of the beginning of a 0 string is set as a difficulty mark;

根据0串开头长度的大小,并将其与所述难度标记进行对比,将hash运算问题分为较为简单或较为困难的;According to the size of the length of the beginning of the 0 string, and compare it with the difficulty mark, the hash operation problem is divided into relatively simple or relatively difficult;

统计待评价设备在单位时间内完成较为简单的hash运算问题的个数;Count the number of relatively simple hash operation problems completed by the equipment to be evaluated in unit time;

统计待评价设备完成一个较为困难hash运算问题所花费的时间;Count the time it takes for the device to be evaluated to complete a difficult hash operation problem;

综合所述完成个数和花费时间,得到待评价设备的算力评价值。The computing power evaluation value of the device to be evaluated is obtained by synthesizing the number of completions and the time spent.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.

本发明实施例提供的基于PoW共识机制的设备算力评价方法及系统,针对基于PoW共识机制的区块链计算设备,以hash问题的运算速度作为评价区块链计算设备的评价指标,同时针对区块链计算设备的异构性,对算力较强和算力较弱的两种区块链计算设备分别设计不同的评价指标来平衡时间和难度上的异构性,其针对性更强,兼容性也更好。The device computing power evaluation method and system based on the PoW consensus mechanism provided by the embodiments of the present invention, for the blockchain computing device based on the PoW consensus mechanism, the computing speed of the hash problem is used as the evaluation index for evaluating the blockchain computing device. Heterogeneity of blockchain computing equipment, different evaluation indicators are designed for the two types of blockchain computing equipment with strong computing power and weak computing power to balance the heterogeneity in time and difficulty, which is more targeted , the compatibility is also better.

本发明实施例中,针对hash运算问题的算法采用SHA256加密算法,采用其他加密算法(如MD5,、SHA160等)也同样具有可行性,能够完成上述记载的评价过程。In the embodiment of the present invention, the SHA256 encryption algorithm is used as the algorithm for the hash operation problem, and it is also feasible to use other encryption algorithms (such as MD5, SHA160, etc.), and the evaluation process described above can be completed.

本发明实施例中,针对基于PoW共识机制的设备算力评价,也同样适用基于于PoS、Ethereum等算法的其他区块链系统的共识结果评价。In the embodiment of the present invention, the evaluation of the computing power of the device based on the PoW consensus mechanism is also applicable to the evaluation of the consensus results of other blockchain systems based on algorithms such as PoS and Ethereum.

上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited by the above-mentioned embodiments, and any other changes, modifications, substitutions, combinations, The simplification should be equivalent replacement manners, which are all included in the protection 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 spent 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 devices 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 relatively 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 appointed difficulty coefficient after the starting time, and a 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.XA2020-12-102020-12-10 A device computing power evaluation method and system based on PoW consensus mechanismActiveCN112600919B (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN202011464087.XACN112600919B (en)2020-12-102020-12-10 A device computing power evaluation method and system based on PoW consensus mechanism
PCT/CN2020/139637WO2022120995A1 (en)2020-12-102020-12-25Device computing power evaluation method and system based on pow consensus mechanism

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011464087.XACN112600919B (en)2020-12-102020-12-10 A device computing power evaluation method and system based on PoW consensus mechanism

Publications (2)

Publication NumberPublication Date
CN112600919A CN112600919A (en)2021-04-02
CN112600919Btrue CN112600919B (en)2022-06-21

Family

ID=75192755

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011464087.XAActiveCN112600919B (en)2020-12-102020-12-10 A device computing power evaluation method and system based on PoW consensus mechanism

Country Status (2)

CountryLink
CN (1)CN112600919B (en)
WO (1)WO2022120995A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114062891A (en)*2021-10-112022-02-18深圳市德斯戈智能科技有限公司Calculation force testing device based on AI chip
CN114978908B (en)*2022-05-112023-09-26量子科技长三角产业创新中心Evaluation and operation method and device for computing power network node
CN115907040A (en)*2022-10-122023-04-04中国电信股份有限公司 A data assignment method, device, electronic equipment and storage medium
CN115543911B (en)*2022-10-262023-08-01中国电子技术标准化研究院 A Method for Calculating Computing Capability of Heterogeneous Computing Devices

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2018032371A1 (en)*2016-08-132018-02-22深圳市樊溪电子有限公司Power consumption perception pow consensus mechanism for block chain
CN110661867A (en)*2019-09-252020-01-07东北大学Block chain consensus method based on improved workload certification and equity certification
CN111091258A (en)*2018-10-242020-05-01成都高新信息技术研究院Weight-based block chain consensus computing method and system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108984470A (en)*2018-06-192018-12-11四川斐讯信息技术有限公司A kind of FPGA mine machine calculates the lifting system and method for power
CN108900380B (en)*2018-07-142020-07-10上海分布信息科技有限公司Node management method and implementation system thereof
CN109412838A (en)*2018-09-292019-03-01吴志培Server cluster host node selection method based on hash calculating and Performance Evaluation
US20200313855A1 (en)*2019-03-262020-10-01Si YinConsensus method for blockchain via virtual machine based hybrid delegated proof of stake and proof of work (vdposw)
CN110166541B (en)*2019-05-142022-03-15魏松杰Rendering method based on block chain, related equipment and system
CN110532092A (en)*2019-08-212019-12-03云湾科技(嘉兴)有限公司Reso urce matching method, device and equipment
CN110943869B (en)*2019-12-162022-03-04杭州复杂美科技有限公司Block consensus and broadcast method, equipment and storage medium
CN111274110B (en)*2020-01-202023-03-31四川万物数创科技有限公司Block chain-based edge device performance evaluation method, management method and medium
CN111432014B (en)*2020-03-302023-05-05上海玳鸽信息技术有限公司Method and device for selecting main node in block chain consensus algorithm
CN111552573B (en)*2020-05-062024-02-09行星算力(深圳)科技有限公司Blockchain heterogeneous system and artificial intelligence power calculation network
CN111736059B (en)*2020-07-022022-08-26深圳比特微电子科技有限公司Chip testing method, testing equipment and testing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2018032371A1 (en)*2016-08-132018-02-22深圳市樊溪电子有限公司Power consumption perception pow consensus mechanism for block chain
CN111091258A (en)*2018-10-242020-05-01成都高新信息技术研究院Weight-based block chain consensus computing method and system
CN110661867A (en)*2019-09-252020-01-07东北大学Block chain consensus method based on improved workload certification and equity certification

Also Published As

Publication numberPublication date
WO2022120995A1 (en)2022-06-16
CN112600919A (en)2021-04-02

Similar Documents

PublicationPublication DateTitle
CN112600919B (en) A device computing power evaluation method and system based on PoW consensus mechanism
CN110535836A (en)A kind of trust block chain common recognition method of based role classification
EP3779760B1 (en)Blockchain-based data processing method and apparatus, and electronic device
CN109063985A (en)A kind of Application of risk decision method and device of business
CN112433988B (en) Data verification method, device, computer equipment and storage medium
CN108460068A (en)Method, apparatus, storage medium and the terminal that report imports and exports
US20220377109A1 (en)Crypto-jacking detection
CN110135711A (en)A kind of information management method and device
WO2020000631A1 (en)Virtual currency value estimation method and apparatus, electronic device and storage medium
CN108665272A (en)Block chain data processing method, device, equipment and storage medium
CN114742630A (en) Method for processing business documents and corresponding systems, devices and media
CN102681936B (en)Verification method and device for test result of financial system
CN115511486A (en) Transaction processing method, device, medium and electronic device
CN112214402A (en)Code verification algorithm selection method and device and storage medium
WO2019104844A1 (en)Automatic performance testing method, apparatus and device for monetary fund system, and storage medium
CN113822693A (en) Method, device, device and storage medium for generating evaluation value of user purchasing power
CN118626301A (en) Method, device, equipment, medium and product for locating abnormal process execution problems
CN108804640B (en)Data grouping method, device, storage medium and equipment based on maximized IV
US11768855B1 (en)Replicating data across databases by utilizing validation functions for data completeness and sequencing
CN114397876B (en)Method and device for evaluating performance of domain controller, electronic equipment and storage medium
CN116225690A (en)Memory multidimensional database calculation load balancing method and system based on docker
JPWO2013114911A1 (en) Risk assessment system, risk assessment method, and program
CN116308370A (en)Training method of abnormal transaction recognition model, abnormal transaction recognition method and device
CN111896030A (en)Fiber-optic gyroscope data structure configuration method, data structure and analysis method
CN114648228B (en) A method, device and equipment for evaluating business execution efficiency

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp