Method, device, electronic device and storage medium for testing blockchain storage cluster

By maintaining the external test interface and the native test interface of the blockchain storage cluster on the test node, the blockchain storage cluster is directly tested, which solves the problem of single testing angle and insufficient convenience in the existing technology, and realizes sufficient and convenient testing of the blockchain storage cluster.

CN115098384BActive Publication Date: 2025-02-28ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210758984.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-02-28
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

When testing blockchain storage clusters, the existing technology has a single test angle and cannot be fully tested. It also requires the deployment of a complete blockchain platform testing environment, which lacks convenience.

Method used

By maintaining the external test interface and the native test interface of the blockchain storage cluster on the test node, the testing of the blockchain storage cluster is directly implemented, avoiding the method of simulating the blockchain transaction execution process and reducing the dependence on the complete blockchain platform test environment.

Benefits of technology

It realizes sufficient testing of blockchain storage clusters, has high test targeting and freedom, and does not need to deploy a complete blockchain platform testing environment, improving the convenience of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098384B_ABST
    Figure CN115098384B_ABST
Patent Text Reader

Abstract

The present specification provides a method, device, electronic device and storage medium for testing a blockchain storage cluster, wherein the method is applied to a test node connected to the blockchain storage cluster, the test node maintains an external test interface, and the blockchain storage cluster maintains a native test interface; the method includes: receiving a test request sent by a test party to the external test interface, and determining a test task corresponding to the test request; sending a call request corresponding to the test task to the blockchain storage cluster through the native test interface; receiving a call response generated by the blockchain storage cluster executing the call request from the native test interface, and generating a test result corresponding to the test task based on the execution status of the call request contained in the call response; and returning the test response containing the test result to the test party through the external test interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification belong to the field of blockchain technology, and in particular, relate to a method, device, electronic device, and storage medium for testing a blockchain storage cluster. Background Art

[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to chronological order, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography.

[0003] In blockchain technology, the blockchain storage cluster is an important component of the underlying blockchain technology platform. It is responsible for persistent storage of blockchain data such as blocks, transactions, status, historical read-write sets, etc., and provides query functions for the above data. At present, the test scheme related to the blockchain storage cluster is based on on-chain transactions, and the relevant functions of the blockchain storage cluster are tested by executing the complete on-chain transaction process, consensus process, and block synchronization process. However, although such a test scheme can complete the verification of some functions of the blockchain storage cluster, the test angle is based on the overall system of the chain. The calling method of the blockchain storage cluster involved in the test process is relatively simple, and the blockchain storage cluster cannot be fully tested, so the test lacks pertinence. In addition, since the traditional test scheme is essentially a simulation of the entire process of executing on-chain transactions, it is necessary to deploy a complete blockchain platform test environment, so the test lacks convenience. Summary of the invention

[0004] The object of the present invention is to provide a method, device, electronic device and storage medium for testing a blockchain storage cluster.

[0005] According to a first aspect of one or more embodiments of this specification, a method for testing a blockchain storage cluster is proposed, which is applied to a test node connected to the blockchain storage cluster, the test node maintains an external test interface, and the blockchain storage cluster maintains a native test interface; the method includes:

[0006] Receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request;

[0007] Sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface;

[0008] Receiving, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generating a test result corresponding to the test task based on the execution status of the call request contained in the call response;

[0009] A test response including the test result is returned to the test party through the external test interface.

[0010] According to a second aspect of one or more embodiments of this specification, a device for testing a blockchain storage cluster is proposed, which is applied to a test node connected to the blockchain storage cluster, the test node maintains an external test interface, and the blockchain storage cluster maintains a native test interface; the device includes:

[0011] A test request receiving unit, used to receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request;

[0012] A call request sending unit, used to send the call request corresponding to the test task to the blockchain storage cluster through the native test interface;

[0013] A test result generating unit, configured to receive, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generate a test result corresponding to the test task based on the execution status of the call request contained in the call response;

[0014] The test response returning unit returns the test response including the test result to the test party through the external test interface.

[0015] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0016] processor;

[0017] a memory for storing processor-executable instructions;

[0018] The processor implements the method as described in the first aspect by running the executable instructions.

[0019] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0020] The test node in the embodiments of this specification is connected to the test party by maintaining an external test interface, and is connected to the blockchain storage cluster through the native test interface of the blockchain storage cluster, so that the test party can directly implement the test for the blockchain storage cluster through the external test interface maintained by the test node, instead of simulating the blockchain transaction execution process. Therefore, the implementation of the test scheme involved in the embodiments of this specification does not need to rely on the deployment of a complete blockchain platform test environment, and has the convenience of testing; in addition, because the test task is targeted at the blockchain storage cluster and is not a derivative process after the execution of the blockchain transaction, it has a high degree of testing pertinence and freedom, and can achieve full testing of the blockchain storage cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 It is a flowchart of a method for testing a blockchain storage cluster provided by an exemplary embodiment.

[0023] Figure 2 This is a system architecture diagram of a test blockchain storage cluster provided by an exemplary embodiment.

[0024] Figure 3 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0025] Figure 4 It is a block diagram of a device for testing a blockchain storage cluster provided by an exemplary embodiment. DETAILED DESCRIPTION

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

[0027] Figure 1This is a flowchart of a method for testing a blockchain storage cluster provided by an exemplary embodiment. The method is applied to a test node connected to the blockchain storage cluster, the test node maintains an external test interface, and the blockchain storage cluster maintains a native test interface; the method includes:

[0028] S102: Receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request.

[0029] Figure 2 This is a system architecture diagram of a test blockchain storage cluster provided by an exemplary embodiment. Figure 2 As shown, the blockchain storage cluster maintains a native test interface. In the traditional test solution, the blockchain storage cluster is connected to the complete blockchain test platform through the native test interface, while in the embodiment of this specification, the blockchain storage cluster is connected to the lightweight test node through the native test interface. Since the test node does not deploy a complete blockchain platform test environment, but only deploys a storage service test environment for managing the blockchain storage cluster, the storage service test environment only provides the function, performance, and stress testing capabilities for the native test interface, but does not support operations such as transaction consensus, transaction execution, transaction block, and block chaining. Therefore, the test solution involved in the embodiment of this specification has lower requirements for the test environment.

[0030] The blockchain storage cluster involved in the embodiments of this specification includes one or more databases for storing and managing blockchain data, and the blockchain data includes at least block data, state data and / or event data. The above storage management includes performing various database operations on the blockchain data in the database, including reading data, writing data, modifying or updating data, and deleting data. The native test interface involved in the embodiments of this specification may include one or more. When the native test interface includes multiple, each native test interface corresponds to implementing a specific type of database operation.

[0031] The blockchain data involved in the embodiments of this specification include block data, state data, event data and historical read-write sets, etc. Wherein, block data refers to the data in the blockchain account book maintained by each blockchain node in the blockchain network. Since the blockchain account book is a special data structure, it is formed by multiple blocks connected end to end by hash anchoring, and it is tamper-proof. Each block is composed of a block header and a block body. The block header of any block contains the state tree root, transaction number root, receipt tree root, block height and hash value of the corresponding parent block of the block, and the block body contains the transaction data (transaction hash) contained in the block. The block data involved in the embodiments of this specification refers to the data contained in the blockchain account book. The state data and event data involved in the embodiments of this specification are maintained by each smart contract deployed by the blockchain node. The historical read-write set involved in the embodiments of this specification refers to the backup archive of all read-write tasks (such as writing block data) in the past, which is convenient for data rollback or data playback.

[0032] In the embodiments of this specification, the test node can be deployed on the same physical device as the blockchain storage cluster. In this case, the test node can maintain both the external test interface and the native test interface locally to achieve local interface conversion. Figure 2 As shown in the figure, the test node and the blockchain storage cluster are deployed on different physical devices. The two are connected through network communication. The test node needs to call the native test interface of the blockchain storage cluster through remote calling. The test node maintains the interface semantic specifications of the external test interface and the interface semantic specifications of the native test interface. Therefore, the test node can construct requests or responses corresponding to the external test interface or the native test interface according to the correct specifications to realize the interface conversion function.

[0033] In an embodiment of the present specification, the test node is connected to the test party through an external test interface. The test node can be deployed on the same or different physical device as the test party. The test party involved in the embodiment of the present specification can be a series of test tools, such as Jmeter (a Java-based stress testing tool) or LoaderRunner (a load testing tool), or various user parties with a test environment installed. In an embodiment of the present specification, the test request and test response connected to the external test interface conform to the interface semantic specification corresponding to the external test interface. Since the standardized interface semantic specification is unified, this allows various different external test tools to perform test calls based on the interface semantic specification of the external test interface, which can simply and conveniently implement diversified test scenarios, reduce the design complexity of external test cases, and have great compatibility with the expansion of test tools.

[0034] The external test interface involved in the embodiments of this specification may specifically include a RESTful (Representational State Transfer, a design style and development method for network applications) API (Application Programming Interface), which uses JSON (JavaScript Object Notation, JS object notation, a lightweight data exchange format) to implement data transmission between the test node and the test party. Therefore, the test party and the test node implement RESTful HTTP (HyperText Transfer Protocol) interaction through the RESTful API, which can simply and conveniently implement diversified test scenarios.

[0035] After receiving the test request sent by the test party to the external test interface, the test node can parse the test request based on the interface semantic specification corresponding to the external test interface, and determine the test task corresponding to the test request. The test task involved in the embodiment of this specification refers to a complete set of test logic for a blockchain storage cluster on a certain function, which may include: one or more calls (asynchronous calls or synchronous calls) to the blockchain storage cluster and some customized test judgment logic. Finally, the test node will generate a corresponding test result for characterizing whether the test task is successfully tested after executing the test task. The design of the test task has a high degree of freedom, for example, it can include data query reading tasks, data new writing tasks, data update tasks, data migration tasks, data rollback tasks, data playback tasks, etc. In the embodiment of this specification, the test node itself has encapsulated the execution logic of most test tasks, and the test party only needs to reference these test tasks through test requests and execute them, which is equivalent to providing a part of the default test task templates for the test party in advance. The test party can directly call or further design based on these test task templates, so it can save a lot of design work for the test case for the test party, avoid repeated design, and reduce the design complexity of the test case for the test party.

[0036] S104: Sending a call request corresponding to the test task to the blockchain storage cluster through the native test interface.

[0037] In the embodiments of this specification, the call request may include one or more, and the call request includes a data write request, a data read request, a data modification request and / or a data deletion request. That is, the blockchain storage cluster can only provide basic database operation capabilities to the outside through the original test interface, thereby limiting the function of the call request to a data write request for the blockchain storage cluster to write data, a data read request for the blockchain storage cluster to read data, a data modification request for the blockchain storage cluster to modify data, and a data deletion request for the blockchain storage cluster to delete data. The test task maintained by the test node is essentially to integrate the basic database capabilities provided by the above-mentioned blockchain storage cluster and encapsulate it into an overall test logic, and send one or more call requests to the original test interface of the blockchain storage cluster through the predefined test logic, so as to realize various complex test tasks beyond the basic database operation capabilities.

[0038] S106: Receive, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generate a test result corresponding to the test task based on the execution status of the call request contained in the call response.

[0039] Since a call request may include one or more, and the blockchain storage cluster returns a corresponding call response through the native test interface for each call request, the number of call responses may also include one or more, the same as the number of call requests.

[0040] In the embodiments of this specification, any call response includes the execution status of the corresponding call request (used to trigger the generation of the call request of any call response), and the execution status is used to characterize whether the call request is executed successfully, specifically used to characterize whether the corresponding call request is executed successfully.

[0041] In the case where the call request is the data read request, the call response includes the data stored at the storage location indicated by the data read request. In the case where the call request includes a data read request, the blockchain storage cluster will execute the data read request, parse the specific storage address indicated by the data read request from the data read request, and query the blockchain storage cluster for the data corresponding to the specific storage address, and finally read the data and carry it in the call response corresponding to the data read request to return to the test node.

[0042] Optionally, the generating of the test result corresponding to the test task based on the execution status of the call request contained in the call response includes: when the execution status is used to characterize the successful execution of the call request, generating a test result characterizing the successful test of the test task; otherwise, generating a test result characterizing the failure of the test task. If the call request and the call response respectively include multiple call requests, a test result characterizing the successful test of the test task will be generated only when the execution status of the multiple call requests respectively included in the multiple call responses are all used to characterize the successful execution; and a test result characterizing the failure of the test task will be generated only when the execution status of any call request among the execution status of the multiple call requests is used to characterize the failure of the execution.

[0043] S108: Returning the test response including the test result to the test party through the external test interface.

[0044] After the test node generates the test result for the test task, it needs to first convert it according to the interface semantic specification corresponding to the external test interface to obtain a test response containing the test result, and then return the test response as the response corresponding to the test request to the test party through the external test interface. After receiving the test response, the test party can parse the test response and extract the test result from it according to the interface semantic specification corresponding to the external test interface maintained by itself.

[0045] The test node in the embodiments of this specification is connected to the test party by maintaining an external test interface, and is connected to the blockchain storage cluster through the native test interface of the blockchain storage cluster, so that the test party can directly implement the test for the blockchain storage cluster through the external test interface maintained by the test node, instead of simulating the blockchain transaction execution process. Therefore, the implementation of the test scheme involved in the embodiments of this specification does not need to rely on the deployment of a complete blockchain platform test environment, and has the convenience of testing; in addition, because the test task is targeted at the blockchain storage cluster and is not a derivative process after the execution of the blockchain transaction, it has a high degree of testing pertinence and freedom, and can achieve full testing of the blockchain storage cluster.

[0046] Optionally, the test task is a data migration task, the call request includes a first data read request, a first data write request and a first data delete request, and the call response includes a first call response corresponding to the first data read request, a second call response corresponding to the first data write request and a third call response corresponding to the first data delete request;

[0047] The sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface includes:

[0048] Sending a first data read request for causing the blockchain storage cluster to read the first data at the first storage location to the blockchain storage cluster through the native test interface, and upon receiving a first call response containing the first data, generating a first data write request for causing the blockchain storage cluster to write the first data at the second storage location and a first data delete request for causing the blockchain storage cluster to delete the first data at the first storage location;

[0049] Sending a first data write request and a first data delete request to the blockchain storage cluster through the native test interface.

[0050] The embodiment of this specification records a test plan when the test task is a data migration task. Through this test plan, the data migration function of the blockchain storage cluster can be tested.

[0051] Optionally, the test task is a data playback task, the call request includes a second data read request, a second data write request, a second data delete request, a third data write request and a third data read request, and the call response includes a fourth call response corresponding to the second data read request, a fifth call response corresponding to the second data write request, a sixth call response corresponding to the second data delete request, a seventh call response corresponding to the third data write request and an eighth call response corresponding to the third data read request;

[0052] The sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface includes:

[0053] Sending a second data read request for causing the blockchain storage cluster to read the second data at the third storage location to the blockchain storage cluster through the native test interface, and upon receiving a fourth call response containing the second data, sending a second data write request for causing the blockchain storage cluster to write the second data at the fourth storage location and a second data delete request for causing the blockchain storage cluster to delete the second data at the third storage location to the blockchain storage cluster through the native test interface;

[0054] When the execution conditions contained in the received fifth call response and the sixth call response are used to respectively indicate that the second data write request and the second data delete request are executed successfully, a third data write request for causing the blockchain storage cluster to write the second data in the third storage location is sent to the blockchain storage cluster through the native test interface;

[0055] When the execution status included in the received seventh call response is used to indicate that the third data write request is successfully executed, sending a third data read request for causing the blockchain storage cluster to read the third data at the third storage location to the blockchain storage cluster through the native test interface;

[0056] The generating a test result corresponding to the test task based on the execution status contained in the call response includes:

[0057] When the second data is consistent with the third data included in the received eighth call response, a test result is generated to indicate that the data playback task test is successful; otherwise, a test result is generated to indicate that the data playback task test is unsuccessful.

[0058] The embodiment of this specification describes a test scheme when the test task is a data playback task. This scheme can be used to test the data playback capability of the blockchain storage cluster. Since the data playback process includes the data rollback and data comparison processes, this scheme can simultaneously test the data rollback capability of the blockchain storage cluster. In particular, the second data specified in the third data write request to be written in the third storage location is obtained by reading from the fourth storage location (sending an additional data read request for the second data in the third storage location to the blockchain storage cluster through the native test interface). Since the second data written repeatedly may be wrong, the data playback task involved in the embodiment of this specification is actually to test the consistency and correctness of the repeated storage data of the blockchain storage cluster by detecting whether the repeatedly written data has changed compared to the historically written data.

[0059] In the traditional testing scheme for blockchain storage clusters, since it is driven by transaction execution, the test of blockchain storage clusters is only carried out incidentally and lacks specificity. Therefore, it is impossible to perform tests on blockchain storage clusters similar to the above-mentioned data migration tasks or data playback tasks. The embodiments of this specification design the test logic corresponding to the test tasks in the test nodes, integrate the native test interface with the external test interface, and realize the full testing of the blockchain storage cluster without relying on the complete blockchain platform test environment.

[0060] Figure 3 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 3At the hardware level, the device includes a processor 302, an internal bus 303, a network interface 306, a memory 308, and a non-volatile memory 310, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 302 reading the corresponding computer program from the non-volatile memory 310 into the memory 308 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0061] like Figure 4 As shown, Figure 4 This is a block diagram of a device for testing a blockchain storage cluster provided by this specification according to an exemplary embodiment. The device can be applied to Figure 3 In the device shown, the technical solution of this specification is implemented; the device is applied to a test node connected to the blockchain storage cluster, the test node maintains an external test interface, and the blockchain storage cluster maintains a native test interface; the device includes:

[0062] The test request receiving unit 401 is used to receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request.

[0063] The call request sending unit 402 is used to send the call request corresponding to the test task to the blockchain storage cluster through the native test interface.

[0064] The test result generating unit 403 is used to receive, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generate a test result corresponding to the test task based on the execution status of the call request contained in the call response.

[0065] The test response returning unit 404 returns the test response including the test result to the test party through the external test interface.

[0066] Optionally, the execution status is used to indicate whether the call request is executed successfully.

[0067] Optionally, the test result generating unit 403 is specifically used for:

[0068] In the case where the execution status is used to indicate that the call request is executed successfully, a test result is generated to indicate that the test task is tested successfully; otherwise, a test result is generated to indicate that the test task is tested unsuccessfully.

[0069] Optionally, the call request includes a data write request, a data read request, a data modification request and / or a data deletion request.

[0070] Optionally, in the case where the call request is the data read request, the call response includes data stored at the storage location indicated by the data read request.

[0071] Optionally, the test task is a data migration task, the call request includes a first data read request, a first data write request and a first data delete request, and the call response includes a first call response corresponding to the first data read request, a second call response corresponding to the first data write request and a third call response corresponding to the first data delete request;

[0072] The call request sending unit 402 is specifically used for:

[0073] Sending a first data read request for causing the blockchain storage cluster to read the first data at the first storage location to the blockchain storage cluster through the native test interface, and upon receiving a first call response containing the first data, generating a first data write request for causing the blockchain storage cluster to write the first data at the second storage location and a first data delete request for causing the blockchain storage cluster to delete the first data at the first storage location;

[0074] Sending a first data write request and a first data delete request to the blockchain storage cluster through the native test interface.

[0075] Optionally, the test task is a data playback task, the call request includes a second data read request, a second data write request, a second data delete request, a third data write request and a third data read request, and the call response includes a fourth call response corresponding to the second data read request, a fifth call response corresponding to the second data write request, a sixth call response corresponding to the second data delete request, a seventh call response corresponding to the third data write request and an eighth call response corresponding to the third data read request;

[0076] The call request sending unit 402 is specifically used for:

[0077] Sending a second data read request for causing the blockchain storage cluster to read the second data at the third storage location to the blockchain storage cluster through the native test interface, and upon receiving a fourth call response containing the second data, sending a second data write request for causing the blockchain storage cluster to write the second data at the fourth storage location and a second data delete request for causing the blockchain storage cluster to delete the second data at the third storage location to the blockchain storage cluster through the native test interface;

[0078] When the execution conditions contained in the received fifth call response and the sixth call response are used to respectively indicate that the second data write request and the second data delete request are executed successfully, a third data write request for causing the blockchain storage cluster to write the second data in the third storage location is sent to the blockchain storage cluster through the native test interface;

[0079] When the execution status included in the received seventh call response is used to indicate that the third data write request is successfully executed, sending a third data read request for causing the blockchain storage cluster to read the third data at the third storage location to the blockchain storage cluster through the native test interface;

[0080] The test result generating unit 403 is specifically used for:

[0081] When the second data is consistent with the third data included in the received eighth call response, a test result is generated to indicate that the data playback task test is successful; otherwise, a test result is generated to indicate that the data playback task test is unsuccessful.

[0082] Optionally, the test request and the test response comply with an interface semantic specification corresponding to the external test interface.

[0083] Optionally, the blockchain storage cluster is used to store and manage blockchain data, and the blockchain data includes at least block data, status data and / or event data.

[0084] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0085] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0086] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present invention does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0087] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.

[0088] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0089] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0092] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0093] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0094] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0095] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0097] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0098] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.

Claims

1. A method for testing a blockchain storage cluster, applied to a test node connected to the blockchain storage cluster, the test node maintaining an external test interface, and the blockchain storage cluster maintaining a native test interface; the method comprises: Receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request; Sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface; Receiving, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generating a test result corresponding to the test task based on the execution status of the call request contained in the call response; A test response including the test result is returned to the test party through the external test interface.

2. According to the method of claim 1, the execution status is used to indicate whether the call request is executed successfully.

3. According to the method of claim 2, generating the test result corresponding to the test task based on the execution status of the call request contained in the call response comprises: In the case where the execution status is used to indicate that the call request is executed successfully, a test result is generated to indicate that the test task is tested successfully; otherwise, a test result is generated to indicate that the test task is tested unsuccessfully.

4. According to the method of claim 1, the call request includes a data write request, a data read request, a data modification request and / or a data deletion request. 5 . The method according to claim 4 , wherein, when the call request is the data read request, the call response includes the data stored in the storage location indicated by the data read request.

6. The method according to claim 4, wherein the test task is a data migration task, the call request includes a first data read request, a first data write request, and a first data delete request, and the call response includes a first call response corresponding to the first data read request, a second call response corresponding to the first data write request, and a third call response corresponding to the first data delete request; The sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface includes: Sending a first data read request for causing the blockchain storage cluster to read the first data at the first storage location to the blockchain storage cluster through the native test interface, and upon receiving a first call response containing the first data, generating a first data write request for causing the blockchain storage cluster to write the first data at the second storage location and a first data delete request for causing the blockchain storage cluster to delete the first data at the first storage location; Sending a first data write request and a first data delete request to the blockchain storage cluster through the native test interface.

7. The method according to claim 4, wherein the test task is a data playback task, the call request comprises a second data read request, a second data write request, a second data delete request, a third data write request and a third data read request, and the call response comprises a fourth call response corresponding to the second data read request, a fifth call response corresponding to the second data write request, a sixth call response corresponding to the second data delete request, a seventh call response corresponding to the third data write request and an eighth call response corresponding to the third data read request; The sending the call request corresponding to the test task to the blockchain storage cluster through the native test interface includes: Sending a second data read request for causing the blockchain storage cluster to read the second data at the third storage location to the blockchain storage cluster through the native test interface, and upon receiving a fourth call response containing the second data, sending a second data write request for causing the blockchain storage cluster to write the second data at the fourth storage location and a second data delete request for causing the blockchain storage cluster to delete the second data at the third storage location to the blockchain storage cluster through the native test interface; When the execution conditions contained in the received fifth call response and the sixth call response are used to respectively indicate that the second data write request and the second data delete request are executed successfully, a third data write request for causing the blockchain storage cluster to write the second data in the third storage location is sent to the blockchain storage cluster through the native test interface; When the execution status included in the received seventh call response is used to indicate that the third data write request is successfully executed, sending a third data read request for causing the blockchain storage cluster to read the third data at the third storage location to the blockchain storage cluster through the native test interface; The generating a test result corresponding to the test task based on the execution status contained in the call response includes: When the second data is consistent with the third data included in the received eighth call response, a test result is generated to indicate that the data playback task test is successful; otherwise, a test result is generated to indicate that the data playback task test is unsuccessful.

8. According to the method of claim 1, the test request and the test response comply with the interface semantic specification corresponding to the external test interface.

9. According to the method of claim 1, the blockchain storage cluster is used to store and manage blockchain data, and the blockchain data at least includes block data, status data and / or event data.

10. A device for testing a blockchain storage cluster, applied to a test node connected to the blockchain storage cluster, the test node maintaining an external test interface, and the blockchain storage cluster maintaining a native test interface; the device comprises: A test request receiving unit, used to receive a test request sent by a test party to the external test interface, and determine a test task corresponding to the test request; A call request sending unit, used to send the call request corresponding to the test task to the blockchain storage cluster through the native test interface; A test result generating unit, configured to receive, from the native test interface, a call response generated by the blockchain storage cluster executing the call request, and generate a test result corresponding to the test task based on the execution status of the call request contained in the call response; The test response returning unit returns the test response including the test result to the test party through the external test interface.

11. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.

12. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Automated test method based on access of associated network device

    CN109361562A

  • Distributed database cluster test method and device and storage medium

    CN110389900A