Block chain service testing method and system based on workflow

By employing a workflow-based blockchain business testing methodology, and leveraging the collaborative work of test execution units, business simulation units, and test service units, the problem of inflexible business scenario configuration in blockchain business testing is solved, achieving efficient and accurate testing to meet diverse needs.

CN121833474APending Publication Date: 2026-04-10CHINA STAR NETWORK SYST RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA STAR NETWORK SYST RES INST CO LTD
Filing Date
2024-10-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve flexible business scenario configurations in blockchain business testing, failing to meet diverse testing needs and resulting in insufficient testing efficiency and accuracy.

Method used

By employing a workflow-based blockchain business testing method, and leveraging the collaborative work of test execution units, business simulation units, and test service units, flexible configuration and security checks of business scenarios are achieved. This generates workflow tasks and business scenario information, simulates blockchain business scenarios, and obtains test data information.

Benefits of technology

It improves the efficiency and accuracy of blockchain business testing, enables flexible creation of workflows according to different testing needs, meets diverse testing scenarios, provides data support, and supports security checks for blockchain businesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833474A_ABST
    Figure CN121833474A_ABST
Patent Text Reader

Abstract

The invention provides a workflow-based block chain service testing method and system, and relates to the technical field of data processing and block chain service testing. The system comprises a test service unit used for obtaining business logic information and test verification information of a block chain business, performing simulation arrangement based on the business logic information and the test verification information, generating a workflow task and business scene information, and sending the workflow task to a test execution unit, the service scene information is sent to the service simulation unit; the business simulation unit is used for calling the to-be-tested block chain system based on the business scene information and simulating a business scene of the block chain business so as to support the test execution unit to execute the workflow task; and the test execution unit is used for calling the to-be-tested block chain system and executing the workflow task under the business scene provided by the business simulation unit to obtain test data information. According to the invention, the flexible configuration of the business scene can be realized, and the efficiency and accuracy of the block chain business test are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of data processing technology and blockchain business testing technology, and is applicable to detection and evaluation scenarios before blockchain business deployment. Background Technology

[0002] In related technologies, when testing blockchain services, the execution of the blockchain itself can be tested by acquiring and detecting data on blockchain-on-chain behavior. However, in complex scenarios, blockchain services may involve different business scenarios, and the nodes running the blockchain or the content uploaded to the chain may be subject to attacks. In these cases, simply detecting and alerting on the execution of blockchain transactions may not meet the testing needs of blockchain services. Therefore, how to achieve flexible configuration of business scenarios, provide data support for the security checks of blockchain services, improve the efficiency and accuracy of blockchain service testing, and flexibly create workflows according to different testing needs to meet diverse testing scenarios has become an important research direction. Summary of the Invention

[0003] This disclosure aims to at least partially address one of the technical problems in the related art.

[0004] The first aspect of this disclosure proposes a workflow-based blockchain business testing method, executed by a test execution unit, comprising:

[0005] Receive workflow tasks sent by the test service unit;

[0006] In the business scenario provided by the business simulation unit, the blockchain system under test is invoked and workflow tasks are executed to obtain test data information.

[0007] A second aspect of this disclosure proposes a workflow-based blockchain business testing method, executed by a business simulation unit, comprising:

[0008] Receive business scenario information sent by the test service unit;

[0009] The test system invokes the blockchain system under test based on business scenario information to simulate the business scenario of blockchain business, so as to support the test execution unit to execute workflow tasks.

[0010] A third aspect of this disclosure proposes a workflow-based blockchain business testing method, executed by a test service unit, comprising:

[0011] Obtain business logic information and test verification information for blockchain applications;

[0012] Simulated orchestration is performed based on business logic information and test verification information to generate workflow tasks and business scenario information.

[0013] The workflow task is sent to the test execution unit, and the business scenario information is sent to the business simulation unit.

[0014] This fourth aspect of the disclosure proposes a workflow-based blockchain business testing system, including a business simulation unit, a test execution unit, and a test service unit. The test service unit is connected to both the test execution unit and the business simulation unit, and the blockchain system under test is connected to both the test execution unit and the business simulation unit, wherein:

[0015] The testing service unit is used to acquire business logic information and test verification information of blockchain business, simulate and orchestrate based on business logic information and test verification information, generate workflow tasks and business scenario information, send workflow tasks to the test execution unit, and send business scenario information to the business simulation unit.

[0016] The business simulation unit is used to receive business scenario information sent by the test service unit, and call the blockchain system under test based on the business scenario information to simulate the business scenario of the blockchain business, so as to support the test execution unit to execute workflow tasks.

[0017] The test execution unit is used to receive workflow tasks sent by the test service unit, call the blockchain system under test and execute workflow tasks in the business scenario provided by the business simulation unit, and obtain test data information.

[0018] A fifth aspect of this disclosure provides an electronic device comprising:

[0019] At least one processor; and

[0020] A memory that is communicatively connected to at least one processor; wherein,

[0021] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to execute the workflow-based blockchain business testing method provided in the first aspect embodiment of this disclosure, or to execute the workflow-based blockchain business testing method provided in the second aspect embodiment of this disclosure, or to execute the workflow-based blockchain business testing method provided in the third aspect embodiment of this disclosure.

[0022] A sixth aspect of this disclosure provides a computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to execute a workflow-based blockchain business testing method provided in a first aspect of this disclosure, or to execute a workflow-based blockchain business testing method provided in a second aspect of this disclosure, or to execute a workflow-based blockchain business testing method provided in a third aspect of this disclosure.

[0023] A seventh aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the workflow-based blockchain business testing method provided in the first aspect of this disclosure, or implements the workflow-based blockchain business testing method provided in the second aspect of this disclosure, or implements the workflow-based blockchain business testing method provided in the third aspect of this disclosure.

[0024] This disclosure enables flexible configuration of business scenarios, provides data support for security checks of blockchain businesses, improves the efficiency and accuracy of blockchain business testing, and allows for flexible creation of workflows based on different testing needs, meeting diverse testing scenarios. Attached Figure Description

[0025] Figure 1 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0026] Figure 2 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0027] Figure 3 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0028] Figure 4 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0029] Figure 5 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0030] Figure 6 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure;

[0031] Figure 7 This is a structural diagram of a workflow-based blockchain business testing system according to an embodiment of this disclosure;

[0032] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0033] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0034] For ease of understanding, the following explanations are provided regarding the categories covered in this application:

[0035] The String type is a reference data type used to represent text information. For example, a String variable can be used to store a series of characters, which can be letters, numbers, punctuation marks, etc., forming meaningful text information.

[0036] The workflow-based blockchain business testing method and system of this disclosure are described below with reference to the accompanying drawings.

[0037] Figure 1 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 1 As shown, this method is executed by the test execution unit and includes:

[0038] S101 receives workflow tasks sent by the test service unit.

[0039] In this embodiment of the disclosure, a workflow task sent by a test service unit is received, and the workflow task is parsed and read sequentially from the instantiated workflow list.

[0040] S102, under the business scenario provided by the business simulation unit, call the blockchain system under test and execute workflow tasks to obtain test data information.

[0041] Based on the split business scenario information, the business simulation unit simulates the business scenario to be tested on each relevant node of the blockchain, including simulating the hardware and software environment of the node under the business scenario and the working status within the node.

[0042] The test execution unit, based on the behavior to be simulated and the service sequence and / or working status of each relevant node simulated by the business simulation unit in the corresponding business scenario to be tested, issues the corresponding test actions to be executed and the corresponding target nodes to each component. Each component of the test terminal unit executes test actions on the target nodes and obtains test data information.

[0043] In this embodiment of the disclosure, under the business scenario provided by the business simulation unit, the blockchain system under test is invoked and workflow tasks are executed to obtain test data information. This disclosure can simulate business scenarios, business nodes, and business behaviors, integrate and analyze a series of blockchain behaviors for a certain business scenario, complete scenario testing, and improve the efficiency and accuracy of blockchain business testing.

[0044] Figure 2 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 2 As shown, this method is executed by the test execution unit and includes:

[0045] S201, Receive workflow tasks sent by the test service unit.

[0046] For a description of step S201, please refer to the relevant content in the above embodiments, which will not be repeated here.

[0047] S202, under the business scenario provided by the business simulation unit, the workflow task is parsed to obtain the test actions that each first component in the test execution unit needs to execute, the execution order of the test actions, and the target node of the corresponding blockchain system under test.

[0048] In this embodiment of the disclosure, the first component may include, for example, a component for testing and information interaction.

[0049] In some implementations, under the business scenario provided by the business simulation unit, the workflow tasks are parsed, and the workflows are read and initialized sequentially from the instantiated workflow list to obtain information such as the test actions to be executed by each first component in the test execution unit, the execution order of the test actions, and the target node of the corresponding blockchain system under test.

[0050] The execution order of the test actions is obtained according to the workflow order.

[0051] S203, the first components of the test execution unit are invoked to perform test actions on the target node in the order of execution and obtain test data information.

[0052] In some implementations, the test execution unit invokes each first component to perform test actions on the target node in execution order. The business simulation component, based on the workflow created by the work logs and the corresponding on-chain data, simulates the environment at each relevant node. It simulates the hardware and software environment, node conditions, and functional and performance characteristics of the actual business scenario at each stage of log generation, transmission, and on-chain evidence storage, to support the test execution unit in obtaining the generated logs, the interactive transmission information of the target node, and the on-chain evidence storage information. Optionally, the generated logs, the interactive transmission information of the target node, and the on-chain evidence storage information can be used as test data.

[0053] S204, obtain the actual component state and actual task parameters of the first component.

[0054] In this embodiment of the disclosure, in order to improve the flexibility of the test execution unit in executing test actions, it is necessary to monitor the component state of the first component. In some embodiments, the actual component state and actual task parameters when the first component executes the test action can be obtained to check whether the test execution unit has encountered any abnormalities; in some embodiments, the actual component state and actual task parameters before the first component executes the test action can be obtained to check whether the test execution unit has encountered any abnormalities. This disclosure does not impose any limitations on this. Optionally, the actual task parameters may include parameter types and parameter values ​​corresponding to each parameter type.

[0055] The component state includes an available state and an unavailable state. Reasons for a component being in an unavailable state include, but are not limited to: the component has not been initialized, the component is configured incorrectly, or the current runtime environment does not meet the component's requirements.

[0056] S205, Obtain the first configuration information of the first component. The first configuration information includes at least the reference component status, reference working mode, and parameter verification conditions of the first component.

[0057] In this embodiment of the disclosure, the first configuration information is used to determine whether the actual component status and actual task parameters of the first component are abnormal.

[0058] S206, Based on the first configuration information, check the actual component status and actual task parameters. If the reference component status of the first component is inconsistent with the actual component status, or the actual task parameters do not match the reference working mode, or the actual task parameters do not meet the parameter verification conditions, it is determined that the check has failed.

[0059] The reference component state of the first component is compared with the actual component state. If the reference component state of the first component is inconsistent with the actual component state, the check is determined to have failed and an anomaly occurs in the test execution unit.

[0060] In some implementations, there is a mapping relationship between the parameter type of the task parameters and the working mode. Based on this mapping relationship, it can be determined whether the actual task parameters match the reference working mode. If the parameter type of the actual task parameters does not match the reference working mode, it is determined that the check has failed and the test execution unit has an anomaly.

[0061] In some implementations, the parameter values ​​of the actual task parameters are judged based on parameter verification conditions. Parameter verification conditions may include, for example, numerical range and numerical type. In other implementations, other verification conditions may also be used. This disclosure does not limit this. If the parameter value of the actual task parameter does not meet the parameter verification conditions, it is determined that the check has failed and the test execution unit malfunctions.

[0062] S207, Generate an exception alert message and send the exception alert message to the test service unit.

[0063] Optionally, if the check fails, it indicates that an abnormality has occurred in the test execution unit. An abnormality alert is generated and sent to the test service unit to report the abnormality.

[0064] In some implementations, after the service execution unit reports an exception to the test service unit, it can stop executing subsequent workflow tasks; in other implementations, after the service execution unit reports an exception to the test service unit, if it receives a corresponding instruction message from the test service unit, it can stop executing subsequent workflow tasks.

[0065] S208, if the reference component state of the first component is consistent with the actual component state, the actual task parameters match the reference working mode, and the actual task parameters meet the parameter verification conditions, then the check is passed.

[0066] In this embodiment of the disclosure, various possible situations of the blockchain system or blockchain business service when facing external attacks are detected by actively attacking the nodes running on the blockchain or the content on the chain. Optionally, before executing the attack simulation process, the test execution unit verifies whether the working mode and task parameters match and whether the task parameters meet the parameter verification conditions. If the verification passes, the active attack on the nodes running on the blockchain or the content on the chain is triggered.

[0067] S209, parse the workflow task to obtain the predefined process of the second component.

[0068] The test execution unit also includes a second component for attack purposes.

[0069] During the attack simulation process, the test execution unit executes different predefined processes based on different working modes.

[0070] S210, invoke the second component to attack the blockchain system under test based on a predefined process, and collect attack process data.

[0071] For example, in the case of a blockchain data tampering attack, the test execution unit will sequentially execute the following steps in a predefined process: stop the blockchain node, back up the blockchain node database, tamper with the blockchain database, and start the blockchain database.

[0072] For example, in some implementations, the workflow task also includes a data collection task. During the execution of the attack simulation, the data collection task is triggered in the order of the data collection tasks and process data is collected.

[0073] S211, add attack process data to test data information to update test data information.

[0074] For example, in a security test simulating the tampering of work logs created by the control center, the business simulation component simulates the workflow of work log creation and corresponding on-chain storage at various relevant nodes, including log generation, transmission, and on-chain evidence storage. Simultaneously, the test execution unit begins tampering with the logs created by the control center node, storing the evidence on the chain and sending it to subsequent nodes, returning a successful tampering response. Subsequent nodes receive the tampered logs, perform on-chain verification, return a verification failure response, and send the test data to the test service unit for test result evaluation and display.

[0075] It should be noted that, Figure 2 In the illustrated process, the test execution unit takes the example of executing test actions first, followed by attack simulation actions. In other implementations, after executing steps S201 and S202, the test execution unit can first execute the attack simulation actions involved in steps S204 to S210 to obtain attack process data, then execute the test actions involved in step S203 to obtain test data information, and finally execute step S211 to add the attack process data to the test data information and obtain the updated test data information. This disclosure does not impose any limitations on this.

[0076] This disclosure enables the testing of blockchain business systems while simultaneously testing their security. By simulating attack methods used on the business system, it detects the system's security. It supports configuring different tasks for collecting, analyzing, comparing, and uploading test results to the blockchain within the workflow, enabling more effective processing and display of test data, and ensuring the credibility and immutability of the test results.

[0077] In some implementations, before receiving the workflow task sent by the test service unit, the method further includes obtaining the test service address, service information, and heartbeat cycle corresponding to the test execution unit; obtaining first heartbeat data based on the test service address, service information, and heartbeat cycle corresponding to the test execution unit; and sending the first heartbeat data to the test service unit. In other words, the test execution unit is configured with a test service address, its own service information, and a heartbeat cycle, enabling it to send first heartbeat data to the test service unit, thus facilitating subsequent heartbeat-based service information registration and service status reporting.

[0078] Figure 3 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 3 As shown, this method is executed by the business simulation unit and includes:

[0079] S301 receives business scenario information sent by the test service unit.

[0080] The business simulation unit receives business scenario information sent by the test service unit, and parses and splits the business scenario information to obtain the split business scenario information.

[0081] S302 invokes the blockchain system under test based on business scenario information to simulate the business scenario of the blockchain business, so as to support the test execution unit to execute workflow tasks.

[0082] Based on the decomposed business scenario information, the business scenarios to be tested are simulated on each relevant node of the blockchain system under test, including simulating the hardware and software environment of the node under the business scenario and the working status within the node.

[0083] This disclosure calls the blockchain system under test based on business scenario information, simulates the business scenario of blockchain business, supports the test execution unit to execute workflow tasks, can realize flexible configuration of business scenarios, provide data support for the security check of blockchain business, improve the efficiency and accuracy of blockchain business testing, and flexibly create workflows according to different testing needs to meet diverse testing scenarios.

[0084] Figure 4 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 4 As shown, this method is executed by the business simulation unit and includes:

[0085] S401 receives business scenario information sent by the test service unit.

[0086] For a description of step S401, please refer to the relevant content in the above embodiments, which will not be repeated here.

[0087] The business scenario information includes at least the node information of the target node and the blockchain smart contract identifier. The node information includes at least the service order and working status of the target node.

[0088] S402, obtain the target blockchain smart contract corresponding to the blockchain smart contract identifier.

[0089] In some implementations, there is an association between the blockchain smart contract identifier and the blockchain smart contract, and the target blockchain smart contract corresponding to the blockchain smart contract identifier can be obtained based on the association.

[0090] S403 invokes the third component in the business simulation unit to simulate and deploy the target blockchain smart contract, the service order of the target node, and its working status.

[0091] The business simulation component simulates and deploys the blockchain smart contracts used in the business, and simulates the environment at each relevant node based on the workflow of creating and uploading the work logs to the chain. It simulates the software and hardware environment, node conditions, functions and performance characteristics of the actual business scenario at each stage of log generation, transmission and uploading to the chain, so as to support the test execution unit to obtain the generated logs, the interactive transmission information of the target node and the uploading information to the chain.

[0092] S404, Obtain the second configuration information of the third component, the second configuration information including at least the reference component state of the third component.

[0093] In this embodiment of the disclosure, in order to improve the flexibility of the business simulation unit, it is necessary to supervise the process of simulating and deploying the third component. The second configuration information is used to determine whether the actual component status is abnormal when the third component simulates and deploys the business environment.

[0094] S405, obtain the actual component state of the third component.

[0095] In this embodiment of the disclosure, the actual component status when the third component is simulated and deployed can be obtained to determine whether the third component of the business simulation unit has an anomaly when it is simulated and deployed.

[0096] Optionally, if the reference component state of the third component is consistent with the actual component state, the check is deemed to have passed.

[0097] S406 If the reference component state of the third component is inconsistent with the actual component state, an exception alert message is generated and sent to the test service unit.

[0098] The reference component state of the third component is compared with the actual component state. If the reference component state of the third component is inconsistent with the actual component state, the check is determined to have failed, an anomaly occurs in the business simulation unit, an anomaly reminder message is generated, and the anomaly reminder message is sent to the test service unit to report the anomaly.

[0099] In some implementations, the actual component status of the third component before the simulated deployment can be obtained to determine whether the third component of the business simulation unit has any abnormalities before the simulated deployment. This disclosure does not limit this. For example, the contents of steps S405 and S406 can be executed first, and then the contents of steps S401 to S404 can be executed.

[0100] In some implementations, the business simulation unit can stop simulating the business scenario of blockchain business after reporting an anomaly to the test service unit; in other implementations, the business simulation unit can stop simulating the business scenario of blockchain business if it receives a corresponding instruction message from the test service unit after reporting an anomaly to the test service unit.

[0101] This disclosure can flexibly and effectively simulate business scenarios, and can also realize various testing capabilities for business interfaces and business scenarios, and can analyze multiple business-related scenarios.

[0102] In some implementations, before receiving the business scenario information sent by the test service unit, the method further includes obtaining the test service address, service information, and heartbeat cycle corresponding to the business simulation unit; obtaining second heartbeat data based on the test service address, service information, and heartbeat cycle corresponding to the business simulation unit; and sending the second heartbeat data to the test service unit. In other words, the business simulation unit is configured with a test service address, its own service information, and a heartbeat cycle, enabling it to send second heartbeat data to the test service unit, thus facilitating subsequent heartbeat-based service information registration and service status reporting.

[0103] Figure 5 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 5 As shown, this method is executed by the test service unit and includes:

[0104] S501, obtain business logic information and test verification information for blockchain business.

[0105] For example, it can receive business logic information and test verification information sent by third-party servers or terminal devices, and use them as business logic information and test verification information for blockchain business.

[0106] In some implementations, business logic information may include at least one of the following: historical transaction records (detailed information about historical transactions of the blockchain business, including sender, receiver, amount, timestamp, etc.), smart contract information (contracts that define business rules and automatic execution logic, which can be automatically executed when specific conditions are met), the functional and performance characteristics of different nodes, and strategies for recording and updating the state of the blockchain, etc.

[0107] In some implementations, the test verification information mainly includes information in the following aspects, such as functional test information (verifying whether the basic functions of the blockchain system under test are normal) and security test information (evaluating the security of the blockchain system under test and testing its ability to resist attacks). In other implementations, the test verification information may also include performance test information (testing the response time and throughput of the blockchain system under test under different loads) and other test verification information, and this disclosure does not limit this.

[0108] S502 simulates and orchestrates based on business logic information and test verification information to generate workflow tasks and business scenario information.

[0109] In this embodiment of the disclosure, the data transmission process of the business is simulated and arranged according to the business logic information, and the blockchain smart contracts used are determined so that the business simulation unit can simulate and deploy the blockchain smart contracts used in the business.

[0110] In some implementations, corresponding workflow tasks are generated in the test service unit by combining the data transmission process and the number of triggers, nodes involved, and reference evaluation indicators of the pre-configured workflow.

[0111] In some implementations, the corresponding attack mode (i.e., working mode) and its parameters are added to the workflow task in conjunction with the security tests to be performed based on the test verification information. Table 1 provides an example list of parameters for a blockchain data tampering attack. For example, for a blockchain data tampering attack, it is necessary to configure the state database path of the blockchain node, pause and start commands, the data key to be tampered with, and the expected data value to be tampered with.

[0112] Table 1

[0113] Parameter name Parameter type Parameter meaning statePath String State database path stopCommand String Stop command startCommand String Startup command key String Data key that needs to be tampered with value String The expected data value to be tampered with

[0114] S503 sends the workflow task to the test execution unit and the business scenario information to the business simulation unit.

[0115] In this embodiment of the disclosure, business scenario information is sent to the business simulation unit to instruct the business simulation unit to call the blockchain system under test based on the business scenario information, simulate the business scenario of the blockchain business, and support the test execution unit to execute workflow tasks; the workflow task is sent to the test execution unit to instruct the test execution unit to call the blockchain system under test and execute the workflow task under the business scenario provided by the business simulation unit, and obtain test data information.

[0116] This disclosure uses workflow to orchestrate, schedule, and automate the test process, achieving efficient and easy-to-use automated testing and verification. It not only improves testing efficiency but also reduces testing costs and complexity. It supports customizing the configuration and execution order of tasks in the workflow and can flexibly create workflows according to different testing needs to meet diverse testing scenarios.

[0117] Figure 6 This is a flowchart of a workflow-based blockchain business testing method according to an embodiment of this disclosure, as follows: Figure 6 As shown, this method is executed by the test service unit and includes:

[0118] S601, obtain business logic information and test verification information for blockchain business.

[0119] For a description of step S601, please refer to the relevant content in the above embodiments, which will not be repeated here.

[0120] S602, Obtain the third configuration information of the workflow. The third configuration information includes the number of times the workflow is triggered, the configuration parameters of at least one target node of the blockchain system under test, and reference rating indicators.

[0121] In some implementations, third configuration information sent by a third-party server or terminal device may be received.

[0122] S603 simulates and orchestrates based on business logic information to obtain data transmission process information and blockchain smart contract identifiers of target nodes.

[0123] In some implementations, for example, a pre-deployed model (such as a large language model) or application in the component can be invoked to simulate and orchestrate business logic information, and obtain data transmission process information and blockchain smart contract identifiers of the target node.

[0124] S604 generates workflow tasks based on data transmission flow, test verification information, and third-party configuration information.

[0125] In some implementations, pre-deployed models (such as large language models) or applications within the components can be invoked to integrate data transmission processes, test verification information, and third-party configuration information to obtain workflow tasks. Optionally, workflow tasks include action execution tasks, system attack tasks, and data collection tasks, which are used to instruct the test execution unit to perform test actions on the target node, attack the blockchain system under test, collect process data, etc., respectively.

[0126] S605 extracts data transmission process information from the target node to obtain node information of the target node, including at least the service order and working status of the target node.

[0127] In some implementations, information about the data transmission process of the target node is extracted to obtain the service sequence and working status of the target node.

[0128] S606 generates business scenario information based on the node information of the target node and the blockchain smart contract identifier.

[0129] In some implementations, the node information of the target node and the blockchain smart contract identifier are integrated to generate business scenario information.

[0130] S607 sends the workflow task to the test execution unit and the business scenario information to the business simulation unit.

[0131] For a description of step S607, please refer to the relevant content in the above embodiments, which will not be repeated here.

[0132] This disclosure supports configuring different tasks for collecting, analyzing, comparing, and uploading test results to the blockchain within the workflow, enabling more effective processing and presentation of test data, and ensuring the credibility and immutability of test results.

[0133] In some implementations, before acquiring the business logic information and test verification information of the blockchain business, the process further includes receiving first heartbeat data sent by the test execution unit, receiving second heartbeat data sent by the business simulation unit, registering service information based on the first and second heartbeat data, and acquiring the service status of each of the business simulation unit and the test execution unit. Optionally, the heartbeat data is a small data packet sent to the test service unit at preset intervals. This allows the test service unit to determine whether the communication link between the two parties has been broken, thereby determining the service status of each of the business simulation unit and the test execution unit. In other words, in this embodiment, the business simulation unit and the test execution unit continuously send heartbeat data to report service information and service status. Optionally, the business simulation unit and the test execution unit can go into sleep mode based on the heartbeat cycle.

[0134] In some implementations, after sending the workflow task to the test execution unit and the business scenario information to the business simulation unit, the process further includes: obtaining reference data information and a comparison strategy for the target node. The reference data information includes at least the data type of the target node and a reference comparison value. The test data information sent by the test execution unit is received, and the test data information and reference data information are compared based on the comparison strategy to obtain the analysis and comparison results. In other words, the nodes and types of data that need to be acquired in the workflow are set, along with the reference comparison value and comparison strategy. The collected test data information is then summarized, processed and compared according to the predetermined comparison strategy, the analysis and comparison results are obtained, and pushed to the front-end page for display.

[0135] Optionally, business processes, test data, analysis and comparison results, and other related information can be stored on the blockchain for later traceability and verification.

[0136] This disclosure enables the comparison and analysis of test results with expected settings in multiple scenarios, and completes the automated judgment of the results.

[0137] In some implementations, the method further includes: receiving and displaying an anomaly alert from the test execution unit or the business simulation unit. In some implementations, after displaying the anomaly alert, the method further includes: sending a corresponding instruction message to the test execution unit to instruct it to stop executing subsequent workflow tasks. In some implementations, after displaying the anomaly alert, the method further includes: sending a corresponding instruction message to the business simulation unit to instruct it to stop simulating the business scenario of the blockchain business.

[0138] Figure 7 This is a structural diagram of a workflow-based blockchain business testing system according to an embodiment of this disclosure, as shown below. Figure 7 As shown, the workflow-based blockchain business testing system 700 includes a test execution unit 710, a business simulation unit 720, and a test service unit 730. The test service unit 730 is connected to the test execution unit 710 and the business simulation unit 720, respectively, and the blockchain system under test is connected to the test execution unit 710 and the business simulation unit 720, respectively.

[0139] Optionally, in this embodiment of the disclosure, the blockchain business testing system can be pre-deployed on a preset server.

[0140] The test execution unit is used to receive workflow tasks sent by the test service unit; under the business scenario provided by the business simulation unit, it calls the blockchain system under test and executes the workflow tasks to obtain test data information.

[0141] The business simulation unit is used to receive business scenario information sent by the test service unit; based on the business scenario information, it calls the blockchain system under test to simulate the business scenario of the blockchain business, so as to support the test execution unit to execute workflow tasks.

[0142] The testing service unit is used to acquire business logic information and test verification information of blockchain business; perform simulation orchestration based on business logic information and test verification information to generate workflow tasks and business scenario information; send workflow tasks to the test execution unit and business scenario information to the business simulation unit.

[0143] In some implementations, the test execution unit is also used for:

[0144] The workflow tasks are parsed to obtain the test actions that each first component in the test execution unit needs to execute, the execution order of the test actions, and the target node of the corresponding blockchain system under test;

[0145] The first components of the test execution unit are invoked to perform test actions on the target node in the order of execution and obtain test data information.

[0146] In some implementations, the test execution unit is also used for:

[0147] Obtain the actual component state and actual task parameters of the first component;

[0148] Obtain the first configuration information of the first component, which includes at least the reference component status, reference working mode, and parameter verification conditions of the first component;

[0149] Based on the first configuration information, the actual component status and actual task parameters are checked. If the reference component status of the first component is inconsistent with the actual component status, or the actual task parameters do not match the reference working mode, or the actual task parameters do not meet the parameter verification conditions, it is determined that the check has failed.

[0150] Generate an exception alert message and send it to the test service unit.

[0151] In some implementations, the test execution unit further includes a second component for attack, and the test execution unit is also used for:

[0152] If the reference component state of the first component is consistent with the actual component state, the actual task parameters match the reference working mode, and the actual task parameters meet the parameter verification conditions, then the check is passed.

[0153] Parse the workflow tasks to obtain the predefined process of the second component;

[0154] The second component is invoked to attack the blockchain system under test based on a predefined process, and data on the attack process is collected.

[0155] Add attack process data to the test data information to update the test data information.

[0156] In some implementations, the test execution unit is also used for:

[0157] Obtain the test service address, service information, and heartbeat cycle corresponding to the test execution unit;

[0158] Based on the test service address, service information, and heartbeat cycle corresponding to the test execution unit, obtain the first heartbeat data;

[0159] Send the first heartbeat data to the test service unit.

[0160] In some implementations, the test execution unit is also used for:

[0161] The test data information is sent to the test service unit.

[0162] In some implementations, the business scenario information includes at least the node information of the target node and the blockchain smart contract identifier. The node information includes at least the service order and working status of the target node. The business simulation unit is also used for:

[0163] Obtain the target blockchain smart contract corresponding to the blockchain smart contract identifier;

[0164] The third component in the business simulation unit is invoked to simulate and deploy the target blockchain smart contract, the service order of the target node, and its working status.

[0165] In some implementations, the business simulation unit is also used for:

[0166] Obtain the test service address, service information, and heartbeat cycle corresponding to the business simulation unit;

[0167] Based on the test service address, service information, and heartbeat cycle corresponding to the business simulation unit, obtain the second heartbeat data;

[0168] Send the second heartbeat data to the test service unit.

[0169] In some implementations, the business simulation unit is also used for:

[0170] Obtain the second configuration information of the third component, the second configuration information including at least the reference component state of the third component;

[0171] Get the actual component state of the third component;

[0172] If the reference component state of the third component is consistent with the actual component state, the check is deemed successful.

[0173] If the reference component state of the third component is inconsistent with the actual component state, an exception alert message is generated and sent to the test service unit.

[0174] In some implementations, the test service unit is also used for:

[0175] Obtain the third configuration information of the workflow, which includes the number of times the workflow is triggered, the configuration parameters of at least one target node of the blockchain system under test, and reference rating indicators.

[0176] Simulated orchestration is performed based on business logic information to obtain data transmission process information and blockchain smart contract identifiers of target nodes;

[0177] Workflow tasks are generated based on data transmission flow, test verification information, and third-party configuration information;

[0178] Extract information from the data transmission process of the target node to obtain the node information of the target node. The node information includes at least the service order and working status of the target node.

[0179] Business scenario information is generated based on the node information of the target node and the blockchain smart contract identifier.

[0180] In some implementations, the test service unit is also used for:

[0181] Receive the first heartbeat data sent by the test execution unit;

[0182] Receive the second heartbeat data sent by the service simulation unit;

[0183] Service information registration is performed based on the first and second heartbeat data, and the service status of the business simulation unit and the test execution unit is obtained respectively.

[0184] In some implementations, the test service unit is also used for:

[0185] Obtain reference data information and comparison strategy for the target node. The reference data information shall include at least the data type of the target node and the reference comparison value.

[0186] Receive test data information sent by the test execution unit;

[0187] The test data and reference data are compared using a comparison strategy to obtain the analysis and comparison results.

[0188] In some implementations, the test service unit is also used for:

[0189] Receive exception alerts from the test execution unit or business simulation unit;

[0190] Display abnormal alerts.

[0191] The overall architecture of this publicly available test and verification system comprises three units: business simulation, test service, and test execution. Through the coordinated design of these three units, blockchain business scenarios can be simulated. Simultaneously, attack methods within the test terminal can be used to simulate attacks on business processes, thereby obtaining various indicators and states of the business system when attacked. Flexible configuration of business scenarios is possible, providing data support for the security checks of blockchain businesses, improving the efficiency and accuracy of blockchain business testing, and flexibly creating workflows according to different testing needs to meet diverse testing scenarios.

[0192] The acquisition, transmission, storage, use, and processing of data in this disclosed technical solution all comply with relevant laws and regulations.

[0193] It should be noted that in the embodiments disclosed herein, certain software, components, models, and other existing solutions in the industry may be mentioned. These should be considered as exemplary and are intended only to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used such solutions.

[0194] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure.

[0195] like Figure 8 As shown, the electronic device 800 includes:

[0196] The system includes a memory 801 and a processor 802, and a bus 803 connecting different components (including the memory 801 and the processor 802). The memory 801 stores a computer program, and when the processor 802 executes the program, it implements the workflow-based blockchain business testing method of this disclosure embodiment.

[0197] Bus 803 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0198] Electronic device 800 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 800, including volatile and non-volatile media, removable and non-removable media.

[0199] Memory 801 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 804 and / or cache memory 805. Electronic device 800 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 806 may be used to read and write non-removable, non-volatile magnetic media (… Figure 8 Not shown; usually referred to as a "hard drive"). Although Figure 8Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 803 via one or more data media interfaces. Memory 801 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0200] A program / utility 808 having a set (at least one) of program modules 807 may be stored, for example, in memory 801. Such program modules 807 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 807 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0201] Electronic device 800 can also communicate with one or more external devices 809 (e.g., keyboard, pointing device, display 811, etc.), and with one or more devices that enable a user to interact with the electronic device 800, and / or with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 812. Furthermore, electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 813. Figure 8 As shown, network adapter 813 communicates with other modules of electronic device 800 via bus 803. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0202] The processor 802 performs various functional applications and data processing by running programs stored in the memory 801.

[0203] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the workflow-based blockchain business testing method of this disclosure embodiment, and will not be repeated here.

[0204] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium.

[0205] When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the workflow-based blockchain business testing method described above. Optionally, the computer-readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0206] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0207] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A workflow-based blockchain business testing method, characterized in that, executed by a test execution unit, comprising: receiving a workflow task sent by a test service unit; calling a to-be-tested blockchain system and executing the workflow task under a business scenario provided by a business simulation unit to obtain test data information.

2. The method of claim 1, wherein, The calling of the to-be-tested blockchain system and the execution of the workflow task to obtain the test data information comprises: parsing the workflow task to obtain test actions required to be executed by each first component in the test execution unit, an execution order of the test actions, and a target node of the to-be-tested blockchain system corresponding to the test actions; calling each first component of the test execution unit to execute the test actions on the target node according to the execution order to obtain the test data information.

3. The method of claim 2, wherein, Further comprising: obtaining an actual component state and an actual task parameter of the first component; obtaining first configuration information of the first component, the first configuration information at least including a reference component state, a reference working mode, and a parameter verification condition of the first component; checking the actual component state and the actual task parameter based on the first configuration information, and determining that the checking fails if the reference component state of the first component is inconsistent with the actual component state, or the actual task parameter does not match the reference working mode, or the actual task parameter does not meet the parameter verification condition; generating an abnormality reminding information and sending the abnormality reminding information to the test service unit.

4. The method of claim 3, wherein, The test execution unit further comprises a second component for attack, and the method further comprises: determining that the checking passes if the reference component state of the first component is consistent with the actual component state, the actual task parameter matches the reference working mode, and the actual task parameter meets the parameter verification condition; parsing the workflow task to obtain a predefined process of the second component; calling the second component to attack the to-be-tested blockchain system based on the predefined process and collecting attack process data; adding the attack process data to the test data information to update the test data information.

5. The method of claim 1, wherein, Before the receiving of the workflow task sent by the test service unit, further comprising: obtaining a test service address, service information, and a heartbeat period corresponding to the test execution unit; obtaining first heartbeat data based on the test service address, the service information, and the heartbeat period corresponding to the test execution unit; sending the first heartbeat data to the test service unit.

6. The method according to any one of claims 1 to 5, characterized in that, After the obtaining of the test data information, further comprising: sending the test data information to the test service unit. 7.A method for testing a blockchain business based on a workflow, characterized in that, executed by a business simulation unit, comprising: receiving business scenario information sent by a test service unit; calling a to-be-tested blockchain system based on the business scenario information to simulate a business scenario of a blockchain business to support a test execution unit to execute a workflow task.

8. The method of claim 7, wherein, The business scenario information at least includes node information of a target node and an identification of a blockchain smart contract, and the node information at least includes a service order and a working state of the target node. The calling of the to-be-tested blockchain system based on the business scenario information to simulate the business scenario of the blockchain business comprises: Obtaining a target blockchain smart contract corresponding to the blockchain smart contract identifier; Calling a third component in the business simulation unit to simulate deployment of the target blockchain smart contract, service order and working state of the target node.

9. The method of claim 7, wherein, Before the receiving of the business scenario information sent by the test service unit, further comprising: Obtaining a test service address, service information and heartbeat period corresponding to the business simulation unit; Based on the test service address, service information and heartbeat period corresponding to the business simulation unit, obtaining second heartbeat data; Sending the second heartbeat data to the test service unit.

10. The method according to any one of claims 7-9, characterized in that, Further comprising: Obtaining second configuration information of the third component, the second configuration information at least including reference component state of the third component; Obtaining actual component state of the third component; If the reference component state of the third component is consistent with the actual component state, it is determined to pass the inspection; If the reference component state of the third component is inconsistent with the actual component state, an abnormal reminder information is generated, and the abnormal reminder information is sent to the test service unit.

11. A workflow-based blockchain service testing method, characterized in that, Executed by the test service unit, comprising: Obtaining business logic information and test verification information of a blockchain business; Based on the business logic information and the test verification information, simulating arrangement is performed to generate workflow tasks and business scenario information; Sending the workflow tasks to a test execution unit and sending the business scenario information to a business simulation unit.

12. The method of claim 11, wherein, The simulation arrangement based on the business logic information and the test verification information to generate workflow tasks and business scenario information further comprises: Obtaining third configuration information of the workflow, the third configuration information including trigger number of the workflow, configuration parameters of at least one target node of the blockchain system to be tested and reference rating index; Based on the business logic information, simulating arrangement is performed to obtain data transmission process information of the target node and blockchain smart contract identifier; Based on the data transmission process, the test verification information and the third configuration information, the workflow tasks are generated; Information extraction is performed on the data transmission process information of the target node to obtain node information of the target node, the node information at least including service order and working state of the target node; Based on the node information of the target node and the blockchain smart contract identifier, the business scenario information is generated.

13. The method of claim 11, wherein, Before the obtaining of the business logic information and the test verification information of the blockchain business, further comprising: Receiving first heartbeat data sent by the test execution unit; Receiving second heartbeat data sent by the business simulation unit; Based on the first heartbeat data and the second heartbeat data, service information registration is performed, and service states of the business simulation unit and the test execution unit are obtained.

14. The method according to any one of claims 11-13, characterized in that, After the sending of the workflow tasks to the test execution unit and the sending of the business scenario information to the business simulation unit, further comprising: Obtaining reference data information and comparison strategy of the target node, the reference data information at least including data type and reference comparison value of the target node; receive the test data information sent by the test execution unit; compare the test data information and the reference data information based on the comparison strategy, and obtain an analysis comparison result.

15. The method according to any one of claims 11-13, characterized in that, Further comprising: receive the abnormality reminding information sent by the test execution unit or the business simulation unit; display the abnormality reminding information. 16.A workflow-based blockchain business testing system, comprising a business simulation unit, a test execution unit and a test service unit, the test service unit being connected with the test execution unit and the business simulation unit respectively, and a to-be-tested blockchain system being connected with the test execution unit and the business simulation unit respectively, wherein: the test service unit is configured to obtain business logic information and test verification information of a blockchain business, simulate arrangement based on the business logic information and the test verification information, generate workflow tasks and business scenario information, send the workflow tasks to the test execution unit, and send the business scenario information to the business simulation unit; the business simulation unit is configured to receive the business scenario information sent by the test service unit, call the to-be-tested blockchain system based on the business scenario information, simulate a business scenario of the blockchain business, and support the test execution unit to execute the workflow tasks; the test execution unit is configured to receive the workflow tasks sent by the test service unit, call the to-be-tested blockchain system and execute the workflow tasks under the business scenario provided by the business simulation unit, and obtain test data information. 17.An electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6, or perform the method of any one of claims 7-10, or perform the method of any one of claims 11-15.

18. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to make the computer execute the steps of the method according to any one of claims 1-6, or execute the steps of the method according to any one of claims 7-10, or execute the steps of the method according to any one of claims 11-15. 19.A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6, or implements the method according to any one of claims 7-10, or implements the method according to any one of claims 11-15.