Interface testing method and device for non-relational database and computer equipment

By building process canvas data templates and generating interface tags in a non-relational database, the flexibility and efficiency issues in automated testing of non-relational database interfaces are solved, achieving reusability of test code and efficient interface testing.

CN121501873APending Publication Date: 2026-02-10CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511618844.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In automated testing of interfaces for non-relational databases, testing flexibility is poor, testing efficiency is low, and test code reusability is low.

Method used

By initializing the process canvas data template, maintaining the application system version number corresponding to the interface based on the interface document in a non-relational database, initializing the interface request parameters and expected interface return parameters, storing the process canvas data template in the database, generating interface tags, executing interface test cases according to the process canvas rule template and interface request parameters, and determining the interface test results.

Benefits of technology

It improves the testing flexibility and efficiency of NoSQL database interface testing, realizes the reusability of test code, avoids configuring different test methods for different interfaces, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121501873A_ABST
    Figure CN121501873A_ABST
Patent Text Reader

Abstract

The invention relates to an interface testing method and device for a non-relational database and computer equipment. The method comprises the following steps: initializing a flow canvas data template, maintaining a version number of an application system corresponding to an interface based on an interface document of a non-relational database, and initializing an interface request parameter and an expected interface return parameter of the non-relational database; storing the flow canvas data template in a non-relational database, and generating an interface label of the flow canvas data template; matching the interface data structure rule template of the non-relational database, and determining a flow canvas rule template according to a matching result; and based on the flow canvas rule template and the interface request parameter, executing the interface test case of the non-relational database, and determining an interface test result of the non-relational database according to an execution result of the interface test case and the expected interface return parameter. According to the scheme, the test flexibility and the test efficiency of the non-relational database interface test are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database, in particular to an interface test method, device and computer equipment of a non-relational database. BACKGROUND

[0002] Database interface automatic testing is a testing method for verifying the correctness of database interface by writing scripts or using tools, which is mainly used for detecting data interaction logic and security between different system components. Since there may be interface dependency between the interfaces of the database, that is, the calling parameters of an interface are actually the return parameters of another interface, when performing interface automatic testing on a non-relational database, different testing methods are often used for different database interfaces, that is, the test cases to be executed need to be unloaded in the code or configured in the test-related configuration file, which has poor testing flexibility, low testing efficiency, and low test code reuse rate. Therefore, how to improve the testing flexibility and efficiency while improving the test code reuse rate when performing interface automatic testing on a non-relational database is a problem to be solved. SUMMARY

[0003] Therefore, it is necessary to provide an interface test method, device and computer equipment of a non-relational database which can improve the testing flexibility and efficiency while improving the test code reuse rate when performing interface automatic testing on a non-relational database.

[0004] In a first aspect, the present application provides an interface test method of a non-relational database, which comprises:

[0005] Initializing a flow canvas data template, and maintaining the version number of the application system corresponding to the interface based on the interface document of the non-relational database, initializing the interface request parameters and the expected interface return parameters of the non-relational database;

[0006] Storing the flow canvas data template in the non-relational database, and generating the interface label of the flow canvas data template;

[0007] Matching the interface data structure rule template of the non-relational database according to the configuration data of the flow canvas data template, and determining the flow canvas rule template according to the matching result;

[0008] Based on the flow canvas rule template and the interface request parameters, executing the interface test case of the non-relational database, and determining the interface test result of the non-relational database according to the execution result of the interface test case and the expected interface return parameters.

[0009] In one of the embodiments, the flow canvas data template is stored in the non-relational database, including:

[0010] According to the system interface identifier, the system version number and the interface document of the application system, the interface identifier of the interface is maintained, and it is determined whether the system interface data structure template of the application system exists in the non-relational database.

[0011] If the system interface data structure template of the application system exists in the non-relational database, it is determined whether the data structure of the system interface data structure template is consistent with the data structure of the flow canvas data template.

[0012] If not, the flow canvas data template is stored in the non-relational database.

[0013] In one of the embodiments, it is determined whether the data structure of the system interface data structure template is consistent with the data structure of the flow canvas data template, including:

[0014] The data structure of the interface return value of the interface document maintenance interface is obtained.

[0015] It is determined whether the data structure of the interface return value is consistent with the data structure of the flow canvas data template.

[0016] If the data structure of the interface return value is consistent with the data structure of the flow canvas data template, it is determined that the data structure of the system interface data structure template is consistent with the data structure of the flow canvas data template.

[0017] If the data structure of the interface return value is not consistent with the data structure of the flow canvas data template, it is determined that the data structure of the system interface data structure template is not consistent with the data structure of the flow canvas data template.

[0018] In one of the embodiments, the interface label of the flow canvas data template is generated, including:

[0019] According to the business code, the system interface identifier and the system version number of the application system, the interface label of the flow canvas data template is generated based on the interface label generation algorithm.

[0020] In one of the embodiments, based on the flow canvas rule template and the interface request parameter, the interface test case of the non-relational database is executed, and the interface test result of the non-relational database is determined according to the execution result of the interface test case and the expected interface return parameter, including:

[0021] The data object association algorithm recursively analyzes a flow canvas rule template of the non-relational database to generate a storage key-value pair set of the non-relational database.

[0022] According to the storage key-value pair set of the non-relational database, an interface dependency relationship of the non-relational database is determined.

[0023] Based on the flow canvas rule template and the interface request parameter, an interface test case of the non-relational database is executed to determine interface return data of the non-relational database.

[0024] Based on the interface dependency relationship and the expected interface return parameter, an execution result of the interface test case is checked layer by layer, and a test report is generated according to a checking result.

[0025] In one embodiment, based on the interface dependency relationship and the expected interface return parameter, an execution result of the interface test case is checked layer by layer, and a test report is generated according to a checking result, including:

[0026] Based on the interface dependency relationship, an interface execution order of a test case execution interface of the non-relational database is determined; the number of the test case execution interfaces is at least two.

[0027] Based on the interface execution order and the execution result of the interface test case, actual interface return parameters of the test case execution interfaces are determined.

[0028] The expected interface return parameters and the actual interface return parameters are compared for consistency to complete the layer-by-layer checking of the execution result of the interface test case, and a test report is generated according to the checking result.

[0029] In one embodiment, the flow canvas data template includes system business coding, data request type, data request protocol, system interface domain name, system interface identifier, and system version number of an application system.

[0030] In a second aspect, the application further provides a non-relational database testing device, which includes:

[0031] A data template construction module is configured to initialize a flow canvas data template, maintain a version number of an application system corresponding to an interface based on an interface document of a non-relational database, initialize an interface request parameter and an expected interface return parameter of the non-relational database, and initialize a flow canvas data template.

[0032] A template storage module is configured to store the flow canvas data template in the non-relational database and generate an interface label of the flow canvas data template.

[0033] The template matching module is configured to match an interface data structure rule template of the non-relational database according to configuration data of the flow canvas data template, and determine a flow canvas rule template according to a matching result.

[0034] The interface test module is configured to execute an interface test case of the non-relational database based on the flow canvas rule template and the interface request parameter, and determine an interface test result of the non-relational database according to an execution result of the interface test case and the expected interface return parameter.

[0035] In a third aspect, the present application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0036] initializing a flow canvas data template, and maintaining a version number of an application system corresponding to an interface based on an interface document of a non-relational database, initializing an interface request parameter and an expected interface return parameter of the non-relational database;

[0037] storing the flow canvas data template in the non-relational database, and generating an interface label of the flow canvas data template;

[0038] matching an interface data structure rule template of the non-relational database according to configuration data of the flow canvas data template, and determining a flow canvas rule template according to a matching result;

[0039] executing an interface test case of the non-relational database based on the flow canvas rule template and the interface request parameter, and determining an interface test result of the non-relational database according to an execution result of the interface test case and the expected interface return parameter.

[0040] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0041] initializing a flow canvas data template, and maintaining a version number of an application system corresponding to an interface based on an interface document of a non-relational database, initializing an interface request parameter and an expected interface return parameter of the non-relational database;

[0042] storing the flow canvas data template in the non-relational database, and generating an interface label of the flow canvas data template;

[0043] matching an interface data structure rule template of the non-relational database according to configuration data of the flow canvas data template, and determining a flow canvas rule template according to a matching result;

[0044] Based on the process canvas rule template and the interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database according to the execution results of the interface test cases and the expected interface return parameters.

[0045] The aforementioned interface testing method, apparatus, and computer equipment for non-relational databases initialize a process canvas data template and maintain the application system version number corresponding to the interface based on the interface documentation of the non-relational database. It also initializes the interface request parameters and expected interface return parameters of the non-relational database. The process canvas data template is stored in the non-relational database, and interface tags for the process canvas data template are generated. Based on the configuration data of the process canvas data template, the interface data structure rule template of the non-relational database is matched, and the process canvas rule template is determined based on the matching result. Based on the process canvas rule template and the interface request parameters, interface test cases for the non-relational database are executed, and the interface test results are determined based on the execution results of the interface test cases and the expected interface return parameters. This solves the problem that, due to potential interface dependencies between database interfaces, automated interface testing of non-relational databases often requires different testing methods for different database interfaces. This necessitates either unloading the test cases into the code or configuring them in test-related configuration files, resulting in poor testing flexibility, low testing efficiency, and low test code reusability. The above solution, when performing interface testing on a non-relational database, firstly constructs a process canvas data template for automated interface testing in the non-relational database based on actual testing requirements. This process canvas data template is stored in the non-relational database, enabling template reusability. The interface request parameters and expected interface return parameters are determined during the testing process. Then, the process canvas rule template for interface testing of the non-relational database is matched according to the configuration data of the process canvas data template. Interface test cases for the non-relational database are executed based on the process canvas rule template and the interface request parameters. The interface test results for the non-relational database are determined by comparing the execution results of the interface test cases with the expected return parameters. This eliminates the need to configure different test methods for different test interfaces, improving the testing flexibility and efficiency of non-relational database interface testing. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating an interface testing method for a non-relational database in one embodiment.

[0047] Figure 2 This is a flowchart illustrating an interface testing method for a non-relational database in another embodiment.

[0048] Figure 3This is a structural block diagram of a test device for a non-relational database in one embodiment;

[0049] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0051] In one embodiment, such as Figure 1 As shown, an interface testing method for a non-relational database is provided. This embodiment illustrates the method using a terminal as an example. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0052] S110. Initialize the process canvas data template, and maintain the application system version number corresponding to the interface based on the interface document of the non-relational database. Initialize the interface request parameters and expected interface return parameters of the non-relational database.

[0053] The process canvas data template is a template tool used to describe the data flow and processing in a business process. In the interface testing method for non-relational databases, the process canvas data template includes the parameter data required when performing interface testing on non-relational databases.

[0054] For example, the process canvas data template includes: the application system's system business code, data request type, data request protocol, system interface domain name, system interface identifier, and system version number.

[0055] The application system refers to the application system corresponding to the interface document maintenance interface of the non-relational database. The interface document is a standardized document describing the interaction rules between systems, mainly used to clarify request methods and parameter formats. The application system corresponding to the interface document maintenance interface refers to the application system connected to the non-relational database maintained by the interface document maintenance interface. System business codes are a coding system used to uniquely identify various objects within the business system, including customer numbers, order numbers, material codes, etc., ensuring the accuracy of data management and system operation. Data request types can be GET or POST. GET and POST are two basic methods for data requests in the HTTP protocol. GET passes parameters through the URL, and the parameters appear in the URL (Uniform Resource Locator) in the form of key-value pairs. POST places the data in the HTTP request body and does not display it in the URL. The data request protocol is a standardized rule for data transmission between clients and servers, specifying the request format, transmission method, and response specifications. A system interface domain name refers to the Domain Name System used for network service identification and IP (Internet Protocol Address) address translation. It is primarily used in mobile device operating systems, enabling service access through DNS (Domain Name System) resolution. A system interface identifier refers to a standardized marker used in a computer system to facilitate communication and data exchange between different functional modules. A system version number is a symbol used to identify different versions of an application system. A non-relational database can be a Redis database.

[0056] For example, the process canvas data template is shown in Table 1.

[0057] Table 1

[0058]

[0059] Here, "login" refers to registration. POST is a request method in the HTTP protocol, primarily used to transmit data to a server, which then performs corresponding operations based on the received data. A URL (Uniform Resource Locator) is a standard identifier for locating resources on the internet. It describes the unique address of a network resource using the Uniform Resource Locator syntax format, covering types such as web pages, documents, images, audio / video files, and network services.

[0060] Specifically, the configuration parameters of the process canvas data template are configured according to actual needs. These parameters include the application system's system business code, data request type, data request protocol, system interface domain name, system interface identifier, and system version number. The process canvas data template is then initialized based on these parameters. The version number of the application system corresponding to the interface documentation maintenance interface of the non-relational database is used to determine the return data structure of the application system corresponding to the interface documentation maintenance interface of the non-relational database. Based on the return data structure, the interface request parameters and expected interface return parameters of the non-relational database are initialized. Interface request parameters are the necessary data that the application system must provide when sending a request to the non-relational database during API (Application Programming Interface) communication. Expected interface return parameters refer to the data expected to be returned by the non-relational database based on the interface request parameters.

[0061] S120. Store the process canvas data template in a non-relational database and generate the interface tags for the process canvas data template.

[0062] For example, storing the process canvas data template in the non-relational database includes: determining whether the application system's system interface data structure template exists in the non-relational database based on the application system's system interface identifier, system version number, and interface identifier of the interface document maintenance interface; if the application system's system interface data structure template exists in the non-relational database, determining whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template; if not, then the process canvas data template is stored in the non-relational database.

[0063] Specifically, based on the application system's system interface identifier, system version number, and interface identifier of the interface document maintenance interface, a search is performed on the non-relational database to determine if the application system's system interface data structure template exists in the non-relational database. If the application system's system interface data structure template exists in the non-relational database, it is determined whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template. If the data structure of the system interface data structure template is inconsistent with the data structure of the process canvas data template, then the process canvas data template is constructed in the non-relational database. If the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template, then it is not necessary to construct the process canvas data template in the non-relational database.

[0064] The above solution determines whether the system interface data structure template in the non-relational database overlaps with the process canvas data template before storing the process canvas data template in the non-relational database. If not, the process canvas data template is built in the non-relational database, thus avoiding the duplication of process canvas data templates in the non-relational database and improving database resource utilization.

[0065] For example, determining whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template includes:

[0066] Obtain the data structure of the interface return value from the interface documentation maintenance interface; determine whether the data result of the interface return value is consistent with the data structure of the process canvas data template; if the data result of the interface return value is consistent with the data structure of the process canvas data template, then determine that the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template; if the data result of the interface return value is inconsistent with the data structure of the process canvas data template, then determine that the data structure of the system interface data structure template is inconsistent with the data structure of the process canvas data template.

[0067] The above solution, by comparing the data structure of the interface return value maintained in the interface documentation with the data structure of the process canvas data template, determines whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template, which can improve the efficiency of determining whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template.

[0068] For example, the interface tags for generating the process canvas data template include:

[0069] Based on the interface tag generation algorithm, interface tags for the process canvas data template are generated according to the application system's business code, system interface identifier, and system version number.

[0070] The interface tag generation algorithm can be a natural language processing algorithm, which is mainly used to automatically generate tags based on interface request parameters.

[0071] Specifically, the system's business code, system interface identifier, and system version number are input into the pre-trained label generation algorithm, and the unique interface label of the process canvas data template is determined based on the label generation algorithm.

[0072] S130. Based on the configuration data of the process canvas data template, match the interface data structure rule template of the non-relational database, and determine the process canvas rule template based on the matching result.

[0073] Among them, the flowchart rule template is a reference standard used to standardize the symbols, structure and paths of flowchart drawing.

[0074] Specifically, the process canvas data template is parsed using the fastjson toolkit to determine the configuration data of the process canvas data template, namely the system business code, data request type, data request protocol, system interface domain name, system interface identifier and system version number of the application system. Based on the configuration data of the process canvas data template, the interface data structure rule template of the non-relational database is matched to determine the process canvas rule template.

[0075] For example, in the test case file of cases_v3, the sheet is named "systemName_Login_v10". Using the sheet name plus the "test case number" values ​​(1, 2, 3, etc.) as keys, during text parsing, the test case values ​​can be retrieved in a loop based on the column names, the actual results can be written back, and then compared with the actual response before writing back the pass / fail indicator. Here, "sheet" refers to a table displayed in the workbook window.

[0076] S140. Based on the process canvas rule template and interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database according to the execution results of the interface test cases and the expected interface return parameters.

[0077] Specifically, based on the process canvas rule template and interface request parameters, interface test cases for the non-relational database are executed, and the execution results of the interface test cases are determined. A consistency comparison is performed between the execution results of the interface test cases and the expected interface return parameters. If the execution results of the interface test cases are consistent with the expected interface return parameters, the interface test result for the non-relational database is determined to be a pass; if the execution results of the interface test cases are inconsistent with the expected interface return parameters, the interface test result for the non-relational database is determined to be a fail.

[0078] The above-described interface testing method for non-relational databases involves: initializing a process canvas data template; maintaining the application system version number corresponding to the interface based on the interface documentation of the non-relational database; initializing the interface request parameters and expected interface return parameters of the non-relational database; storing the process canvas data template in the non-relational database and generating interface tags for the process canvas data template; matching the interface data structure rule template of the non-relational database with the configuration data of the process canvas data template, and determining the process canvas rule template based on the matching results; executing interface test cases for the non-relational database based on the process canvas rule template and interface request parameters, and determining the interface test results of the non-relational database based on the execution results of the interface test cases and the expected interface return parameters. This method solves the problem that, due to the potential interface dependencies between database interfaces, automated interface testing of non-relational databases often requires different testing methods for different database interfaces, necessitating the removal of test cases from the code or their configuration in test-related configuration files, resulting in poor testing flexibility, low testing efficiency, and low test code reusability. The above solution, when performing interface testing on a non-relational database, firstly constructs a process canvas data template for automated interface testing in the non-relational database based on actual testing requirements. This process canvas data template is stored in the non-relational database, enabling template reusability. The interface request parameters and expected interface return parameters are determined during the testing process. Then, the process canvas rule template for interface testing of the non-relational database is matched according to the configuration data of the process canvas data template. Interface test cases for the non-relational database are executed based on the process canvas rule template and the interface request parameters. The interface test results for the non-relational database are determined by comparing the execution results of the interface test cases with the expected return parameters. This eliminates the need to configure different test methods for different test interfaces, improving the testing flexibility and efficiency of non-relational database interface testing.

[0079] In one embodiment, such as Figure 2 As shown, based on the process canvas rule template and the interface request parameters, interface test cases for the non-relational database are executed. The interface test results for the non-relational database are determined based on the execution results of the interface test cases and the expected interface return parameters, including:

[0080] S210. Using a data object association algorithm, recursively parse the process canvas rule template of the non-relational database to generate a set of key-value pairs for storing the non-relational database.

[0081] It should be noted that recursively parsing the process canvas rule template of a non-relational database means parsing the process canvas rule template layer by layer according to the template execution flow of the non-relational database process canvas rule template.

[0082] Using a data object association algorithm, the process canvas rule template of a non-relational database is recursively parsed to generate a set of key-value pairs for storing non-relational databases, namely a Map set. The data format of the Map set is (key, value), where the key is a unique label for the rule template and the value is the rule execution strategy data.

[0083] S220. Based on the set of key-value pairs stored in the non-relational database, determine the interface dependencies of the non-relational database.

[0084] It should be noted that interface dependency refers to a usage or being used relationship between two interfaces, where a change in one interface will affect the implementation of the other interface.

[0085] S230. Based on the process canvas rule template and interface request parameters, execute interface test cases for the non-relational database to determine the interface return data of the non-relational database.

[0086] Specifically, based on the interface testing process defined by the process canvas rule template, interface test cases for non-relational databases are executed through interface request parameters, and the interface return data of non-relational databases is determined based on the execution results of the interface test cases.

[0087] S240. Based on interface dependencies and expected interface return parameters, perform layer-by-layer verification of the execution results of interface test cases, and generate a test report based on the verification results.

[0088] For example, based on interface dependencies and expected interface return parameters, the execution results of interface test cases are verified layer by layer, and a test report is generated based on the verification results, including:

[0089] Based on interface dependencies, determine the execution order of test cases for non-relational databases; the number of test cases executing interfaces is at least two; based on the interface execution order and the execution results of the interface test cases, determine the actual interface return parameters of the test cases; perform a consistency comparison between the expected interface return parameters and the actual interface return parameters to complete the layer-by-layer verification of the execution results of the interface test cases, and generate a test report based on the verification results.

[0090] Understandably, by verifying the actual return parameters of each test case based on interface dependencies and expected interface return parameters, and by performing layer-by-layer verification of the execution results of the interface test cases, the problem of poor test flexibility caused by using different test methods for different database interfaces can be avoided, thereby further improving test flexibility.

[0091] For example, the interface testing methods for the above-mentioned non-relational databases also include:

[0092] Initialize the process canvas data template, which includes: the application system's system business code, data request type, data request protocol, system interface domain name, system interface identifier, and system version number. Maintain the data structure of the interface's returned data by referring to the interface documentation of the non-relational database, and initialize the interface request parameters and expected interface return parameters. The aforementioned data structure includes the hierarchical structure and field names of the returned data.

[0093] Based on the system interface identifier, system version number, and interface identifier of the application system maintained by the interface documentation, determine whether a system interface data structure template exists in the non-relational database. If so, obtain the data structure of the interface return value of the interface maintained by the interface documentation, and determine whether the target interface data structure and the system interface data structure template are consistent based on the comparison results between the process canvas data template and the interface return value data structure. If they are consistent, there is no need to build a process canvas data template in the non-relational database. If they are inconsistent, store the process canvas data template in the non-relational database in a form that conforms to the business scenario data, and generate a unique interface label for the process canvas data template based on the interface label generation algorithm, according to the application system's business code, system interface identifier, and system version number.

[0094] Initialize the database connection to the non-relational database and parse the configuration data of the process canvas data template using the Fastjson toolkit, assembling the data into its corresponding data types (Map, JSON, List, Set). Using a data object association algorithm, recursively parse the process canvas rule template based on the configuration data to generate a collection of key-value pairs for the non-relational database. Parse the interface request parameters and expected return parameters in the process canvas data template using Fastjson, matching the corresponding process canvas rule template based on the application system's business code, system version number, and system interface identifier suffix. Execute interface test cases for the non-relational database using the TestNG framework for interface automation. Based on the collection of key-value pairs in the non-relational database, determine the interface dependencies and assemble them. Package the interface data into Map data, with the data format <field name, List collection>, where the List collection can be retrieved based on the key value in the key-value pair collection. Perform automated database interface testing based on the hierarchical structure corresponding to the interface dependencies. The TestNG framework is used to execute interface test cases. The result returned by the first-level interface is passed as a parameter to the second interface, and so on. If the result returned by the interface does not meet the parameter requirements of the next interface, the test case is marked as inconsistent with the agreed interface return data. Otherwise, the test case is marked as passed, and the test result is written back to the test case.

[0095] Understandably, traditional database storage solutions cannot adapt to the switching and storage of interface dependency data structure templates across multiple systems, do not support complex data scenarios, offer limited storage, have high restrictions on data types, require cumbersome database operations such as JDBC connections and SQL statement writing, suffer from low performance and security, and have low code scalability and flexibility. The solution described above simplifies the management of multi-system interface data dependency structure templates and reduces the cumbersome database operations for developers. It facilitates complex data access, is secure and efficient, stores data in memory for direct retrieval, reduces logical data processing, cleverly utilizes the key-value pair method of NoSQL databases for data storage, and also solves the problem of automation code only supporting one scenario, reducing testing and maintenance costs, decreasing code coupling, and improving code usability.

[0096] The above-described interface testing method for non-relational databases involves: initializing a process canvas data template; maintaining the application system version number corresponding to the interface based on the interface documentation of the non-relational database; initializing the interface request parameters and expected interface return parameters of the non-relational database; storing the process canvas data template in the non-relational database and generating interface tags for the process canvas data template; matching the interface data structure rule template of the non-relational database with the configuration data of the process canvas data template, and determining the process canvas rule template based on the matching results; executing interface test cases for the non-relational database based on the process canvas rule template and interface request parameters, and determining the interface test results of the non-relational database based on the execution results of the interface test cases and the expected interface return parameters. This method solves the problem that, due to the potential interface dependencies between database interfaces, automated interface testing of non-relational databases often requires different testing methods for different database interfaces, necessitating the removal of test cases from the code or their configuration in test-related configuration files, resulting in poor testing flexibility, low testing efficiency, and low test code reusability. The above solution, when performing interface testing on a non-relational database, firstly constructs a process canvas data template for automated interface testing in the non-relational database based on actual testing requirements. This process canvas data template is stored in the non-relational database, enabling template reusability. The interface request parameters and expected interface return parameters are determined during the testing process. Then, the process canvas rule template for interface testing of the non-relational database is matched according to the configuration data of the process canvas data template. Interface test cases for the non-relational database are executed based on the process canvas rule template and the interface request parameters. The interface test results for the non-relational database are determined by comparing the execution results of the interface test cases with the expected return parameters. This eliminates the need to configure different test methods for different test interfaces, improving the testing flexibility and efficiency of non-relational database interface testing.

[0097] Based on the same inventive concept, this application also provides a testing apparatus for a non-relational database used to implement the interface testing method for the non-relational database described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more non-relational database testing apparatus embodiments provided below can be found in the limitations of the interface testing method for non-relational databases described above, and will not be repeated here.

[0098] In one embodiment, such as Figure 3 As shown, a testing device for a non-relational database is provided, including: a data template construction module 301, a template storage module 302, a template matching module 303, and an interface testing module 304, wherein:

[0099] The data template construction module 301 is used to initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface document of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database.

[0100] Template storage module 302 is used to store the process canvas data template in the non-relational database and generate interface tags for the process canvas data template;

[0101] The template matching module 303 is used to match the interface data structure rule template of the non-relational database with the configuration data of the process canvas data template, and determine the process canvas rule template based on the matching result.

[0102] The interface testing module 304 is used to execute interface test cases for the non-relational database based on the process canvas rule template and the interface request parameters, and to determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters.

[0103] For example, the template storage module 302 is specifically used for:

[0104] Based on the system interface identifier, system version number, and interface identifier of the interface document maintenance interface of the application system, determine whether the system interface data structure template of the application system exists in the non-relational database;

[0105] If a system interface data structure template for the application system exists in a non-relational database, then determine whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template.

[0106] If not, the process canvas data template is stored in the non-relational database.

[0107] Furthermore, the template storage module 302 is also specifically used for:

[0108] Obtain the data structure of the API return value from the API documentation;

[0109] Determine whether the data result returned by the interface is consistent with the data structure of the process canvas data template;

[0110] If the data result returned by the interface is consistent with the data structure of the process canvas data template, then it is determined that the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template.

[0111] If the data result returned by the interface is inconsistent with the data structure of the process canvas data template, then it is determined that the data structure of the system interface data structure template is inconsistent with the data structure of the process canvas data template.

[0112] Furthermore, the template storage module 302 is also specifically used for:

[0113] Based on the interface tag generation algorithm, interface tags for the process canvas data template are generated according to the application system's business code, system interface identifier, and system version number.

[0114] For example, the interface testing module 304 is specifically used for:

[0115] By using a data object association algorithm, the process canvas rule template of a non-relational database is recursively parsed to generate a set of key-value pairs for storing the non-relational database.

[0116] Based on the set of key-value pairs stored in the non-relational database, determine the interface dependencies of the non-relational database;

[0117] Based on the process canvas rule template and interface request parameters, execute interface test cases for the non-relational database to determine the interface return data of the non-relational database.

[0118] Based on the interface dependencies and expected interface return parameters, the execution results of the interface test cases are verified layer by layer, and a test report is generated based on the verification results.

[0119] For example, the interface testing module 304 is also specifically used for:

[0120] Based on the interface dependencies, the execution order of the test case execution interfaces for the non-relational database is determined; the number of test case execution interfaces is at least two.

[0121] Based on the execution order of the interfaces and the execution results of the interface test cases, determine the actual interface return parameters of the test case execution interface;

[0122] The expected interface return parameters and the actual interface return parameters are compared for consistency to complete the layer-by-layer verification of the execution results of the interface test cases, and a test report is generated based on the verification results.

[0123] For example, the process canvas data template includes: the application system's system business code, data request type, data request protocol, system interface domain name, system interface identifier, and system version number.

[0124] Each module in the aforementioned test device for non-relational databases can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0125] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an interface testing method for a non-relational database. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0126] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0128] Step 1: Initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface documentation of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database.

[0129] Step 2: Store the process canvas data template in the non-relational database and generate the interface tags for the process canvas data template;

[0130] Step 3: Based on the configuration data of the process canvas data template, match the interface data structure rule template of the non-relational database, and determine the process canvas rule template based on the matching results;

[0131] Step 4: Based on the process canvas rule template and the interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters.

[0132] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0133] Step 1: Initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface documentation of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database.

[0134] Step 2: Store the process canvas data template in the non-relational database and generate the interface tags for the process canvas data template;

[0135] Step 3: Based on the configuration data of the process canvas data template, match the interface data structure rule template of the non-relational database, and determine the process canvas rule template based on the matching results;

[0136] Step 4: Based on the process canvas rule template and the interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters.

[0137] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0138] Step 1: Initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface documentation of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database.

[0139] Step 2: Store the process canvas data template in the non-relational database and generate the interface tags for the process canvas data template;

[0140] Step 3: Based on the configuration data of the process canvas data template, match the interface data structure rule template of the non-relational database, and determine the process canvas rule template based on the matching results;

[0141] Step 4: Based on the process canvas rule template and the interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters.

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

[0143] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An interface testing method for a non-relational database, characterized in that, include: Initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface document of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database. The process canvas data template is stored in the non-relational database, and interface tags for the process canvas data template are generated. Based on the configuration data of the process canvas data template, the interface data structure rule template of the non-relational database is matched, and the process canvas rule template is determined based on the matching results. Based on the process canvas rule template and the interface request parameters, execute the interface test cases for the non-relational database, and determine the interface test results for the non-relational database according to the execution results of the interface test cases and the expected interface return parameters.

2. The method according to claim 1, characterized in that, Storing the process canvas data template in the non-relational database includes: Based on the system interface identifier, system version number, and interface identifier of the interface document maintenance interface of the application system, determine whether the system interface data structure template of the application system exists in the non-relational database; If a system interface data structure template for the application system exists in a non-relational database, then determine whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template. If not, the process canvas data template is stored in the non-relational database.

3. The method according to claim 2, characterized in that, Determining whether the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template includes: Obtain the data structure of the API return value from the API documentation; Determine whether the data result returned by the interface is consistent with the data structure of the process canvas data template; If the data result returned by the interface is consistent with the data structure of the process canvas data template, then it is determined that the data structure of the system interface data structure template is consistent with the data structure of the process canvas data template. If the data result returned by the interface is inconsistent with the data structure of the process canvas data template, then it is determined that the data structure of the system interface data structure template is inconsistent with the data structure of the process canvas data template.

4. The method according to claim 1, characterized in that, The interface tags for generating the process canvas data template include: Based on the interface tag generation algorithm, interface tags for the process canvas data template are generated according to the application system's business code, system interface identifier, and system version number.

5. The method according to claim 1, characterized in that, Based on the process canvas rule template and the interface request parameters, execute interface test cases for the non-relational database, and determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters, including: By using a data object association algorithm, the process canvas rule template of a non-relational database is recursively parsed to generate a set of key-value pairs for storing the non-relational database. Based on the set of key-value pairs stored in the non-relational database, determine the interface dependencies of the non-relational database; Based on the process canvas rule template and interface request parameters, execute interface test cases for the non-relational database to determine the interface return data of the non-relational database. Based on the interface dependencies and expected interface return parameters, the execution results of the interface test cases are verified layer by layer, and a test report is generated based on the verification results.

6. The method according to claim 5, characterized in that, Based on the interface dependencies and expected interface return parameters, the execution results of the interface test cases are verified layer by layer, and a test report is generated based on the verification results, including: Based on the interface dependencies, the execution order of the test case execution interfaces for the non-relational database is determined; the number of test case execution interfaces is at least two. Based on the execution order of the interfaces and the execution results of the interface test cases, determine the actual interface return parameters of the test case execution interface; The expected interface return parameters and the actual interface return parameters are compared for consistency to complete the layer-by-layer verification of the execution results of the interface test cases, and a test report is generated based on the verification results.

7. The method according to claim 1, characterized in that, The process canvas data template includes: the application system's system business code, data request type, data request protocol, system interface domain name, system interface identifier, and system version number.

8. A testing device for a non-relational database, characterized in that, The testing apparatus for the non-relational database includes: The data template construction module is used to initialize the process canvas data template, maintain the application system version number corresponding to the interface based on the interface document of the non-relational database, and initialize the interface request parameters and expected interface return parameters of the non-relational database. A template storage module is used to store the process canvas data template in the non-relational database and generate interface tags for the process canvas data template. The template matching module is used to match the interface data structure rule template of the non-relational database with the configuration data of the process canvas data template, and determine the process canvas rule template based on the matching results. The interface testing module is used to execute interface test cases for the non-relational database based on the process canvas rule template and the interface request parameters, and to determine the interface test results for the non-relational database based on the execution results of the interface test cases and the expected interface return parameters.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.