Blockchain health test method and apparatus therefor, storage medium, program product

By combining online and offline health testing strategies to obtain multi-dimensional comprehensive business parameters, the problem of inaccurate blockchain health detection in existing technologies has been solved, achieving a more accurate and comprehensive assessment of the health of blockchain operations.

CN116955100BActive Publication Date: 2026-07-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-10-31
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies cannot accurately detect the operational health of blockchains, especially since they cannot take into account their distributed, consensus, eventual consistency, and fault-tolerant characteristics, resulting in inaccurate health test results.

Method used

By combining online and offline health testing sub-strategies, multi-dimensional comprehensive business parameters among multiple blockchain nodes are obtained, including response time and the number of intra-block transactions between nodes, to determine the operational health of the blockchain.

Benefits of technology

To more accurately detect the operational health of blockchain, while taking into account its fault tolerance, and to improve the accuracy and comprehensiveness of the detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116955100B_ABST
    Figure CN116955100B_ABST
Patent Text Reader

Abstract

The application discloses a kind of blockchain health degree test method and its device, storage medium, program product, first determine the target blockchain to be tested and the multiple blockchain nodes corresponding to target blockchain, determine the running state of multiple blockchain nodes when running target blockchain, when multiple blockchain nodes include the first type node of online state and the second type node of offline state, determine the combination strategy of online health degree test sub-strategy and offline health degree test sub-strategy as target health degree test strategy, according to target health degree test strategy, obtain the multidimensional comprehensive service parameter between multiple blockchain nodes, and according to multidimensional comprehensive service parameter, determine the running health degree of target blockchain and generate health degree test result.The embodiment of the application can more accurately detect the running health degree of blockchain.The embodiment of the application can be applied to, for example, blockchain performance test, blockchain performance detection and other various scenes of blockchain technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a blockchain health testing method, apparatus, storage medium, and program product. Background Technology

[0002] Currently, to detect the operational availability of a blockchain, it is necessary to monitor its operational status, determine its operational health, and then judge its operational availability based on its operational health. Currently, blockchain health testing is generally based on the collected operational resources of each blockchain node and business error codes. The operational resources of blockchain nodes include the utilization rate of the Central Processing Unit (CPU) and memory utilization, while business error codes reflect the errors that have occurred in the blockchain's operations.

[0003] However, due to the inherent distributed, consensus, eventual consistency, and fault-tolerant characteristics of blockchain, the abnormal operation of local blockchain nodes or business error codes do not necessarily indicate that the blockchain is unavailable. Therefore, current health testing methods cannot accurately detect the operational health of blockchain, and there is an urgent need for a method that can more accurately detect the operational health of blockchain. Summary of the Invention

[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0005] This invention provides a blockchain health testing method, apparatus, storage medium, and program product, which can more accurately detect the operational health of a blockchain.

[0006] On one hand, embodiments of the present invention provide a blockchain health testing method, including the following steps:

[0007] Identify the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain;

[0008] Determine the running status of multiple blockchain nodes when running the target blockchain;

[0009] When multiple blockchain nodes include first-type nodes and second-type nodes, a combined strategy of online health testing sub-strategy and offline health testing sub-strategy is determined as the target health testing strategy, wherein the first-type nodes are nodes whose running state is online, and the second-type nodes are nodes whose running state is offline.

[0010] Based on the target health test strategy, obtain multi-dimensional comprehensive business parameters among multiple blockchain nodes;

[0011] The operational health of the target blockchain is determined based on the aforementioned multi-dimensional comprehensive business parameters;

[0012] The health test results of the target blockchain are generated based on the operational health status.

[0013] On the other hand, embodiments of the present invention also provide a blockchain health testing device, comprising:

[0014] The first determining module is used to determine the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain;

[0015] The second determining module is used to determine the operating status of the multiple blockchain nodes when running the target blockchain;

[0016] The third determining module is used to determine, when multiple blockchain nodes include first-type nodes and second-type nodes, a combined strategy of online health test sub-strategy and offline health test sub-strategy as the target health test strategy, wherein the first-type nodes are nodes whose running state is online, and the second-type nodes are nodes whose running state is offline.

[0017] The first acquisition module is used to acquire multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy.

[0018] The fourth determining module is used to determine the operational health of the target blockchain based on the multi-dimensional comprehensive business parameters;

[0019] The result generation module is used to generate the health test result of the target blockchain based on the operational health status.

[0020] Optionally, the first acquisition module is further configured to:

[0021] According to the online health test sub-strategy, obtain the first multi-dimensional comprehensive parameters among multiple first-type nodes;

[0022] The second multi-dimensional comprehensive parameter among multiple blockchain nodes is obtained according to the offline health test sub-strategy;

[0023] Multi-dimensional comprehensive business parameters among the multiple blockchain nodes are obtained based on the first multi-dimensional comprehensive parameters and the second multi-dimensional comprehensive parameters.

[0024] Optionally, the fourth determining module is further configured to:

[0025] Determine the target business indicator values ​​based on the aforementioned online health test sub-strategy;

[0026] The first health value of the target blockchain is determined based on the target business indicator value and the first multi-dimensional comprehensive parameter.

[0027] Data verification is performed on the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain data verification results;

[0028] The second health value of the target blockchain is determined based on the data verification results.

[0029] The operational health of the target blockchain is determined based on the first health value and the second health value.

[0030] Optionally, the fourth determining module is further configured to:

[0031] Calculate the offset between the target business indicator value and the first multi-dimensional comprehensive parameter;

[0032] The first health value of the target blockchain is determined based on the offset value.

[0033] Optionally, the first multi-dimensional comprehensive parameter includes multiple comprehensive business sub-parameters, and the target business indicator value includes multiple target business sub-indicator values; the fourth determining module is further configured to:

[0034] Calculate the square of the difference between each of the comprehensive business sub-parameters and each of the target business sub-indicators, and then perform a square root calculation based on the square value to obtain the offset between the target business indicator value and the first multi-dimensional comprehensive parameter.

[0035] Optionally, the fourth determining module is further configured to perform at least one of the following:

[0036] When the comprehensive business sub-parameters include on-chain transaction data and the target business sub-indicator value includes on-chain transaction indicator value, calculate the square of the difference between the on-chain transaction data and the on-chain transaction indicator value.

[0037] Alternatively, when the comprehensive business sub-parameters include the average consensus node switching frequency within the target block height range, and the target business sub-index value includes the consensus node switching frequency index value within the target block height range, calculate the square of the difference between the average consensus node switching frequency and the consensus node switching frequency index value.

[0038] Alternatively, when the integrated business sub-parameters include the average block height distance within a first time range, and the target business sub-index value includes the block height distance index value within the first time range, the square of the difference between the average block height distance and the block height distance index value is calculated.

[0039] Alternatively, when the comprehensive business sub-parameters include the standard deviation of the number of transactions within a block within a second time range, and the target business sub-index value includes the index value of the number of transactions within a block within a second time range, the square of the difference between the standard deviation of the number of transactions within a block and the index value of the number of transactions within a block is calculated.

[0040] Optionally, the fourth determining module is further configured to:

[0041] Data verification is performed on the second multi-dimensional comprehensive parameters among different blockchain nodes at the target block height to obtain a first verification result;

[0042] The second multi-dimensional comprehensive parameter between different blockchain nodes within the target block height range is verified to obtain a second verification result.

[0043] The data verification result is obtained based on the first verification result and the second verification result.

[0044] Optionally, the fourth determining module is further configured to perform at least one of the following:

[0045] When the second multi-dimensional comprehensive parameter includes block data, data verification is performed on the block data between different blockchain nodes;

[0046] Alternatively, when the second multi-dimensional comprehensive parameter includes transaction data, data verification is performed on the transaction data between different blockchain nodes;

[0047] Alternatively, when the second multi-dimensional comprehensive parameter includes business status data, data verification is performed on the business status data between different blockchain nodes.

[0048] Optionally, the fourth determining module is further configured to:

[0049] When the data verification result shows that the second multi-dimensional comprehensive parameter is consistent among different blockchain nodes, the second health value of the target blockchain is determined to be the first preset value representing the health of the target blockchain.

[0050] Alternatively, if the data verification result shows that the second multi-dimensional comprehensive parameters are inconsistent between different blockchain nodes, the second health value of the target blockchain is determined to be a second preset value that indicates that the target blockchain is unhealthy.

[0051] Optionally, the fourth determining module is further configured to:

[0052] The first weight value of the first health value and the second weight value of the second health value are determined according to the target health value testing strategy.

[0053] The operational health of the target blockchain is determined based on the first health value, the first weight value, the second health value, and the second weight value.

[0054] Optionally, the second determining module is further configured to:

[0055] The application for the target blockchain is compiled to obtain the compiled blockchain application.

[0056] The blockchain application is sent to each of the blockchain nodes, so that each of the blockchain nodes runs the blockchain application;

[0057] Run a blockchain instance in at least one of the blockchain nodes that are running the blockchain application;

[0058] Determine the running status of multiple blockchain nodes when the blockchain instance is running.

[0059] On the other hand, embodiments of the present invention also provide a blockchain health testing device, comprising:

[0060] At least one processor;

[0061] At least one memory for storing at least one program;

[0062] The blockchain health test method described above is implemented when at least one of the programs is executed by at least one of the processors.

[0063] On the other hand, embodiments of the present invention also provide a computer-readable storage medium storing a processor-executable computer program, which, when executed by a processor, is used to implement the blockchain health testing method as described above.

[0064] On the other hand, embodiments of the present invention also provide a computer program product, including a computer program or computer instructions, wherein the computer program or computer instructions are stored in a computer-readable storage medium, the processor of the blockchain health testing device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, causing the blockchain health testing device to perform the blockchain health testing method as described above.

[0065] The embodiments of the present invention include at least the following beneficial effects: First, the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain are determined. Then, the operating status of the multiple blockchain nodes when running the target blockchain is determined. When the multiple blockchain nodes include a first type of node in an online state and a second type of node in an offline state, a combined strategy of online health testing sub-strategy and offline health testing sub-strategy is determined as the target health testing strategy. Multi-dimensional comprehensive business parameters among the multiple blockchain nodes are obtained according to the target health testing strategy. Since the target health testing strategy is determined based on the operating status of the multiple blockchain nodes corresponding to the target blockchain to be tested, the target health testing strategy can be adapted to the target blockchain. After obtaining multi-dimensional comprehensive business parameters from multiple blockchain nodes using the target health test strategy, the operational health of the target blockchain is determined based on these parameters. A health test result is then generated based on this operational health. Since the multi-dimensional comprehensive business parameters are obtained according to a target health test strategy adapted to the target blockchain, and these parameters represent comprehensive business parameters from multiple blockchain nodes, they can reflect the overall operational status of the target blockchain. Therefore, determining the operational health of the target blockchain based on these multi-dimensional comprehensive business parameters not only allows for more accurate detection of its operational health but also takes into account its fault tolerance.

[0066] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description

[0067] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.

[0068] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention;

[0069] Figure 2 This is a schematic diagram of another implementation environment provided by an embodiment of the present invention;

[0070] Figure 3 This is a flowchart of a blockchain health testing method provided in an embodiment of the present invention;

[0071] Figure 4This is a schematic diagram of a blockchain network provided in an embodiment of the present invention;

[0072] Figure 5 This is a schematic diagram of the target business indicator values ​​provided in the embodiments of the present invention;

[0073] Figure 6 This is a schematic diagram of the interface for displaying comprehensive business sub-parameters on the monitoring platform, provided by an embodiment of the present invention;

[0074] Figure 7 This is a flowchart illustrating the principle of determining the operational health of a target blockchain based on an offline health test sub-strategy, as provided in an embodiment of the present invention.

[0075] Figure 8 This is a schematic diagram of a data verification result provided in an embodiment of the present invention;

[0076] Figure 9 This is a schematic diagram of log information generated during the operation health detection of a target blockchain, provided in an embodiment of the present invention.

[0077] Figure 10 This is a schematic diagram of a test report provided in an embodiment of the present invention;

[0078] Figure 11 This is a schematic diagram of an alarm message provided in an embodiment of the present invention;

[0079] Figure 12 This is a flowchart illustrating the principle of detecting the operational health of a target blockchain according to an embodiment of the present invention.

[0080] Figure 13 This is a schematic diagram of a blockchain health testing device provided in an embodiment of the present invention;

[0081] Figure 14 This is a schematic diagram of another blockchain health testing device provided in an embodiment of the present invention. Detailed Implementation

[0082] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present invention, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present invention.

[0083] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0084] 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 pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0085] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.

[0086] 1) Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include the underlying blockchain platform, the platform's product and service layer, and the application service layer. Blockchains can include public blockchains, consortium blockchains, and private blockchains. A public blockchain is one where anyone can access the blockchain network at any time to read data, send data, or compete for ledger entries; a consortium blockchain is one jointly managed by several organizations or institutions; a private blockchain is one with a degree of centralized control, where the right to write to the ledger is controlled by a specific organization or institution, and data access and use are subject to strict permission management.

[0087] 2) Artificial Intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI technology can be combined with blockchain technology, acting as an excellent manager within the distributed network of the blockchain, while blockchain technology provides a vast data foundation for AI, allowing for data collection and analysis to discover better solutions.

[0088] In related technologies, to detect the operational availability of a blockchain, it is typically necessary to monitor its operational status, determine its operational health, and then judge its operational availability based on the operational health. Currently, when conducting health tests on a blockchain, the operational health is generally determined based on the collected operational resources of each blockchain node and business error codes. The operational resources of the blockchain nodes include system resources such as CPU utilization and memory utilization, while business error codes reflect the errors that have occurred in the blockchain's operations.

[0089] However, due to the inherent distributed, consensus, eventual consistency, and fault-tolerance characteristics of blockchain, its operational availability cannot be solely reflected by the operational resources of blockchain nodes and business error codes. In other words, abnormal operational resources or business error codes of local blockchain nodes do not necessarily indicate that the blockchain is unavailable. Current health testing methods do not consider the unique characteristics of blockchain, namely its distributed, consensus, eventual consistency, and fault-tolerance features. Therefore, the operational health obtained through these methods cannot accurately reflect the blockchain's operational availability. Thus, a more accurate method for detecting blockchain operational health is urgently needed. Furthermore, current health testing methods have limitations because they do not consider the fault-tolerance characteristics of blockchain. In addition, business error codes collected through current health testing methods cannot be applied to the underlying blockchain layer. This is because errors in blockchain node operation caused by network anomalies or malicious behavior do not necessarily indicate that the blockchain is unavailable. Therefore, current health testing methods need to combine other methods to comprehensively evaluate the stability and operational availability of the current blockchain.

[0090] To more accurately detect the operational health of a target blockchain while also considering its fault tolerance, this invention provides a blockchain health testing method, apparatus, storage medium, and program product. First, the target blockchain to be tested and its corresponding multiple blockchain nodes are determined. Then, the operational status of the multiple blockchain nodes while running the target blockchain is determined. When the multiple blockchain nodes include a first type of nodes in an online state and a second type of nodes in an offline state, a combined strategy of online and offline health testing sub-strategies is determined as the target health testing strategy. Multi-dimensional comprehensive business parameters among the multiple blockchain nodes are obtained based on the target health testing strategy. Since the target health testing strategy is determined based on the operational status of the multiple blockchain nodes corresponding to the target blockchain to be tested... Therefore, the target health testing strategy is compatible with the target blockchain. After obtaining multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health testing strategy, the operational health of the target blockchain is determined based on these parameters, and a health test result is generated. Since the multi-dimensional comprehensive business parameters are obtained according to the target health testing strategy adapted to the target blockchain, and these parameters are comprehensive business parameters among multiple blockchain nodes, they can reflect the overall operational status of the target blockchain. Therefore, when determining the operational health of the target blockchain based on these parameters, not only can the operational health of the target blockchain be detected more accurately, but the fault tolerance of the target blockchain can also be taken into account.

[0091] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes a test terminal 101 and multiple test nodes 102. The test terminal 101 and these test nodes 102 are directly or indirectly connected via wired or wireless communication. When some of the test nodes 102 load and run the corresponding blockchain application, the multiple test nodes 102 running the blockchain application will form a corresponding blockchain network. At this time, the test nodes 102 running the blockchain application will become the corresponding blockchain nodes.

[0092] The test terminal 101 may include, but is not limited to, smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, smart TVs, etc. Optionally, the test terminal 101 may be equipped with a test client, which testers can use to test the operational health of the blockchain.

[0093] The test terminal 101 has at least the following functions: determining the target blockchain to be tested, determining the target health test strategy for testing the operational health of the target blockchain, and judging the operational health of the target blockchain based on multi-dimensional comprehensive business parameters between blockchain nodes. For example, it can determine the target blockchain to be tested, and determine multiple blockchain nodes corresponding to the target blockchain among multiple test nodes 102, then determine the operating status of these blockchain nodes when running the target blockchain, and determine the corresponding target health test strategy based on the operating status of these blockchain nodes, then obtain the multi-dimensional comprehensive business parameters between these blockchain nodes according to the target health test strategy, and determine the operational health of the target blockchain based on the multi-dimensional comprehensive business parameters, and finally generate the health test result of the target blockchain based on the operational health.

[0094] Test node 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0095] Test node 102 has at least the functions of loading and running blockchain applications and running blockchain instances. For example, when it receives a blockchain application sent by test terminal 101, it can load and run the blockchain application. In addition, when it receives an instance running instruction sent by test terminal 101, it can also run the corresponding blockchain instance according to the instance running instruction. Furthermore, when it receives a health test instruction sent by test terminal 101, it can also collect and send multi-dimensional comprehensive business parameters to test terminal 101 according to the health test instruction, so that test terminal 101 can determine the operational health of the target blockchain and generate the corresponding health test results based on the multi-dimensional comprehensive business parameters between multiple blockchain nodes.

[0096] Reference Figure 1As shown, in one application scenario, assuming the test terminal 101 is a desktop computer and a test client is installed on it, when testers use the test client to test the operational health of the target blockchain to be launched, the test terminal 101 will distribute the target blockchain application to multiple test nodes 102. The multiple test nodes 102 that receive the target blockchain application will become multiple blockchain nodes corresponding to the target blockchain. At this time, the test terminal 101 can identify the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain, and determine the operating status of these blockchain nodes when running the target blockchain. Then, based on the operating status of these blockchain nodes, it determines the target health test strategy. Next, based on the target health test strategy, it obtains multi-dimensional comprehensive business parameters between multiple blockchain nodes. After obtaining the multi-dimensional comprehensive business parameters between multiple blockchain nodes, the test terminal 101 determines the operational health of the target blockchain based on the obtained multi-dimensional comprehensive business parameters, and generates the target blockchain health test result based on the operational health. After generating the target blockchain health test result, the test terminal 101 displays the health test result or provides the download path of the health test result through the test client.

[0097] Figure 2 This is a schematic diagram of another implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 2 The implementation environment includes a detection terminal 201, a control server 202, and multiple blockchain nodes 203. The detection terminal 201 is directly or indirectly connected to these blockchain nodes 203 via wired or wireless communication. The detection terminal 201 is directly or indirectly connected to the control server 202 via wired or wireless communication. The multiple blockchain nodes 203 constitute a blockchain network corresponding to the target blockchain.

[0098] The testing terminal 201 may include, but is not limited to, smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, vehicle terminals, smart TVs, etc. Optionally, the testing terminal 201 may be equipped with a testing client, which maintenance personnel can use to test the operational health of the blockchain.

[0099] The detection terminal 201 has at least the following functions: determining the target blockchain to be detected, determining the target health test strategy for detecting the operational health of the target blockchain, and judging the operational health of the target blockchain based on multi-dimensional comprehensive business parameters between blockchain nodes. For example, it can determine the target blockchain to be detected and the multiple blockchain nodes 203 corresponding to the target blockchain, then determine the operating status of these blockchain nodes 203 when running the target blockchain, and determine the corresponding target health test strategy based on the operating status of these blockchain nodes 203. Then, it can obtain the multi-dimensional comprehensive business parameters between these blockchain nodes 203 according to the target health test strategy, and determine the operational health of the target blockchain based on the multi-dimensional comprehensive business parameters. Finally, it can generate the health test result of the target blockchain based on the operational health.

[0100] The control server 202 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0101] The control server 202 has at least the function of optimizing the configuration of the target blockchain's operating parameters based on the health test results of the target blockchain. For example, after receiving the health test results of the target blockchain sent by the detection terminal 201, it can determine the operational availability of the target blockchain based on the health test results. When the operational availability of the target blockchain is relatively poor, it can send optimized operational parameters of the target blockchain to each blockchain node 203, so that each blockchain node 203 can improve the operational health and operational availability of the target blockchain after configuring the optimized operational parameters.

[0102] Blockchain node 203 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN networks, and big data and artificial intelligence platforms.

[0103] Blockchain node 203 has at least the functions of creating blocks and adding blocks to the blockchain. For example, it can obtain transaction information, create blocks based on transaction information, and then broadcast the blocks in the blockchain network so that the blockchain network can perform consensus processing on the blocks. When consensus is reached on the blocks, the blocks are added to the target blockchain.

[0104] It should be noted that the transaction information involved in the embodiments of the present invention refers to the relevant information of the object that serves as the medium of transaction. For example, for goods that serve as the medium of transaction, the transaction information may be information such as product information, production time, listing date, shelf life, and warranty period; for currency that serves as the medium of transaction, the transaction information may be information such as currency value, original owner, and current owner; for services that serve as the medium of transaction, the transaction information may be information such as service content, the provider of the service, and the recipient of the service.

[0105] Reference Figure 2 As shown, in another application scenario, assuming the detection terminal 201 is a desktop computer and a detection client is installed on it, when maintenance personnel use the detection client to test the operational health of a target blockchain that is already online, the detection terminal 201 will determine the target blockchain to be tested and the multiple blockchain nodes 203 corresponding to the target blockchain, and determine the operating status of these blockchain nodes 203 when running the target blockchain. Then, based on the operating status of these blockchain nodes 203, it will determine the target health test strategy. Next, based on the target health test strategy, it will obtain multi-dimensional comprehensive business parameters among the multiple blockchain nodes 203. After obtaining the multi-dimensional comprehensive business parameters among the multiple blockchain nodes 203, the detection terminal 201... 1. Determine the operational health of the target blockchain based on the acquired multi-dimensional comprehensive business parameters, and generate a health test result for the target blockchain based on the operational health. After generating the health test result for the target blockchain, the detection terminal 201 can send the health test result for the target blockchain to the control server 202. After receiving the health test result, the control server 202 determines the operational availability of the target blockchain based on the health test result. When the operational availability of the target blockchain is relatively poor, optimize the operational parameters of the target blockchain and issue the optimized operational parameters to each blockchain node 203, so that each blockchain node 203 can improve the operational health and operational availability of the target blockchain after configuring the optimized operational parameters.

[0106] Figure 3 This is a flowchart of a blockchain health testing method provided in an embodiment of the present invention. In this embodiment, a terminal (e.g., a test terminal or a detection terminal) is used as the execution subject for illustration. (Refer to...) Figure 3 The blockchain health test method includes, but is not limited to, steps 310 to 360.

[0107] Step 310: Determine the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain.

[0108] In this step, the target blockchain to be tested and its corresponding multiple blockchain nodes can be identified, so as to determine the running status of these multiple blockchain nodes when running the target blockchain in subsequent steps. In one embodiment, there are many types of target blockchains, including public blockchains, consortium blockchains, and private blockchains, without specific limitations here. Different types of target blockchains have different implementation methods, but their overall architectures share commonalities. That is, the overall architecture generally includes an infrastructure layer, a basic component layer, a storage layer, a consensus layer, a ledger layer, a smart contract layer, and an interface layer, wherein the interface layer may include RPC interfaces, MySQL ports, etc. In addition, the multiple blockchain nodes may include at least one of adjacent blockchain nodes and non-adjacent blockchain nodes, without specific limitations here.

[0109] In one possible implementation, such as Figure 4 As shown, assume that the target blockchain corresponds to blockchain nodes A, B, C, D, and E. These blockchain nodes are interconnected. Therefore, the target blockchain and its corresponding blockchain nodes (A, B, C, D, and E) can be identified to determine their operational status in subsequent steps.

[0110] Step 320: Determine the running status of multiple blockchain nodes when running the target blockchain.

[0111] In this step, since the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain were determined in step 310, the operating status of the multiple blockchain nodes when running the target blockchain can be determined. This allows for the determination of the target health testing strategy based on the operating status of the multiple blockchain nodes in subsequent steps. In one embodiment, the operating status of the blockchain nodes includes offline and online states. The multiple blockchain nodes can all be in an offline state or all be in an online state; alternatively, some of the blockchain nodes may be in an offline state while others are in an online state. No specific limitations are imposed here.

[0112] In one possible implementation, the target blockchain application can be compiled to obtain a compiled blockchain application. This compiled application is then sent to various blockchain nodes, allowing each node to run it. A blockchain instance is then run on at least one of the blockchain nodes running the application. Finally, the running status of multiple blockchain nodes while the blockchain instance is running is determined. Specifically, the target blockchain code (i.e., the application) is submitted to the master branch of the Git repository. A pipeline is then triggered, causing the pipeline to launch a build environment, compile the code under the master branch, and obtain a compiled blockchain application. This compiled application is then sent to the corresponding stability testing environment (i.e., each blockchain node). The pipeline then starts the blockchain application on multiple blockchain nodes (i.e., each blockchain node runs the blockchain application) and initiates a health assessment function. Finally, a blockchain instance is run on at least one blockchain node running the application, and the running status of multiple blockchain nodes while the blockchain instance is running is determined. The Git repository is used to store the code, and it is managed by branches (such as the master branch, i.e., the main branch). Therefore, using a Git repository to compile the application can improve the automation of testing.

[0113] Step 330: When multiple blockchain nodes include first-type nodes and second-type nodes, determine the combined strategy of online health test sub-strategy and offline health test sub-strategy as the target health test strategy, wherein the first-type nodes are nodes in the online state and the second-type nodes are nodes in the offline state.

[0114] In this step, since the running status of multiple blockchain nodes when running the target blockchain was determined in step 320, the target health test strategy can be determined based on the running status of multiple blockchain nodes. When the multiple blockchain nodes include a first type of node that is running online and a second type of node that is running offline, a combination of online health test sub-strategy and offline health test sub-strategy can be used as the target health test strategy. Since the target health test strategy is determined based on the running status of multiple blockchain nodes corresponding to the target blockchain to be tested, the target health test strategy can be adapted to the target blockchain.

[0115] In one possible implementation, the target health testing strategy may include at least one of an online health testing sub-strategy or an offline health testing sub-strategy. The online health testing sub-strategy is a strategy for testing the operational health of a blockchain node when it is in an online state, and the offline health testing sub-strategy is a strategy for testing the operational health of a blockchain node when it is in an offline state. Specifically, when multiple blockchain nodes are in an online state, the online health testing sub-strategy can be determined as the target health testing strategy; or, when multiple blockchain nodes are in an offline state, the offline health testing sub-strategy can be determined as the target health testing strategy; or, when multiple blockchain nodes include nodes in an online state and nodes in an offline state, a combination of the online and offline health testing sub-strategies can be determined as the target health testing strategy.

[0116] Step 340: Obtain multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy.

[0117] In this step, since the target health testing strategy was determined in step 330, to improve upon the existing technology that relies solely on the resource operation status and business error codes of each blockchain node to determine operational health, and to more accurately reflect the operational health of the blockchain while maintaining its fault tolerance, multi-dimensional comprehensive business parameters among multiple blockchain nodes can be obtained based on the target health testing strategy. This allows subsequent steps to determine the operational health of the target blockchain based on these multi-dimensional comprehensive business parameters, thereby improving the accuracy of the target blockchain's operational health detection. It should be noted that the multi-dimensional comprehensive business parameters are a comprehensive indicator of the currently collected blockchain network. In one embodiment, the multi-dimensional comprehensive business parameters include response time, number of intra-block transactions between nodes, average height of the blockchain currently occupied by the blockchain node, transaction on-chain data, average consensus node switching frequency within the target block height range, average block height distance within the first time range, standard deviation of intra-block transactions within the second time range, etc. Among them, transaction on-chain data and number of intra-block transactions between nodes can be obtained through the function get_txs(), and average block height distance within the first time range and average height of the blockchain currently occupied by the blockchain node can be obtained through the function get_avg_round_per_height(). No specific restrictions are imposed here.

[0118] In one possible implementation, when obtaining multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy, the first multi-dimensional comprehensive parameters among multiple first-type nodes can be obtained first according to the online health test sub-strategy, then the second multi-dimensional comprehensive parameters among multiple blockchain nodes can be obtained according to the offline health test sub-strategy, and then the multi-dimensional comprehensive business parameters among multiple blockchain nodes can be obtained according to the first multi-dimensional comprehensive parameters and the second multi-dimensional comprehensive parameters. Since the second type of nodes operating offline cannot be subject to the online health test sub-strategy, while the first type of nodes operating online can be subject to either the online or offline health test sub-strategy, the online health test sub-strategy can be used to obtain the first multi-dimensional comprehensive parameters among multiple first type of nodes, such as the transaction on-chain data among multiple first type of nodes, the average consensus node switching frequency within the target block height range, the average block height distance within the first time range, and the standard deviation of the number of transactions within the block within the second time range. The offline health test sub-strategy can be used to obtain the second multi-dimensional comprehensive parameters among multiple blockchain nodes (including between first type of nodes, between second type of nodes, and between first type of nodes and second type of nodes), such as block data, transaction data, and business status data. Then, all the obtained first multi-dimensional comprehensive parameters and all the second multi-dimensional comprehensive parameters are summarized to obtain the multi-dimensional comprehensive business parameters among multiple blockchain nodes. Since the first and second multi-dimensional comprehensive parameters are obtained based on the target health test strategy adapted to the target blockchain, and both are comprehensive business parameters among multiple blockchain nodes, the first and second multi-dimensional comprehensive parameters can reflect the overall operation of the target blockchain, which is beneficial to the accuracy of subsequent steps in determining the operational health of the target blockchain based on the first and second multi-dimensional comprehensive parameters.

[0119] Step 350: Determine the operational health of the target blockchain based on multi-dimensional comprehensive business parameters.

[0120] In this step, since multi-dimensional comprehensive business parameters between multiple blockchain nodes were obtained in step 340, the operational health of the target blockchain can be determined based on these parameters. This allows subsequent steps to generate health test results for the target blockchain based on its operational health. Because the multi-dimensional comprehensive business parameters are obtained according to a target health test strategy adapted to the target blockchain, and because these parameters are comprehensive business parameters between multiple blockchain nodes, they can reflect the overall operational status of the target blockchain. Therefore, determining the operational health of the target blockchain based on these multi-dimensional comprehensive business parameters not only allows for more accurate detection of its operational health but also takes into account its fault tolerance.

[0121] In one possible implementation, the target health testing strategy may include an online health testing sub-strategy, an offline health testing sub-strategy, or a combination of online and offline health testing sub-strategies. The appropriate sub-strategy can be selected based on the actual operation of the target blockchain, and no specific limitation is made here.

[0122] When the target health testing strategy includes an online health testing sub-strategy, the target business indicator value can be determined based on the online health testing sub-strategy, and then the operational health of the target blockchain can be determined based on the target business indicator value and multi-dimensional comprehensive business parameters. When the target health testing strategy includes an offline health testing sub-strategy, data verification can be performed on the multi-dimensional comprehensive business parameters between different blockchain nodes to obtain data verification results, and then the operational health of the target blockchain can be determined based on the data verification results. When the target health testing strategy includes a combination of online and offline health testing sub-strategies, the target business indicator value can be determined first based on the online health testing sub-strategy, and the first health value of the target blockchain can be determined based on the target business indicator value and the first multi-dimensional comprehensive parameters. Then, data verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain data verification results, and the second health value of the target blockchain can be determined based on the data verification results. Finally, the operational health of the target blockchain can be determined based on the first and second health values. Regardless of the specific sub-strategies or combinations thereof included in the target health testing strategy, the obtained multi-dimensional comprehensive business parameters are derived from a target health testing strategy adapted to the target blockchain. Furthermore, these parameters represent the combined business parameters across multiple blockchain nodes, thus reflecting the overall operational status of the target blockchain. Therefore, determining the operational health of the target blockchain based on these multi-dimensional comprehensive business parameters not only allows for more accurate health monitoring but also considers the blockchain's fault tolerance. It should be noted that the target business indicator values ​​are preset steady-state indicators of the blockchain network, such as... Figure 5 As shown, the target business metrics include metrics related to the infrastructure layer, basic component layer, storage layer, consensus layer, ledger layer, smart contract layer, business metrics, and performance metrics. Specifically, the infrastructure layer includes metrics related to CPU, network, memory, and disk; the basic component layer includes metrics related to routers, CA authentication centers, and data centers; the storage layer includes metrics related to MySQL, TcaPlus, and LevelDB; the consensus layer includes metrics related to consensus time, consensus traffic, block production time, and Byzantine fault tolerance; the smart contract layer includes metrics related to contract deployment time and contract call time; business metrics include block data, transaction data, and packaged data; and performance metrics include average throughput, average response time, throughput per unit of CPU, throughput per unit of memory time, throughput per unit of disk space, and throughput per unit of network space.

[0123] In one possible implementation, when determining the first health value of the target blockchain based on the target business indicator value and the first multi-dimensional comprehensive parameter, the offset value between the target business indicator value and the multi-dimensional comprehensive business parameter can be calculated. The first health value of the target blockchain is then determined based on the offset value, allowing for the assessment of the target blockchain's availability. It is understood that a larger offset value results in a lower first health value and poorer blockchain availability; conversely, a smaller offset value results in a higher first health value and better blockchain availability. It should be noted that the process of calculating the offset value between the target business indicator value and the first multi-dimensional comprehensive parameter will be provided in subsequent embodiments and will not be elaborated here.

[0124] In one possible implementation, the first multi-dimensional comprehensive parameter may include multiple comprehensive business sub-parameters, and the target business indicator value may include multiple target business sub-indicator values. Therefore, the square of the difference between each comprehensive business sub-parameter and each target business sub-indicator value can be calculated, and the square root of this square value can be used to obtain the offset value between the target business indicator value and the first multi-dimensional comprehensive parameter. This allows the first health value of the target blockchain to be evaluated based on the offset value between the target business indicator value and the first multi-dimensional comprehensive parameter, thereby evaluating the operational availability of the target blockchain. It should be noted that the number of comprehensive business sub-parameters and the number of target business sub-indicator values ​​are not limited, and the comprehensive business sub-parameters and target business sub-indicator values ​​correspond one-to-one. The offset value between the target business indicator value and the first multi-dimensional comprehensive parameter, obtained by taking the square root of the square of the difference between each comprehensive business sub-parameter and each target business sub-indicator value, can be expressed by the following formula (1):

[0125]

[0126] In formula (1), D x,y This represents the offset between the target business indicator value and the first multi-dimensional comprehensive parameter, x. i Let y represent the i-th integrated business sub-parameter. i Both represent the value of the i-th target business sub-indicator, where i is any positive integer.

[0127] In one possible implementation, there are many ways to calculate the square of the difference between each comprehensive business sub-parameter and each target business sub-metric value. For example, when the comprehensive business sub-parameter includes on-chain transaction data and the target business sub-metric value includes on-chain transaction metric values, the square of the difference between the on-chain transaction data and the on-chain transaction metric values ​​can be calculated. Here, the on-chain transaction data can be either the on-chain transaction QPS (Query Per Second) in a concurrent scenario or the on-chain transaction TPS (Transactions Per Second) in a concurrent scenario. (e.g., transactions per second); or, when the comprehensive business sub-parameters include the average consensus node switching frequency within the target block height range, and the target business sub-indicator values ​​include the consensus node switching frequency index value within the target block height range, the square of the difference between the average consensus node switching frequency and the consensus node switching frequency index value can be calculated. The average consensus node switching frequency within the target block height range reflects the stability of the blockchain nodes, and this average consensus node switching frequency within the target block height range can be calculated using the round function; or, when the comprehensive business sub-parameters include the average block height distance within a first time range, and the target business sub-indicator values ​​include the block height distance index value within the first time range, the square of the difference between the average block height distance and the block height distance index value can be calculated. The average block height distance within the first time range is the average of the block height differences within the first time range, and this average block height distance within the first time range reflects the differences between different blockchain nodes. The network connectivity and performance differences of blocks submitted by different blockchain nodes are considered. The first time range refers to a specific time period, such as 20:00:00 on October 9, 2020 to 20:06:00 on October 9, 2020. The first time range can be determined based on actual circumstances and is not specifically limited here. Alternatively, when the comprehensive business sub-parameters include the standard deviation of the number of transactions within a block within the second time range, and the target business sub-indicator value includes the indicator value of the number of transactions within a block within the second time range, calculations can be performed. The standard deviation of the number of transactions within a block is the square of the difference between the standard deviation of the number of transactions within a block and the value of the transaction count index within a block. The standard deviation of the number of transactions within a block within a second time range reflects the smoothness of on-chain transactions across different blockchain nodes, i.e., it reflects the transaction volatility within the block within that second time range. This second time range is a specific period, such as 20:00:00 on October 9, 2020 to 21:45:00 on October 9, 2020. The second time range can be determined based on actual circumstances and is not specifically limited here. In one embodiment, the comprehensive business sub-parameters can be displayed on the monitoring platform, for example, in... Figure 6 middle, Figure 6 The left side displays the target block height of the target blockchain. Figure 6The right side displays the first multi-dimensional comprehensive parameters between different blockchain nodes at the target block height, such as the number of blockchain transactions, block commit time, minimum block commit time, etc.

[0128] It should be noted that the first and second time ranges may completely overlap, partially overlap, or not overlap at all; no specific limitations are imposed here. Furthermore, all the above-described methods for calculating the square of the difference between each comprehensive business sub-parameter and each target business sub-indicator value can be implemented in combination or individually; no specific limitations are imposed here.

[0129] For example, when the comprehensive business sub-parameters include on-chain transaction data, the average consensus node switching frequency within the target block height range, the average block height distance within the first time range, and the standard deviation of the number of transactions within a block within the second time range, and the target business sub-indicator values ​​include on-chain transaction indicator values, consensus node switching frequency indicator values ​​within the target block height range, block height distance indicator values ​​within the first time range, and the number of transactions within a block indicator values ​​within the second time range, the square of the difference between the on-chain transaction data and the on-chain transaction indicator values ​​can be calculated to obtain the first square value. The square of the difference between the average consensus node switching frequency and the consensus node switching frequency indicator values ​​can be calculated to obtain the second square value. The square of the difference between the average block height distance and the block height distance indicator values ​​can be calculated to obtain the third square value. The square of the difference between the standard deviation of the number of transactions within a block and the number of transactions within a block indicator values ​​can be calculated to obtain the fourth square value. Then, the square root of the sum of the first, second, third, and fourth square values ​​can be used to calculate the offset between the target business indicator value and the first multi-dimensional comprehensive parameter. Specifically, assuming the transaction on-chain data is x1, the average consensus node switching frequency within the target block height range is x2, the average block height distance within the first time range is x3, the standard deviation of the number of transactions within a block within the second time range is x4, the transaction on-chain indicator value is y1, the consensus node switching frequency indicator within the target block height range is y2, the block height distance indicator within the first time range is y3, and the number of transactions within a block within the second time range is y4, then the offset value D between the target business indicator value obtained by taking the square root of the sum of the first square value, the second square value, the third square value, and the fourth square value and the first multi-dimensional comprehensive parameter is... x,y It can be expressed by the following formula (2):

[0130]

[0131] In formula (2), (x1-y1) 2 Let (x² - y²) represent the first squared value. 2 This represents the second square value, (x³ - y³).2 This represents the third square value, (x⁴ - y⁴). 2 This represents the fourth squared value.

[0132] In one possible implementation, during the process of verifying the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification result, there are many ways to perform data verification on the second multi-dimensional comprehensive parameters between different blockchain nodes. For example, when the second multi-dimensional comprehensive parameters include block data, data verification is performed on the block data between different blockchain nodes. The block data may include block hash values, block Merkle roots (or the root hash values ​​of Merkle trees), etc., where the block Merkle root is generated by the hash values ​​of all transactions in the block body; or, when the second multi-dimensional comprehensive parameters include transaction data, data verification is performed on the transaction data between different blockchain nodes. The transaction data may include transaction hash values, transaction receipts, etc., where the transaction hash value is a hash string obtained by encrypting the transaction information in a block using a hash algorithm and compressing the transaction information. The transaction hash value may consist of a string of numbers and letters; or, when the second multi-dimensional comprehensive parameters include business status data, data verification is performed on the business status data between different blockchain nodes. It should be noted that all the above-described methods for verifying the second multi-dimensional comprehensive parameters between different blockchain nodes can be implemented individually or in combination, and no specific limitations are imposed here. Furthermore, data verification includes consistency verification and integrity verification. Consistency verification of the second multi-dimensional comprehensive parameters between different blockchain nodes verifies whether the second multi-dimensional comprehensive parameters are consistent; integrity verification of the second multi-dimensional comprehensive parameters between different blockchain nodes verifies whether the second multi-dimensional comprehensive parameters are complete. Furthermore, there are many ways to determine the operational health of a target blockchain based on data verification results. For example, when the data verification results show that the second multi-dimensional comprehensive parameters of different blockchain nodes are consistent, the second health value of the target blockchain can be determined as a first preset value representing the health of the target blockchain. For example, the first preset value can be 1 or other values, without specific limitations. When the second health value of the target blockchain is determined to be the first preset value, it indicates that the target blockchain is in a partially healthy state and has a certain degree of availability. Alternatively, when the data verification results show that the second multi-dimensional comprehensive parameters of different blockchain nodes are inconsistent, the second health value of the target blockchain can be determined as a second preset value representing the unhealthiness of the target blockchain. For example, the second preset value can be 0 or other values, without specific limitations. However, the second preset value is different from the first preset value, and in general, the second preset value is less than the first preset value. When the second health value of the target blockchain is determined to be the second preset value, it indicates that the target blockchain is in a partially unhealthy state, and its availability may be affected.

[0133] In one possible implementation, in determining the operational health of the target blockchain based on a first health value and a second health value, a first weight value for the first health value and a second weight value for the second health value can be determined first according to the target health test strategy. Then, the operational health of the target blockchain is determined based on the first health value, the first weight value, the second health value, and the second weight value. For example, assuming the first health value is A, the second health value is B, the first weight value for the first health value determined by the target health test strategy is a, and the second weight value for the second health value determined by the target health test strategy is b, then the operational health of the target blockchain can be determined according to the formula C = a*A + b*B, where C is the operational health of the target blockchain. It should be noted that the first weight value and the second weight value can be appropriately selected according to the actual application situation, and no specific limitation is made here. For example, the first weight value and the second weight value can be determined according to the proportion of the first type of nodes and the second type of nodes. If the number of first type nodes is greater than the number of second type nodes, then the first weight value is greater than the second weight value; if the number of first type nodes is less than the number of second type nodes, then the first weight value is less than the second weight value.

[0134] In one possible implementation, data verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes at the target block height to obtain a first verification result. Then, data verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes within the target block height range to obtain a second verification result. Finally, the data verification result is obtained based on the first and second verification results. It should be noted that the target block height and the target block height range are preset block heights and ranges, which can be set according to actual needs; no specific limitations are imposed here. Furthermore, data verification includes consistency verification and integrity verification. For example, consistency verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes at the target block height, i.e., verifying whether the second multi-dimensional comprehensive parameters between different blockchain nodes at the target block height are consistent; integrity verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes at the target block height, i.e., verifying whether the second multi-dimensional comprehensive parameters between different blockchain nodes at the target block height are complete. Similarly, consistency verification and / or integrity verification can be performed on the second multi-dimensional comprehensive parameters between different blockchain nodes within the target block height range, which will not be elaborated further here. In one embodiment, the data verification of the second multi-dimensional comprehensive parameters between different blockchain nodes can be implemented using the functions run_case(), verify_height(), and verify_height_range(). run_case() initiates the verification process and queries the second multi-dimensional comprehensive parameters (such as block data and transaction data) between different blockchain nodes at the target block height. verify_height() verifies the consistency and integrity of the second multi-dimensional comprehensive parameters (such as block data and transaction data) between different blockchain nodes at the target block height. These second multi-dimensional comprehensive parameters include transaction hash values, transaction receipts, block hash values, and block Merkle roots. verify_height_range() verifies the consistency and integrity of the second multi-dimensional comprehensive parameters (such as block data and transaction data) between different blockchain nodes within the target block height range.

[0135] The following section will provide a detailed explanation using the example of verifying the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification results.

[0136] refer to Figure 7First, in a blockchain network, node information such as IP address and RPC port can be configured for multiple blockchain nodes. These multiple blockchain nodes are designated as first blockchain node N1, second blockchain node N2, third blockchain node N3, and fourth blockchain node N4.

[0137] Next, verification tasks are allocated based on the target block height range. Therefore, the execution order of each verification task is as follows: the first task process verifies the second multi-dimensional comprehensive parameters for heights 1-100; the second task process verifies the second multi-dimensional comprehensive parameters for heights 101-200; the third task process verifies the second multi-dimensional comprehensive parameters for heights 201-300; and so on. This verification task not only supports height range verification but also multi-node data verification and custom comparison items (i.e., other verification tasks), such as:

[0138] Assuming that the second multi-dimensional comprehensive parameter among the first blockchain node N1, the second blockchain node N2, the third blockchain node N3, and the fourth blockchain node N4 includes block data, transaction data, and business status data, then based on the target block height range in each task process, consistency verification is performed on the block data, transaction data, and business status data among different blockchain nodes (i.e., the first blockchain node N1, the second blockchain node N2, the third blockchain node N3, and the fourth blockchain node N4) within the target block height range. Specifically, each task process can be executed according to RPC (Remote Procedure Call Protocol). In the first task process, consistency checks can be performed on block data, transaction data, and business status data among different blockchain nodes within the target block height range of 1 to 100. In the second task process, consistency checks can be performed on block data, transaction data, and business status data among different blockchain nodes within the target block height range of 101 to 200. In the third task process, consistency checks can be performed on block data, transaction data, and business status data among different blockchain nodes within the target block height range of 201 to 300. Finally, the data verification results of all task processes are obtained, and the second health value of the target blockchain is determined based on these results. The data verification results of the first task process are as follows: Figure 8 As shown. In Figure 8In this context, "verify_result" represents the data verification result, and "height from to: (*)" represents the target block height range. For example, from "height from to: (100, 104), verify_result: False", we know that the block data, transaction data, and business status data between different blockchain nodes within the target block height range (100, 104) are inconsistent. Therefore, the second health value of the target blockchain can be determined as the second preset value representing the unhealthy state of the target blockchain. As another example, from "height from to: (175, 179), verify_result: True", we know that the block data, transaction data, and business status data between different blockchain nodes within the target block height range (175, 179) are consistent. Therefore, the second health value of the target blockchain can be determined as the first preset value representing the health of the target blockchain.

[0139] Step 360: Generate the health test results of the target blockchain based on the operational health.

[0140] In this step, since the operational health of the target blockchain was determined in step 350, a health test result for the target blockchain can be generated based on the operational health. This allows for problem localization and remediation based on the health test result. In one embodiment, such as... Figure 9 As shown, Figure 9 This is a diagram illustrating the log information generated during the health check of a target blockchain. Figure 9 The log information can be used for problem localization and remediation. Additionally, based on the health test results of the target blockchain, data such as... can be generated. Figure 10 The test report shown allows testers to summarize and analyze the health test results. When the health test results include abnormal information, it can display something like... Figure 11 The alarm information shown is intended to help testers locate problems or optimize the target blockchain application based on the alarm information.

[0141] In one possible implementation, such as Figure 12 As shown, during the blockchain product iteration cycle, the developed blockchain project can be submitted to the pipeline platform (such as the first platform, second platform, third platform, fourth platform, and fifth platform), and then test execution is triggered. After completing basic functional testing, testers can begin usability testing and trigger a health check of the target blockchain, finally obtaining an archived report (i.e., health test results).

[0142] In this embodiment, the blockchain health testing method, including steps 310 to 360 above, first determines the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain. Then, it determines the running status of the multiple blockchain nodes when running the target blockchain. When the multiple blockchain nodes include a first type of node in an online state and a second type of node in an offline state, a combined strategy of online health testing sub-strategy and offline health testing sub-strategy is determined as the target health testing strategy. Based on the target health testing strategy, multi-dimensional comprehensive business parameters among the multiple blockchain nodes are obtained. Since the target health testing strategy is determined based on the running status of the multiple blockchain nodes corresponding to the target blockchain to be tested, the target health testing strategy can be correlated with the target blockchain. Chain compatibility: After obtaining multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy, the operational health of the target blockchain is determined based on these parameters, and a health test result is generated. Since the multi-dimensional comprehensive business parameters are obtained according to a target health test strategy adapted to the target blockchain, and these parameters are comprehensive business parameters among multiple blockchain nodes, they can reflect the overall operational status of the target blockchain. Therefore, when determining the operational health of the target blockchain based on these parameters, not only can the operational health of the target blockchain be detected more accurately, but the fault tolerance of the target blockchain can also be taken into account.

[0143] The following examples illustrate the application scenarios of the embodiments of the present invention.

[0144] It should be noted that the blockchain health testing method provided in this embodiment of the invention can be applied to different application scenarios, such as performance testing of blockchains to be launched and performance testing of blockchains already launched. The following description will use the scenarios of performance testing of blockchains to be launched and performance testing of blockchains already launched as examples.

[0145] Scene 1

[0146] The blockchain health testing method provided in this invention can be applied to scenarios involving performance testing of blockchains awaiting deployment. For example, assuming testers use a test client on a test terminal (e.g., a desktop computer) to test the operational health of a target blockchain, the test terminal first determines the target blockchain to be tested and multiple test nodes that will run the target blockchain. These test nodes will become the multiple blockchain nodes corresponding to the target blockchain. Next, the test terminal compiles the application for the target blockchain, obtaining the compiled blockchain application. Then, the blockchain application is sent to each test node that will run the target blockchain, causing each test node to run the blockchain application. At this point, the multiple test nodes running the blockchain application become the multiple blockchain nodes corresponding to the target blockchain. Finally, the test terminal runs a blockchain instance on at least one of the blockchain nodes running the blockchain application. The testing terminal first determines the operational status of multiple blockchain nodes when running the blockchain instance. Then, based on these node statuses, it determines a target health test strategy. Specifically, if multiple blockchain nodes are online, an online health test sub-strategy is used; if they are offline, an offline health test sub-strategy is used; or if the network includes both online and offline nodes, a combination of online and offline sub-strategies is used. After determining the target health test strategy, the testing terminal acquires multi-dimensional comprehensive business parameters from the multiple blockchain nodes. Based on these parameters, it determines the operational health of the target blockchain and generates the target blockchain's health test results.

[0147] If the target health test strategy includes an online health test sub-strategy, the multi-dimensional comprehensive business parameters obtained between multiple blockchain nodes can include multiple comprehensive business sub-parameters. These multiple comprehensive business sub-parameters include at least one of the following: transaction on-chain data, average consensus node switching frequency within the target block height range, average block height distance within the first time range, or standard deviation of the number of transactions within a block within the second time range. In this case, the test terminal can determine the target business indicator value based on the online health test sub-strategy, and then calculate the offset value between the target business indicator value and the multi-dimensional comprehensive business parameters. The target business indicator value corresponds to the multi-dimensional comprehensive business parameters; that is, the target business indicator value can include multiple target business sub-indicator values. These multiple target business sub-indicator values ​​include at least one of the following: transaction on-chain indicator value, consensus node switching frequency indicator value within the target block height range, block height distance indicator value within the first time range, or number of transactions within a block within the second time range. For example, assuming the multi-dimensional comprehensive business parameters include transaction on-chain data, average consensus node switching frequency, average block height distance, and number of transactions within a block... To calculate the offset between the target business indicator value and the multi-dimensional comprehensive business parameters, we can calculate the square of the difference between the transaction on-chain data and the transaction on-chain indicator value, the square of the difference between the average consensus node switching frequency and the consensus node switching frequency indicator value, the square of the difference between the average block height distance and the block height distance indicator value, and the square of the difference between the standard deviation of the number of transactions within a block and the number of transactions within a block indicator value. These squared values ​​are then summed and their square roots are taken to obtain the offset between the target business indicator value and the multi-dimensional comprehensive business parameters. After calculating the offset, the test terminal can determine the operational health of the target blockchain based on this offset value. Then, a health test result is generated based on the operational health. For example, if the operational health of the target blockchain is less than a preset health threshold, the operational health test result is "unhealthy"; if the operational health of the target blockchain is greater than or equal to the preset health threshold, the operational health test result is "healthy".

[0148] If the target health testing strategy includes an offline health testing sub-strategy, and the acquired multi-dimensional comprehensive business parameters between multiple blockchain nodes include at least one of block data, transaction data, or business status data, then the testing terminal can first perform data verification on the multi-dimensional comprehensive business parameters between different blockchain nodes at the target block height to obtain a first verification result. Then, it can perform data verification on the multi-dimensional comprehensive business parameters between different blockchain nodes within the target block height range to obtain a second verification result. Based on the first and second verification results, a data verification result is obtained. This data verification can include data consistency verification and data integrity verification. After obtaining the data verification result, the testing terminal can determine the operational health of the target blockchain based on the data verification result. For example, if the data verification result shows that the multi-dimensional comprehensive business parameters between different blockchain nodes are consistent, the operational health of the target blockchain can be determined to be healthy. If the data verification result shows that the multi-dimensional comprehensive business parameters between different blockchain nodes are inconsistent, the operational health of the target blockchain can be determined to be unhealthy. After determining the operational health of the target blockchain, the testing terminal can generate a health test result for the target blockchain based on the obtained operational health.

[0149] If the target health test strategy includes a combination of online and offline health test sub-strategies, the first multi-dimensional comprehensive parameters obtained between multiple first-type nodes can include multiple comprehensive business sub-parameters. These multiple comprehensive business sub-parameters include at least one of the following: transaction on-chain data, average consensus node switching frequency within the target block height range, average block height distance within the first time range, or standard deviation of the number of transactions within a block within the second time range. The second multi-dimensional comprehensive parameters obtained between multiple blockchain nodes include at least one of block data, transaction data, or business status data. In this case, the test terminal can determine the target business indicator value based on the online health test sub-strategy, and determine the first health value of the target blockchain based on the target business indicator value and the first multi-dimensional comprehensive parameters. Then, it can perform data verification on the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification result, and determine the second health value of the target blockchain based on the data verification result. Next, it can determine the operational health of the target blockchain based on the first and second health values. After determining the operational health of the target blockchain, the test terminal can generate the health test result of the target blockchain based on the obtained operational health.

[0150] Once the testing terminal obtains the health test results of the target blockchain, it can display these results to the testers through the testing client, or provide the testers with a download path for the health test results. At this point, the testers can determine whether the target blockchain meets the requirements for online operation based on the health test results.

[0151] Scene 2

[0152] The blockchain health testing method provided in this invention can also be applied to scenarios involving performance testing of blockchains already in operation. For example, assuming maintenance personnel use a testing client on a testing terminal (e.g., a desktop computer) to test the operational health of a target blockchain already in operation, the testing terminal first identifies the target blockchain to be tested and the multiple blockchain nodes corresponding to it. Then, it determines the operating status of these blockchain nodes while running the target blockchain. Next, the testing terminal determines the target health testing strategy based on the operating status of these blockchain nodes. If multiple blockchain nodes are in an online state, an online health testing sub-strategy can be adopted as the target health test strategy. The strategy can be as follows: if multiple blockchain nodes are in an offline state, an offline health test sub-strategy can be adopted as the target health test strategy; or, if multiple blockchain nodes include nodes in an online state and nodes in an offline state, a combination of online and offline health test sub-strategies can be adopted as the target health test strategy. After determining the target health test strategy, the detection terminal obtains multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy, then determines the operational health of the target blockchain based on the obtained multi-dimensional comprehensive business parameters, and generates the health test result of the target blockchain based on the operational health.

[0153] If the target health test strategy includes an online health test sub-strategy, the multi-dimensional comprehensive business parameters obtained from multiple blockchain nodes can include multiple comprehensive business sub-parameters. These multiple comprehensive business sub-parameters include at least one of the following: transaction on-chain data, average consensus node switching frequency within the target block height range, average block height distance within the first time range, or standard deviation of the number of transactions within a block within the second time range. In this case, the detection terminal can determine the target business indicator value based on the online health test sub-strategy, and then calculate the offset value between the target business indicator value and the multi-dimensional comprehensive business parameters. The target business indicator value corresponds to the multi-dimensional comprehensive business parameters; that is, the target business indicator value can include multiple target business sub-indicator values. These multiple target business sub-indicator values ​​include at least one of the following: transaction on-chain indicator value, consensus node switching frequency indicator value within the target block height range, block height distance indicator value within the first time range, or number of transactions within a block within the second time range. For example, assuming the multi-dimensional comprehensive business parameters include transaction on-chain data, average consensus node switching frequency, average block height distance, and number of transactions within a block... To calculate the offset between the target business indicator value and the multi-dimensional comprehensive business parameters, we can calculate the square of the difference between the transaction on-chain data and the transaction on-chain indicator value, the square of the difference between the average consensus node switching frequency and the consensus node switching frequency indicator value, the square of the difference between the average block height distance and the block height distance indicator value, and the square of the difference between the standard deviation of the number of transactions within a block and the number of transactions within a block indicator value. These squared values ​​are then summed and their square roots are taken to obtain the offset between the target business indicator value and the multi-dimensional comprehensive business parameters. After calculating the offset, the detection terminal can determine the operational health of the target blockchain based on this offset value. Then, it generates a health test result for the target blockchain based on the operational health. For example, if the operational health of the target blockchain is less than a preset health threshold, the operational health test result is "unhealthy"; if the operational health of the target blockchain is greater than or equal to the preset health threshold, the operational health test result is "healthy".

[0154] If the target health testing strategy includes an offline health testing sub-strategy, and the acquired multi-dimensional comprehensive business parameters between multiple blockchain nodes include at least one of block data, transaction data, or business status data, then the testing terminal can first perform data verification on the multi-dimensional comprehensive business parameters between different blockchain nodes at the target block height to obtain a first verification result. Then, it can perform data verification on the multi-dimensional comprehensive business parameters between different blockchain nodes within the target block height range to obtain a second verification result. Based on the first and second verification results, a data verification result is obtained. This data verification can include data consistency verification and data integrity verification. After obtaining the data verification result, the testing terminal can determine the operational health of the target blockchain based on the data verification result. For example, if the data verification result shows that the multi-dimensional comprehensive business parameters between different blockchain nodes are consistent, the operational health of the target blockchain can be determined to be healthy. If the data verification result shows that the multi-dimensional comprehensive business parameters between different blockchain nodes are inconsistent, the operational health of the target blockchain can be determined to be unhealthy. After determining the operational health of the target blockchain, the testing terminal can generate a health test result for the target blockchain based on the obtained operational health.

[0155] If the target health test strategy includes a combination of online and offline health test sub-strategies, the first multi-dimensional comprehensive parameters obtained between multiple first-type nodes can include multiple comprehensive business sub-parameters. These multiple comprehensive business sub-parameters include at least one of the following: transaction on-chain data, average consensus node switching frequency within the target block height range, average block height distance within the first time range, or standard deviation of the number of transactions within a block within the second time range. The second multi-dimensional comprehensive parameters obtained between multiple blockchain nodes include at least one of block data, transaction data, or business status data. In this case, the test terminal can determine the target business indicator value based on the online health test sub-strategy, and determine the first health value of the target blockchain based on the target business indicator value and the first multi-dimensional comprehensive parameters. Then, it can perform data verification on the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification result, and determine the second health value of the target blockchain based on the data verification result. Next, it can determine the operational health of the target blockchain based on the first and second health values. After determining the operational health of the target blockchain, the test terminal can generate the health test result of the target blockchain based on the obtained operational health.

[0156] After the detection terminal obtains the health test results of the target blockchain, it can send the results to the control server. Upon receiving the results, the control server can determine the operational availability of the target blockchain. For example, if the target blockchain's operational availability is determined to be poor due to its poor health, the control server can optimize the blockchain's operating parameters and distribute the optimized parameters to each blockchain node. This will improve the target blockchain's operational health and availability after each node is configured with the optimized parameters. Conversely, if the target blockchain's operational availability is determined to be good due to its good health, the control server can send corresponding feedback to the detection terminal, prompting the detection terminal to wait for the next health test of the target blockchain.

[0157] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0158] Reference Figure 13 This invention also discloses a blockchain health testing device 1300, which can implement the blockchain health testing method as described in the previous embodiments. The blockchain health testing device 1300 includes:

[0159] The first determining module 1310 is used to determine the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain;

[0160] The second determining module 1320 is used to determine the running status of multiple blockchain nodes when running the target blockchain;

[0161] The third determining module 1330 is used to determine, when multiple blockchain nodes include first-type nodes and second-type nodes, a combined strategy of online health test sub-strategy and offline health test sub-strategy as the target health test strategy, wherein the first-type nodes are nodes whose running state is online and the second-type nodes are nodes whose running state is offline.

[0162] The first acquisition module 1340 is used to acquire multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the target health test strategy.

[0163] The fourth determination module 1350 is used to determine the operational health of the target blockchain based on multi-dimensional comprehensive business parameters;

[0164] The result generation module 1360 is used to generate health test results for the target blockchain based on its operational health.

[0165] In one embodiment, the first acquisition module 1340 is further configured to:

[0166] Based on the online health test sub-strategy, obtain the first multi-dimensional comprehensive parameters among multiple first-type nodes;

[0167] The second multi-dimensional comprehensive parameter among multiple blockchain nodes is obtained based on the offline health test sub-strategy;

[0168] The multi-dimensional comprehensive business parameters between multiple blockchain nodes are obtained based on the first and second multi-dimensional comprehensive parameters.

[0169] In one embodiment, the fourth determining module 1350 is further configured to:

[0170] Determine the target business indicator values ​​based on the online health test sub-strategy;

[0171] The first health score of the target blockchain is determined based on the target business indicator value and the first multi-dimensional comprehensive parameter.

[0172] Data verification is performed on the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification results;

[0173] Determine the second health value of the target blockchain based on the data verification results;

[0174] The operational health of the target blockchain is determined based on the first health value and the second health value.

[0175] In one embodiment, the fourth determining module 1350 is further configured to:

[0176] Calculate the offset between the target business indicator value and the first multi-dimensional comprehensive parameter;

[0177] The first health value of the target blockchain is determined based on the offset value.

[0178] In one embodiment, the first multi-dimensional comprehensive parameter includes multiple comprehensive business sub-parameters, and the target business indicator value includes multiple target business sub-indicator values; the fourth determining module 1350 is further configured to:

[0179] Calculate the square of the difference between each comprehensive business sub-parameter and each target business sub-index value, and then take the square root of the square value to obtain the offset between the target business index value and the first multi-dimensional comprehensive parameter.

[0180] In one embodiment, the fourth determining module 1350 is further configured to perform at least one of the following:

[0181] When the comprehensive business sub-parameters include on-chain transaction data and the target business sub-indicator values ​​include on-chain transaction indicator values, calculate the square of the difference between the on-chain transaction data and the on-chain transaction indicator values.

[0182] Alternatively, when the comprehensive business sub-parameters include the average consensus node switching frequency within the target block height range, and the target business sub-index values ​​include the consensus node switching frequency index values ​​within the target block height range, calculate the square of the difference between the average consensus node switching frequency and the consensus node switching frequency index values.

[0183] Alternatively, when the comprehensive business sub-parameters include the average block height distance within the first time range, and the target business sub-indicator values ​​include the block height distance indicator values ​​within the first time range, calculate the square of the difference between the average block height distance and the block height distance indicator values.

[0184] Alternatively, when the comprehensive business sub-parameters include the standard deviation of the number of transactions within a block within the second time range, and the target business sub-indicator value includes the indicator value of the number of transactions within a block within the second time range, calculate the square of the difference between the standard deviation of the number of transactions within a block and the indicator value of the number of transactions within a block.

[0185] In one embodiment, the fourth determining module 1350 is further configured to:

[0186] Data verification is performed on the second multi-dimensional comprehensive parameters among different blockchain nodes at the target block height to obtain the first verification result;

[0187] Data verification is performed on the second multi-dimensional comprehensive parameters between different blockchain nodes within the target block height range to obtain the second verification result;

[0188] The data verification result is obtained based on the first and second verification results.

[0189] In one embodiment, the fourth determining module 1350 is further configured to perform at least one of the following:

[0190] When the second multi-dimensional comprehensive parameter includes block data, data verification is performed on the block data between different blockchain nodes;

[0191] Alternatively, when the second multi-dimensional comprehensive parameter includes transaction data, data verification is performed on the transaction data between different blockchain nodes;

[0192] Alternatively, when the second multi-dimensional comprehensive parameter includes business status data, data verification is performed on the business status data between different blockchain nodes.

[0193] In one embodiment, the fourth determining module 1350 is further configured to:

[0194] When the data verification results show that the second multi-dimensional comprehensive parameters of different blockchain nodes are consistent, the second health value of the target blockchain is determined as the first preset value representing the health of the target blockchain.

[0195] Alternatively, if the data verification result shows that the second multi-dimensional comprehensive parameters of different blockchain nodes are inconsistent, the second health value of the target blockchain is determined as the second preset value that represents the unhealthiness of the target blockchain.

[0196] In one embodiment, the fourth determining module 1350 is further configured to:

[0197] The first weight value of the first health value and the second weight value of the second health value are determined according to the target health value testing strategy.

[0198] The operational health of the target blockchain is determined based on the first health value, the first weight value, the second health value, and the second weight value.

[0199] In one embodiment, the second determining module 1320 is further configured to:

[0200] The application for the target blockchain is compiled to obtain the compiled blockchain application;

[0201] Send the blockchain application to each blockchain node, so that each blockchain node can run the blockchain application;

[0202] Run a blockchain instance on at least one blockchain node that is running a blockchain application;

[0203] Determine the running status of multiple blockchain nodes when running a blockchain instance.

[0204] It should be noted that since the blockchain health testing device 1300 of this embodiment can implement the blockchain health testing method of the previous embodiment, the blockchain health testing device 1300 of this embodiment and the blockchain health testing method of the previous embodiment have the same technical principle and the same beneficial effect. In order to avoid repetition, it will not be described again here.

[0205] Reference Figure 14The present invention also discloses a blockchain health testing device, the blockchain health testing device 1400 comprising:

[0206] At least one processor 1401;

[0207] At least one memory 1402 is used to store at least one program;

[0208] When at least one program is executed by at least one processor 1401, the blockchain health test method described above is implemented. This embodiment of the invention also discloses a computer-readable storage medium storing a processor-executable computer program, which, when executed by the processor, is used to implement the blockchain health test method described above.

[0209] This invention also discloses a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. The processor of the blockchain health testing device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the blockchain health testing device to perform the blockchain health testing method as described above.

[0210] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0211] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0212] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.

[0213] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0214] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0215] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or 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 various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0216] The step numbers in the above method embodiments are set only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

Claims

1. A blockchain health testing method, characterized in that, Includes the following steps: Identify the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain; Determine the running status of multiple blockchain nodes when running the target blockchain; When multiple blockchain nodes include first-type nodes and second-type nodes, a combined strategy of online health testing sub-strategy and offline health testing sub-strategy is determined as the target health testing strategy, wherein the first-type nodes are nodes whose running state is online, and the second-type nodes are nodes whose running state is offline. According to the online health test sub-strategy, a first multi-dimensional comprehensive parameter is obtained among multiple first-type nodes; according to the offline health test sub-strategy, a second multi-dimensional comprehensive parameter is obtained among multiple blockchain nodes; and multi-dimensional comprehensive business parameters among multiple blockchain nodes are obtained based on the first multi-dimensional comprehensive parameter and the second multi-dimensional comprehensive parameter. The target business indicator value is determined according to the online health test sub-strategy; the offset value between the target business indicator value and the first multi-dimensional comprehensive parameter is calculated; the first health value of the target blockchain is determined according to the offset value; the second multi-dimensional comprehensive parameter between different blockchain nodes is verified to obtain the data verification result; the second health value of the target blockchain is determined according to the data verification result; the operational health of the target blockchain is determined according to the first health value and the second health value. The health test results of the target blockchain are generated based on the operational health status.

2. The blockchain health testing method according to claim 1, characterized in that, The first multi-dimensional comprehensive parameter includes multiple comprehensive business sub-parameters, and the target business indicator value includes multiple target business sub-indicator values; The calculation of the offset between the target business indicator value and the first multi-dimensional comprehensive parameter includes: Calculate the square of the difference between each of the comprehensive business sub-parameters and each of the target business sub-indicators, and then perform a square root calculation based on the square value to obtain the offset between the target business indicator value and the first multi-dimensional comprehensive parameter.

3. The blockchain health testing method according to claim 2, characterized in that, The calculation of the squared value of the difference between each of the comprehensive business sub-parameters and each of the target business sub-indicators includes at least one of the following: When the comprehensive business sub-parameters include on-chain transaction data and the target business sub-indicator value includes on-chain transaction indicator value, calculate the square of the difference between the on-chain transaction data and the on-chain transaction indicator value. Alternatively, when the comprehensive business sub-parameters include the average consensus node switching frequency within the target block height range, and the target business sub-index value includes the consensus node switching frequency index value within the target block height range, calculate the square of the difference between the average consensus node switching frequency and the consensus node switching frequency index value. Alternatively, when the integrated business sub-parameters include the average block height distance within a first time range, and the target business sub-index value includes the block height distance index value within the first time range, the square of the difference between the average block height distance and the block height distance index value is calculated. Alternatively, when the comprehensive business sub-parameters include the standard deviation of the number of transactions within a block within a second time range, and the target business sub-index value includes the index value of the number of transactions within a block within a second time range, the square of the difference between the standard deviation of the number of transactions within a block and the index value of the number of transactions within a block is calculated.

4. The blockchain health testing method according to claim 1, characterized in that, The data verification of the second multi-dimensional comprehensive parameters between different blockchain nodes to obtain the data verification result includes: Data verification is performed on the second multi-dimensional comprehensive parameters among different blockchain nodes at the target block height to obtain a first verification result; The second multi-dimensional comprehensive parameter between different blockchain nodes within the target block height range is verified to obtain a second verification result. The data verification result is obtained based on the first verification result and the second verification result.

5. The blockchain health testing method according to claim 1, characterized in that, The data verification of the second multi-dimensional comprehensive parameters between different blockchain nodes includes at least one of the following: When the second multi-dimensional comprehensive parameter includes block data, data verification is performed on the block data between different blockchain nodes; Alternatively, when the second multi-dimensional comprehensive parameter includes transaction data, data verification is performed on the transaction data between different blockchain nodes; Alternatively, when the second multi-dimensional comprehensive parameter includes business status data, data verification is performed on the business status data between different blockchain nodes.

6. The blockchain health testing method according to claim 1, characterized in that, Determining the second health value of the target blockchain based on the data verification result includes: When the data verification result shows that the second multi-dimensional comprehensive parameter is consistent among different blockchain nodes, the second health value of the target blockchain is determined to be the first preset value representing the health of the target blockchain. Alternatively, if the data verification result shows that the second multi-dimensional comprehensive parameters are inconsistent between different blockchain nodes, the second health value of the target blockchain is determined to be a second preset value that indicates that the target blockchain is unhealthy.

7. The blockchain health testing method according to claim 1, characterized in that, Determining the operational health of the target blockchain based on the first health value and the second health value includes: The first weight value of the first health value and the second weight value of the second health value are determined according to the target health value testing strategy. The operational health of the target blockchain is determined based on the first health value, the first weight value, the second health value, and the second weight value.

8. The blockchain health testing method according to claim 1, characterized in that, Determining the operating status of the multiple blockchain nodes while running the target blockchain includes: The application for the target blockchain is compiled to obtain the compiled blockchain application. The blockchain application is sent to each of the blockchain nodes, so that each of the blockchain nodes runs the blockchain application; Run a blockchain instance in at least one of the blockchain nodes that are running the blockchain application; Determine the running status of multiple blockchain nodes when the blockchain instance is running.

9. A blockchain health testing device, characterized in that, include: The first determining module is used to determine the target blockchain to be tested and the multiple blockchain nodes corresponding to the target blockchain; The second determining module is used to determine the operating status of the multiple blockchain nodes when running the target blockchain; The third determining module is used to determine, when multiple blockchain nodes include first-type nodes and second-type nodes, a combined strategy of online health test sub-strategy and offline health test sub-strategy as the target health test strategy, wherein the first-type nodes are nodes whose running state is online, and the second-type nodes are nodes whose running state is offline. The first acquisition module is used to acquire a first multi-dimensional comprehensive parameter among multiple first-type nodes according to the online health test sub-strategy; acquire a second multi-dimensional comprehensive parameter among multiple blockchain nodes according to the offline health test sub-strategy; and obtain multi-dimensional comprehensive business parameters among multiple blockchain nodes according to the first multi-dimensional comprehensive parameter and the second multi-dimensional comprehensive parameter. The fourth determining module is used to: determine the target business indicator value according to the online health test sub-strategy; calculate the offset value between the target business indicator value and the first multi-dimensional comprehensive parameter; determine the first health value of the target blockchain according to the offset value; perform data verification on the second multi-dimensional comprehensive parameter between different blockchain nodes to obtain data verification results; determine the second health value of the target blockchain according to the data verification results; and determine the operational health of the target blockchain according to the first health value and the second health value. The result generation module is used to generate the health test result of the target blockchain based on the operational health status.

10. A blockchain health testing device, characterized in that, include: At least one processor; At least one memory for storing at least one program; The blockchain health test method as described in any one of claims 1 to 8 is implemented when at least one of the programs is executed by at least one of the processors.

11. A computer-readable storage medium, characterized in that, It stores a processor-executable computer program, which, when executed by the processor, is used to implement the blockchain health test method as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program or computer instructions, characterized in that, The computer program or the computer instructions are stored in a computer-readable storage medium. The processor of the blockchain health testing device reads the computer program or the computer instructions from the computer-readable storage medium. The processor executes the computer program or the computer instructions, causing the blockchain health testing device to perform the blockchain health testing method as described in any one of claims 1 to 8.