Test data maintenance method, system and equipment and storage medium

By automatically determining the integrity of the test data table and generating new data for maintenance, the inefficiency caused by manual intervention in existing technologies is solved, achieving efficient and accurate test data maintenance.

CN120994557APending Publication Date: 2025-11-21CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511111024.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

The existing test data integrity verification and maintenance process requires manual intervention, has a low degree of automation, resulting in low maintenance efficiency, and requires repeated operations for data maintenance in multiple business scenarios and batches.

Method used

By obtaining the test data table and determining whether it meets the configuration verification conditions, if the data is not complete, the data retrieval configuration information is queried to generate new test data. The data to be maintained is filtered according to the configuration filtering conditions, and the data is maintained to generate the target test data table.

Benefits of technology

It achieves automated test data maintenance, reduces manual intervention, lowers complexity and cost, improves maintenance efficiency and accuracy, and adapts to various test scenarios and data requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994557A_ABST
    Figure CN120994557A_ABST
Patent Text Reader

Abstract

The invention discloses a test data maintenance method, system and device and a storage medium, and relates to the technical field of data processing.The method comprises the steps that a test data table is obtained, whether the test data table meets configuration verification conditions or not is judged, and the configuration verification conditions are used for judging whether the test data table does not have data integrity or not; if yes, querying access configuration information corresponding to the test data table, and generating new test data according to the access configuration information; performing data screening on the test data table according to a configuration screening condition to obtain to-be-maintained data; and performing data maintenance on the test data table according to the new test data and the to-be-maintained data to obtain a target test data table. According to the method, whether the test data table has data integrity or not can be automatically judged, and new data is automatically acquired for maintenance when the test data table does not have the data integrity, so that manual intervention is effectively reduced, and the complexity and cost of test data maintenance are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, system, device and storage medium for maintaining test data. Background Technology

[0002] In complex business environments, testing requires accurate and complete test data to accurately reflect the system's operational status and business logic. Currently, verifying and maintaining the integrity of test data mainly relies on manual operations: querying test data tables to analyze whether the quantity and result values ​​of test data in specific business scenarios meet testing requirements; when verification finds that the data in the current test data table does not meet the requirements, new data is obtained by executing specific API interfaces or retrieving data from the business database, and then maintained in the test data table.

[0003] However, since the verification and maintenance process needs to be performed manually, and the judgment and parameter modification in the process all require manual participation, only a single aspect of the test data can be verified and maintained at one time. When maintaining multiple business scenarios of the same batch of test data, multiple modifications and executions are required, resulting in low reusability of the executed content. When maintaining different batches of data, repeated operations need to be performed multiple times, resulting in high repetition of the operation process. Summary of the Invention

[0004] The main purpose of this application is to provide a method, system, device and storage medium for maintaining test data, which aims to solve the technical problems of low automation and low maintenance efficiency in the existing test data integrity verification and maintenance process.

[0005] To achieve the above objectives, this application proposes a method for maintaining test data, the method comprising:

[0006] Obtain the test data table and determine whether the test data table meets the configuration verification conditions. The configuration verification conditions are used to determine whether the test data table lacks data integrity.

[0007] If so, query the data retrieval configuration information corresponding to the test data table, and generate new test data according to the data retrieval configuration information;

[0008] The test data table is filtered according to the configured filtering conditions to obtain the data to be maintained.

[0009] The test data table is maintained based on the new test data and the data to be maintained to obtain the target test data table.

[0010] In one embodiment, the configuration verification conditions include: a timed verification condition and a total data volume verification condition. The step of obtaining a test data table and determining whether the test data table meets the configuration verification conditions includes:

[0011] Obtain the test data table, and when the timed verification condition is met at the current moment, trigger the data verification task of the test data table;

[0012] When the data verification task is triggered, the original test data in the test data table is checked sequentially to see if it is less than the total threshold corresponding to the total data verification condition.

[0013] The data total quantity verification conditions include: table data total quantity condition, business scenario total quantity condition, and table SQL execution quantity condition.

[0014] In one embodiment, the step of querying the data retrieval configuration information corresponding to the test data table and generating new test data according to the data retrieval configuration information includes:

[0015] If so, the test data table is determined to lack data integrity.

[0016] When the test data table lacks data integrity, the data retrieval configuration information corresponding to the test data table is queried, and the current data retrieval method and target data source are determined based on the data retrieval configuration information. The target data source includes: business database, configuration test database, configuration script or configuration data generation rules.

[0017] New test data is generated based on the target data source according to the current data retrieval method.

[0018] In one embodiment, after the step of filtering the test data table according to the configured filtering conditions to obtain the data to be maintained, the method further includes:

[0019] Based on the configured expiration conditions, the original test data that is in an expired state is determined in the test data table;

[0020] The expired original test data is cleared from the test data table to obtain the current test data table;

[0021] Accordingly, the step of maintaining the test data table based on the new test data and the data to be maintained to obtain the target test data table includes:

[0022] The current test data table is maintained based on the new test data and the data to be maintained to obtain the target test data table.

[0023] In one embodiment, the step of maintaining the current test data table based on the new test data and the data to be maintained to obtain the target test data table includes:

[0024] Determine whether the new test data and the data to be maintained have the same data structure;

[0025] If so, determine whether there is a record in the data to be maintained that has the same primary key as the new test data;

[0026] If records with the same primary key exist, update the non-primary key fields corresponding to the records with the same primary key based on the new test data;

[0027] If no record with the same primary key exists, the new test data is inserted into the current test data table;

[0028] The target test data table is obtained based on the field update results and data insertion results.

[0029] In one embodiment, after the step of determining whether the new test data and the data to be maintained have the same data structure, the method further includes:

[0030] If not, the data to be maintained is divided into several rows of data, and the replacement row data corresponding to each row of data is determined in the new test data. The current test data table is updated according to each replacement row data to obtain the target test data table.

[0031] Alternatively, the data to be maintained can be divided into several batches, and replacement batch data corresponding to each batch of data can be determined in the new test data. The current test data table can be updated according to each replacement batch of data to obtain the target test data table.

[0032] In one embodiment, after the step of obtaining the target test data table, the method further includes:

[0033] Determine whether the target test data table meets the configuration verification conditions;

[0034] If not, then the target test data table is determined to have data integrity;

[0035] When the target test data table has data integrity, a data maintenance record is generated based on the new test data and the data to be maintained and sent to the user terminal.

[0036] Furthermore, to achieve the above objectives, this application also proposes a test data maintenance system, the system comprising:

[0037] The condition verification module is used to obtain the test data table and determine whether the test data table meets the configuration verification conditions. The configuration verification conditions are used to determine whether the test data table lacks data integrity.

[0038] The data filtering module is used to query the data retrieval configuration information corresponding to the test data table if the data is yes, and generate new test data according to the data retrieval configuration information;

[0039] The data filtering module is also used to filter the test data table according to the configured filtering conditions to obtain the data to be maintained;

[0040] The data maintenance module is used to maintain the test data table based on the new test data and the data to be maintained, so as to obtain the target test data table.

[0041] In addition, to achieve the above objectives, this application also proposes a test data maintenance device, the device comprising: a memory, a processor, and a test data maintenance program stored in the memory and executable on the processor, the test data maintenance program being configured to implement the steps of the test data maintenance method described above.

[0042] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a test data maintenance program is stored, and when the test data maintenance program is executed by a processor, it implements the steps of the test data maintenance method described above.

[0043] This application discloses a method for maintaining test data. The method involves obtaining a test data table and determining whether the test data table meets configuration verification conditions. These conditions are used to determine whether the test data table lacks data integrity. If so, the method queries the data retrieval configuration information corresponding to the test data table and generates new test data according to the configuration information. The method then filters the test data table according to configuration filtering conditions to obtain data to be maintained. Finally, the method maintains the test data table based on the new test data and the data to be maintained, obtaining the target test data table.

[0044] Because this application can automatically determine whether there are data integrity issues in the test data table and automatically retrieve new data for maintenance when problems are found, it effectively reduces manual intervention and lowers the complexity and cost of test data maintenance. At the same time, through flexible data retrieval configuration and filtering conditions, it can adapt to various different test scenarios and data requirements, improving the efficiency and accuracy of test data maintenance. Attached Figure Description

[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating the first embodiment of the test data maintenance method of this application;

[0048] Figure 2 This is a flowchart illustrating the second embodiment of the test data maintenance method of this application;

[0049] Figure 3 This is a flowchart illustrating the third embodiment of the test data maintenance method of this application;

[0050] Figure 4 This is a schematic diagram illustrating the entire process of maintaining the test data for this application;

[0051] Figure 5 This is a schematic diagram of the module structure of the first embodiment of the test data maintenance system of this application;

[0052] Figure 6 This is a schematic diagram of the structure of the maintenance equipment for the test data of this application.

[0053] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0054] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0055] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0056] This application provides a method for maintaining test data, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for maintaining test data according to this application. In this embodiment, the method includes steps S10 to S40:

[0057] Step S10: Obtain the test data table and determine whether the test data table meets the configuration verification conditions. The configuration verification conditions are used to determine whether the test data table lacks data integrity.

[0058] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or server capable of performing the above functions. The following description uses a test data maintenance device (hereinafter referred to as "device") as an example to illustrate this embodiment and the subsequent embodiments.

[0059] It should be understood that this test data table is the one that currently needs to be validated and maintained. This test data table stores various types of data used for testing, and this data will gradually change as testing progresses and business processes evolve. This may lead to issues such as missing or inaccurate data, affecting the effectiveness and accuracy of the testing. Therefore, it is necessary to perform an integrity check on this test data table.

[0060] The configuration verification conditions can include several key indicators to determine whether the test data table lacks integrity, covering multiple aspects, such as whether the total amount of data in the test data table is lower than the set minimum threshold, whether the total amount of data in a specific business scenario is insufficient, and whether the total amount of data obtained after executing a specific SQL statement is too small, etc. The configuration verification conditions can also include timed verification conditions that perform integrity verification based on a set time interval.

[0061] It should be understood that, in order to determine whether to perform subsequent data maintenance operations on the test data table, this configuration verification condition can be used to judge whether the test data table does not meet the conditions for data integrity. Therefore, if the test data table meets the configuration verification condition, the test data table fails the integrity verification; otherwise, it passes the integrity verification. When the test data table fails the integrity verification, subsequent data maintenance operations can be triggered.

[0062] Step S20: If yes, query the data retrieval configuration information corresponding to the test data table, and generate new test data according to the data retrieval configuration information.

[0063] It should be understood that once it is determined that a test data table needs maintenance, the data retrieval configuration information corresponding to that test data table can be queried. This data retrieval configuration information can be the data retrieval logic pre-configured by the user based on different business scenario requirements, including: the source of new test data, the method of retrieving new test data, or the rules for retrieving new test data, etc.

[0064] In practice, the device can acquire or generate new test data according to the methods and rules specified in the data acquisition configuration information. This new test data can be used for subsequent maintenance operations on the test data table to supplement or update the original test data, ensuring the integrity and accuracy of the test data.

[0065] Step S30: Filter the test data table according to the configured filtering conditions to obtain the data to be maintained.

[0066] It should be noted that these configuration filtering conditions can also be pre-configured by the user based on different business scenarios. Based on the configured filtering conditions, it is possible to determine which data in the test data table has problems or needs to be updated after integrity verification.

[0067] It should be understood that the data to be maintained may be data that does not meet the requirements of the current business scenario, expired data, missing data, etc.; therefore, it is necessary to use newly acquired test data to perform the corresponding maintenance operations.

[0068] It should also be noted that if the filter conditions are empty, that is, no filter conditions are configured for the test data table, the entire test data table can be maintained by default, and the data to be maintained will be all the contents of the test data table.

[0069] Step S40: Perform data maintenance on the test data table based on the new test data and the data to be maintained, to obtain the target test data table.

[0070] It should be understood that when performing data maintenance, one can also query whether a configuration maintenance method exists. This maintenance method can include: synchronizing all test data, performing row-by-row operations, and performing batch operations—maintenance logic pre-configured by the user based on different business scenarios—thereby meeting the user's data maintenance needs in different business scenarios.

[0071] Understandably, after maintenance, the original test data table is updated and optimized to form the target test data table. This target test data table contains complete data, meets the requirements of effectiveness and accuracy in testing, provides reliable data support for subsequent testing tasks, and ensures the smooth progress of the testing process and the credibility of the test results.

[0072] Furthermore, after completing the maintenance operation of the test data table and obtaining the target test data table, the target test data table can be checked again to verify whether it meets the previously set configuration verification conditions. After step S40, the following steps are also included: steps S501 to S503:

[0073] Step S501: Determine whether the target test data table meets the configuration verification conditions.

[0074] Step S502: If not, then determine that the target test data table has data integrity.

[0075] It should be understood that since the aforementioned configuration verification conditions are used to determine whether the test data table lacks data integrity, if the target test data table does not meet the registration verification conditions, it means that the target test data table has passed the data integrity verification and no further data maintenance operations are required.

[0076] It should also be noted that if the target test data table still meets the configuration verification conditions, it means that the target test data table has not yet passed the data integrity verification. At this time, corresponding measures need to be taken, such as returning the target test data table as a new test data table to step S20 and repeating the data retrieval, data filtering and data maintenance operations until the target test data table no longer meets the above configuration verification conditions, that is, passes the data integrity verification.

[0077] Step S503: When the target test data table has data integrity, generate a data maintenance record based on the new test data and the data to be maintained, and send it to the user terminal.

[0078] It should be understood that when the target test data table meets the configuration verification conditions, it indicates that it has data integrity and can be used for subsequent testing. At this point, a data maintenance record is generated based on the new test data and the data to be maintained.

[0079] The data maintenance log records detailed information about the maintenance operation, including the maintenance time, the amount of data maintained, the comparison between the old and new data, the type of maintenance operation (such as synchronization, row-by-row operation, batch operation, etc.), and the data status after maintenance.

[0080] In practice, after generating a maintenance record based on new test data, data to be maintained, and configuration information executed during the aforementioned data verification and maintenance process, the device can send the data maintenance record to the user terminal so that the user can understand the execution status and results of the maintenance operation, ensure the accuracy and completeness of the test data, and provide reliable data support for subsequent testing work.

[0081] This embodiment can automatically determine whether there are data integrity issues in the test data table based on configured verification conditions, and automatically retrieve new data for maintenance when problems are found, effectively reducing manual intervention and lowering the complexity and cost of test data maintenance. At the same time, through flexible data retrieval configuration and filtering conditions, it can adapt to various different test scenarios and data requirements, improving the efficiency and accuracy of test data maintenance.

[0082] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2This is a flowchart illustrating the second embodiment of the method for maintaining test data in this application.

[0083] In this embodiment, to specifically illustrate the data verification process, step S10 specifically includes: steps S101 to S102:

[0084] Step S101: Obtain the test data table, and when the timed verification condition is met at the current time, trigger the data verification task of the test data table.

[0085] It should be understood that this scheduled verification condition can be a user-configured condition that triggers at a specific time or at fixed time intervals. For example, a user can configure verification to occur at 00:00 every day, or to occur every seven days. When the scheduled verification condition is met at the current time, a data verification task on the test data table can be triggered.

[0086] Step S102: When the data verification task is triggered, check in turn whether the original test data in the test data table is less than the total threshold corresponding to the total data verification condition.

[0087] Understandably, once the data verification task is triggered, the device can begin to perform a series of checks on the raw test data in the test data table to determine whether the data meets the integrity requirements.

[0088] It should be noted that the total data volume verification conditions can include: total table data volume conditions, total business scenario volume conditions, and total table SQL execution volume conditions. Furthermore, the total data volume verification conditions can be configured with a threshold for the total data volume used to determine the original test data.

[0089] Total Data Quantity Condition: Based on the user-configured check frequency, check whether the total data quantity of the entire test data table is lower than a set threshold. For example, the corresponding threshold can be set to 1000 data entries. If the current table only has 800 data entries, it is considered that the test data table may have a data missing problem.

[0090] Total Data Count for Specific Business Scenarios: Based on the user-configured check frequency, this feature checks test data for specific business scenarios to see if the total data volume falls below a set threshold. For example, in a business scenario, it checks whether the total test data volume related to the "product promotion" business scenario is below the threshold.

[0091] Table SQL Execution Volume Condition: Based on the user-configured check frequency, data can be retrieved by executing specific user-configured SQL statements, and the total amount of this data can be checked against a set threshold. For example, executing an SQL statement to query a specific type of test data, and then comparing the returned data volume to see if it is below the set threshold.

[0092] In the specific implementation, for each of the above data total quantity verification conditions, the actual total data quantity in the test data table is compared with the corresponding total quantity threshold to determine whether it is less than the threshold. If it is less than the threshold, it indicates that the test data table has a data integrity problem in this aspect, and subsequent maintenance operations are required; otherwise, no further maintenance operations are required.

[0093] Furthermore, after the above verification conditions are met, the data retrieval configuration can be checked to ensure that the latest test data can be obtained during subsequent data maintenance. Therefore, step S20 specifically includes: steps S201 to S203:

[0094] Step S201: If yes, then it is determined that the test data table does not have data integrity.

[0095] In practical implementation, if the original test data in the test data table is less than the total threshold corresponding to a certain verification condition, it indicates that the test data table has a data integrity problem. For example, if the total amount of data in the table is lower than the set threshold, or the total amount of data in a specific business scenario is insufficient, or the total amount of data obtained after executing SQL is too small, the test data table is incomplete and cannot meet the requirements of effectiveness and accuracy of the testing work.

[0096] Step S202: When the test data table does not have data integrity, query the data retrieval configuration information corresponding to the test data table, and determine the current data retrieval method and target data source according to the data retrieval configuration information. The target data source includes: business database, configuration test database, configuration script or configuration data generation rules.

[0097] It should be understood that once it is determined that the test data table lacks data integrity, the data retrieval configuration information corresponding to that test data table can be queried. This data retrieval configuration information specifies where to obtain new test data (data source) and how to obtain this new test data (data retrieval method).

[0098] The current data retrieval methods can be to obtain data directly from the database, by calling APIs or scripts, or by generating data according to data generation rules; the target data source can be the actual storage or test data generation location, which can include, for example, business databases, configuration test databases, configuration scripts, or configuration data generation rules, depending on the configuration.

[0099] The business database stores actual business data, from which real business data can be obtained as new test data. The configuration test database is a database specifically for testing, which may contain pre-processed or filtered test data. When using a configuration script as the target data source, new test data can be generated according to specific logic or rules using a pre-configured script, or data can be extracted and transformed from other data sources. Data generation rules can also be pre-configured by the user. When using configuration data generation rules as the target data source, new test data can be generated according to certain rules and algorithms, suitable for situations that require simulating specific scenarios or data patterns.

[0100] Step S203: Generate new test data based on the target data source according to the current data retrieval method.

[0101] In practice, after determining the current data retrieval method and the target data source, new test data is obtained or generated from the target data source according to the methods and rules specified in the data retrieval configuration information.

[0102] For example, if the current data retrieval method is to obtain data from the business database, then SQL query statements can be executed according to the configured database connection information, table names, fields, etc., to extract the required data as new test data;

[0103] If the current data retrieval method is to retrieve data from the configured test database, then based on the configuration of the test database, specific query methods or API interfaces can be used to obtain data that meets business requirements.

[0104] If the current data retrieval method is to execute a configured script, then the configured script can be run, thereby calling external APIs, reading files or other data sources through the script, and then processing the data according to the logic to generate new test data.

[0105] If the current data acquisition method is to generate data according to the data generation rules, new test data can be generated using data generation tools or programs based on the set data generation rules, such as data type, value range, generation algorithm, etc.

[0106] This embodiment verifies the test data table by configuring verification conditions. When the test data table lacks data integrity, new test data is generated by the data retrieval configuration. This new test data can be used for subsequent maintenance operations on the test data table to supplement or update the original test data, ensuring the integrity and accuracy of the test data. Compared to the existing methods where the test data verification and maintenance processes are separate, this embodiment can automatically trigger the subsequent test data maintenance process after data verification. Furthermore, the test data retrieval method can be configured, separating the data retrieval process from the subsequent specific maintenance process, thereby enabling the reuse of the data retrieval method in different business scenarios.

[0107] Based on the first and second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to that in embodiments one and two above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the method for maintaining test data in this application.

[0108] In this embodiment, to specifically illustrate ensuring the validity of data in the test data table during maintenance, after step S30, the following steps are also included: S01 to S02:

[0109] Step S01: Based on the configured expiration conditions, determine the original test data that is in an expired state in the test data table.

[0110] It should be understood that this expiration condition can be pre-defined to determine whether test data has expired. It can be defined based on factors such as data creation time, update time, and business validity period. By checking each record in the test data table and comparing it with the configured expiration condition, it can accurately determine which original test data is in an expired state.

[0111] For example, if the validity period of data is set to 30 days, then for a certain piece of data, if its last update time is more than 30 days from the current time, then this piece of data will be judged to be expired.

[0112] Step S02: Clear the expired original test data from the test data table to obtain the current test data table.

[0113] It should be understood that once expired data is identified in the test data table, this expired original test data can be removed from the test data table.

[0114] After the data was cleared, the remaining data constituted the current test data table. This current test data table has removed outdated data that no longer meets business requirements, providing a more accurate and refined data foundation for subsequent data maintenance operations.

[0115] Accordingly, step S40 includes:

[0116] Step S400: Perform data maintenance on the current test data table based on the new test data and the data to be maintained, to obtain the target test data table.

[0117] It should be understood that in this specific data maintenance step, the object of the maintenance operation can be the current test data table where expired data has been cleared.

[0118] In practice, the newly generated test data is combined with the previously determined data to be maintained, and the current test data table can be maintained according to the pre-configured maintenance strategy.

[0119] To illustrate in detail how to save new test data to the current test data, step S400 specifically includes: steps S401 to S404:

[0120] Step S401: Determine whether the new test data and the data to be maintained have the same data structure.

[0121] It should be understood that when maintaining the current test data table, different maintenance strategies can be adopted depending on whether the data structure of the new test data and the data to be maintained is the same: when the data structure is the same, a data synchronization strategy is used, as shown in steps S402 to S405 below; when the data structure is different, a row-by-row operation strategy is used, as shown in step S402' below, or a batch operation strategy is used, as shown in step S402" below. This is to meet the data maintenance needs of users in different business scenarios.

[0122] Step S402: If yes, then determine whether there is a record in the data to be maintained that has the same primary key as the new test data.

[0123] It should be understood that if the new test data and the data to be maintained have the same data structure—that is, they contain the same fields and data types—then primary key comparison and update / insert operations can be performed. First, check if a record with the same primary key as the new test data exists in the data to be maintained.

[0124] The primary key is a unique identifier for a data record, which can be used to distinguish different rows of data.

[0125] Step S403: When there are records with the same primary key, update the non-primary key fields corresponding to the records with the same primary key according to the new test data.

[0126] It should be noted that non-primary key fields are fields in a data record other than the primary key; they contain the specific content and attributes of the data.

[0127] In practice, if a record with the same primary key as the new test data exists in the data to be maintained, it means that the record needs to be updated. In this case, the non-primary key fields corresponding to the record with the same primary key can be updated based on the field values ​​in the new test data.

[0128] Step S404: If there are no records with the same primary key, insert the new test data into the current test data table.

[0129] In practice, if no record with the same primary key as the new test data exists in the data to be maintained, it indicates that this is a new data record. In this case, the new test data can be inserted into the current test data table to expand the data record.

[0130] Step S405: Obtain the target test data table based on the field update results and data insertion results.

[0131] It should be understood that, based on the results of the above update and insert operations, a target test data table can be obtained. This target test data table integrates the updated data and the newly inserted data, thereby ensuring the integrity and accuracy of the test data.

[0132] Furthermore, if the data structure of the new test data differs from that of the data to be maintained, other maintenance strategies are required, such as row-by-row replacement or batch replacement. Therefore, after step S401, the process also includes: step S402' or step S402":

[0133] Step S402': If not, divide the data to be maintained into several rows of data, determine the replacement row data corresponding to each row of data in the new test data, update the current test data table according to each replacement row of data, and obtain the target test data table.

[0134] It should be noted that the data to be maintained can be divided into several rows, and then a corresponding replacement row can be found for each row of data to be maintained in the new test data. Based on these replacement rows, the corresponding data rows in the current test data table are updated row by row, and finally the target test data table is obtained.

[0135] Specifically, the data update process can be as follows: if a record with the same primary key already exists in the test data table, the replacement row data with the same primary key can be updated to the corresponding non-primary key column in the test data table; if the corresponding column does not exist in the test data table, the replacement row data corresponding to the primary key can be ignored.

[0136] Step S402”: Divide the data to be maintained into several batches of data, determine the replacement batch data corresponding to each batch of data in the new test data, update the current test data table according to each replacement batch of data, and obtain the target test data table.

[0137] It should also be noted that the data to be maintained can be divided into several batches, and then the corresponding replacement batch data can be found for each batch of data to be maintained in the new test data. Based on these replacement batch data, the corresponding data in the current test data table is updated in batches, and finally the target test data table is obtained.

[0138] Specifically, the data update process is as follows: For rows in the new test data where the primary key already exists, the replacement batch data for the corresponding columns is updated; for rows where the primary key does not exist, the replacement batch data is directly inserted into the test data table. If the new test data contains a column that does not exist in the test data table, the replacement batch data corresponding to that column is ignored.

[0139] It should be understood that by pre-configuring different data maintenance strategies, it is possible to adapt to the data maintenance needs under different business scenarios, thereby realizing the function of maintaining test data according to different business scenarios. This eliminates the need for multiple manual interventions in the data to be maintained or the maintenance method, reducing the labor costs of the test data maintenance process and improving the efficiency of test data maintenance.

[0140] Furthermore, this can be referenced here. Figure 4 This document describes the entire process of maintaining the test data in this application. Figure 4 This is a schematic diagram illustrating the entire process of maintaining the test data for this application.

[0141] Depend on Figure 4 As can be seen, the method in this application can be divided into three stages: condition verification, data filtering, and data maintenance.

[0142] During the condition verification phase, the test data table can be verified by configuring verification conditions: the configuration verification task is triggered periodically, and then the total number of data records in the execution table, the number of data records related to specific business scenarios, and the number of SQL execution result records are all checked in turn to verify the total data volume. If the data is less than the threshold, it indicates that there is a data integrity problem in the test data table, and subsequent maintenance operations are required.

[0143] During the data filtering phase, once the above verification conditions are met, the data retrieval configuration can be checked to ensure that the latest test data can be obtained based on the data retrieval configuration information during subsequent data maintenance. The data retrieval configuration can consist of the data retrieval method and the target data source, such as: retrieving the entire data table from the business database, generating it from the database according to the configuration, generating it from an API or configuration script, or generating it according to the configured data generation rules.

[0144] In addition, based on the test data table and user-configured filtering conditions, data that meets the criteria and needs to be maintained can be filtered from the original test data table. If no test data filtering conditions are configured, the entire table will be maintained by default.

[0145] Based on the configured expiration conditions, the test data in the test data table that is in an expired state is cleaned up, and the current test data table is obtained to enter the subsequent data maintenance stage.

[0146] During the data maintenance phase, different data maintenance strategies can be determined based on different business scenarios to implement data maintenance operations: when the data structures are the same, a data synchronization strategy is adopted; when the data structures are different, a row-by-row operation strategy or a batch operation strategy is adopted. Furthermore, during this data maintenance operation, new test data can be generated based on the aforementioned data retrieval configuration information to ensure the reliability and integrity of the new test data.

[0147] After passing through the three stages of condition verification, data filtering, and data maintenance, redundant test data in the test data table can be cleaned up according to the configured cleanup conditions to finally obtain the target test data table. This completes the entire process from data verification to data maintenance.

[0148] Furthermore, once the entire maintenance process is complete, log records can be generated and messages can be sent to users to inform them of the total amount of data inserted, updated, and cleaned during this data maintenance process. This allows users to understand the execution status and results of the maintenance operations and provides reliable data support for subsequent testing.

[0149] Compared with existing methods, the method of this application can realize multiple configurations for the same test data table, complete data verification for test data in multiple different business scenarios and multiple maintenance batches. When the test data fails the integrity verification, the test data maintenance operation can be automatically executed without multiple manual interventions for the data or maintenance methods that need to be maintained, thereby reducing the labor cost of the test data maintenance process and improving the efficiency of test data maintenance.

[0150] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the method of maintaining the test data of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0151] This application also provides a test data maintenance system, referencing... Figure 5 , Figure 5 This is a schematic diagram of the module structure of the system for maintaining the test data of this application.

[0152] Depend on Figure 5 It can be seen that the test data maintenance system includes: condition verification module 501, data filtering module 502, and data maintenance module 503;

[0153] The condition verification module 501 is used to obtain the test data table and determine whether the test data table meets the configuration verification conditions, wherein the configuration verification conditions are used to determine whether the test data table lacks data integrity.

[0154] The data filtering module 502 is used to query the data retrieval configuration information corresponding to the test data table if the data is yes, and generate new test data according to the data retrieval configuration information;

[0155] The data filtering module 502 is also used to filter the test data table according to the configured filtering conditions to obtain the data to be maintained;

[0156] The data maintenance module 503 is used to maintain the test data table according to the new test data and the data to be maintained, so as to obtain the target test data table.

[0157] This embodiment can automatically determine whether there are data integrity issues in the test data table by configuring verification conditions, and automatically retrieve new data for maintenance when problems are found, effectively reducing manual intervention and lowering the complexity and cost of test data maintenance. At the same time, through flexible data retrieval configuration and filtering conditions, it can adapt to various different test scenarios and data requirements, improving the efficiency and accuracy of test data maintenance.

[0158] This application also provides a test data maintenance device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the test data maintenance method in the first embodiment described above.

[0159] The following is for reference. Figure 6 , Figure 6 This is a schematic diagram of the structure of the test data maintenance device for this application. The test data maintenance device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The equipment used to maintain the test data shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.

[0160] like Figure 6As shown, the test data maintenance device may include a processor 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the test data maintenance device. The processor 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the test data maintenance equipment to communicate wirelessly or wiredly with other equipment to exchange data. Although the figure shows test data maintenance equipment with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0161] The test data maintenance device provided in this application, employing the test data maintenance method in the above embodiments, can solve the technical problem of test data maintenance. Compared with the prior art, the beneficial effects of the test data maintenance device provided in this application are the same as those of the test data maintenance method provided in the above embodiments, and other technical features in the test data maintenance device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0162] This application also provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the test data maintenance method in the above embodiments.

[0163] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0164] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described test data maintenance method, thereby solving the technical problem of the test data maintenance method. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the test data maintenance method provided in the above embodiments, and will not be repeated here.

[0165] The above-mentioned embodiment numbers are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. They are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application's specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.

Claims

1. A method for maintaining test data, characterized in that, The method includes: Obtain the test data table and determine whether the test data table meets the configuration verification conditions. The configuration verification conditions are used to determine whether the test data table lacks data integrity. If so, query the data retrieval configuration information corresponding to the test data table, and generate new test data according to the data retrieval configuration information; The test data table is filtered according to the configured filtering conditions to obtain the data to be maintained. The test data table is maintained based on the new test data and the data to be maintained to obtain the target test data table.

2. The method as described in claim 1, characterized in that, The configuration verification conditions include: timed verification conditions and total data volume verification conditions. The step of obtaining the test data table and determining whether the test data table meets the configuration verification conditions includes: Obtain the test data table, and when the timed verification condition is met at the current moment, trigger the data verification task of the test data table; When the data verification task is triggered, the original test data in the test data table is checked sequentially to see if it is less than the total threshold corresponding to the total data verification condition. The data total quantity verification conditions include: table data total quantity condition, business scenario total quantity condition, and table SQL execution quantity condition.

3. The method as described in claim 1, characterized in that, If so, the step of querying the data retrieval configuration information corresponding to the test data table and generating new test data according to the data retrieval configuration information includes: If so, the test data table is determined to lack data integrity. When the test data table lacks data integrity, the data retrieval configuration information corresponding to the test data table is queried, and the current data retrieval method and target data source are determined based on the data retrieval configuration information. The target data source includes: business database, configuration test database, configuration script or configuration data generation rules. New test data is generated based on the target data source according to the current data retrieval method.

4. The method as described in claim 1, characterized in that, After the step of filtering the test data table according to the configured filtering conditions to obtain the data to be maintained, the method further includes: Based on the configured expiration conditions, the original test data that is in an expired state is determined in the test data table; The expired original test data is cleared from the test data table to obtain the current test data table; Accordingly, the step of maintaining the test data table based on the new test data and the data to be maintained to obtain the target test data table includes: The current test data table is maintained based on the new test data and the data to be maintained to obtain the target test data table.

5. The method as described in claim 4, characterized in that, The step of maintaining the current test data table based on the new test data and the data to be maintained to obtain the target test data table includes: Determine whether the new test data and the data to be maintained have the same data structure; If so, determine whether there is a record in the data to be maintained that has the same primary key as the new test data; If records with the same primary key exist, update the non-primary key fields corresponding to the records with the same primary key based on the new test data; If no record with the same primary key exists, the new test data is inserted into the current test data table; The target test data table is obtained based on the field update results and data insertion results.

6. The method as described in claim 5, characterized in that, After the step of determining whether the new test data and the data to be maintained have the same data structure, the method further includes: If not, the data to be maintained is divided into several rows of data, and the replacement row data corresponding to each row of data is determined in the new test data. The current test data table is updated according to each replacement row data to obtain the target test data table. Alternatively, the data to be maintained can be divided into several batches, and replacement batch data corresponding to each batch can be determined in the new test data. The current test data table can be updated according to each replacement batch data to obtain the target test data table.

7. The method as described in claim 1, characterized in that, After the step of obtaining the target test data table, the method further includes: Determine whether the target test data table meets the configuration verification conditions; If not, then the target test data table is determined to have data integrity; When the target test data table has data integrity, a data maintenance record is generated based on the new test data and the data to be maintained and sent to the user terminal.

8. A test data maintenance system, characterized in that, The system includes: The condition verification module is used to obtain the test data table and determine whether the test data table meets the configuration verification conditions. The configuration verification conditions are used to determine whether the test data table lacks data integrity. The data filtering module is used to query the data retrieval configuration information corresponding to the test data table if the data is yes, and generate new test data according to the data retrieval configuration information; The data filtering module is also used to filter the test data table according to the configured filtering conditions to obtain the data to be maintained; The data maintenance module is used to maintain the test data table based on the new test data and the data to be maintained, so as to obtain the target test data table.

9. A test data maintenance device, characterized in that, The device includes: a memory, a processor, and a test data maintenance program stored in the memory and executable on the processor, the test data maintenance program being configured to implement the steps of the test data maintenance method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and the storage medium stores a test data maintenance program. When the test data maintenance program is executed by a processor, it implements the steps of the test data maintenance method as described in any one of claims 1 to 7.