Block chain test method and device based on multiple scoring strategies, equipment and medium
By performing functional, performance and security testing on multiple blockchains under the same system environment and generating scoring results based on multiple scoring strategies, the problem that existing testing methods cannot comprehensively evaluate multiple blockchains is solved, and a comprehensive evaluation and comparison of blockchain is achieved.
Patent Information
- Application Number
- CN202510104580.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
AI Technical Summary
The existing blockchain testing methods are only tested on a single blockchain, and the tests are not comprehensive enough to conduct a comprehensive evaluation of multiple blockchains.
A blockchain testing method based on multiple scoring strategies is provided. By performing functional tests, performance tests and security tests on at least two blockchain functional modules in the same system environment, and generating scoring results based on preset scoring strategies and weights.
A comprehensive comparison of multiple different blockchains in terms of functions, performance, security, etc. has been achieved, and the problem that existing testing tools can only test a single chain and can conduct a comprehensive evaluation of the new blockchain.
Smart Images

Figure CN120029914A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain testing method, device, equipment and medium based on multiple scoring strategies. Background Art
[0002] Blockchain testing is to verify the functionality, performance, and security of the blockchain system to ensure that the system can run stably and meet expected needs. Blockchain testing mainly includes the following aspects:
[0003] (1) Functional testing: This is the process of verifying the various functions of the blockchain system. Testers need to write test cases based on the requirements document and design document to test each functional module. The focus is on verifying whether the system functions meet the requirements and discovering potential defects and problems.
[0004] (2) Performance testing: Aims to evaluate the performance of the blockchain system under different load conditions. Testing is performed by simulating concurrent user operations and large-scale transaction processing to determine performance test indicators such as throughput and response time, and testing is performed using performance testing tools. This helps to identify performance bottlenecks and problems of the system under high load conditions and provide suggestions for performance optimization.
[0005] (3) Security testing: Evaluate the security and protection capabilities of the blockchain system. It is necessary to simulate various attack scenarios, such as denial of service attacks and data tampering attacks, to test the system. Check whether the system's security mechanism, identity authentication, data encryption, etc. can effectively prevent attacks, and provide suggestions for security improvements.
[0006] (4) Consistency testing: Verify the consistency of the blockchain system in a distributed environment. Since the blockchain system achieves data consistency through a consensus algorithm, consistency testing is very important. Simulate a distributed network environment, test the data synchronization and consistency between different nodes of the system, and verify whether the system can correctly handle problems such as forks and data synchronization delays.
[0007] (5) Compatibility testing: Verify the compatibility of the blockchain system with other systems. The blockchain system usually needs to interact with other systems, such as integrating with database systems, payment systems, etc. The compatibility test simulates various data interaction scenarios and tests the data transmission and compatibility between the system and other systems.
[0008] Existing blockchain tests only test the performance of a single blockchain, which is not comprehensive enough. Summary of the invention
[0009] Based on this, it is necessary to provide a blockchain test, device and computer equipment based on multiple scoring strategies that can be comprehensively evaluated for the above technical issues.
[0010] In the first aspect, the present application provides a blockchain testing method based on multiple scoring strategies, including:
[0011] Based on the same system environment, perform functional testing, performance testing, and security testing on the functional modules of at least two blockchains;
[0012] According to the preset scoring strategies of the functional test, performance test and security test of each functional module, the scoring results of the functional test, performance test and security test of each functional module are obtained; the preset scoring strategies include multiple ones;
[0013] According to the weights of the functional test, performance test and security test of each functional module and the scoring results, the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain are obtained.
[0014] In a second aspect, the present application also provides a blockchain testing device based on multiple scoring strategies, the device comprising:
[0015] A test module, used to perform functional testing, performance testing, and security testing on the functional modules of at least two blockchains based on the same system environment;
[0016] A scoring module, used to obtain scoring results of the functional test, performance test and safety test of each functional module according to the preset scoring strategies of the functional test, performance test and safety test of each functional module; the preset scoring strategies include multiple ones;
[0017] The comparison module is used to obtain the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain according to the weights of the functional test, performance test and security test of each functional module and the scoring results.
[0018] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of a blockchain testing method based on multiple scoring strategies when executing the computer program.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a blockchain testing method based on multiple scoring strategies.
[0020] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which, when executed by a processor, implements the steps of a blockchain testing method based on multiple scoring strategies.
[0021] The above-mentioned blockchain testing method, device, equipment and medium based on multiple scoring strategies, based on the same system environment, perform functional testing, performance testing and security testing on the functional modules of at least two blockchains; according to the preset scoring strategies of the functional testing, performance testing and security testing of each functional module, obtain the scoring results of the functional testing, performance testing and security testing of each functional module; according to the weights and scoring results of the functional testing, performance testing and security testing of each functional module, obtain the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain. This method can realize the comparison of multiple different blockchains in terms of function, performance, security, etc., solve the problem that the existing blockchain testing tools can only test a single chain, and can comprehensively evaluate the new blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A system architecture diagram of a blockchain comparison test system in one embodiment;
[0023] Figure 2 A flowchart of a blockchain testing method based on multiple scoring strategies in one embodiment;
[0024] Figure 3 This is a schematic diagram illustrating the content of a blockchain comparison test in one embodiment;
[0025] Figure 4 A flowchart of the steps of constructing a blockchain comparison test system in one embodiment;
[0026] Figure 5 A flowchart of the steps for configuring the scoring of blockchain technical indicators in one embodiment;
[0027] Figure 6 This is a flowchart of the steps of blockchain comparison test in one embodiment;
[0028] Figure 7 This is a schematic diagram of the structure of a blockchain testing device based on multiple scoring strategies in one embodiment;
[0029] Figure 8 Schematic diagram of the structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] The blockchain testing method based on multiple scoring strategies in this application is Figure 1 The blockchain comparison test system shown in the figure is implemented. The blockchain comparison test system supports testing the functions, performance, and security of the four modules of blockchain: consensus algorithm, smart contract, privacy protection, and storage.
[0032] like Figure 1 As shown in the system architecture diagram, the blockchain comparison test system is a system used to compare and evaluate the performance and characteristics of different blockchain technologies. It is specifically used to compare and analyze various blockchain key technology modules in detail. By creating multiple blockchain network instances and using the same test cases and loads to simulate real-world usage, the key technology modules are compared and analyzed in terms of performance, security, and functional characteristics to optimize the blockchain system. The system provides strong access and adaptation support for various blockchain test verifications, and can provide stable and efficient support both at the module level and at the platform level. The overall framework of this system consists of the basic layer, data layer, support layer, and application layer, which work together to provide users with reliable, secure, and efficient test comparison services.
[0033] The basic layer resources include network systems, servers, storage systems, and security systems. Among them, the network system is responsible for data transmission and backup in the comparative test system, as well as data sharing and management. Servers include cache servers and database servers. The cache server can store high-frequency access data in real time, improving the system's response speed and concurrent processing capabilities. The database server is used to store various system data, including detailed information of various blockchains, raw data of comparative tests, and analysis results. The test system ensures data security through operations such as identity authentication and access control, encryption, signature, and verification.
[0034] The data layer is a database used to store and compare different blockchain data in the blockchain comparison test system. It is mainly composed of module data, indicator data, and comparative analysis result data. This database contains a variety of different blockchains, such as FISCO-BCOS chain, Fabric chain, Changan chain, and Ant Chain. These blockchains can be publicly available or private or dedicated. For each blockchain, the indicators in the technical indicator library mentioned above are used to evaluate and analyze it in order to find out the differences and advantages and disadvantages between different blockchains.
[0035] The support layer of the blockchain comparative test system is its core part, providing powerful functions and data processing capabilities for the entire system. This support layer mainly includes the following three main components: analysis environment, technical indicator library and evaluation model.
[0036] The application layer is the top layer of the blockchain comparison test system. It interacts directly with users and provides users with intuitive and easy-to-use analysis tools to help users compare and analyze blockchain technologies. This layer mainly includes four technical module comparison test tools, including consensus algorithm module comparison analysis tools, smart contract module comparison analysis tools, privacy protection module comparison analysis tools, and storage module comparison analysis tools.
[0037] Based on the above blockchain comparison test system, this application provides a blockchain testing method based on multiple scoring strategies, such as Figure 2 As shown, the method includes:
[0038] Step 202: Based on the same system environment, functional testing, performance testing, and security testing are performed on the functional modules of at least two blockchains.
[0039] Specifically, functional testing, performance testing, and security testing can be performed on the functional modules of the new chain and the classic chain to achieve comparative analysis of at least two blockchains.
[0040] Among them, each blockchain's functional module is tested from the perspective of functional, performance and security testing indicators.
[0041] Among them, the classic chain may include at least one or more of the FISCO-BCOS blockchain, Fabric blockchain, Changan Chain and Ant Chain.
[0042] FISCO-BCOS is an open source blockchain underlying platform. As the financial branch of the BCOS open source platform, it is deeply customized for the financial industry through module upgrades and functional reshaping. Its code is open source and can be interoperable with BCOS and learn from each other. The main functions of FISCO-BCOS include the "arbitration chain", which is based on the decentralized, tamper-proof and trustworthy features of blockchain, and uses distributed data storage, encryption algorithms and other technologies to sign the consensus of transaction data and then upload it to the chain, and form an evidence chain through smart contracts to achieve standardization of evidence and trials.
[0043] Fabric Blockchain: Hyperledger Fabric is an open source, enterprise-level, permissioned distributed ledger technology platform designed to promote the development of cross-industry applications of blockchain. It is mainly used in finance, banking, supply chain and other fields, and meets the needs of enterprise-level applications by providing key capabilities such as data privacy protection, flexible membership services, smart contract implementation, etc. Fabric is designed with special requirements of enterprise environments in mind, such as the need for identity authentication and access control, as well as data security and privacy protection.
[0044] Step 204, according to the preset scoring strategies for the function test, performance test and security test of each of the function modules, the scoring results of the function test, performance test and security test of each of the function modules are obtained, and the preset scoring strategies include multiple ones.
[0045] Specifically, in the scoring strategy, the standard value β is set as the average value of the technical indicators obtained through multiple tests of the classic chain; the actual value θ is set as the actual value obtained during the new chain testing process.
[0046] like Figure 3 As shown, at least two blockchains are tested in consensus algorithm module, smart contract module, privacy protection module and storage module for comparison. Security test, performance test and safety test are performed for each of the above functional modules. The test indicators for security test, performance test and safety test can be further refined.
[0047] Among them, the corresponding scoring strategy can be configured in advance based on the characteristics of the function test, performance test and security test of each functional module to obtain the test results according to the scoring strategy. The scoring strategy includes a percentage system, a grade system, a binary system and a plus / minus system.
[0048] Step 206, according to the weights of the functional test, performance test and security test of each functional module and the scoring results, obtain the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain.
[0049] The test comparison file can be used to synthesize the weights of the functional tests, performance tests and security tests of all functional modules of the first blockchain and the scoring results to obtain the overall scoring result of the blockchain, and / or, based on the weights of the functional tests, performance tests and security tests of a single functional module and the scoring results, the scoring result of a single functional module of the blockchain can be obtained. In this way, it is possible to compare multiple different blockchains in terms of function, performance, security, etc., solve the problem that existing blockchain testing tools can only test a single chain, and be able to conduct a comprehensive evaluation of new blockchains.
[0050] The above-mentioned blockchain testing method based on multiple scoring strategies performs functional testing, performance testing and security testing on the functional modules of at least two blockchains based on the same system environment; obtains the scoring results of the functional testing, performance testing and security testing of each functional module according to the preset scoring strategies of the functional testing, performance testing and security testing of each functional module; obtains the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain according to the weights of the functional testing, performance testing and security testing of each functional module and the scoring results. This method can compare multiple different blockchains in terms of function, performance, security, etc., solve the problem that the existing blockchain testing tools can only test a single chain, and can comprehensively evaluate the new blockchain.
[0051] Among them, the functional modules include consensus algorithm module, smart contract module, privacy protection module and storage module. In this way, it can support comprehensive testing of the functions, performance and security of the consensus algorithm, smart contract, privacy protection and storage modules of the blockchain, reflecting the advanced nature of the new blockchain. At the same time, it provides consensus algorithm comparison, smart contract comparison, privacy protection comparison, storage comparison and other functions, comprehensively covering various indicators of the blockchain, solving the problem that the existing testing tools are not comprehensive in blockchain testing, and realizing integrity testing of the blockchain.
[0052] In one embodiment, the scoring result of the blockchain is:
[0053] where α,α i ,α ij ∈[0,1],s ij ∈[0,100]
[0054] Among them, α represents the functional module, a, b, c, d are the weights of the consensus algorithm module, smart contract module, privacy protection module and storage module respectively, where a+b+c+d=1; αi represents the weight of the i-th first-level technical indicator of the module, and the i-th first-level technical indicator is function, performance and security; s ij is the scoring result of the jth secondary technical indicator under the i-th primary technical indicator; α ij Represents the weight of the jth technical indicator under the i-th functional module.
[0055] like Figure 3As shown, at least two blockchains are tested in the consensus algorithm module, smart contract module, privacy protection module and storage module for comparison. Security testing, performance testing and safety testing are performed on each of the above functional modules. The test indicators for security testing, performance testing and safety testing can be further refined. Based on this, the scoring method assigns weights to the first-level test indicators under each functional module, and assigns weights to the second-level test indicators under each first-level test indicator, by assigning weights to the weights of the consensus algorithm module, smart contract module, privacy protection module and storage module. In this way, accurate testing can be achieved. Among them, the first-level technical indicators are functional, performance and security indicators. The second-level technical indicators can be flexibly set according to actual conditions and are not limited here.
[0056] In one embodiment, the function modules of at least two blockchains are tested for function, performance and security based on the same system environment, including:
[0057] Based on the same system environment, call the consensus algorithm testing tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the consensus algorithm modules of at least two blockchains;
[0058] Based on the same system environment, call the smart contract testing tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the smart contract modules of at least two blockchains;
[0059] Based on the same system environment, call the privacy protection test tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the privacy protection modules of at least two blockchains;
[0060] Based on the same system environment, the storage module testing tool of the blockchain comparison test system is called to perform functional testing, performance testing, and security testing on the storage modules of at least two blockchains.
[0061] In this embodiment, by integrating the consensus algorithm testing tool, the smart contract testing tool, the privacy protection testing tool and the storage module testing tool in the blockchain comparison test system, the above tools in the blockchain comparison test system are utilized, and the corresponding tools of the blockchain comparison test system are called to implement the testing of the corresponding functional modules.
[0062] The existing testing tools have complex environment configuration and strong dependencies, resulting in poor cross-platform compatibility and insufficient environment consistency. Developers need to spend a lot of time and energy on environment configuration when testing different blockchain systems, which reduces testing efficiency and accuracy.
[0063] To address this problem, the steps of constructing the blockchain comparison test system in this application are as follows: Figure 4 Shown include:
[0064] Step 402, define the blockchain testing tools to be integrated and their functional modules; the blockchain testing tools to be integrated are consensus algorithm testing tools, smart contract testing tools, privacy protection testing tools and storage module testing tools.
[0065] At this stage, first identify and define the blockchain testing tools that need to be integrated, such as consensus algorithm testing tools, smart contract testing tools, privacy protection testing tools, and storage module testing tools. Ensure that each functional module has clear responsibilities and the interfaces between modules are clear to facilitate subsequent interoperability and maintainability.
[0066] Step 404: Create a Dockerfile for each module of each blockchain testing tool.
[0067] Dockerfile is a text file used to build a Docker image. It contains a series of instructions and parameters that guide Docker on how to start from a basic image and gradually build the required customized image. Dockerfile defines the image building process, including installing software, setting environment variables, copying files, configuring running parameters, etc.
[0068] For each defined module, write a corresponding Dockerfile. The Dockerfile should define in detail:
[0069] Base image: Select a suitable base image, such as Python, Node.js, or other environment suitable for running the module.
[0070] Dependencies: List all dependent libraries and tools required by the module and install them through the RUN command.
[0071] Environment variables: Set the necessary environment variables to ensure that the module can run correctly in the container.
[0072] Startup command: defines the command to be run when the container starts, ensuring that the module can automatically start and provide services.
[0073] Step 406: Use Docker to build an image of each module of the blockchain testing tool and perform independent testing.
[0074] Use the Docker CLI or CI / CD tool to execute the docker build command to build the Docker image of each module. After the build is complete, perform independent testing of the module to ensure that its functionality and performance meet expectations. The test results will help identify potential problems and fix them.
[0075] Step 408: Integrate the modules of the blockchain testing tools through Docker Compose.
[0076] Docker Compose is a tool for defining and running multi-container Docker applications. Use Docker Compose to define the docker-compose.yml file to integrate all modules together. The file includes:
[0077] Service definition: lists the configuration of all services (i.e. each test module).
[0078] Network configuration: defines the network connections between modules to ensure they can communicate with each other.
[0079] Dependencies: Clarify the startup order of modules and ensure that dependent modules are started before the modules they require.
[0080] Shared data volume: Configure data volumes to facilitate data sharing and persistence among modules.
[0081] Step 410, incorporating the modular Docker container into the continuous integration / continuous deployment process to obtain the blockchain comparison test system.
[0082] Use CI / CD tools such as Jenkins, GitLab CI, or GitHub Actions to incorporate modular Docker containers into your continuous integration / continuous deployment process. On every code commit:
[0083] 1) Automatically pull the latest code and build a Docker image.
[0084] 2) Run integration tests to verify the interoperability of all modules.
[0085] 3) Deploy the successful image to the test environment or production environment.
[0086] The above operations are implemented using containerization technology. Containerization technology is a lightweight virtualization method that ensures the consistency and portability of applications in different environments by packaging applications and all their dependencies into independent, portable containers. Containers share the kernel of the host operating system, have fast startup speeds, consume less resources, and are isolated from each other, which improves security and stability. Commonly used containerization tools include Docker, Kubernetes, and Docker Compose, which support rapid deployment, automatic expansion, and continuous delivery, helping development teams accelerate application delivery and improve system reliability and maintainability. Containerization technology is gradually becoming a mainstream solution for modern software development and operation and maintenance.
[0087] This method modularizes and containerizes blockchain testing tools, and uses Docker to isolate the environment of each module and simplify the configuration process. At the same time, an automated continuous integration method is proposed to ensure that different modules maintain compatibility and stability during version updates. This method can effectively reduce the complexity of environmental configuration of blockchain testing tools and improve testing efficiency. Through modular and containerized design, developers can quickly iterate test tools to adapt to the rapidly changing needs of blockchain technology, while also improving the maintainability and scalability of the system.
[0088] In another embodiment, the scoring strategy includes a percentage system, a grade system, a binary system, and a plus / minus system. The scoring strategy can be flexibly used to achieve accurate and comprehensive evaluation according to the characteristics of each test indicator.
[0089] In one embodiment, the operation steps of the blockchain comparison test system include the following steps:
[0090] Step 1: System modularization and containerization
[0091] (1) Define the blockchain testing tools to be integrated and their functional modules
[0092] At this stage, first identify and define the blockchain testing tools that need to be integrated, such as consensus algorithm testing tools, smart contract testing tools, privacy protection testing tools, and storage module testing tools. Ensure that each functional module has clear responsibilities and the interfaces between modules are clear to facilitate subsequent interoperability and maintainability.
[0093] (2) Create a Dockerfile for each module
[0094] For each defined module, write a corresponding Dockerfile. The Dockerfile should define in detail:
[0095] Base image: Select a suitable base image, such as Python, Node.js, or other environment suitable for running the module.
[0096] Dependencies: List all dependent libraries and tools required by the module and install them through the RUN command.
[0097] Environment variables: Set the necessary environment variables to ensure that the module can run correctly in the container.
[0098] Startup command: defines the command to be run when the container starts, ensuring that the module can automatically start and provide services.
[0099] (3) Use Docker to build an image for each module and perform independent testing
[0100] Use the Docker CLI or CI / CD tool to execute the docker build command to build the Docker image of each module. After the build is complete, perform independent testing of the module to ensure that its functionality and performance meet expectations. The test results will help identify potential problems and fix them.
[0101] (4) Integrate modules through Docker Compose
[0102] Use Docker Compose to define the docker-compose.yml file to integrate all modules together. The file includes:
[0103] Service definition: lists the configuration of all services (i.e. each test module).
[0104] Network configuration: defines the network connections between modules to ensure they can communicate with each other.
[0105] Dependencies: Clarify the startup order of modules and ensure that dependent modules are started before the modules they require.
[0106] Shared data volume: Configure data volumes to facilitate data sharing and persistence among modules.
[0107] (5) Incorporate modular Docker containers into the continuous integration / continuous deployment (CI / CD) process
[0108] Integrate CI / CD processes to automate building and testing. Use CI / CD tools (such as Jenkins, GitLab CI, or GitHub Actions) to:
[0109] 1) Automatically pull the latest code and build a Docker image.
[0110] 2) Run integration tests to verify the interoperability of all modules.
[0111] 3) Deploy the successful image to the test environment or production environment.
[0112] Step 2: Form a technical indicator comparison library. Investigate the key technical indicators of the four modules of the existing classic chain FISCO-BCOS and Fabric in terms of function, performance, and security, including consensus algorithm, smart contract, privacy protection, and storage, and form a technical indicator comparison library.
[0113] Step 3: Determine the technical indicators of the new chain compared with the classic chain. Compare the functions, performance, and security of the new chain in the four modules of consensus algorithm, smart contract, privacy protection, and storage with the corresponding indicators of the classic chain, and determine the technical indicators to be compared based on actual needs.
[0114] Step 4: Assign weights to technical indicators. Set the total score S of the blockchain comparison test to a percentage system, and the test score s of each technical indicator to a percentage system. According to actual needs, users first assign weights a, b, c, d to the four modules of consensus algorithm, smart contract, privacy protection, and storage, where a+b+c+d=1. Then assign weights α to function, performance, and security in each module. 1 , α 2 , α 3 , where α 1 +α 2 +α 3 =1, α∈(a,b,c,d); finally, weights are assigned to the technical indicators under function, performance, and security, α 11 ,α 12 ,α 13 ,...,α 1n , where α 11 +α 12 +α 13 +...+α 1n = 1. Therefore, the calculation formula for the total score S of the blockchain comparison test is:
[0115] where α,α i ,α ij ∈[0,1],s ij ∈[0,100]
[0116] Step 5: Select a scoring strategy based on the characteristics of technical indicators. According to the type and characteristics of technical indicators, four scoring rules are designed, namely, percentage system, grade system, binary system, and bonus / deduction system.
[0117] In the scoring strategy, the standard value β is set as the average value of the technical indicators obtained through multiple tests of the classic chain; the actual value θ is set as the actual value obtained during the new chain testing process.
[0118] (1) Percentage system: For numerical technical indicators, the test score of the technical indicator is set as a percentage. The calculation formula is as follows:
[0119]
[0120] For example, the percentage scoring strategy is used when testing the TPS value under a certain condition. When the TPS value is larger, the score is higher. When the test value exceeds the standard value, it is a full score.
[0121] (2) Grading system: Determine the score based on the interval corresponding to the actual value θ. The calculation expression is as follows:
[0122]
[0123] The values of e, f, g, h, m, and n are determined by the user based on the actual application scenario. For example, when calculating the latency in a certain scenario, a latency of [0,1]s is scored 100 points, a latency of [1,2]s is scored 80 points, and a latency greater than 3s is scored 0 points.
[0124] (3) Binary system: The actual value θ is a bool type, true is 100 points, false is 0 points, and the calculation expression is as follows:
[0125]
[0126] The binary scoring strategy is used to determine whether the new chain has this function. For example, if the new chain does not support resistance to witch attacks, this technical indicator is 0 points; if it supports the national encryption algorithm, this technical indicator is 100 points.
[0127] (4) Add / subtract points system: The add / subtract points system is used to add or subtract points from the total score S. For example, if the classic chain supports two consensus algorithms, but the new chain only supports one, one point will be subtracted from the original score. If it supports three, one point will be added to the total score S until the full score is reached.
[0128] An example of a blockchain technical indicator scoring configuration is as follows: Figure 5 As shown, the following steps are included:
[0129] Step (1), select a scoring module. The scoring module is one of a consensus algorithm module, a smart contract module, a privacy protection module and a storage module.
[0130] Step (2), assign weights to the functional, performance, and safety technical indicators in the module.
[0131] Step (3) selects a scoring strategy according to the characteristics of the technical indicators. The scoring strategy can be determined from a percentage system, a grade system, a binary system, and a plus / minus point system according to the characteristics of the indicators.
[0132] Step (4) outputs the score of each technical indicator.
[0133] Step 5: Under the same system environment, test the technical indicators of the functions, performance, and security of the four modules of the classic chain FISCO-BCOS and Fabric, the consensus algorithm, smart contract, privacy protection, and storage of the new chain, and generate a visual comparative test report.
[0134] like Figure 6 As shown in the figure, a specific blockchain testing method based on multiple scoring strategies includes the following steps:
[0135] Step (1): Configure the blockchain comparison test environment.
[0136] Step (2): Deploy FISCO-BCOS and Fabric blockchain. Step (3): Connect the new chain to be tested.
[0137] Step (4), determine the technical indicators to be compared.
[0138] Step (5): Users assign weights to various technical indicators based on their needs.
[0139] Step (6), test the technical indicators of FISCO-BCOS, Fabric, and New Chain.
[0140] Step (7) obtains the scores for the consensus algorithm module, the smart contract module, the privacy protection module, and the storage module respectively.
[0141] Step (8): output a scoring report based on the scoring of the above functional modules.
[0142] The above method modularizes and containerizes the test tools, which can effectively reduce the complexity of the environment configuration of the blockchain test tools and improve the test efficiency. Through modular and containerized design, developers can quickly iterate the test tools to adapt to the rapidly changing blockchain technology requirements, while also improving the maintainability and scalability of the system. The method is based on a blockchain comparison test system, which supports comparison tests of multiple blockchains in terms of function, performance, and security, and solves the problem that existing blockchain test tools can only test a single chain. At the same time, the blockchain comparison test system provides consensus algorithm comparison, smart contract comparison, privacy protection comparison, storage comparison and other functions, comprehensively covering various indicators of the blockchain, solving the problem that the existing test tools are not comprehensive in blockchain testing, and realizing integrity testing of the blockchain.
[0143] like Figure 7 As shown, the present application also provides a blockchain testing device based on multiple scoring strategies, and the system includes:
[0144] The testing module 701 is used to perform functional testing, performance testing and security testing on the functional modules of at least two blockchains based on the same system environment.
[0145] The scoring module 702 is used to obtain the scoring results of the functional test, performance test and security test of each functional module according to the preset scoring strategies of the functional test, performance test and security test of each functional module; the preset scoring strategies include multiple ones.
[0146] The comparison module 703 is used to obtain the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain according to the weights of the functional test, performance test and security test of each functional module and the scoring results.
[0147] The blockchain testing device based on multiple scoring strategies can compare multiple different blockchains in terms of function, performance, security, etc., solving the problem that existing blockchain testing tools can only test a single chain.
[0148] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0149] Based on the same inventive concept, the embodiment of the present application also provides a blockchain testing device based on multiple scoring strategies for implementing the blockchain testing method based on multiple scoring strategies involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the blockchain testing device based on multiple scoring strategies provided below can be found in the above limitations on the structural dynamic response calculation method based on the adaptive physical base network, which will not be repeated here.
[0150] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a blockchain testing method based on multiple scoring strategies.
[0151] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0152] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, steps of a blockchain testing method based on multiple scoring strategies are implemented.
[0153] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a blockchain testing method based on multiple scoring strategies are implemented.
[0154] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of a blockchain testing method based on multiple scoring strategies.
[0155] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A blockchain testing method based on multiple scoring strategies, characterized in that: include: Based on the same system environment, perform functional testing, performance testing, and security testing on the functional modules of at least two blockchains; According to the preset scoring strategies of the functional test, performance test and safety test of each functional module, the scoring results of the functional test, performance test and safety test of each functional module are obtained; The preset scoring strategies include multiple ones; According to the weights of the functional test, performance test and security test of each functional module and the scoring results, the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain are obtained.
2. The method according to claim 1, characterized in that The functional modules include a consensus algorithm module, a smart contract module, a privacy protection module and a storage module.
3. The method according to claim 2, characterized in that The scoring results of the blockchain are: Among them, i ,a ij ∈[0,1],s ij ∈[0,100] Among them, α represents the functional module, a, b, c, d are the weights of the consensus algorithm module, smart contract module, privacy protection module and storage module respectively, where a+b+c+d=1; α i represents the weight of the i-th first-level technical indicator of the module, and the i-th first-level technical indicator is function, performance and safety; s ij is the scoring result of the jth secondary technical indicator under the i-th primary technical indicator; α ij Represents the weight of the jth technical indicator under the i-th functional module.
4. The method according to claim 2, characterized in that: The functional modules of at least two blockchains are tested for functional testing, performance testing and security testing based on the same system environment, including: Based on the same system environment, call the consensus algorithm testing tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the consensus algorithm modules of at least two blockchains; Based on the same system environment, call the smart contract testing tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the smart contract modules of at least two blockchains; Based on the same system environment, call the privacy protection test tool of the blockchain comparison test system to perform functional testing, performance testing, and security testing on the privacy protection modules of at least two blockchains; Based on the same system environment, the storage module testing tool of the blockchain comparison test system is called to perform functional testing, performance testing, and security testing on the storage modules of at least two blockchains.
5. The method according to claim 4, characterized in that The steps of constructing the blockchain comparison test system include: Define the blockchain testing tools to be integrated and their functional modules; the blockchain testing tools to be integrated are consensus algorithm testing tools, smart contract testing tools, privacy protection testing tools and storage module testing tools; Create a Dockerfile for each module of each blockchain testing tool; Use Docker to build an image of each module of each blockchain testing tool and perform independent testing; Integrate the modules of the blockchain testing tools through Docker Compose; The modular Docker container is incorporated into the continuous integration / continuous deployment process to obtain the blockchain comparison test system.
6. The method according to claim 1, characterized in that The scoring strategies include percentage system, grade system, binary system and bonus / deduction system.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The scoring results of each of the blockchains and / or the scoring results of each of the functional modules of each of the blockchains output a comparative test report of at least two blockchains.
8. A blockchain testing device based on multiple scoring strategies, characterized in that: The device comprises: A test module, used to perform functional testing, performance testing, and security testing on the functional modules of at least two blockchains based on the same system environment; A scoring module, used to obtain scoring results of the functional test, performance test and safety test of each functional module according to the preset scoring strategies of the functional test, performance test and safety test of each functional module; the preset scoring strategies include multiple ones; The comparison module is used to obtain the scoring results of each blockchain and / or the scoring results of each functional module of each blockchain according to the weights of the functional test, performance test and security test of each functional module and the scoring results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.