Block chain network test method and device, computer equipment and storage medium

By identifying and adjusting resource interaction messages in the blockchain network, generating exception messages and verifying node processing capabilities, the problem of inaccurate exception transaction processing in the existing test methods is solved, and the accuracy of blockchain system testing and network stability are improved.

CN120223576APending Publication Date: 2025-06-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311811364.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing blockchain system testing methods cannot effectively determine whether abnormal transactions are correctly identified and processed by other nodes, resulting in inaccurate test results and affecting the accuracy of blockchain network testing.

Method used

By subscribing to resource interaction pool messages in the blockchain network, normal resource interaction messages are identified, and these messages are adjusted using fuzzy test templates to generate different types of exception resource interaction messages and sent to the blockchain node to verify the node's exception message processing capabilities.

Benefits of technology

By monitoring the operating status of blockchain nodes, the ability to accurately identify and process abnormal messages can be improved, thereby improving the accuracy of blockchain system testing and ensuring the stability and security of the blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120223576A_ABST
    Figure CN120223576A_ABST
Patent Text Reader

Abstract

The invention relates to a block chain network testing method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps of adding a to-be-tested target block chain network, connecting block chain nodes in the target block chain network, and subscribing a resource interaction pool message of the target block chain network; identifying normal resource interaction messages in the resource interaction pool messages; normal resource interaction messages are adjusted through a fuzzy test template, different types of abnormal resource interaction messages are generated, and the fuzzy test template is obtained by analyzing resource interaction messages in historical data; sending different types of abnormal resource interaction messages to a block chain node in a target block chain network; and obtaining a test result of the target block chain network based on the operation state of the block chain node. According to the method, the capability of identifying and processing the abnormal message of the block chain network can be effectively verified through a fuzzy test method, and the test accuracy of the block chain system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technologies, and particularly to a blockchain network testing method, apparatus, computer device, storage medium, and computer program product. Background Art

[0002] With the development of computer technologies and Internet technologies, blockchain technology has emerged. Blockchain is a distributed ledger technology, generally composed of consensus, resource interaction blocks and state data storage, cryptographic identity security, etc. Since the ledger is distributedly stored and the blocks are consensus-based, it has features such as immutability, traceability, and co-maintenance. What blockchain needs to consensus on is the block, and the block is composed of resource transfers and metadata one by one. The execution of these resource transfers depends on the execution of smart contracts and their methods.

[0003] Currently, for the testing of blockchain systems, it is usually a blockchain resource interaction pool testing method based on manual or semi-automatic scripts. However, it mainly relies on manually writing test cases, verification processes, scenario coverage, and handling of abnormal situations. Therefore, these methods cannot determine whether abnormal transactions are correctly recognized and processed by other nodes. When encountering abnormal messages, accurate test results and status information may not be obtained, affecting the accuracy rate of blockchain network testing. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a blockchain network testing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the accuracy rate of blockchain system testing.

[0005] In a first aspect, the present application provides a blockchain network testing method, which is applied to a test server and includes:

[0006] Join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network;

[0007] Identify the normal resource interaction messages in the resource interaction pool messages;

[0008] Adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in historical data, and the fuzz testing template is used to modify the keyword fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages;

[0009] Send the different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network;

[0010] Obtain the test result of the target blockchain network based on the running status of the blockchain node.

[0011] In a second aspect, the present application further provides a blockchain network testing device, including:

[0012] A message subscription module, configured to join a target blockchain network to be tested, connect to blockchain nodes in the target blockchain network, and subscribe to resource interaction pool messages of the target blockchain network;

[0013] A message recognition module, configured to recognize normal resource interaction messages in the resource interaction pool messages;

[0014] A message adjustment module, configured to adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing resource interaction messages in historical data, and the fuzz testing template is used to modify key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages;

[0015] A message sending module, configured to send the different types of abnormal resource interaction messages to blockchain nodes in the target blockchain network;

[0016] A test result acquisition module, configured to obtain the test result of the target blockchain network based on the running status of the blockchain node.

[0017] In a third aspect, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0018] Join a target blockchain network to be tested, connect to blockchain nodes in the target blockchain network, and subscribe to resource interaction pool messages of the target blockchain network;

[0019] Recognize normal resource interaction messages in the resource interaction pool messages;

[0020] Adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing resource interaction messages in historical data, and the fuzz testing template is used to modify key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages;

[0021] Send the different types of abnormal resource interaction messages to blockchain nodes in the target blockchain network;

[0022] Obtain the test result of the target blockchain network based on the running status of the blockchain node.

[0023] Fourthly, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0024] Join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network;

[0025] Identify the normal resource interaction messages in the resource interaction pool messages;

[0026] Adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in historical data. The fuzz testing template is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages;

[0027] Send the different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network;

[0028] Obtain the test result of the target blockchain network based on the running status of the blockchain node.

[0029] Fifthly, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0030] Join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network;

[0031] Identify the normal resource interaction messages in the resource interaction pool messages;

[0032] Adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in historical data. The fuzz testing template is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages;

[0033] Send the different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network;

[0034] Obtain the test result of the target blockchain network based on the running status of the blockchain node.

[0035] The above blockchain network testing method, device, computer device, storage medium, and computer program product first join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network to obtain the resource interaction messages generated by the resource interaction pool during the operation of the target blockchain. Then, the normal resource interaction messages in the resource interaction pool messages are identified; and the normal resource interaction messages are adjusted through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in the historical data and is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages. That is, based on the identification of the normal resource interaction messages, these normal resource interaction messages are transformed into different types of abnormal resource messages based on the fuzz testing template, so as to verify the ability of the blockchain nodes to identify abnormal messages through these abnormal resource interaction messages. That is, different types of abnormal resource interaction messages are sent to the blockchain nodes in the target blockchain network to verify the ability of the blockchain nodes to process abnormal resource interaction messages. That is, the test result of the target blockchain network is obtained based on the running state of the blockchain nodes. By monitoring the running state of the blockchain nodes, it is determined whether there are abnormalities in the blockchain nodes, and then it is determined whether the target blockchain is running abnormally and the existing running problems, so as to obtain the test result of the target blockchain network. In this application, these normal resource interaction messages are transformed into different types of abnormal resource messages through a fuzz testing template, and then the generated abnormal resource messages are sent to the blockchain nodes of the target blockchain, and the running state of the blockchain nodes is monitored, so as to confirm the ability and state of the blockchain nodes to identify and process abnormal transactions, and obtain the test result of the target blockchain network. The ability of the blockchain network to identify and process abnormal messages can be effectively verified through the fuzz testing method, and the test accuracy of the blockchain system can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments or related technologies. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0037] Figure 1 It is a schematic structural diagram of a distributed system applied to a blockchain system in an embodiment;

[0038] Figure 2 It is a schematic diagram of a block structure in an embodiment;

[0039] Figure 3Schematic flowchart of a blockchain network testing method in an embodiment;

[0040] Figure 4 Schematic structural diagram of a test node for blockchain network testing in an embodiment;

[0041] Figure 5 Schematic architectural diagram of a blockchain network testing system in an embodiment;

[0042] Figure 6 Schematic flowchart of the initialization of a blockchain network testing system in an embodiment;

[0043] Figure 7 Schematic flowchart of a blockchain network testing method in another embodiment;

[0044] Figure 8 Schematic flowchart of problem reproduction during blockchain network testing in an embodiment;

[0045] Figure 9 Schematic block diagram of a blockchain network testing device in an embodiment;

[0046] Figure 10 Internal structural diagram of a computer device in an embodiment. Detailed implementation manners

[0047] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to 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.

[0048] The system involved in the embodiments of the present invention may be a distributed system formed by connecting a client and multiple nodes (any form of computing device accessing the network, such as a server, a user terminal) through network communication.

[0049] Taking the distributed system as a blockchain system as an example, refer to Figure 1 , Figure 1 is an optional structural diagram of the distributed system 100 provided by the embodiments of the present invention applied to a blockchain system, formed by multiple nodes 200 (any form of computing device accessing the network, such as a server, a user terminal) and a client 300. A peer-to-peer network is formed among the nodes. The peer-to-peer protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In a distributed system, any machine such as a server or a terminal can join and become a node. A node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.

[0050] Refer toFigure 1 The functions of each node in the shown blockchain system involve the following functions:

[0051] 1) Routing, which is a basic function of a node and is used to support communication between nodes.

[0052] In addition to the routing function, a node can also have the following functions:

[0053] 2) Application, which is used to be deployed in the blockchain, implement specific services according to actual business requirements, record the data related to the implemented functions to form record data, carry a digital signature in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes verify the source and integrity of the record data successfully, they add the record data to the temporary block.

[0054] For example, the services implemented by the application include:

[0055] 2.1) Wallet, which is used to provide the function of resource interaction, including initiating resource interaction (that is, sending the resource interaction record of the current resource interaction to other nodes in the blockchain system. After other nodes verify successfully, as a response to acknowledging the validity of the resource interaction, they deposit the record data of the resource interaction into the temporary block of the blockchain; of course, the wallet also supports querying the remaining resource amount in the resource address;

[0056] 2.2) Shared ledger, which is used to provide functions such as storage, query, and modification of account data, send the record data of the operations on the account data to other nodes in the blockchain system. After other nodes verify its validity, as a response to acknowledging the validity of the account data, they deposit the record data into the temporary block and can also send a confirmation to the node that initiated the operation.

[0057] 2.3) Smart contract, which is a computerized protocol that can execute the terms of a certain contract. It is implemented through code deployed on the shared ledger and used to execute when certain conditions are met. According to actual business requirements, the code is used to complete automated resource interaction. For example, querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for resource interaction, but can also execute contracts for processing received information.

[0058] 3) Blockchain, which includes a series of blocks (Block) that are sequentially connected in the order of generation. Once a new block is added to the blockchain, it will not be removed again. The block records the record data submitted by the nodes in the blockchain system.

[0059] See Figure 2 , Figure 2It is an optional schematic diagram of the block structure provided by the embodiments of the present invention. Each block includes the hash value of the resource interaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected through the hash value to form a blockchain. In addition, the block may further include information such as the timestamp when the block is generated. A blockchain, in essence, is a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.

[0060] This application is applicable to testing the above blockchain network and can be implemented through the blockchain node 200 as shown in Figure 1 First, the blockchain node 200 connects to the target blockchain network to be tested and subscribes to the resource interaction pool messages of the target blockchain network; identifies the normal resource interaction messages in the resource interaction pool messages; adjusts the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages, and the fuzz testing template is obtained by parsing the resource interaction messages in the historical data; sends different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network; and obtains the test result of the target blockchain network based on the running state of the blockchain nodes.

[0061] In an exemplary embodiment, as shown in Figure 3 a blockchain network testing method is provided. This blockchain network testing method is applied to a test server. By taking the test server joined to the Figure 1 blockchain network as the blockchain node 200 as an example, the following steps 302 to step 310 are included. Among them:

[0062] Step 302: Join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network.

[0063] Among them, the target blockchain network refers to the target blockchain tested by the blockchain network testing method of this application. The target blockchain network is composed of different blockchain nodes. Therefore, the test is to test the ability of each node in the target blockchain network to process abnormal resource interaction requests, and then determine whether there are abnormalities in the blockchain network. The resource interaction pool messages refer to the messages generated by the target blockchain network during the process of processing resource interaction tasks. These messages are broadcast to each node of the target blockchain network, and the nodes will confirm and process the resource interaction pool.

[0064] Exemplarily, the present application can implement the test of the connected blockchain network by connecting to a blockchain node in the blockchain network to determine the relevant data of each node in the blockchain network when processing messages. When the staff needs to test the target blockchain network, the corresponding blockchain information can be submitted to the computer device corresponding to the test node 200. Then, according to the blockchain information provided by the staff, the computer device joins the target blockchain network to be tested, then connects to the blockchain nodes in the target blockchain network, and after the connection is successful and it becomes a node of the blockchain, it subscribes to the resource interaction pool messages of the target blockchain network. In one embodiment, the computer device can download the node application of the target blockchain network according to the blockchain information provided by the staff, then configure the node parameters, and synchronize the blockchain data of the target blockchain network. After the synchronization is completed, the device can join the target blockchain network as a blockchain node and subscribe to the corresponding resource interaction messages from the target blockchain network. For the connection method, it can specifically support communication protocols such as API (Application Programming Interface), RPC (Remote Procedure Call Protocol), or WebSocket (a full-duplex communication protocol based on TCP) to establish a connection with the blockchain network. For message subscription, after successfully connecting to the target blockchain network, real-time messages broadcast by the resource interaction pool are subscribed according to the pre-configured filtering conditions. Specifically, filtering can be performed according to the message type, message structure, message content, exception or error information. In this way, the test device as a blockchain node will only receive resource interaction messages that meet the conditions.

[0065] Step 304, identify the normal resource interaction messages in the resource interaction pool messages.

[0066] Among them, the normal resource interaction message is in contrast to the abnormal resource interaction message. Compared with the normal resource interaction message, the abnormal resource interaction message may be an incomplete or inaccurate message, such as a message containing inconsistent hash values, invalid signatures, or format errors, while the normal resource interaction message is an accurate and complete message sent by the resource interaction pool.

[0067] Exemplarily, after the test node 200 connects to the target blockchain network and subscribes to the resource interaction pool messages, it can start the blockchain test process based on the subscribed resource interaction pool messages. During the test process, the test node 200 can determine the abnormal resource interaction messages and normal resource interactions therein by parsing the resource interaction pool messages. Specifically, it can extract the key information in the resource interaction pool messages by parsing the resource interaction pool messages, and then determine whether the current resource interaction pool message is normal based on the extracted key information. In one embodiment, the components and structure of the resource interaction pool message can be determined by parsing, including identifying key elements such as resource interaction content (such as resource interaction volume, contract call methods and parameters, etc.), sender information, receiver information, timestamp, interaction hash, etc. Then, it is verified whether there are problems such as inconsistent hash values, invalid signatures, format errors, etc. in these information, so as to identify whether there are abnormalities in the resource interaction pool messages and extract the normal resource interaction messages therein.

[0068] Step 306, adjust the normal resource interaction messages through the fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in the historical data. The fuzz testing template is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages.

[0069] Among them, the fuzz testing template refers to the template data constructed through fuzz testing technology. Fuzz testing is a method of discovering software vulnerabilities by providing unexpected inputs to the target system and monitoring abnormal results. The fuzz testing template contains sufficient information to generate distorted or abnormal resource interaction messages, such as incorrect formats, invalid parameters, boundary values, etc. Therefore, the normal resource interaction messages can be distorted by inputting them into the fuzz testing template, modifying the key fields and key parameters in the normal resource interaction messages, and generating different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in the historical data, and by summarizing the differences between the abnormal resource interaction information and the normal resource interaction messages, a fuzz testing template for transforming the normal resource interaction messages is constructed.

[0070] Exemplarily, after subscribing to the resource interaction pool messages of the target blockchain network, the test node 200 for blockchain network testing can parse and analyze these resource interaction pool messages to determine abnormal messages among them, and analyze the causes of the abnormalities in these abnormal messages to determine which parts of the messages lead to the abnormalities, such as abnormal hash values, abnormal signatures, or abnormal message formats in the messages. Then, corresponding fuzz testing templates are constructed for different types of abnormalities. Through the fuzz testing templates, normal resource interaction messages can be adjusted to make various types of abnormalities occur in the normal resource interaction messages. For example, a normal resource interaction message with a normal hash value can be adjusted to an abnormal resource interaction message with an abnormal hash value, or a normal resource interaction message with a normal format can be adjusted to an abnormal resource interaction message with a scrambled format. Through the fuzz testing templates, normal resource interaction messages can be adjusted to generate abnormal resource interaction messages of different abnormal types, and then these abnormal resource interaction messages can be used to test each blockchain node in the target blockchain network.

[0071] Step 308: Send abnormal resource interaction messages of different types to the blockchain nodes in the target blockchain network.

[0072] Exemplarily, a blockchain network is composed of different blockchain nodes. The solution of this application is to generate various abnormal resource interaction messages through fuzz testing, and then send abnormal resource interaction messages of different types to the blockchain nodes in the target blockchain network. These blockchain nodes can process the abnormal resource interaction messages sent by the test node 200, and the test node 200 can determine whether the blockchain nodes and the blockchain network are abnormal by monitoring the states of these blockchain nodes.

[0073] Step 310: Obtain the test result of the target blockchain network based on the running states of the blockchain nodes.

[0074] Exemplarily, after sending abnormal resource interaction messages of different types to the blockchain nodes in the target blockchain network, the test node 200 can monitor the running conditions of other nodes in the target blockchain network after receiving the abnormal resource interaction messages. Check whether other nodes can identify different types of abnormal messages, and at the same time handle related unexpected situations and maintain stable operation. In one embodiment, the test node 200 can collect the log data generated by each blockchain node in the target blockchain network during the process of processing requests, and then monitor these blockchain nodes by sorting out the log data. Through the logs, it can be located whether the blockchain nodes accurately identify the abnormalities during the process of processing abnormal resource interaction messages, as well as data such as the node states during the process of handling the impacts. Then, the state of each blockchain node is determined, and the final test result of the blockchain network is obtained.

[0075] The above blockchain network testing method involves joining the target blockchain network to be tested, connecting to the blockchain nodes in the target blockchain network, and subscribing to the resource interaction pool messages of the target blockchain network to obtain the resource interaction messages generated by the resource interaction pool during the operation of the target blockchain. Then, the normal resource interaction messages in the resource interaction pool messages are identified; and the normal resource interaction messages are adjusted through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in historical data and is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages. That is, based on the identification of normal resource interaction messages, these normal resource interaction messages are transformed into different types of abnormal resource messages based on the fuzz testing template, so as to verify the ability of blockchain nodes to identify abnormal messages through these abnormal resource interaction messages. That is, different types of abnormal resource interaction messages are sent to the blockchain nodes in the target blockchain network to verify the ability of blockchain nodes to process abnormal resource interaction messages, that is, the test result of the target blockchain network is obtained based on the running state of the blockchain nodes. By monitoring the running state of the blockchain nodes, it is determined whether there are abnormalities in the blockchain nodes, and then it is determined whether the target blockchain is running abnormally and what running problems exist, so as to obtain the test result of the target blockchain network. In this application, these normal resource interaction messages are transformed into different types of abnormal resource messages through a fuzz testing template, and then through the generated abnormal resource messages, these abnormal resource messages are sent to the blockchain nodes of the target blockchain, and the running state of the blockchain nodes is monitored, so as to confirm the ability and state of the blockchain nodes to identify and process abnormal transactions, and obtain the test result of the target blockchain network. It can effectively verify the ability of the blockchain network to identify and process abnormal messages through the fuzz testing method and improve the test accuracy of the blockchain system.

[0076] This application can effectively improve the testing efficiency. By automatically generating abnormal resource interactions and test cases based on fuzz testing, the time cost of testing can be greatly reduced. At the same time, automated testing avoids human errors and improves the testing accuracy. Meanwhile, this application also provides extensive scenario coverage. Through fuzz testing, various abnormal situations can be covered, including boundary value conditions and unexpected abnormal scenarios. This helps to ensure that the blockchain system has good stability and robustness in various situations. The solution of this application is also conducive to discovering potential security hazards in the blockchain network. Fuzz testing helps to discover possible vulnerabilities and insufficient exception handling in the system, so as to solve potential problems in advance and improve the security performance of the entire blockchain network. At the same time, this application also provides problem location and reproduction. That is, by detailedly recording the test logs, problems can be quickly located and reproduced when they occur, so as to more quickly locate the cause of the problem and take solution measures. In addition, through the matching of connection modes, different authentication modes of the blockchain can be adapted. By adapting to the test requirements of multiple authentication modes (CA, PK, PWK), the applicability of security policies in different scenarios and applications can be ensured.

[0077] In an exemplary embodiment, step 306 includes: searching for a fuzz testing template corresponding to the target blockchain network; identifying key fields and key parameters of the normal resource interaction message based on the fuzz testing template; randomly adjusting at least one of the key fields and key parameters of the normal resource interaction message through the fuzz testing template to generate different types of abnormal resource interaction messages.

[0078] Among them, for the fuzz testing template corresponding to the target blockchain network, it specifically refers to the template generated based on the historical resource interaction messages of the target blockchain network. Different blockchain networks correspond to different fuzz testing templates. When it is necessary to test the target blockchain network, it is necessary to first search for the fuzz testing template corresponding to the target blockchain network. The key fields and key parameters are important components in the resource interaction message. The resource interaction message may specifically include key fields such as resource interaction content, sender information, and receiver information, as well as key parameters such as timestamp and interaction hash.

[0079] Exemplarily, a test node for blockchain network testing can connect to different blockchain networks and save fuzz testing templates for different blockchain networks. When testing is required, the test node can, based on the corresponding blockchain identification information, find the fuzz testing template corresponding to the target blockchain network, and then perform testing based on the found template. The generation of abnormal resource interaction information can be specifically achieved by adjusting the key fields and key parameters of normal resource interaction messages. Therefore, the normal resource interaction messages obtained can be parsed through the fuzz testing template to obtain the information of the key fields and parameters included in each normal resource interaction message. Then, based on the fuzz testing template, it can be identified which key fields and key parameters need to be adjusted to change the normal resource interaction information into an abnormal resource interaction message, and at least one of the key fields and key parameters of the normal resource interaction message is randomly adjusted. By adjusting different key fields and parameters, different types of abnormal resource interaction messages are generated. In this embodiment, by using the fuzz testing template to identify the key fields and key parameters of the normal resource interaction message, and then adjusting at least one of these key fields and key parameters according to the fuzz testing template, different types of abnormal resource interaction messages can be generated in large quantities, which can effectively improve the efficiency and effectiveness of generating abnormal resource interaction messages, thereby enhancing the test effect of blockchain network testing.

[0080] In an exemplary embodiment, the method further includes: obtaining historical resource interaction messages from the historical data of the target blockchain network; parsing the historical resource interaction messages to obtain the message type information, message composition information, and message structure information of the historical resource interaction messages; determining abnormal key data and potential abnormal data based on the message type information, message composition information, and message structure information; and constructing a fuzz testing template based on the abnormal key data and potential abnormal data.

[0081] Among them, the message type information refers to the message type of the resource interaction message, such as the ordinary resource interaction type, the contract call type, or the cross-chain resource interaction type, etc. The message composition information refers to the components that make up the resource interaction message, which specifically includes key elements such as the resource interaction content, the sender information, the receiver information, the timestamp, the interaction hash, etc. The message structure information refers to the structure of the resource interaction message formed by each part of the message composition information. For abnormal critical data and potential abnormal data, the abnormal critical data refers to the data found to be abnormal by screening the parsed message composition information and message structure information. For example, inconsistent hash values, invalid signatures, format errors, etc. obtained by screening can be used as abnormal critical information. The potential abnormal data refers to the potential abnormal situations identified by in-depth analysis of the parsed resource interaction message. For example, unreasonable interaction content, inconsistent hash values, invalid signatures, etc. found by analysis can be used as potential abnormal data. For abnormal critical data, the key information usually refers to the information related to the test target, related to a specific resource interaction type, and has guiding significance for discovering potential problems in the resource interaction pool. The following several types of information can be regarded as key information. For example, the resource interaction content, including the amount of resource interaction, the function call and parameters of the smart contract, etc. The sender information, including the sender's address, public key, signature, etc. The receiver information, including the receiver's address (or contract address). Timestamp: The creation time or validity period of the resource interaction request. Interaction hash, loss, and other details: Such as the unique identifier of the resource interaction, the Gas price, and the Gas limit, etc. The abnormal information is the key information of the problems or violations of normal rules that occur during the resource interaction process. The abnormal information is mainly used to identify potential problems in the resource interaction pool, such as security vulnerabilities, performance bottlenecks, or other failures. The abnormal information is usually discovered after analyzing and evaluating the key information. The method of determining the key information mainly depends on the test target and the characteristics of the blockchain system. The factors to be considered include: the resource interaction type, the resource interaction processing flow, the information of the participating parties, and the execution result, etc.

[0082] Specifically, before adjusting and transforming the normal resource interaction message through the fuzz testing template, it is also necessary to construct the fuzz testing template based on the resource interaction messages in the historical data. Since the fuzz testing template needs to adjust the normal resource interaction message into different types of abnormal resource interaction messages, it is necessary to collect the abnormal key data and potential abnormal data of the abnormal resource interaction messages in the historical data, and then determine the transformation basis corresponding to different types of abnormalities based on this information, so as to construct the fuzz testing template. In order to determine the abnormal key data and potential abnormal data, it is necessary to first perform hierarchical parsing processing on the resource interaction messages in the historical data, first parse to obtain the type of the resource interaction message, and then deeply parse to determine information such as the composition and structure of the message. Then, by analyzing this information, identify the resource interaction messages with abnormalities, and determine the abnormal key data and potential abnormal data corresponding to the abnormal resource interaction messages, etc.; finally, construct the fuzz testing template based on the abnormal key data and potential abnormal data. The obtained abnormal template contains sufficient information to generate distorted or abnormal resource interaction messages, such as adjusting the normal resource interaction message into abnormal resource interaction messages in the form of incorrect formats, invalid parameters, or boundary values, etc. In this embodiment, by collecting and parsing the resource interaction messages in the historical data to obtain the abnormal key data and potential abnormal data, and thus constructing the fuzz testing template, the accuracy and efficiency of template construction can be effectively guaranteed, thereby improving the accuracy of blockchain network testing. According to the interaction type, it is possible to specifically check for security vulnerabilities that may be related to a specific interaction type. For example, for resource interactions of the smart contract type, security issues such as data overflow, re-entrancy attacks, and uninitialized storage variables can be checked.

[0083] In an exemplary embodiment, determining the abnormal key data and potential abnormal data based on the message type information, message composition information, and message structure information includes: detecting abnormal data in the message type information, message composition information, and message structure information through an abnormal data detection strategy to obtain the abnormal key data; detecting abnormal data in the message type information, message composition information, and message structure information through an abnormal data analysis strategy to obtain the potential abnormal data.

[0084] Among them, the abnormal data detection strategy is used to define different types of abnormalities (resource interaction structure errors, potential security risks, protocol compliance issues, etc.). Each strategy can define different data patterns and rules according to the type. The abnormal data detection strategy is specifically formulated manually based on the understanding of the blockchain system and the analysis of historical data. The main purpose of abnormal data detection is to find apparent abnormalities in resource interaction messages, such as inconsistent hash values, invalid signatures, and resource interaction data with format errors. Abnormal data detection focuses on identifying obvious problems and errors in resource interaction messages. And abnormal data analysis mainly targets resource interaction messages that have passed abnormal data detection and preliminary parsing. Its purpose is to conduct a more in-depth analysis of resource interaction messages based on predefined abnormal data analysis strategies, historical data, and other relevant information. For the abnormal data analysis strategy, it specifically includes: system rules and constraints, introducing rules such as protocol agreements, resource interaction processing procedures, and restrictions of the blockchain system in the analysis to detect resource interactions that comply with these rules; historical data analysis, obtaining the normal distribution range, typical behaviors, and possible abnormal situations of resource interaction data through statistical analysis of historical resource interaction data; security vulnerability identification, analyzing whether there are signs of known security vulnerabilities in resource interaction data, such as re-entrancy attacks, accidental data overflows, etc.

[0085] Exemplarily, for abnormal critical data and potential abnormal data, they can be determined through parsing and analysis respectively. After parsing the resource interaction message to obtain message type information, message composition information, and message structure information, the abnormal data detection strategy can be directly used to detect abnormal data in the parsed message type information, message composition information, and message structure information to obtain abnormal critical data. After the preliminary detection, the parsed data can be further analyzed. Specifically, based on the predefined abnormal data analysis strategy, an in-depth analysis of the parsed resource interaction message can be conducted to identify potential abnormal situations, such as unreasonable resource interaction content, inconsistent hash values, invalid signatures, etc. In this embodiment, the corresponding abnormal messages are extracted through the abnormal data detection strategy and the abnormal data analysis strategy, so that a template for fuzz testing can be accurately constructed to ensure the testing effect of the blockchain network.

[0086] In an exemplary embodiment, constructing a fuzz testing template based on abnormal critical data and potential abnormal data includes: constructing an abnormal message template based on abnormal critical data and potential abnormal data; classifying the abnormal message template according to the abnormal type of the abnormal message template to obtain various fuzz testing templates.

[0087] Exemplarily, for the construction process of the fuzz testing template, for the abnormal critical data and potential abnormal data, an abnormal message template corresponding to each abnormality can be constructed. The abnormal message template contains sufficient information to adjust the normal resource interaction message into a distorted or abnormal resource interaction message, such as error format, invalid parameters, boundary values, etc. After generating the template, the template can be further classified. Specifically, the abnormal messages can be classified according to the abnormal type of the abnormal message first, and the abnormal messages can be divided into categories such as network abnormalities, contract abnormalities, data abnormalities, etc., so as to classify the abnormal message templates according to the abnormal type of the abnormal message templates, and obtain various fuzz testing templates. In this embodiment, through the classification processing of the abnormal message templates, corresponding fuzz testing templates can be effectively obtained based on different types of message templates, so as to generate various types of abnormal resource interaction messages, improving the efficiency and accuracy of the blockchain network testing process.

[0088] In an exemplary embodiment, step 306 includes: obtaining abnormal type configuration information; based on the abnormal type characterized by the abnormal type configuration information, searching for the target fuzz testing template of the abnormal type in the fuzz testing template; based on the target fuzz testing template, adjusting the normal resource interaction message to generate different types of abnormal resource interaction messages.

[0089] Exemplarily, the abnormal type configuration information can be input by test staff based on the test requirements of the target blockchain network, or the default configuration information can be directly read. The abnormal type configuration information can specify the abnormal types to be tested, so as to find the target fuzz testing templates corresponding to these abnormal types. For example, the abnormal type configuration information can configure the fuzz testing templates that need to use network abnormalities and contract abnormalities. Then, based on the abnormal type configuration information, the target fuzz testing templates can be filtered out from the fuzz testing templates corresponding to the target blockchain network. Then, based on the selected target fuzz testing templates, the normal resource interaction messages are adjusted to generate different types of abnormal resource interaction messages. In a specific embodiment, in addition to the abnormal type configuration information, the data used for test configuration further includes abnormal policy configuration information. The abnormal policy configuration information can configure the generation policy of abnormal resource interaction messages, such as configuring the abnormal probability distribution, abnormal weight setting, and abnormal sorting rules of different messages, so as to meet the test requirements of different types of situations and complexities. In addition, by combining the abnormal type configuration information and obtaining the abnormal policy configuration information; combining different types of abnormal resource interaction messages to determine the distribution and sorting of different types of abnormal resource interaction messages, and obtaining a group of abnormal resource interaction messages; and for the sending process, the group of abnormal resource interaction messages is directly sent to the blockchain nodes in the target blockchain network. In this way, the processing strategies of the nodes in the target blockchain network for different messages in the message group can be tested, thereby ensuring the test effect. In this embodiment, through the abnormal type configuration information and the abnormal policy configuration information, the configuration of the abnormal resource interaction messages used in the test process is completed, so that the generation of the test data for the blockchain nodes is completed through reasonable test data configuration, which can effectively improve the test effect of the blockchain network test.

[0090] In an exemplary embodiment, step 310 includes: determining the running state of the blockchain node in the process of processing the abnormal resource interaction message; determining the abnormal message recognition ability and abnormal message processing ability of the blockchain node based on the running state; and obtaining the test result of the target blockchain network based on the abnormal message recognition ability and abnormal message processing ability of different blockchain nodes.

[0091] Exemplarily, for the testing process of a blockchain network, it can be specifically determined by monitoring the running status of blockchain nodes when processing abnormal requests. First, different types of abnormal resource interaction messages are sent to the blockchain nodes in the target blockchain network. The test node can monitor the running status of other blockchain nodes. The running status specifically includes whether the node is online, whether the node processing speed is normal, whether the node has errors, etc. If the node is online, the processing speed is normal, and the node has not made an error, then further determine the abnormal message recognition ability and abnormal message processing ability of the blockchain node. For example, by reading the logs of the blockchain node processing requests, it can be determined whether the blockchain node can normally recognize abnormal resource interaction messages and accurately process these abnormal messages. Thus, the abnormal message recognition ability and abnormal message processing ability of the blockchain node are determined. After obtaining the abnormal message recognition ability and abnormal message processing ability of all blockchain nodes, the test results of the target blockchain network can be obtained by integrating the capabilities of these nodes, and it can be determined whether the target blockchain network has the ability to handle exceptions and can maintain effective operation. In this embodiment, by determining the running status of the blockchain node, and then identifying the ability of the blockchain node to recognize and handle exceptions, the processing performance of the target blockchain can be determined, which can effectively ensure the test accuracy of the target blockchain network.

[0092] In an exemplary embodiment, the method further includes: obtaining log information generated by a blockchain node; performing log analysis processing based on the log information to obtain a log analysis result of the target blockchain network; when the log analysis result indicates that there are optimization items in the target blockchain network, generating a blockchain optimization message based on the log analysis result; when the log analysis result indicates that there are running risks in the target blockchain network, generating a blockchain warning message based on the log analysis result.

[0093] Among them, the log information specifically refers to the log record data generated by the blockchain node during the running process and the message processing process. The test node can specifically collect various log data generated by these blockchains during the running process while monitoring the blockchain node. For example, the sent abnormal resource interaction information, the status of the test node, the error information that appears during the test process, etc. Analyzing the log information can provide useful data for the problem diagnosis process of the target blockchain network. At the same time, it can also facilitate the processes such as problem reproduction and network improvement in the later stage.

[0094] Exemplarily, in order to effectively monitor and analyze the data during the blockchain network testing process, while conducting the blockchain network testing, the log information generated by the blockchain nodes in the target blockchain network can be collected, and a unified log format can be defined for convenient reading and parsing. The log information may include a timestamp, a log level (such as INFO, WARNING, ERROR, etc.), the module where the log comes from, the log content, and additional information (such as the hash of an abnormal request, the node ID, etc.). Then, the collected log information is analyzed to determine the problems or optimization items found by each blockchain node during the processing of normal resource interaction messages and abnormal resource interaction messages. During the log processing, potential problems, system bottlenecks, or parts that need to be optimized are identified. Based on the log analysis results, corresponding blockchain optimization messages are sent to provide reliable data support for operation and maintenance personnel and developers. At the same time, real-time alarm rules and thresholds can also be designed for the logs. When it is determined through the logs that there are running risks in the target blockchain network, that is, when abnormal situations are found or the alarm conditions are triggered, alarm notifications can be automatically generated. The notifications can be sent to relevant personnel in multiple ways such as by email, text message, or in-app notification. In this embodiment, by analyzing and processing the abnormal log information to complete the optimization and alarm of the blockchain network, the monitoring and optimization effects of the blockchain network can be effectively improved.

[0095] In an exemplary embodiment, the method further includes: identifying problem recurrence information in the log information; constructing a problem reproduction scenario of the target blockchain network based on the problem recurrence information; and performing problem localization processing on the target blockchain network based on the problem reproduction scenario.

[0096] Exemplarily, the problem reproduction information refers to the scenario information used to reproduce the process of a blockchain node processing a request, specifically including the abnormal data and situations recorded in the log, etc. When it is necessary to accurately reproduce the anomalies in the blockchain network to help developers and operators better locate and solve problems, the problem reproduction process can also be completed through test nodes. During the reproduction process, first, the problem reproduction information in the log information can be identified by parsing the log data, the key data during the processing of abnormal resource interaction requests, such as abnormal resource interaction messages, timestamps, node status, etc. Then, based on the problem reproduction information, a problem reproduction scenario for the target blockchain network is constructed. In one embodiment, for the process of scenario reproduction, the abnormal resource interaction message can be reconstructed based on the problem reproduction information; simulate sending the abnormal resource interaction message to the blockchain node of the target blockchain network to construct the problem reproduction scenario of the target blockchain network. By simulating the sending of the reconstructed abnormal resource interaction message to the target node, it is possible to observe how the target node processes the abnormal resource interaction message and the system performance, and at the same time, it is also possible to monitor the running status of the node during the reproduction process, and collect the processing information and running status of the problem node after resending the abnormal resource interaction. In this embodiment, after discovering the problems in the target blockchain network, the problem scenario is reproduced in a simulated manner to better understand the cause of the problem, thereby helping the developers and operators of the target blockchain network to locate the problem faster. Debug the original code, configuration, or policy, repair potential problems, and improve the efficiency and accuracy of blockchain problem maintenance.

[0097] This application also provides an application scenario that applies the above blockchain network testing method. Specifically, the application of the blockchain network testing method in this application scenario is as follows:

[0098] When blockchain developers or operators need to test the blockchain during the development or operation process to determine the recognition accuracy and processing accuracy of the blockchain network for abnormal messages, the solution of this application can be used to implement the testing of each node in the blockchain network. The solution of this application uses a test tool to simulate blockchain nodes to implement the test. The specific test node structure can refer to Figure 4 as shown, and its corresponding test system architecture can refer to Figure 5As shown in the figure, the test tool connects to the blockchain network as a test node. The blockchain network represents the entire blockchain network, including various nodes and components such as the consensus module, smart contract module, etc. The message receiving module 402 of the test node is used to monitor and receive messages from the resource interaction pool of the blockchain network, providing raw data for subsequent parsing, analysis, and construction modules. The message parsing module 403 is responsible for parsing the received messages, identifying their types, components, and structures, and providing structured data for subsequent analysis and construction modules. The message analysis module 404 is used to analyze the parsed messages, find possible abnormal key data and potential problems, etc., and provide an abnormal template for the message construction module according to the analysis results. The fuzz testing engine 405 (message construction module) can generate distorted or abnormal resource interaction messages using fuzz testing technology according to the abnormal template provided by the message analysis module to cover various abnormal types. The message sending module 406 is used to send the abnormal resource interaction messages generated by the fuzz testing engine to other nodes in the blockchain network to simulate the sending process and test the processing capabilities of other nodes after receiving the abnormal resource interaction messages. The monitoring module 407 is used to monitor the running status of the nodes in the blockchain network during the entire testing process, checking whether other nodes can identify abnormal messages, handle unexpected situations, and maintain stable operation. The log module 408 is used to record log information such as abnormal resource interaction message information, timestamps, and node status during the testing process for post-event analysis. The problem reproduction module 409 can reconstruct and generate abnormal resource interaction messages according to the abnormal data and situations recorded in the log and simulate sending them to the target node.

[0099] Specifically, the message parsing module 403 is responsible for parsing the received resource interaction messages, further processing the resource interaction messages, and extracting key information. The module implements the following functions:

[0100] Message type identification, which is used to perform a preliminary analysis on the received resource interaction messages to identify the resource interaction types, such as ordinary resource interaction, contract call, cross-chain resource interaction, etc. This helps subsequent modules to perform targeted processing according to the type of resource interaction.

[0101] Parse the message structure, which is used to parse the received resource interaction messages to obtain their components and structures, including identifying key elements such as resource interaction content, sender information, receiver information, timestamp, interaction hash, etc.

[0102] Verify message integrity, which is used to check the integrity and correctness of the received resource interaction messages. For example, verify whether the signature is valid, whether the interaction hash matches, etc., to ensure the accuracy of subsequent processing and analysis.

[0103] Abnormal data detection is used to perform preliminary screening of parsed resource interaction messages based on abnormal data detection strategies to identify possible abnormal information, such as inconsistent hash values, invalid signatures, format errors, etc.

[0104] Extract key information, which is used to extract key information from the parsed resource interaction messages and send the information to subsequent modules for processing and analysis.

[0105] Therefore, the message parsing module 403 can parse the received resource interaction messages, identify the message type, message structure and abnormal situation, and pass the extracted key information to the subsequent modules, which is helpful to evaluate how the nodes in the blockchain network handle information and ensure normal operation when facing abnormal messages.

[0106] The message analysis module 404 is responsible for parsing the received resource interaction messages, further processing the resource interaction messages and extracting key information. The module implements the following functions:

[0107] Receive parsed data, receive parsed data from the message parsing module, including message type, message structure, key information, etc.

[0108] Analyze abnormal information and conduct in-depth analysis on the parsed resource interaction message-related information based on predefined abnormal data analysis strategies. Identify potential abnormal situations, such as unreasonable interaction content, inconsistent hash values, invalid signatures, etc.

[0109] Construct an exception template, and provide an abnormal interaction template for fuzz testing based on the abnormal information analysis results, namely the fuzz test template. The fuzz test template contains enough information to generate distorted or abnormal resource interaction messages, such as wrong format, invalid parameters, boundary values, etc.

[0110] Exception classification: categorize exceptions according to the constructed fuzz test template. For example, classify exception messages into network exceptions, contract exceptions, data exceptions, etc., so that subsequent processes can generate exception messages in a targeted manner.

[0111] Output the abnormal data analysis results and the abnormal template to the fuzzy test engine of the test node. The node can generate abnormal resource interaction messages based on this information and send the messages to other nodes.

[0112] The message analysis module 404 can perform in-depth analysis on the parsed resource interaction messages, identify potential anomalies, and construct a fuzzy test template for generating abnormal interaction messages.

[0113] The fuzz testing engine 405 is responsible for generating distorted or abnormal resource interaction messages according to the provided exception templates, which are used to simulate sending abnormal resource interaction messages to other nodes. For the fuzzing engine module, it implements the following functions:

[0114] Receive exception templates, receive fuzz testing templates from the message analysis module, including resource interaction types, structures, and key information, etc.

[0115] Generate abnormal messages, according to the fuzz testing template, randomly change or replace the keyword fields and parameters in the normal resource interaction messages. For example, modify the amount of resource interaction, change the recipient address, recalculate the hash value, etc. This can cover various abnormal types, such as inaccurate message formats, overly long message lengths, etc.

[0116] Abnormal type configuration, according to the test requirements and environment, configure different abnormal types. Test staff can customize the number, proportion, or type of test cases, and set weights for specific abnormal types.

[0117] Abnormal strategy setting, can set abnormal generation strategies, including probability distribution, weights, and sorting rules, etc. This will help to meet the test requirements of different types of situations and complexities.

[0118] Abnormal message combination, support generating a group of abnormal resource interaction messages simultaneously to simulate multi-type abnormal resource interactions that may occur in the real environment.

[0119] Output abnormal resource interaction messages, send the generated abnormal resource interaction messages to the message sending module, which is used to simulate sending abnormal resource interaction information to other nodes.

[0120] By implementing the above functions, the fuzz testing engine 405 can generate a batch of distorted or abnormal resource interaction messages according to the provided fuzz testing template. And simulate sending these abnormal resource interaction messages to evaluate the processing ability and system stability of other nodes when dealing with abnormal messages.

[0121] The monitoring module 407 is responsible for monitoring the running status of nodes in the blockchain network and the propagation of abnormal resource interaction messages. Its main functions are as follows:

[0122] Establish connections, establish connections with nodes in the blockchain network to collect the running status, status information, and resource interaction data of the nodes. Support communication protocols such as API, RPC, or WebSocket to establish connections with the blockchain network.

[0123] Receive abnormal resource interaction messages, receive the generated abnormal resource interaction messages from the message construction module. At the same time, monitor their propagation in the blockchain network.

[0124] Node status monitoring monitors the running status of other nodes during the abnormal resource interaction propagation process. For example, check whether the node is online, whether the processing speed is normal, whether there are errors, etc.

[0125] Abnormal handling check observes whether other nodes in the target blockchain network can correctly identify abnormal messages and appropriately handle them to prevent crashes. Evaluate the stability and robustness of nodes under different abnormal conditions.

[0126] Logging and analysis record the information collected during the monitoring process in the log. And analyze the log information to provide useful data for diagnosing problems. At the same time, it is convenient for later problem reproduction and improvement.

[0127] Real-time alerting and notification set monitoring rules and alert thresholds. When an abnormal situation is detected, send real-time alert notifications (supporting email, SMS, in-app notifications, etc.).

[0128] By implementing the above functions, the monitoring module of test node 407 can monitor the running conditions of nodes in the blockchain network in real time and evaluate the performance of other nodes when processing abnormal resource interaction information.

[0129] Log module 408 is mainly responsible for recording and managing various log information generated during the security test of the blockchain resource interaction pool based on fuzz testing. Its main implementations are:

[0130] Log data collection captures and collects various log information generated during the test process, such as abnormal resource interaction information sent, the status of test nodes, error information that appears during the test, etc.

[0131] Log format definition is used to define a unified log format. Log information can include timestamp, log level, log source module, log content, and additional information.

[0132] Log storage is used to store the generated log records in an appropriate location, which can be a local file system, a distributed file system, or a cloud storage platform, etc. Ensure the integrity and accessibility of log records during storage.

[0133] Log analysis is used to analyze the collected log data to identify potential problems, system bottlenecks, or parts that need to be optimized. Provide reliable data support for operation and maintenance personnel and developers through the log analysis results.

[0134] Log filtering and search are used to provide log filtering and search functions, which can quickly locate key information. And support filtering and searching logs according to multiple conditions such as time range, log level, log source module, etc.

[0135] Log alerts and notifications can design real-time alert rules and thresholds, and automatically generate alarm notifications when abnormal situations are detected or alert conditions are triggered. Notifications can be sent to relevant personnel in various ways such as email, text message, or in-app notification.

[0136] By implementing the above functions, the log module 408 can record, store, analyze, and manage various log information generated during the test process. The log module will provide effective problem discovery, diagnosis capabilities, and data support to help developers and operators solve problems in a timely manner, thereby improving the security performance of the entire blockchain network.

[0137] The problem reproduction module 409 is mainly responsible for reproducing abnormal resource interaction situations based on the log information generated during the test process to help developers and operators better locate and solve problems. Its main functions include:

[0138] Parse log data, that is, obtain relevant log information from the log module and parse out key data in the abnormal resource interaction process, such as abnormal resource interaction messages, timestamps, node status, etc.

[0139] Reconstruct abnormal resource interaction information, that is, reconstruct abnormal resource interaction messages based on the abnormal data and situations recorded in the log. This includes simulating abnormal resource interaction data generated by the fuzz testing engine and the sending process.

[0140] Simulate sending abnormal resource interaction information, which is used to simulate sending the reconstructed abnormal resource interaction message to the target node to observe how the node processes abnormal resource interactions and the system performance.

[0141] Monitor the processing of re-sent abnormal resource interactions, that is, monitor the running status of the node during the reproduction process, and collect the processing information and running status of the problem node after re-sending the abnormal resource interaction.

[0142] Problem location and debugging. Through the above steps, better understand the cause of the problem, thereby helping developers and operators locate the problem faster. Debug the original code, configuration, or policy to fix potential problems.

[0143] The message sending module 406 is responsible for sending the abnormal resource interaction messages generated by the fuzz testing engine to other blockchain network nodes. Its functions include:

[0144] Receive abnormal resource interaction messages, which are used to receive the generated abnormal resource interaction messages from the fuzz testing engine (or message construction module).

[0145] Establish a connection, which is used to establish a connection with other nodes in the blockchain network. The connection process supports the use of existing communication protocols, such as API, RPC, or WebSocket, etc.

[0146] Encoding format conversion is used to convert abnormal resource interaction messages into the communication formats required by the target nodes. The communication formats support JSON, CBOR, or other encoding formats specific to the blockchain network.

[0147] Sending abnormal resource interaction messages is used to send the constructed abnormal resource interaction messages to the target nodes. During the sending process, the sending status and node responses are monitored to ensure that the messages have been correctly received.

[0148] Traffic control and exception handling are used to implement traffic control strategies to avoid network congestion when sending abnormal resource interaction messages. For messages that fail to be sent or for which acknowledgments are not received, strategies such as retrying and delaying the sending can be adopted for handling.

[0149] By implementing the above functions, the message sending module 406 can successfully send the abnormal resource interaction messages generated by the fuzz testing engine to other nodes in the blockchain network. The module is responsible for establishing connections, sending messages, and monitoring node responses to test the processing capabilities and stability of other nodes after receiving the abnormal resource interaction information.

[0150] For the above-mentioned test nodes, the implementation of blockchain network testing specifically includes three main processes, namely, the initialization process, the test execution process, and the problem reproduction process.

[0151] Among them, the initialization process can refer to Figure 6 As shown, it includes:

[0152] Step 601, reading the configuration file, that is, reading the pre-stored configuration file to obtain configuration information such as test parameters, connection settings, filtering conditions, and exception templates.

[0153] Step 603, connecting to the blockchain network. According to the connection settings in the configuration file, connect the test node as a simulation node to the target blockchain network. Existing communication protocols such as APIs, RPCs, or WebSockets can be used to establish a connection with the blockchain network.

[0154] Step 605, subscribing to resource interaction pool messages. After successfully connecting to the blockchain network, subscribe to the real-time messages broadcast by the resource interaction pool. Filter and collect resource interaction-related information for subsequent operations.

[0155] Step 607, configuring fuzz testing parameters. According to the fuzz testing parameter settings in the configuration file, configure the parameters of the fuzz testing engine, such as exception types, the number of test cases, sending frequencies, etc.

[0156] Step 609, start monitoring events. By starting the event monitoring mechanism, monitor the messages broadcast by the resource interaction pool. Monitor the received resource interaction messages and trigger subsequent operations of anomaly generation, testing, and analysis.

[0157] After initialization is completed, the specific test execution process is carried out. The process is as follows Figure 7 as shown, including:

[0158] Step 702, receive resource interaction pool messages. The test node monitors and receives the real-time messages of the resource interaction pool. Provide basic data for subsequent operations by subscribing to the received resource interaction information.

[0159] Step 704, analyze resource interaction messages. Parse and analyze the received resource interaction messages. Identify potential abnormal data and provide input for the fuzz testing engine.

[0160] Step 706, generate abnormal resource interaction messages. According to the normal resource interaction messages, use fuzz testing technology to generate abnormal resource interaction messages of different types.

[0161] Step 708, send abnormal resource interaction messages, and send the generated abnormal resource interaction messages to other blockchain network nodes to simulate the propagation process of abnormal resource interaction information in the actual environment.

[0162] Step 710, monitor node status. Monitor the running status of other nodes after receiving the abnormal resource interaction messages. Check whether other nodes can identify abnormal messages, handle unexpected situations, and maintain stable operation.

[0163] Step 712, record test logs. Record key log information such as abnormal resource interaction information, node status, and timestamp during the test. Facilitate post-mortem analysis and problem reproduction.

[0164] After the test node determines that there is a problem in the target blockchain network, in order to conduct in-depth analysis, it can also include the processing process of problem reproduction. The specific processing process can be referred to Figure 8 as shown, including:

[0165] Step 801, read test logs. Obtain the log information related to the problem from the log module. Include key information such as abnormal resource interaction messages, timestamp, and node status.

[0166] Step 803, analyze the cause of the problem. According to the log information, analyze the cause of the problem. Extract key data to reconstruct the abnormal resource interaction messages.

[0167] Step 805: Reconstruct the abnormal resource interaction message. According to the analysis results, reconstruct the generated abnormal resource interaction message. Simulate the abnormal resource interaction data generated by the fuzz testing engine.

[0168] Step 807: Simulate sending the abnormal resource interaction message. Simulate sending the reconstructed abnormal resource interaction message to the target node. Observe and verify the ability of the node to handle abnormal resource interactions.

[0169] Step 809: Monitor the node status. During the process of problem reproduction, monitor the running status of the node to collect the processing information of the problem node after resending the abnormal resource interaction.

[0170] Step 811: Problem location and debugging. Locate the cause of the problem by simulating the problem reproduction process to help developers and operators quickly find and solve the problem. Debugging may involve fixing the original code, configuration, or policy.

[0171] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps do not necessarily execute in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily execute at the same moment, but can execute at different moments. The execution order of these steps or stages is not necessarily sequential either, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0172] Based on the same inventive concept, the embodiments of the present application also provide a blockchain network testing device for implementing the blockchain network testing method described above. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following blockchain network testing devices can refer to the limitations on the blockchain network testing method in the above text, and will not be repeated here.

[0173] In an exemplary embodiment, as Figure 9 shown, a blockchain network testing device is provided, including:

[0174] A message subscription module 902, configured to join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network.

[0175] A message recognition module 904, configured to recognize the normal resource interaction messages in the resource interaction pool messages.

[0176] A message adjustment module 906 is configured to adjust normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing resource interaction messages in historical data, and is used to modify key fields and key parameters in normal resource interaction messages to generate different types of abnormal resource interaction messages.

[0177] A message sending module 908 is configured to send different types of abnormal resource interaction messages to blockchain nodes in a target blockchain network.

[0178] A test result acquisition module 910 is configured to obtain a test result of the target blockchain network based on the running state of the blockchain nodes.

[0179] In an exemplary embodiment, the message adjustment module 906 is specifically configured to: find a fuzz testing template corresponding to the target blockchain network; identify key fields and key parameters of normal resource interaction messages based on the fuzz testing template; randomly adjust at least one of the key fields and key parameters of the normal resource interaction messages through the fuzz testing template to generate different types of abnormal resource interaction messages.

[0180] In an exemplary embodiment, a template construction module is further included, and is configured to: obtain historical resource interaction messages from historical data of the target blockchain network; parse the historical resource interaction messages to obtain message type information, message composition information, and message structure information of the historical resource interaction messages; determine abnormal key data and potential abnormal data based on the message type information, message composition information, and message structure information; construct a fuzz testing template based on the abnormal key data and potential abnormal data.

[0181] In an exemplary embodiment, the template construction module is specifically configured to: perform abnormal data detection on the message type information, message composition information, and message structure information through an abnormal data detection strategy to obtain abnormal key data; perform abnormal data detection on the message type information, message composition information, and message structure information through an abnormal data analysis strategy to obtain potential abnormal data.

[0182] In an exemplary embodiment, the template construction module is specifically configured to: construct an abnormal message template based on the abnormal key data and potential abnormal data; classify the abnormal message template according to the abnormal type of the abnormal message template to obtain various fuzz testing templates.

[0183] In an exemplary embodiment, the message adjustment module 906 is specifically configured to: obtain exception type configuration information; based on the exception type characterized by the exception type configuration information, search for the target fuzz test template of the exception type in the fuzz test template; based on the target fuzz test template, adjust the normal resource interaction message to generate different types of abnormal resource interaction messages.

[0184] In an exemplary embodiment, it further includes an exception configuration module, which is configured to: obtain exception policy configuration information; determine the exception probability distribution, exception weight setting, and exception sorting rule based on the exception policy setting information; based on the exception probability distribution, exception weight setting, and exception sorting rule, combine different types of abnormal resource interaction messages to determine the distribution and sorting of different types of abnormal resource interaction messages, and obtain a group of abnormal resource interaction messages. The message sending module is specifically configured to send the group of abnormal resource interaction messages to the blockchain nodes in the target blockchain network.

[0185] In an exemplary embodiment, the test result acquisition module 910 is specifically configured to: determine the running state of the blockchain node during the process of processing the abnormal resource interaction message; determine the abnormal message recognition ability and abnormal message processing ability of the blockchain node based on the running state; based on the abnormal message recognition ability and abnormal message processing ability of different blockchain nodes, obtain the test result of the target blockchain network.

[0186] In an exemplary embodiment, it further includes a log module, which is configured to: obtain the log information generated by the blockchain node; perform log analysis processing based on the log information to obtain the log analysis result of the target blockchain network; when the log analysis result indicates that there are optimization items in the target blockchain network, generate a blockchain optimization message based on the log analysis result, and when the log analysis result indicates that there are running risks in the target blockchain network, generate a blockchain warning message based on the log analysis result.

[0187] In an exemplary embodiment, it further includes a problem reproduction module, which is configured to: identify the problem reproduction information in the log information; construct a problem reproduction scenario of the target blockchain network based on the problem reproduction information; perform problem location processing on the target blockchain network based on the problem reproduction scenario.

[0188] In an exemplary embodiment, the problem reproduction module is specifically configured to: reconstruct the abnormal resource interaction message based on the problem reproduction information; simulate sending the abnormal resource interaction message to the blockchain nodes in the target blockchain network to construct a problem reproduction scenario of the target blockchain network.

[0189] Each module in the above blockchain network testing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0190] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 10 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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 database of the computer device is used to store blockchain network test data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a blockchain network testing method.

[0191] Those skilled in the art can understand that Figure 10 the structure shown in

[0192] is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0193] In an embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in each of the above method embodiments.

[0194] In one embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above method embodiments.

[0195] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0196] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. 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 above method embodiments. Among them, any reference to a memory, a database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories 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 memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0197] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope recorded in this specification.

[0198] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A blockchain network testing method, characterized in that, Applied to a test server, the method includes: Join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network; Identify the normal resource interaction messages in the resource interaction pool messages; Adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in the historical data, and the fuzz testing template is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages; Send the different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network; Obtain the test result of the target blockchain network based on the running status of the blockchain nodes.

2. The method according to claim 1, wherein The adjusting the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages includes: Search for the fuzz testing template corresponding to the target blockchain network; Identify the key fields and key parameters of the normal resource interaction messages based on the fuzz testing template; Randomly adjust at least one of the key fields and key parameters of the normal resource interaction messages through the fuzz testing template to generate different types of abnormal resource interaction messages.

3. The method according to claim 1, characterized in that, The method further includes: Obtain historical resource interaction messages from the historical data of the target blockchain network; Parse the historical resource interaction messages to obtain the message type information, message composition information, and message structure information of the historical resource interaction messages; Determine the abnormal key data and potential abnormal data based on the message type information, the message composition information, and the message structure information; Construct a fuzz testing template based on the abnormal key data and the potential abnormal data.

4. The method according to claim 3, characterized in that, The determining the abnormal key data and potential abnormal data based on the message type information, the message composition information, and the message structure information includes: Perform abnormal data detection on the message type information, the message composition information, and the message structure information through an abnormal data detection strategy to obtain the abnormal key data; Perform abnormal data detection on the message type information, the message composition information, and the message structure information through an abnormal data analysis strategy to obtain the potential abnormal data.

5. The method according to claim 3, wherein The constructing a fuzz testing template based on the abnormal key data and the potential abnormal data includes: Construct an abnormal message template based on the abnormal key data and the potential abnormal data; Classify the abnormal message template according to the abnormal type of the abnormal message template to obtain various fuzz testing templates.

6. The method according to claim 1, wherein The adjusting the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages includes: Obtain the abnormal type configuration information; Search for the target fuzz testing template of the abnormal type in the fuzz testing template based on the abnormal type characterized by the abnormal type configuration information; Based on the target fuzz testing template, adjust the normal resource interaction messages to generate different types of abnormal resource interaction messages.

7. The method according to claim 6, characterized in that The method further includes: Obtain abnormal policy configuration information; Determine the abnormal probability distribution, abnormal weight setting, and abnormal sorting rule based on the abnormal policy setting information; Based on the abnormal probability distribution, the abnormal weight setting, and the abnormal sorting rule, combine the different types of abnormal resource interaction messages to determine the distribution and sorting of the different types of abnormal resource interaction messages, and obtain a group of abnormal resource interaction messages; The step of sending the different types of abnormal resource interaction messages to the blockchain nodes in the target blockchain network includes: Send the group of abnormal resource interaction messages to the blockchain nodes in the target blockchain network.

8. The method according to claim 1, characterized in that, The step of obtaining the test result of the target blockchain network based on the running state of the blockchain nodes includes: Determine the running state of the blockchain nodes during the process of processing the abnormal resource interaction messages; Determine the abnormal message recognition ability and abnormal message processing ability of the blockchain nodes based on the running state; Obtain the test result of the target blockchain network based on the abnormal message recognition ability and the abnormal message processing ability of different blockchain nodes.

9. The method according to any one of claims 1 to 8, characterized in that The method further includes: Obtain the log information generated by the blockchain nodes; Perform log analysis processing based on the log information to obtain the log analysis result of the target blockchain network; When the log analysis result indicates that there are optimization items in the target blockchain network, generate a blockchain optimization message based on the log analysis result; when the log analysis result indicates that there are running risks in the target blockchain network, generate a blockchain warning message based on the log analysis result.

10. The method according to claim 9, characterized in that The method further includes: Identify the problem reproduction information in the log information; Construct a problem reproduction scenario of the target blockchain network based on the problem reproduction information; Perform problem localization processing on the target blockchain network based on the problem reproduction scenario.

11. The method according to claim 10, wherein The step of constructing a problem reproduction scenario of the target blockchain network based on the problem reproduction information includes: Reconstruct the abnormal resource interaction messages based on the problem reproduction information; Simulate sending the abnormal resource interaction messages to the blockchain nodes of the target blockchain network to construct a problem reproduction scenario of the target blockchain network.

12. A blockchain network testing device, characterized in that, Set in a test server, the device includes: A message subscription module, configured to join the target blockchain network to be tested, connect to the blockchain nodes in the target blockchain network, and subscribe to the resource interaction pool messages of the target blockchain network; A message recognition module, configured to recognize the normal resource interaction messages in the resource interaction pool messages; A message adjustment module, configured to adjust the normal resource interaction messages through a fuzz testing template to generate different types of abnormal resource interaction messages. The fuzz testing template is obtained by parsing the resource interaction messages in historical data, and the fuzz testing template is used to modify the key fields and key parameters in the normal resource interaction messages to generate different types of abnormal resource interaction messages; A message sending module, configured to send the abnormal resource interaction messages of different types to the blockchain nodes in the target blockchain network; A test result obtaining module, configured to obtain the test result of the target blockchain network based on the running state of the blockchain nodes.

13. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. 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 11 are implemented.

15. A computer program product, comprising a computer program, 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 11 are implemented.