Blockchain-based data testing method, device and server

By using blockchain technology to conduct data testing on server nodes, efficient and accurate detection and judgment are achieved, ensuring that new tests do not affect existing test cases. This solves the problem of cumbersome and error-prone detection in existing technologies and improves the stability and reliability of the data processing platform.

CN116149995BActive Publication Date: 2026-02-06INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211631491.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2026-02-06
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

In large-scale data processing platforms, when adding new data for testing, existing technologies require cumbersome and complex detection and judgment, which is inefficient and prone to errors, making it difficult to ensure that the addition of new tests does not affect the execution of existing test cases.

Method used

Leveraging the characteristics of blockchain, test requests are received through server nodes to conduct feasibility and stability tests, create target blocks and connect them to the blockchain, and use smart contracts to verify stability and generate confirmation information to ensure that test data and cases meet the requirements.

Benefits of technology

It simplifies the detection and judgment process, accurately and efficiently determines whether new tests affect existing test cases, and protects the stability and reliability of the data processing platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116149995B_ABST
    Figure CN116149995B_ABST
Patent Text Reader

Abstract

The present specification provides a blockchain-based data testing method, device and server. After receiving a target data testing request initiated by a test terminal node and carrying target test data and a target test case, a server node can first perform a feasibility detection to determine whether it meets a preset first requirement. If it is determined that the preset first requirement is met, a corresponding target block is created and connected to the blockchain. Then, a detection request about the target data testing is initiated to a smart contract. The smart contract performs a stability detection according to the target block in the blockchain to determine whether it meets a preset second requirement. If it is determined that the preset second requirement is met and the consensus is passed, the smart contract generates and feeds back target confirmation information. According to the target confirmation information, the server node sends corresponding target test credentials to the test terminal node, so that the test terminal node can perform target data testing through the target block.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification belongs to the technical field of blockchains, and particularly relates to a blockchain-based data testing method and device and server. BACKGROUND

[0002] In a big data processing scenario, some large data processing platforms (for example, an XX bank data processing platform, etc.) often need to simultaneously perform multiple data tests based on multiple test cases for multiple businesses and multiple data involving multiple business systems.

[0003] Based on the existing method, when facing a large number of existing test cases with complex relationships on the platform, if a tester wants to add new test cases for new data tests, the tester often needs to first manually perform relatively tedious and complex detection and judgment to determine whether the new data test will affect the execution of the existing test cases or whether the new data test will be affected by the execution of the existing test cases (for example, some existing test cases may tamper with the test data used by the new test cases during execution, thereby causing unstable testing and poor testing results when performing the new test cases for new data tests). Only when it is determined that the new data test will not affect the execution of the existing test cases and the new data test will not be affected by the execution of the existing test cases, can new test cases be successfully added on the data processing platform for new data tests. It can be seen that, based on the above method, the detection and judgment process is relatively tedious and complex, the processing efficiency is low, and errors are likely to occur.

[0004] At present, no effective solution has been proposed for the above problems. SUMMARY

[0005] The present specification provides a blockchain-based data testing method, device and server, which can fully utilize the characteristics of blockchains, effectively simplify the detection and judgment process, accurately and efficiently automatically determine whether a target data test of executing a target test case with target test data meets relevant requirements, avoid the test terminal node from affecting other existing test cases on the platform when performing the new target data test, and also avoid the new target data test from being affected by the execution of other existing test cases on the platform.

[0006] The present specification provides a blockchain-based data testing method applied to a server node, the method comprising:

[0007] receiving a target data test request initiated by a test terminal node; wherein the target data test request carries at least target test data and a target test case;

[0008] In response to the target data test request, the feasibility of the target test case and the target test data is detected to determine whether the target test case and the target test data meet the preset first requirement;

[0009] In a case where it is determined that the target test case and the target test data meet the preset first requirement, a target block is created according to the target test case and the target test data, and the target block is connected into a block chain;

[0010] A detection request about the target data test is initiated to a smart contract, wherein the smart contract, in response to the detection request, performs stability detection on the target test case and the target test data according to the target block to determine whether the target test case and the target test data meet a preset second requirement, and in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus about the target data test is passed, the smart contract generates corresponding target confirmation information;

[0011] The target test credential for the target data test is sent to a test terminal node according to the target confirmation information, wherein the test terminal node performs the target data test on the target test case and the target test data through the target block according to the target test credential.

[0012] In one embodiment, the feasibility of the target test case and the target test data is detected to determine whether the target test case and the target test data meet the preset first requirement, comprising:

[0013] The target test case is run according to the target test data, wherein the target test data further carries a characteristic field of the target test data, and the target test case further carries a characteristic field of the target test case;

[0014] It is detected whether the target test case is run successfully;

[0015] In a case where it is determined that the target test case is run successfully, a target running result is obtained;

[0016] It is detected whether the target running result meets an expected requirement according to the characteristic field of the target test data and the characteristic field of the target test case;

[0017] In a case where it is determined that the target running result meets the expected requirement, it is determined that the target test case and the target test data meet the preset first requirement.

[0018] In one embodiment, the characteristic field of the target test data comprises at least one of the following: a system field, a data attribute field, and an operation type field;

[0019] The characteristic field of the target test case includes at least one of the following: a service field, a business field, an input field, and an output field.

[0020] In one embodiment, before running the target test case according to the target test data, the method further includes:

[0021] According to the preset data generation rule, it is detected whether the target test case and the target test data conform to the data generation specification.

[0022] In one embodiment, after the feasibility detection on the target test case and the target test data, it is determined whether the target test case and the target test data conform to the preset first requirement, the method further includes:

[0023] In the case where it is determined that the target test case and the target test data do not conform to the preset first requirement, a first type of error prompt is generated; wherein the first type of error prompt carries a modification suggestion for the target test case and / or the target test data;

[0024] The first type of error prompt is sent to the test terminal node.

[0025] In one embodiment, the target block at least includes a block header and a block body; wherein the block body is used to store the target test case and the target test data; and the block header is used to store the node identifier of the test terminal node, the case identifier of the target test case, the data identifier of the target test data, the time stamp, the hash value of the previous block, the hash value of the target test case, the hash value of the target test data, and the hash value of the target block.

[0026] In one embodiment, the smart contract responds to the detection request, and according to the target block, performs stability detection on the target test case and the target test data to determine whether the target test case and the target test data conform to the preset second requirement, including:

[0027] The smart contract determines the target system related to the target test case according to the system field of the target test data.

[0028] The blockchain is queried to determine whether there is a test case other than the target test case related to the target system;

[0029] In the case where it is determined that there is a test case other than the target test case related to the target system, the blockchain is queried to determine whether the target test data is used in the execution process of the other test case.

[0030] In a case where it is determined that there is data update of the target test data in the execution process of the other test case using the target test data, it is determined that the target test case and the target test data do not meet the preset second requirement.

[0031] In a case where it is determined that there is data update of the target test data in the execution process of the other test case using the target test data, it is determined that the target test case and the target test data do not meet the preset second requirement.

[0032] In one embodiment, in a case where it is determined that there is no other test case related to the target system except the target test case, or there is no other test case using the target test data in the execution process, or there is no data update of the target test data in the execution process of the other test case using the target test data, the method further comprises:

[0033] determining a target associated case having a blood relationship with the target test case from existing test cases of the blockchain;

[0034] According to the blockchain, the corresponding test terminal nodes execute the target associated case and the target test case respectively using the corresponding test data to obtain corresponding execution results;

[0035] According to the execution results, it is determined whether the target test case and the target test data meet the preset second requirement.

[0036] In one embodiment, determining a target associated case having a blood relationship with the target test case from existing test cases of the blockchain comprises:

[0037] According to the blockchain, an associated system of the target system is determined;

[0038] determining existing test cases related to the associated system, and test data for executing the existing test cases related to the associated system;

[0039] According to the test data for executing the existing test cases related to the associated system, a target associated case having a blood relationship with the target test case is screened from the existing test cases related to the associated system.

[0040] In one embodiment, according to the blockchain, an associated system of the target system is determined, comprising:

[0041] obtaining a database table of the target system and a database table of other systems except the target system;

[0042] calculating a field similarity between fields contained in the database table of the target system and fields contained in the database table of the other systems.

[0043] calculating a data duplication rate between business data contained in a database table of the target system and business data contained in a database table of the other system;

[0044] determining a correlation degree between the target system and the other system according to the field similarity and the data duplication rate;

[0045] filtering, from the other system, a system having a correlation degree greater than a preset correlation degree threshold as a correlation system of the target system.

[0046] In an embodiment, the method further comprises:

[0047] determining whether the test data of the existing test case related to the correlation system is same as the target test data, and in a case where it is determined that the test data of the existing test case related to the correlation system is same as the target test data, determining the existing test case related to the correlation system as the target correlation case having the blood relationship with the target test case.

[0048] In an embodiment, in a case where it is determined that the test data of the existing test case related to the correlation system is not same as the target test data, the method further comprises:

[0049] obtaining a characteristic field of the test data of the existing test case related to the correlation system;

[0050] filtering, according to the characteristic field of the test data of the existing test case related to the correlation system, a test case not having a data update for the test data to obtain a filtered test case;

[0051] calculating a field matching degree between the characteristic field of the test data of the filtered test case and the characteristic field of the target test data;

[0052] filtering, according to the field matching degree, a target correlation case having the blood relationship with the target test case from the filtered test case.

[0053] The present specification also provides a blockchain-based data testing device applied to a server node, the device comprising:

[0054] a receiving module configured to receive a target data testing request initiated by a testing terminal node, wherein the target data testing request carries at least target test data and a target test case;

[0055] The first detection module is configured to, in response to a target data test request, perform feasibility detection on the target test case and the target test data, and determine whether the target test case and the target test data meet a preset first requirement.

[0056] The creation module is configured to, in a case where it is determined that the target test case and the target test data meet the preset first requirement, create a target block according to the target test case and the target test data, and connect the target block into a block chain.

[0057] The second detection module is configured to initiate a detection request about target data test to a smart contract. The smart contract is configured to, in response to the detection request, perform stability detection on the target test case and the target test data according to the target block, determine whether the target test case and the target test data meet a preset second requirement, and generate corresponding target confirmation information in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus about the target data test is passed.

[0058] The sending module is configured to receive the target confirmation information and send a target test credential for the target data test to a test terminal node according to the target confirmation information. The test terminal node is configured to perform target data test on the target test case and the target test data through the target block according to the target test credential.

[0059] The present specification also provides a server including a processor and a memory for storing processor-executable instructions, wherein the processor implements the related steps of the blockchain-based data test method when executing the instructions.

[0060] The present specification also provides a computer-readable storage medium having computer instructions stored thereon, wherein the instructions are executed by a processor to implement the related steps of the blockchain-based data test method.

[0061] Based on the blockchain-based data testing method, device and server provided in the specification, after receiving a target data testing request initiated by a test terminal node and carrying target test data and a target test case, the server node can first perform a feasibility detection to determine whether it meets a preset first requirement. If it is determined that the preset first requirement is met, a corresponding target block is created and connected to the blockchain. Then, a detection request about the target data testing is initiated to the smart contract. The smart contract performs stability detection according to the target block in the blockchain to determine whether it meets a preset second requirement. If it is determined that the preset second requirement is met and the consensus is passed, the smart contract generates and feeds back target confirmation information. The server node sends corresponding target test credentials to the test terminal node according to the target confirmation information. Then, the test terminal node can use the target test credentials to successfully pass the target block to perform specific target data testing based on the blockchain using the target test case and the target test data. Thus, the characteristics of the blockchain can be fully utilized to effectively simplify the detection and judgment process, accurately and efficiently automatically determine whether the target data testing using the target test case and the target test data will have mutual influence on the execution of other existing test cases on the platform, whether it meets the relevant requirements, avoid the influence of the test terminal node on other existing test cases on the platform when performing the newly added target data testing, and also avoid the influence of the newly added target data testing on the execution of other existing test cases on the platform, thereby better protecting the stability and reliability of the data testing of the data processing platform. BRIEF DESCRIPTION OF DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the specification, the drawings needed in the embodiments will be briefly introduced as follows. The drawings in the following description are only some embodiments described in the specification, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0063] Figure 1 is a flowchart of a blockchain-based data testing method provided by an embodiment of the specification;

[0064] Figure 2 is a schematic diagram of an embodiment of the blockchain-based data testing method provided by the specification in one scenario example;

[0065] Figure 3 is a schematic diagram of an embodiment of the blockchain-based data testing method provided by the specification in one scenario example;

[0066] Figure 4is a schematic diagram of one embodiment of the blockchain-based data testing method provided by the embodiments of the present specification in one scenario example;

[0067] Figure 5 is a schematic diagram of one embodiment of the blockchain-based data testing method provided by the embodiments of the present specification in one scenario example;

[0068] Figure 6 is a schematic diagram of one embodiment of the blockchain-based data testing method provided by the embodiments of the present specification in one scenario example;

[0069] Figure 7 is a schematic diagram of the structure of a server provided by one embodiment of the present specification;

[0070] Figure 8 is a schematic diagram of the structure of a blockchain-based data testing device provided by one embodiment of the present specification. DETAILED DESCRIPTION

[0071] In order to enable those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be described clearly and completely below in conjunction with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only some of the embodiments of the present specification, not all. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present specification.

[0072] It should be noted that the information data related to the user in the present specification is obtained and used on the premise that the user is aware of and agrees. And the acquisition, storage, use, processing, etc. of the above information data all comply with the relevant provisions of national laws and regulations.

[0073] Referring to Figure 1 The embodiments of the present specification provide a blockchain-based data testing method. Wherein the method is specifically applied to the server node side. In specific implementation, the method can include the following contents:

[0074] S101: receiving a target data testing request initiated by a test terminal node; wherein the target data testing request carries at least target test data and target test case;

[0075] S102: responding to the target data testing request, performing feasibility detection on the target test case and the target test data, and determining whether the target test case and the target test data meet a preset first requirement;

[0076] S103: In a case where it is determined that the target test case and the target test data meet the preset first requirement, a target block is created according to the target test case and the target test data, and the target block is connected into the blockchain;

[0077] S104: A detection request about the target data test is initiated to a smart contract; wherein the smart contract responds to the detection request, performs stability detection on the target test case and the target test data according to the target block, and determines whether the target test case and the target test data meet a preset second requirement; in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus about the target data test is passed, the smart contract generates corresponding target confirmation information;

[0078] S105: The target test case and the target test data are received and target test credentials for the target data test are sent to a test terminal node according to the target confirmation information; wherein the test terminal node performs the target data test by using the target test case and the target test data through the target block according to the target test credentials.

[0079] The blockchain can be a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Further, the blockchain can be a common accounting solution that uses cryptography to ensure access security, uses relevant communication technologies to realize peer-to-peer communication, uses a consensus mechanism to realize the legality of accounting, and uses a chain structure to store data to realize non-tamperability. In essence, the blockchain can be understood as a distributed shared database generated based on cryptography technology, and is a technical solution for collectively maintaining a reliable database in a decentralized manner, having the characteristics of non-tamperability and non-falsifiability.

[0080] The smart contract can be a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. Specifically, the smart contract can be responsible for implementing, compiling and deploying the business logic of the blockchain system in the form of code, triggering and automatically executing the conditions of the established rules, and minimizing human intervention. In addition, the smart contract can allow trusted transactions without a third party, and the above transactions are traceable and irreversible.

[0081] Based on the above embodiments, the detection and judgment process can be effectively simplified, and it can be accurately and efficiently determined whether the target data test of executing the target test case with the target test data will have mutual influence on the execution of the existing test case of the platform, so as to ensure the stability and reliability of the overall data test on the platform.

[0082] In some embodiments, reference can be made to Figure 2As shown, the above-mentioned blockchain-based data testing method can be applied to the server node side. The server node can be connected to the blockchain of the data processing platform.

[0083] Specifically, the server node can include a background server applied to the data processing platform side, capable of realizing data transmission, data processing and the like. Specifically, the server node can be an electronic device with data operation, storage and network interaction functions. Alternatively, the server node can be a software program running in the electronic device to support data processing, storage and network interaction. In the embodiment, the number of servers included in the server node is not specifically limited. The server node can be a single server, several servers or a server cluster formed by several servers.

[0084] In addition to the server node, the data processing platform can further include a test terminal node and a business system. The test terminal node is also connected to the blockchain of the data processing platform.

[0085] The business system can be different types of systems for different business scenarios. For example, in the bank business scenario, the business system can include a personal deposit and withdrawal system, a personal remittance system, a personal credit evaluation system and the like. Of course, the above-mentioned business systems are only illustrative. In specific implementation, the business system can also include other corresponding types of systems according to the specific business scenario. The present specification does not limit this. Moreover, according to the corresponding protocol rules, the blockchain also deploys corresponding smart contracts.

[0086] The test terminal node can include a front end applied to the user (e.g., staff) side, capable of realizing data acquisition, data transmission and the like. Specifically, the test terminal node can be a desktop computer, a tablet computer, a notebook computer, a smart phone and the like. Alternatively, the test terminal node can be a software application capable of running in the above-mentioned electronic device. For example, it can be a certain test APP running on a smart phone.

[0087] Before implementation, the server node and the test terminal node need to apply for and connect to the blockchain of the data processing platform according to the corresponding protocol rules. When the server node or the test terminal node is connected to the blockchain of the data processing platform, it will obtain the public key and the private key corresponding to the identity. The server node and the test terminal node each hold and keep their own private key and publicly disclose their own public key.

[0088] Further, based on the blockchain, a corresponding consortium chain is also constructed according to a corresponding consensus protocol. The consortium chain includes a plurality of consensus nodes to perform consensus operations on related data processing on the blockchain.

[0089] In specific implementation, different users can use different test terminal nodes to create and manage test cases and test data through the blockchain of the data processing platform. Correspondingly, a plurality of test cases and a plurality of test data required for execution of the test cases can be stored in the blockchain. Further, different users can use different test terminal nodes to execute corresponding test cases using test data through the blockchain of the data processing platform to perform specific data testing.

[0090] In some embodiments, when a user needs to add a new test case (which can be referred to as a target test case) on the blockchain, a test terminal node can be used to construct a target test case carrying a characteristic field of the target test case (for example, a fund deposit automation test case related to a personal deposit system) and a target test data carrying a characteristic field of the target test data (for example, a bank card number 62***************47 of a personal user) according to a preset data generation rule. The target test data can be understood as test data required for execution of the target test case to add a target data test. Further, the test terminal node can generate a corresponding target data test request according to the target test case and the target test data, and send the target data test request to a server node. Correspondingly, the server node receives and acquires the target data test request. The target data test request carries at least the target test data and the target test case.

[0091] In some embodiments, the characteristic field of the target test data can include at least one of a system field, a data attribute field, an operation type field, and the like.

[0092] The characteristic field of the target test case can include at least one of a service field, a business field, an input field, an output field, and the like.

[0093] Based on the above embodiments, the server node can quickly and accurately acquire the characteristics of the target test case and the target test data according to the related characteristic fields of the target test case and the target test data.

[0094] In some embodiments, in specific implementation, referring to Table 1, the test terminal node can set the characteristic field of the target test case according to a preset data generation rule to generate the target test case. The target test case can also include related test rules and test models.

[0095] Table 1

[0096] Field Field Description Service Name The name of the service being tested. For example, the "deposit" service. This can be understood as an interface and its implementation. Method Name The name of the method being tested. For example, the "deposit" and "withdrawal" methods under the "deposit" service. This can be understood as a specific function within the interface. Input Communication Area The message of the transaction request initiated to the service method being tested. It can generally be in the format of a json or maps message. Output Communication Area The response message returned after the request to the service method being tested. It can generally be in the format of a json or maps message.

[0097] In practice, referring to Table 2, the test terminal node can set the characteristic field for the target test data according to the preset data generation rule to generate the target test data.

[0098] Table 2

[0099] Field Field Description Supplementary Description Data - Card Number Such as 6222xxx; 95588xxx, etc. Specific value of the data used System Such as "bank card system" Or "personal deposit and withdrawal system" "personal remittance system", etc. Data Attribute - Bank Such as the Industrial and Commercial Bank, the Construction Bank, etc. Belongs to the data category Data Attribute - Card Type Such as debit card, credit card, etc. Belongs to the data category Data Attribute - Status Such as normal state; loss state, etc. Belongs to the data characteristics Data Attribute - Balance Such as the current balance is 1000 million RMB Belongs to the data characteristics Operation Type Whether the data is only queried or will have an update operation

[0100] In some embodiments, referring to FIG. 6, the above feasibility detection on the target test case and the target test data to determine whether the target test case and the target test data meet the preset first requirement can include the following contents: Figure 3

[0101] S1: running the target test case according to the target test data; wherein the target test data further carries a characteristic field of the target test data, and the target test case further carries a characteristic field of the target test case;

[0102] S2: detecting whether the target test case is successfully run;

[0103] S3: obtaining a target running result in a case where it is determined that the target test case is successfully run;

[0104] S4: detecting whether the target running result meets an expected requirement according to the characteristic field of the target test data and the characteristic field of the target test case;

[0105] S5: determining that the target test case and the target test data meet the preset first requirement in a case where it is determined that the target running result meets the expected requirement.

[0106] Based on the above embodiments, the server node can run the target test case through single machine, without considering the execution of other existing test cases of the platform, to automatically and efficiently detect and determine whether the target test case itself can be normally and smoothly run, so as to determine whether the target test case and the target test data meet the preset first requirement.

[0107] In some embodiments, in a case where it is determined that the target test case and the target test data meet the preset first requirement, the stability of the target test case and the target test data can be further detected by detecting whether the execution of the target test case and the execution of other existing test cases of the platform affect each other.

[0108] ​In some embodiments, after the feasibility of the target test case and the target test data is detected, and it is determined whether the target test case and the target test data meet the preset first requirement, the method, when implemented, can further include the following: in a case where it is determined that the target test case and the target test data do not meet the preset first requirement, generating a first type of error prompt; wherein the first type of error prompt carries a modification suggestion for the target test case and / or the target test data; and sending the first type of error prompt to the test terminal node.

[0109] When implemented, the server node can analyze the error reason causing the target running result to not meet the expected requirement according to the target running result, the characteristic field of the target test data, and the characteristic field of the target test case; or analyze the error reason causing the target test case to fail according to the characteristic field of the target test data and the characteristic field of the target test case; and then generate a corresponding modification suggestion according to the error reason; and further generate the first type of error prompt carrying the modification suggestion. The server node can feed back the first type of error prompt to the test terminal node while returning the target data test request to the test terminal node. The test terminal node can display the first type of error prompt to the user, so that the user can adjust and modify the target test case and / or the target test data according to the modification suggestion to eliminate the error reason.

[0110] Based on the above embodiments, the first type of error prompt carrying the modification suggestion can be generated and fed back in a case where it is determined that the target test case and the target test data do not meet the preset first requirement, so that the user can accurately and efficiently eliminate the error reason existing in the target test case and the target test data through the test terminal node.

[0111] In some embodiments, before the target test case is run according to the target test data, the method, when implemented, can further include the following: detecting whether the target test case and the target test data meet the data generation specification according to a preset data generation rule.

[0112] When implemented, in a case where it is determined that the target test case or the target test data does not meet the data generation specification, the server node can return the target data test request and prompt the user to regenerate the target test case or the target test data that meets the data generation specification according to the preset data generation rule.

[0113] Based on the above embodiments, the target test case and the target test data that do not meet the data generation specification can be accurately detected and found, and the user can be timely reminded to generate and provide the target test case and the target test data that meet the data generation specification according to the preset data generation rule, so that data errors in subsequent processing processes can be reduced.

[0114] In some embodiments, the server node can create a new block as a target block according to the target test case and the target test data, and connect the target block into the blockchain, in a case that the target test case and the target test data meet the preset first requirement.

[0115] In some embodiments, the target block can at least include a block header and a block body; the block body can be specifically used for storing the target test case and the target test data; and the block header can be specifically used for storing a node identifier of the test terminal node, a case identifier of the target test case, a data identifier of the target test data, a timestamp, a hash value of a previous block, a hash value of the target test case, a hash value of the target test data, and a hash value of the target block.

[0116] Based on the above embodiments, the information related to the target test case and the target test data involved in the target data test can be accurately and reliably recorded and stored in the blockchain by creating the target block and connecting it into the blockchain, for subsequent use.

[0117] In some embodiments, in specific implementation, the server node can initiate a detection request about the target data test to the smart contract, so as to call the smart contract to perform stability detection on the target test case and the target test data.

[0118] In some embodiments, referring to FIG. 8, the smart contract performs stability detection on the target test case and the target test data according to the target block in response to the detection request, and determines whether the target test case and the target test data meet a preset second requirement, which in specific implementation can include the following contents: Figure 4 S1: The smart contract determines a target system related to the target test case according to a system field of the target test data.

[0119] S2: The smart contract queries the blockchain to determine whether there is a test case other than the target test case related to the target system.

[0120] S3: In a case that there is a test case other than the target test case related to the target system, the smart contract queries the blockchain to determine whether the target test data is used in an execution process of the test case other than the target test case.

[0121] S4: In a case that the target test data is used in the execution process of the test case other than the target test case, the smart contract determines whether there is data update of the target test data in the execution process of the test case other than the target test case according to an operation type field of the target test data in the test case other than the target test case.

[0122] S4: In a case that the target test data is used in the execution process of the test case other than the target test case, the smart contract determines whether there is data update of the target test data in the execution process of the test case other than the target test case according to an operation type field of the target test data in the test case other than the target test case.

[0123] S5: In a case where it is determined that there is data update for the target test data in the execution process of the other test cases using the target test data, it is determined that the target test case and the target test data do not meet the preset second requirement.

[0124] Based on the above embodiments, the target test case and other existing test cases based on the same business system can be automatically detected and determined whether they will affect each other in execution, and then it is determined whether the target test case and the target test data meet the preset second requirement.

[0125] In specific implementation, the feature field of the test data in the block body in each block contained in the blockchain and the hash value of the test case in the block header can be queried to determine whether there are other test cases related to the target system except the target test case. In a case where it is determined that there are other test cases related to the target system except the target test case, the hash value of the test data in the block header of the block containing the other test cases related to the target system except the target test case can be queried to determine whether the target test data is used in the execution process of the other test cases. In a case where it is determined that there is data update for the target test data in the execution process of the other test cases using the target test data, it is determined that the execution of the target test case will affect the execution of the other test cases, and then it is determined that the target test case and the target test data do not meet the preset second requirement.

[0126] In some embodiments, referring to Figure 5 In a case where it is determined that there are no other test cases related to the target system except the target test case, or there is no target test data used in the execution process of the other test cases, or there is no data update for the target test data in the execution process of the other test cases using the target test data, the method can further include the following content in specific implementation.

[0127] S1: determining a target associated case having blood relationship with the target test case from the existing test cases of the blockchain;

[0128] S2: according to the blockchain, calling the corresponding test terminal node to execute the target associated case and the target test case respectively by using the corresponding test data to obtain the corresponding execution results;

[0129] S3: determining whether the target test case and the target test data meet the preset second requirement according to the execution results.

[0130] The target associated case having a blood relationship with the target test case can be understood as a test case that is relatively close to the target test case or even the same as the target test case, and has a greater probability of mutual influence with the execution of the target test case.

[0131] Based on the above embodiments, the target test case and other existing test cases based on different business systems can be automatically detected and determined whether they will affect each other during execution under the premise of considering other existing test cases of the platform, and then it is determined whether the target test case and the target test data meet the preset second requirement.

[0132] In some embodiments, when the performance allows, the smart contract can also call multiple test terminal nodes according to multiple blocks of the blockchain to execute the test cases responsible for them in parallel, and determine whether the target test case and the target test data meet the preset second requirement according to the execution result.

[0133] In some embodiments, the target associated case having a blood relationship with the target test case is determined from the existing test cases of the blockchain, and the specific implementation can include the following contents:

[0134] S1: determining the associated system of the target system according to the blockchain;

[0135] S2: determining the existing test cases related to the associated system, and the test data for executing the existing test cases related to the associated system;

[0136] S4: filtering the target associated case having a blood relationship with the target test case from the existing test cases related to the associated system according to the test data for executing the existing test cases related to the associated system.

[0137] Based on the above embodiments, the target associated case having a blood relationship with the target test case can be accurately and efficiently found out by using the blockchain.

[0138] In some embodiments, referring to Figure 6 As shown in the figure, the associated system of the target system can be determined according to the blockchain, and the specific implementation can include the following contents:

[0139] S1: obtaining the database table of the target system and the database table of other systems except the target system;

[0140] S2: calculating the field similarity between the fields contained in the database table of the target system and the fields contained in the database table of other systems;

[0141] S3: calculating a data duplication rate between the business data contained in the database table of the target system and the business data contained in the database table of the other system;

[0142] S4: determining a correlation degree between the target system and the other system according to the field similarity and the data duplication rate;

[0143] S5: screening the system with a correlation degree greater than a preset correlation degree threshold from the other system as a correlation system of the target system.

[0144] Based on the above embodiment, the correlation system with a higher correlation degree with the target system can be accurately and efficiently determined.

[0145] Before the specific implementation, according to the corresponding protocol rules, the system characteristics of each business system, the data characteristics of the processed business data, and the processing characteristics during the business user processing, the database table corresponding to each business system can be set. Among them, the database table is publicly disclosed. Specifically, the above database table can be stored in the block chain to facilitate the query of other nodes.

[0146] In some embodiments, the above calculation of the field similarity between the fields contained in the database table of the target system and the fields contained in the database table of the other system can include the following content during the specific implementation: according to the definition of the table structure of the corresponding database table, a plurality of corresponding fields in the database table of the target system and the database table of the other system are scanned; the similarity between the fields in the plurality of corresponding fields is calculated respectively to obtain the similarity of the plurality of corresponding fields; and the field similarity between the fields contained in the database table of the target system and the fields contained in the database table of the other system is determined according to the similarity of the plurality of corresponding fields.

[0147] When the similarity between the fields in the corresponding fields is specifically calculated, the Levenshtein distance can be used to calculate the edit distance between the field names of each corresponding field to obtain the similarity between the fields in the corresponding fields.

[0148] Among them, the above Levenshtein distance is to describe the minimum number of operations required to convert one string X into another string Y, wherein the allowed operation types include insertion, deletion, and replacement.

[0149] Specifically, for example, the current corresponding field is a string X with a character length of M and a string Y with a character length of N. Specifically, the Levenshtein distance can be calculated according to the recursive algorithm to obtain the similarity between the fields in the current corresponding field in the following manner.

[0150] First, initialization is performed according to the following formula: D(i, 0) = i, D(i, 0) = j, where D represents the edit distance.

[0151] Then, recursive calculation is performed according to the following formula: for the case of adding or deleting a character, the edit distance + 1; for the case of replacing a character, the edit distance + 2:

[0152] For each i = 1, 2,...., M

[0153] For each j = 1, 2,...., N

[0154]

[0155] Next, the recursive calculation is terminated to obtain D(M, N) as the edit distance between the string X and the string Y.

[0156] Finally, the similarity between the string X and the string Y can be obtained by calculating the Levenshtein ratio according to the following formula:

[0157] Specifically, for example, based on the above method, the similarity between the field IDCODE (ID number) in the database table (card information table) of the bank card system and the field IDCODE in the database table (detail table) of the personal remittance system can be calculated as 100%.

[0158] In some embodiments, the above calculation of the data duplication rate between the business data contained in the database table of the target system and the business data contained in the database table of the other system can include the following contents: respectively, the minimum value of the data amount of the business data of a plurality of corresponding fields in the database table of the target system and the database table of the other system, and the data amount of the business data of the plurality of corresponding fields with the same data value; filtering out the data amount of the business data of the special field (for example, the Boolean (only TRUE / FALSE value) field or the data dictionary type (such as 0 / 1 / 2) field) from the business data with the same data value of the plurality of corresponding fields to obtain the filtered data amount; and then calculating the ratio of the filtered data amount to the minimum value of the data amount of the business data of the plurality of corresponding fields to obtain the corresponding data duplication rate.

[0159] Specifically, for example, based on the above manner, the data amount of the business data of the field IDCODE in the database table (card information table) of the bank card system can be counted as 1000, the data amount of the business data of the field IDCODE in the database table (detail table) of the remittance system can be counted as 100, and then the minimum value of the data amount can be determined as min(1000, 100) = 100. The data amount of the repeated business data of the business data of the field IDCODE in the database table (card information table) of the bank card system and the business data of the field IDCODE in the database table (detail table) of the remittance system can be counted as 80. Since the special field business data exists in the repeated business data, the repetition rate can be directly calculated as 80%.

[0160] In some embodiments, the higher the text similarity of the fields in the database tables of the two systems, the greater the repetition rate of the business data of the fields, and the higher the correlation degree of the two systems.

[0161] In specific implementation, the correlation degree between the target system and other systems can be determined by weighted operation according to the field similarity and the data repetition rate.

[0162] In specific implementation, the correlation degree between the target system and other systems can be calculated according to the following formula: G = q1*S1 + q2*S2.

[0163] Wherein, G represents the correlation degree between the target system and other systems, S1 represents the field similarity, S2 represents the data repetition rate, q1 represents the first weight coefficient, which can be set to 0.3 for example, and q2 represents the second weight coefficient, which can be set to 0.7 for example. In specific implementation, the first weight coefficient and the second weight coefficient can be flexibly set according to specific circumstances and processing requirements.

[0164] In some embodiments, in specific implementation, the systems with a correlation degree greater than a preset correlation degree threshold value can be selected from other systems as the correlation systems of the target system. The preset correlation degree threshold value can be obtained by learning and sorting a large amount of sample data in advance. Thus, the systems possibly related to the target correlation case can be quickly and accurately found from a large number of systems, so as to reduce the scope of the target correlation case in the blockchain.

[0165] In some embodiments, the method of filtering out the target association case having the blood relationship with the target test case from the existing test cases related to the association system according to the test data of the existing test case related to the association system can include the following: detecting whether the test data of the existing test case related to the association system is the same as the target test data, and determining the existing test case related to the association system as the target association case having the blood relationship with the target test case when the test data of the existing test case related to the association system is the same as the target test data.

[0166] Based on the above embodiments, the target association case having the blood relationship with the target test case can be found from the blockchain based on the association system, which can have a high probability of mutual influence with the execution of the target test case. Then, only the test terminal node related to the target association case needs to be called to execute the target association case when the target test case is executed, without calling all test terminal nodes to execute all existing test cases. Thus, the data processing amount can be effectively reduced, and the overall processing efficiency can be improved.

[0167] In some embodiments, when it is determined that the test data of the existing test case related to the association system is not the same as the target test data, the method can further include the following:

[0168] S1: obtaining a feature field of the test data of the existing test case related to the association system;

[0169] S2: filtering out the test case without data update for the test data according to the feature field (for example, the operation type field) of the test data of the existing test case related to the association system, to obtain filtered test cases;

[0170] S3: calculating a field matching degree between the feature field of the test data of the filtered test cases and the feature field of the target test data;

[0171] S4: filtering out the target association case having the blood relationship with the target test case from the filtered test cases according to the field matching degree.

[0172] Based on the above embodiments, the test case that will not cause changes to the test data can be filtered out first to obtain filtered test cases, and then the target association case having the blood relationship with the target test case that needs to be synchronously tested with the target test case can be further filtered out from the filtered test cases. Thus, the data processing amount can be further reduced, and the overall processing efficiency can be further improved.

[0173] In some embodiments, the target test credential can be generated according to the block identifier of the target block, the node identifier of the server node, and the private key held by the server node. According to the corresponding protocol rules, the test terminal node needs to use the above target test credential to successfully pass the target data test using the target test case and the target test data through the blockchain.

[0174] In some embodiments, after determining whether the target test case and the target test data meet the preset second requirement, the method can further include the following content when implemented:

[0175] S1: The smart contract initiates a consensus request for the target data test in the alliance chain.

[0176] S2: Receive and determine whether the target data test is consensus passed according to the feedback data of each node in the alliance chain for the consensus request.

[0177] In some embodiments, before initiating the detection request for the target data test to the smart contract, the method can further include the following content when implemented: querying the block in the blockchain according to the hash value of the target test case and the hash value of the target test data to determine whether there is a duplicate block; setting the target block as an invalid block in the case of determining that there is a duplicate block; and feeding back the block hash value of the duplicate block to the test terminal node; wherein the test terminal node uses the duplicate block to perform the target data test according to the block hash value of the duplicate block.

[0178] In some embodiments, the smart contract generates a target error information in the case of determining that the target test case and the target test data do not meet the preset second requirement, and / or the target data test is not consensus passed; and sends the target error information to the server node.

[0179] Correspondingly, the server node receives and sets the target block as an invalid block according to the target error information; generates a second type of error prompt; and sends the second type of error prompt to the test terminal node.

[0180] As can be seen from the above, based on the data testing method based on the blockchain provided by the embodiments of the present specification, after the server node receives the target data testing request initiated by the test terminal node and carrying at least the target test data and the target test case, the server node can first perform the feasibility detection to determine whether it meets the preset first requirement; in the case of determining that it meets the preset first requirement, the corresponding target block is created and connected into the blockchain; then the detection request about the target data testing is initiated to the smart contract; the smart contract performs the stability detection according to the target block in the blockchain to determine whether it meets the preset second requirement; in the case of determining that it meets the preset second requirement and the consensus passes, the smart contract generates and feeds back the target confirmation information; the server node sends the corresponding target test voucher to the test terminal node according to the target confirmation information. Then the test terminal node can perform the target data testing based on the target block by using the target test case and the target test data according to the target test voucher. Thus the characteristics of the blockchain can be fully utilized to effectively simplify the detection and judgment process, accurately and efficiently automatically judge whether the target data testing of executing the target test case by using the target test data meets the relevant requirements, avoid the influence of the test terminal node on other existing test cases of the platform when performing the newly added target data testing, and also avoid the influence of the newly added target data testing on the execution of other existing test cases of the platform, thereby protecting the stability and reliability of the data testing of the data processing platform as a whole.

[0181] Referring to Figure 7 The embodiments of the present specification also provide a specific server, as shown in the figure, wherein the server comprises a network communication port 701, a processor 702 and a memory 703, and the above structures are connected by internal cables so that each structure can perform specific data interaction.

[0182] The network communication port 701 can be specifically used for receiving the target data testing request initiated by the test terminal node; wherein the target data testing request carries at least the target test data and the target test case.

[0183] The processor 702 can be specifically configured to respond to a target data test request, detect feasibility of a target test case and target test data, determine whether the target test case and target test data meet preset first requirements, create a target block according to the target test case and target test data in a case where it is determined that the target test case and target test data meet the preset first requirements, and connect the target block into a block chain, initiate a detection request about target data test to a smart contract, wherein the smart contract responds to the detection request, detects stability of the target test case and target test data according to the target block, determines whether the target test case and target test data meet preset second requirements, generates corresponding target confirmation information in a case where it is determined that the target test case and target test data meet the preset second requirements and a consensus about the target data test is passed, receives and transmits target test credentials for the target data test to a test terminal node according to the target confirmation information, and wherein the test terminal node performs target data test by using the target test case and target test data through the target block according to the target test credentials.

[0184] The memory 703 can be specifically configured to store corresponding instruction programs.

[0185] In this embodiment, the network communication port 701 can be a virtual port that is bound with different communication protocols, so as to transmit or receive different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for mail data communication. In addition, the network communication port can also be an entity communication interface or a communication chip. For example, it can be a wireless mobile network communication chip such as GSM, CDMA, etc.; it can also be a Wifi chip; and it can also be a Bluetooth chip.

[0186] In this embodiment, the processor 702 can be implemented in any appropriate manner. For example, the processor can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The present specification is not limited in this regard.

[0187] In the embodiment, the memory 703 can include multiple levels, and can be any memory that can store binary data in a digital system; in an integrated circuit, a circuit without a physical form that has a storage function is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, a TF card, etc.

[0188] The embodiment of the present specification also provides a computer storage medium based on the above-mentioned blockchain-based data testing method, which stores computer program instructions. When the computer program instructions are executed, the following functions are realized: receiving a target data testing request initiated by a test terminal node; wherein the target data testing request carries at least target test data and a target test case; in response to the target data testing request, performing a feasibility detection on the target test case and the target test data to determine whether the target test case and the target test data meet a preset first requirement; in a case where it is determined that the target test case and the target test data meet the preset first requirement, creating a target block according to the target test case and the target test data; and connecting the target block into a blockchain; initiating a detection request about the target data testing to a smart contract; wherein the smart contract responds to the detection request, performs a stability detection on the target test case and the target test data according to the target block to determine whether the target test case and the target test data meet a preset second requirement; in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus about the target data testing is passed, the smart contract generates corresponding target confirmation information; receiving and sending, according to the target confirmation information, a target test credential for the target data testing to the test terminal node; wherein the test terminal node performs the target data testing by using the target test case and the target test data through the target block according to the target test credential.

[0189] In the embodiment, the storage medium includes but is not limited to a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk drive (HDD) or a memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface set according to a standard specified by a communication protocol, and is used for network connection communication.

[0190] In the embodiment, the program instructions stored in the computer storage medium specifically realize functions and effects, which can be explained by comparing with other embodiments, and will not be described here.

[0191] Reference is made to Figure 8As shown, at the software level, the embodiments of the present specification also provide a kind of data testing device based on block chain, which can specifically include the following structure module:

[0192] The receiving module 801 can be specifically used for receiving the target data test request initiated by the test terminal node;Wherein, the target data test request carries at least target test data, target test case;

[0193] The first detection module 802 can be specifically used for responding to the target data test request, and the feasibility of target test case and target test data is detected, to determine whether the target test case and target test data meet the preset first requirement;

[0194] The creation module 803 can be specifically used for determining that the target test case and target test data meet the preset first requirement, and creating a target block according to the target test case and target test data;And connect the target block into block chain;

[0195] The second detection module 804 can be specifically used for initiating a detection request about target data test to smart contract;Wherein, the smart contract responds to the detection request, and the stability of target test case and target test data is detected according to target block, to determine whether the target test case and target test data meet the preset second requirement;In the case where the target test case and target test data meet the preset second requirement, and the consensus about target data test is passed, the smart contract generates corresponding target confirmation information;

[0196] The sending module 805 can be specifically used for receiving and sending target test credentials for target data test to test terminal node according to target confirmation information;Wherein, the test terminal node uses target test case and target test data to carry out target data test through target block according to the target test credentials.

[0197] In some embodiments, the first detection module 802 can be specifically implemented to detect the feasibility of target test case and target test data, to determine whether the target test case and target test data meet the preset first requirement, in the following way: running target test case according to target test data;Wherein, the target test data also carries the feature field of target test data, and the target test case also carries the feature field of target test case;Detect whether target test case is successfully run;In the case where it is determined that target test case is successfully run, obtain target running result;According to the feature field of target test data, the feature field of target test case, detect whether target running result meets the expected requirement;In the case where it is determined that target running result meets the expected requirement, it is determined that the target test case and target test data meet the preset first requirement.

[0198] In some embodiments, the characteristic field of the target test data can specifically include at least one of the following: a system field, a data attribute field, an operation type field, etc.; and the characteristic field of the target test case can specifically include at least one of the following: a service field, a business field, an input field, an output field, etc.

[0199] In some embodiments, before running the target test case according to the target test data, the first detection module 802 can also be specifically implemented to detect, according to a preset data generation rule, whether the target test case and the target test data conform to a data generation specification.

[0200] In some embodiments, after detecting the feasibility of the target test case and the target test data, and determining whether the target test case and the target test data conform to the preset first requirement, the apparatus can also be specifically implemented to, in a case where it is determined that the target test case and the target test data do not conform to the preset first requirement, generate a first type of error prompt; wherein the first type of error prompt carries a modification suggestion for the target test case and / or the target test data; and send the first type of error prompt to the test terminal node.

[0201] In some embodiments, the target block can at least include a block header and a block body; wherein the block body is used to store the target test case and the target test data; and the block header is used to store a node identifier of the test terminal node, a case identifier of the target test case, a data identifier of the target test data, a timestamp, a hash value of a previous block, a hash value of the target test case, a hash value of the target test data, and a hash value of the target block, etc.

[0202] In some embodiments, based on the second detection module 804, the smart contract responds to the detection request, and performs stability detection on the target test case and the target test data according to the target block, to determine whether the target test case and the target test data meet the preset second requirement, which can include: the smart contract determines the target system related to the target test case according to the system field of the target test data; queries the block chain to determine whether there are other test cases related to the target system and other than the target test case; in the case where it is determined that there are other test cases related to the target system and other than the target test case, the block chain is queried to determine whether the target test data is used in the execution process of the other test cases; in the case where it is determined that the target test data is used in the execution process of the other test cases, it is determined according to the operation type field of the target test data in the other test cases whether there is data update of the target test data in the execution process of the other test cases using the target test data; in the case where it is determined that there is data update of the target test data in the execution process of the other test cases using the target test data, it is determined that the target test case and the target test data do not meet the preset second requirement.

[0203] In some embodiments, in the case where it is determined that there are no other test cases related to the target system and other than the target test case, or there is no target test data used in the execution process of the other test cases, or there is no data update of the target test data in the execution process of the other test cases using the target test data, the device can also be used to determine the target associated case having blood relationship with the target test case from the existing test cases of the block chain when it is implemented; according to the block chain, the corresponding test terminal node is called to execute the target associated case and the target test case respectively by using the corresponding test data, to obtain the corresponding execution result; and according to the execution result, it is determined whether the target test case and the target test data meet the preset second requirement.

[0204] In some embodiments, the device can determine the target associated case having blood relationship with the target test case from the existing test cases of the block chain in the following manner: according to the block chain, the associated system of the target system is determined; the existing test cases related to the associated system are determined, and the test data for executing the existing test cases related to the associated system is determined; and the target associated case having blood relationship with the target test case is screened from the existing test cases related to the associated system according to the test data for executing the existing test cases related to the associated system.

[0205] In some embodiments, when the apparatus is specifically implemented, the related system of the target system can be determined according to the blockchain in the following manner: a database table of the target system and database tables of other systems except the target system are obtained; a field similarity between fields contained in the database table of the target system and fields contained in the database tables of the other systems is calculated; a data repetition rate between business data contained in the database table of the target system and business data contained in the database tables of the other systems is calculated; a correlation degree between the target system and the other systems is determined according to the field similarity and the data repetition rate; and systems with a correlation degree greater than a preset correlation degree threshold are filtered from the other systems as the related systems of the target system.

[0206] In some embodiments, when the apparatus is specifically implemented, the target related case with blood relationship with the target test case can be filtered from the existing test cases related to the related system in the following manner according to the test data of the existing test cases related to the related system: it is detected whether the test data of the existing test cases related to the related system is same as the target test data, and in a case where it is determined that the test data of the existing test cases related to the related system is same as the target test data, the existing test case related to the related system is determined as the target related case with blood relationship with the target test case.

[0207] In some embodiments, in a case where it is determined that the test data of the existing test cases related to the related system is not same as the target test data, when the apparatus is specifically implemented, the apparatus can be further used for: obtaining a characteristic field of the test data of the existing test cases related to the related system; filtering out test cases without data update for the test data according to the characteristic field of the test data of the existing test cases related to the related system to obtain filtered test cases; calculating a field matching degree between the characteristic field of the test data of the filtered test cases and the characteristic field of the target test data; and filtering out the target related case with blood relationship with the target test case from the filtered test cases according to the field matching degree.

[0208] It should be noted that the units, devices or modules and the like illustrated in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described as various modules with functions. Of course, in the implementation of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the modules implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The above described device embodiments are only illustrative, for example, the division of the units is only a logical function division, and in actual implementation, there can be another division method, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the units or devices shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0209] As can be seen from the above, the data testing device based on the blockchain provided by the embodiments of the present specification can make full use of the characteristics of the blockchain, effectively simplify the detection and judgment process, accurately and efficiently automatically judge whether the target data test using the target test data to execute the target test case meets the relevant requirements, avoid the influence of the test terminal node on other existing test cases of the platform when performing the newly added target data test, and also avoid the influence of the newly added target data test on the execution of other existing test cases of the platform, thereby protecting the stability and reliability of the overall data test of the data processing platform.

[0210] Although the present specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps can be included based on conventional or non-inventive means. The order of steps listed in the embodiments is only one of the many execution orders of the steps, and does not represent the only execution order. In actual device or client product execution, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, parallel processor or multi-threaded processing environment, or even distributed data processing environment). The terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, product or equipment. Without more limitations, it does not exclude the presence of other same or equivalent elements in the process, method, product or equipment including the elements. The terms "first", "second" and the like are used to represent names, and do not represent any particular order.

[0211] The various embodiments described in this specification are implemented, at least in part, over one or more computer systems. Such computer systems can be networked and / or include components such as servers, one or more processors, non-transitory computer-readable storage media, memory, input devices, output devices, and / or storage devices. The various embodiments in this specification are described in terms of sequences of actions to be performed by, and interaction with, various components. It will be apparent that sequences of actions to be taken can be performed by computer systems with stored functions and / or instructions, and that objects of various components can be represented by various phrases, terms, and / or data structures as would be understood by one of ordinary skill in the art. Embodiments described in this specification can be implemented in a computing system that includes a back-end component, or component, such as a data server, or that includes a middleware component, or component, such as an application server, or that includes a front-end component, or component, such as a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of this specification, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can generically be

[0212] Although this specification describes particular embodiments, those of ordinary skill in the art will appreciate that changes can be made to the embodiments described without departing from the broad disclosure and without departing from the spirit of the present specification. Accordingly, the present specification is intended to embrace all such changes and modifications in the scope and spirit of the description.

Claims

1. A blockchain-based data testing method, characterized in that, Applied to a server node, the method comprises: receiving a target data test request initiated by a test terminal node; wherein the target data test request carries at least target test data and a target test case; in response to the target data test request, performing a feasibility detection on the target test case and the target test data to determine whether the target test case and the target test data meet a preset first requirement; in a case where it is determined that the target test case and the target test data meet the preset first requirement, creating a target block according to the target test case and the target test data, and connecting the target block into a blockchain; initiating a detection request on the target data test to a smart contract; wherein the smart contract, in response to the detection request, performs a stability detection on the target test case and the target test data according to the target block to determine whether the target test case and the target test data meet a preset second requirement; in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus on the target data test is passed, the smart contract generates corresponding target confirmation information; receiving and sending, according to the target confirmation information, a target test credential for the target data test to the test terminal node; wherein the test terminal node performs the target data test by using the target test case and the target test data through the target block according to the target test credential; wherein the smart contract, in response to the detection request, performs the stability detection on the target test case and the target test data according to the target block to determine whether the target test case and the target test data meet the preset second requirement, comprises: the smart contract determines a target system related to the target test case according to a system field of the target test data; querying the blockchain to determine whether there is a test case other than the target test case related to the target system; in a case where it is determined that there is a test case other than the target test case related to the target system, querying the blockchain to determine whether the target test data is used in an execution process of the test case other than the target test case; in a case where it is determined that the target test data is used in the execution process of the test case other than the target test case, determining, according to an operation type field of the target test data in the test case other than the target test case, whether there is a data update on the target test data in the execution process of the test case other than the target test case; in a case where it is determined that there is the data update on the target test data in the execution process of the test case other than the target test case, determining that the target test case and the target test data do not meet the preset second requirement.

2. The method of claim 1, wherein, the feasibility detection on the target test case and the target test data to determine whether the target test case and the target test data meet the preset first requirement, comprises: running the target test case according to the target test data; wherein the target test data further carries a characteristic field of the target test data, and the target test case further carries a characteristic field of the target test case; detecting whether the target test case is run successfully; in a case where it is determined that the target test case is run successfully, obtaining a target running result; According to a characteristic field of the target test data and a characteristic field of the target test case, it is detected whether the target running result meets an expected requirement; In a case where it is determined that the target running result meets the expected requirement, it is determined that the target test case and the target test data meet a preset first requirement.

3. The method of claim 2, wherein, The characteristic field of the target test data includes at least one of a system field, a data attribute field and an operation type field. The characteristic field of the target test case includes at least one of a service field, a business field, an input field and an output field.

4. The method of claim 2, wherein, Before the target test case is run according to the target test data, the method further includes: According to a preset data generation rule, it is detected whether the target test case and the target test data meet a data generation specification.

5. The method of claim 2, wherein, After the feasibility of the target test case and the target test data is detected and it is determined whether the target test case and the target test data meet the preset first requirement, the method further includes: In a case where it is determined that the target test case and the target test data do not meet the preset first requirement, a first type of error prompt is generated; wherein the first type of error prompt carries a modification suggestion for the target test case and / or the target test data; The first type of error prompt is sent to a test terminal node.

6. The method of claim 3, wherein, The target block at least includes a block header and a block body; wherein the block body is used to store the target test case and the target test data; and the block header is used to store a node identifier of the test terminal node, a case identifier of the target test case, a data identifier of the target test data, a timestamp, a hash value of a previous block, a hash value of the target test case, a hash value of the target test data and a hash value of the target block.

7. The method of claim 1, wherein, In a case where it is determined that there is no test case other than the target test case related to the target system, or there is no target test data used in an execution process of the other test case, or there is no data update of the target test data in the execution process of the other test case, the method further includes: From existing test cases of the block chain, a target associated case having a blood relationship with the target test case is determined; According to the block chain, corresponding test terminal nodes are called to execute the target associated case and the target test case respectively by using corresponding test data, to obtain corresponding execution results; According to the execution results, it is determined whether the target test case and the target test data meet a preset second requirement.

8. The method of claim 7, wherein, From existing test cases of the block chain, a target associated case having a blood relationship with the target test case is determined, including: According to the block chain, an associated system of the target system is determined; Existing test cases related to the associated system are determined, and test data for executing the existing test cases related to the associated system is determined; From the existing test cases related to the associated system, a target associated case having a blood relationship with the target test case is screened according to the test data for executing the existing test cases related to the associated system.

9. The method of claim 8, wherein, According to the block chain, an associated system of the target system is determined, including: A database table of the target system and database tables of other systems except the target system are obtained; calculating field similarity between fields contained in a database table of a target system and fields contained in database tables of other systems; calculating data duplication rate between business data contained in the database table of the target system and business data contained in the database tables of the other systems; determining correlation degree between the target system and the other systems according to the field similarity and the data duplication rate; selecting, from the other systems, a system with a correlation degree greater than a preset correlation degree threshold as a correlation system of the target system.

10. The method of claim 8, wherein, selecting, from existing test cases related to the correlation system, a target correlation case having a blood relationship with the target test case according to test data of the existing test cases related to the correlation system, including: determining whether test data of the existing test cases related to the correlation system is same as the target test data, and in a case where it is determined that the test data of the existing test cases related to the correlation system is same as the target test data, determining that the existing test case related to the correlation system has the blood relationship with the target test case.

11. The method of claim 10, wherein, in a case where it is determined that the test data of the existing test cases related to the correlation system is not same as the target test data, the method further includes: obtaining a characteristic field of the test data of the existing test case related to the correlation system; filtering out a test case without data update for the test data according to the characteristic field of the test data of the existing test case related to the correlation system to obtain a filtered test case; calculating field matching degree between the characteristic field of the test data of the filtered test case and the characteristic field of the target test data; selecting, from the filtered test case, a target correlation case having the blood relationship with the target test case according to the field matching degree. 12.A blockchain-based data testing device, characterized in that, The device is applied to a server node and includes: a receiving module configured to receive a target data test request initiated by a test terminal node, wherein the target data test request carries at least target test data and a target test case; a first detection module configured to perform feasibility detection on the target test case and the target test data in response to the target data test request to determine whether the target test case and the target test data meet a preset first requirement; a creating module configured to create a target block according to the target test case and the target test data in a case where it is determined that the target test case and the target test data meet the preset first requirement, and connect the target block to a blockchain; a second detection module configured to initiate a detection request on the target data test to a smart contract, wherein the smart contract performs stability detection on the target test case and the target test data according to the target block in response to the detection request to determine whether the target test case and the target test data meet a preset second requirement, and generates corresponding target confirmation information in a case where it is determined that the target test case and the target test data meet the preset second requirement and a consensus on the target data test is passed. The sending module is configured to receive the target confirmation information and send target test credentials for the target data test to a test terminal node according to the target confirmation information; and the test terminal node performs the target data test on the target test case and the target test data through the target block according to the target test credentials. The smart contract performs stability detection on the target test case and the target test data according to the target block in response to the detection request, and determines whether the target test case and the target test data meet the preset second requirement, including: The smart contract determines a target system related to the target test case according to a system field of the target test data; The smart contract queries a blockchain to determine whether there is a test case other than the target test case related to the target system; In a case where it is determined that there is a test case other than the target test case related to the target system, the smart contract queries the blockchain to determine whether the target test data is used in an execution process of the test case other than the target test case; In a case where it is determined that the target test data is used in the execution process of the test case other than the target test case, the smart contract determines whether there is data update of the target test data in the execution process of the test case other than the target test case according to an operation type field of the target test data in the test case other than the target test case; In a case where it is determined that there is data update of the target test data in the execution process of the test case other than the target test case, the smart contract determines that the target test case and the target test data do not meet the preset second requirement.

13. A server, characterized by A processor and a memory for storing processor-executable instructions, wherein the processor executes the instructions to implement the steps of the method of any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, A computer program product having stored thereon computer instructions, wherein the instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 11.

Citation Information

Patent Citations

  • Block chain network service platform, test case sharing method thereof and storage medium

    CN111737104A

  • Test case processing method and device based on block chain

    CN113342694A