Data synchronization test method, device, equipment, medium and program product
Automatically generate test cases and execute them by user configuration parameters, solving the problem of functional accuracy and stability of data synchronization products in IT architecture transformation and system upgrade migration, and achieving efficient and accurate data synchronization testing.
Patent Information
- Application Number
- CN202411838144.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-18
AI Technical Summary
In IT architecture transformation, system upgrade and migration, or upstream and downstream business data transmission projects, how to ensure the accuracy and stability of data synchronization product functions to avoid data inconsistency or loss.
Test cases are automatically generated through user configuration parameter information, and the test cases are executed to change the source database data, and synchronize these changes to the target database. Finally, the synchronization test results are determined based on the data differences between the two ends.
Improve the test efficiency and accuracy of results. The automated test process can quickly execute a large number of test cases, save the workload of manual evaluation of test results, and avoid the impact of manual subjective evaluation.
Smart Images

Figure CN119645873A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of financial technology and big data technology, and more specifically to a data synchronization testing method, device, equipment, medium and program product. Background Art
[0002] In the development process of IT architecture transformation, system upgrade and migration, or upstream and downstream business data transmission projects, data synchronization products or tools are often used for data replication and synchronization. These data synchronization products or tools generally obtain the source database data change log, and then parse and convert it, and transmit it to the target database for synchronization. As an important digital asset of the enterprise, business data must ensure that the production data migration and synchronization functions are accurate after the data synchronization product is put into use, avoiding problems such as data inconsistency and data loss. Project testers play an important role in quality control before data synchronization products are put into production. How to ensure the accuracy and stability of data synchronization product functions is a technical problem that needs to be solved urgently by testers. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a data synchronization test method, apparatus, device, medium and program product for improving test efficiency and test result accuracy.
[0004] According to the first aspect of the present disclosure, a data synchronization test method is provided, including: in response to user-configured parameter information, generating a test case corresponding to the parameter information, the test case being configured to change first data in a source database when the source database executes the test case, and the parameter information is used to indicate at least one data source of the test case; in response to the source database executing the test case, changing at least one first data to generate third data, synchronously triggering at least one second data in a target database to be changed to generate fourth data, the first data and the second data being associated with each other; determining a synchronization test result based on difference data between the third data and the fourth data.
[0005] According to an embodiment of the present disclosure, in response to user-configured parameter information, a test case corresponding to the parameter information is generated, including: when the parameter information includes a first parameter, a first test case is generated, and the first parameter allows the data asset system to serve as a data source for the first test case.
[0006] According to an embodiment of the present disclosure, when the parameter information includes a first parameter, a first test case is generated, including: obtaining a table data structure of a data asset system, the table data structure representing at least one data change type and multiple data combination types of table data in the data asset system; and generating a first test case that matches the data change type and the data combination type according to the table data structure.
[0007] According to an embodiment of the present disclosure, in response to user-configured parameter information, a test case corresponding to the parameter information is generated, and also includes: when the parameter information includes a second parameter, a second test case is generated, and the second parameter allows the production operation and maintenance system to serve as the data source for the second test case.
[0008] According to an embodiment of the present disclosure, when the parameter information includes a second parameter, a second test case is generated, including: obtaining characteristic information of production data in the production operation and maintenance system, the characteristic information including at least one of table record size, data volume and change frequency; based on the characteristic information, generating a second test case that matches the production data.
[0009] According to an embodiment of the present disclosure, a synchronization test result is determined based on the difference data between the third data and the fourth data, including: determining the number of successful synchronizations between the target database and the source database during the data synchronization process based on the difference data; determining at least one of the data synchronization success rate and the data synchronization rate based on the number of successful synchronizations to obtain the synchronization test result.
[0010] According to an embodiment of the present disclosure, at least one of a data synchronization success rate and a data synchronization rate is determined based on the number of successful synchronization items, including: determining the total number of data synchronization items during the data synchronization process, calculating the ratio of the number of successful synchronization items to the total number of data synchronization items, and obtaining the data synchronization success rate; determining the time span between the synchronization start time of the source database during the data synchronization process and the synchronization end time of the target database during the data synchronization process, calculating the ratio between the number of successful synchronization items and the time span, and obtaining the data synchronization rate.
[0011] According to an embodiment of the present disclosure, the above method further includes: visually displaying at least one of a synchronization success rate and a data synchronization rate to a user.
[0012] According to an embodiment of the present disclosure, the above method also includes: obtaining synchronization failure test cases and synchronization failure logs during the data synchronization process; submitting the synchronization failure test cases and synchronization failure logs to the defect management system so that the defect management system tracks and processes the data synchronization system.
[0013] A second aspect of the present disclosure provides a data synchronization test device, including: a generation module, for generating a test case corresponding to the parameter information in response to user configuration parameter information, the test case being configured to change the first data in the source database when the test case is executed in the source database, and the parameter information is used to indicate at least one data source of the test case; a trigger module, for changing at least one first data to generate third data in response to the source database executing the test case, synchronously triggering at least one second data in the target database to change to generate fourth data, the first data and the second data being associated with each other; and a determination module, for determining a synchronization test result based on the difference data between the third data and the fourth data.
[0014] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0015] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0016] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.
[0017] According to the data synchronization test method, device, equipment, medium and program product of the embodiment of the present disclosure, the data source and test scenario of the test case can be flexibly specified through the parameters configured by the user, so as to meet different test requirements. Test cases with multiple data sources enable the data synchronization process to cover different data synchronization scenarios and data sources, thereby improving the effectiveness and accuracy of the test results. According to the user's configuration instructions, different test cases can be automatically generated. By configuring the data synchronization test parameter information on the front end, and automatically building and parsing the test case test data on the back end, the problem of coupling the test case number generation with the tool script can be solved, and the time and labor cost of manually writing test cases can be reduced. The automated test process can quickly execute a large number of test cases and improve test efficiency. By comparing the changes in the data on the source and target ends, the synchronization test results can be automatically and accurately obtained, saving the workload of manually evaluating the test results and avoiding the influence of manual subjective evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0019] Figure 1 A diagram schematically illustrates an application scenario of a data synchronization test method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0020] Figure 2 A flowchart of a data synchronization test method according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 3 A flowchart of a data synchronization test method according to some embodiments of the present disclosure is schematically shown;
[0022] Figure 4 A flowchart of a data synchronization test method according to some embodiments of the present disclosure is schematically shown;
[0023] Figure 5 A structural block diagram of a data synchronization test device according to an embodiment of the present disclosure is schematically shown; and
[0024] Figure 6 A block diagram of an electronic device suitable for implementing a data synchronization test method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0028] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0029] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0031] In the process of realizing the concept of the present disclosure, the inventor found that the existing technical solutions have the following deficiencies: in terms of test data design and preparation, first, the efficiency of test data preparation is not high enough. Although there are number-making scripts to assist in data preparation, it is necessary to sort out various data formats in advance, and then write data generation scripts according to the data formats and rules, and perform test debugging. There is a lot of preparation work in advance and it is difficult for testers with general technical capabilities. Second, the test data designed and prepared often depends on the test experience of the tester and the understanding of the project transformation content. The prepared data is difficult to be close to the actual production situation, and there is a risk of insufficient testing. Third, the flexibility and portability of the number-making tool are not high enough. If a new table is added or applied to other business databases, the script needs to be modified or redeveloped. In terms of test verification of data synchronization function, first, although there are data verification tools to assist in test verification, it is still necessary to manually initiate and check the results during the test process. This step fails to be automatically triggered in the test process, and there are breakpoints. Second, when testing the synchronization of large amounts of data, it fails to intuitively display indicators such as the rate and success rate of data migration and replication. Third, anomalies and problems arising from data synchronization verification testing require manual intervention and submission to the defect management system for tracking.
[0032] In view of the above problems, an embodiment of the present disclosure provides a data synchronization testing method, which automatically generates test cases based on user configuration parameter information, executes the test cases to change the source database data, and synchronizes these changes to the target database, and finally determines the synchronization test result based on the data difference between the two ends.
[0033] Figure 1 The application scenario diagram of the data synchronization test method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0034] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0035] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0036] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0037] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0038] It should be noted that the data synchronization test method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data synchronization test device provided in the embodiment of the present disclosure can generally be set in the server 105. The data synchronization test method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the data synchronization test device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0040] The following will be based on Figure 1 The scene described by Figure 2 The data synchronization test method of the disclosed embodiment is described in detail.
[0041] Figure 2 The flowchart of the data synchronization test method according to the embodiment of the present disclosure is schematically shown.
[0042] like Figure 2 As shown, the data synchronization test method of this embodiment may include operations S210 to S230, and the data synchronization test method may be executed by the server 105.
[0043] In operation S210, in response to user configuration parameter information, a test case corresponding to the parameter information is generated, the test case is configured to change the first data in the source database when the test case is executed in the source database, and the parameter information is used to indicate at least one data source of the test case.
[0044] The user inputs configuration parameter information, and the system can automatically generate one or more test cases based on these parameters. These test cases can have different data sources. Different data sources can obtain test cases with different purposes and functions. In this way, when these test cases are used for synchronization testing, different data synchronization situations that the synchronization system needs to handle during real operation can be simulated as much as possible, and synchronization test results that are as accurate as possible and more meaningful for reference can be obtained. In this embodiment, the first data can be the original data of the source database.
[0045] In operation S220, in response to the source database executing the test case, at least one first data is changed to generate third data, and at least one second data in the target database is synchronously triggered to be changed to generate fourth data, and the first data and the second data are associated with each other.
[0046] Before executing the test case, the source database can first establish a synchronization mapping relationship with the target database, such as configuring the database source and target database types, IP addresses, ports, test synchronization table names, mapping relationships between source tables and target tables, etc. In this way, when the source database executes the test case, the original data of the source database changes, and the original data of the target database also changes accordingly. The second data can be the original data of the target database. Before performing the synchronization data test, the original data of the target database and the source database are associated, for example, they can be exactly the same data, or they can be one-to-one corresponding data. As an example, the execution of the test case can be set by the user. For example, the running information of the test task can be set by the user, including setting a fixed time execution, periodic timing execution, or the user can manually click to execute immediately. Multi-threading technology can be used to execute multiple test tasks concurrently at the same time, and to support the concurrent execution of multiple test cases in a test task.
[0047] In operation S230, a synchronization test result is determined according to difference data between the third data and the fourth data.
[0048] The difference data may include, for example, records that failed to synchronize correctly, field value mismatches, etc. By comparing the data in the source database and the target database, it is possible to determine which records are successfully synchronized (i.e., the data of the two are consistent) and which records are not synchronized (i.e., the data of the two are inconsistent). It is understandable that the smaller the difference data volume and the difference data range between the third data and the fourth data, the better the synchronization effect. The synchronization test results may be numerical quantitative results, and these difference data may be quantitatively analyzed to obtain quantifiable synchronization test results, thereby accurately representing the effect of the synchronization test.
[0049] Through the data synchronization test method of the above embodiment, the data source and test scenario of the test case can be flexibly specified according to the parameters configured by the user, so as to meet different test requirements. Test cases with multiple data sources enable the data synchronization process to cover different data synchronization scenarios and data sources, thereby improving the effectiveness and accuracy of the test results. According to the user's configuration instructions, different test cases can be automatically generated. By configuring the data synchronization test parameter information on the front end, and automatically building and parsing the test case test data on the back end, the problem of coupling the test case number generation with the tool script can be solved, and the time and labor cost of manually writing test cases can be reduced. The automated test process can quickly execute a large number of test cases and improve test efficiency. By comparing the changes in the source and target data, the synchronization test results can be automatically and accurately obtained, saving the workload of manually evaluating the test results and avoiding the influence of manual subjective evaluation.
[0050] Based on the above embodiment, the above operation S210 may include: generating a first test case when the parameter information includes a first parameter, and the first parameter allows the data asset system to serve as a data source for the first test case.
[0051] The data asset system can be a system that stores a large amount of data resources, which can contain various types of normal and abnormal test data. The first parameter can be, for example, an interface parameter for obtaining typical test data in the data asset system, so that the system under test can obtain the target data in the data asset system as the data source for the test case. In other words, when the test case is executed, it will obtain the required data from the data asset system and use this data to perform the test. By linking the data asset system, test cases covering a large number of test data types can be automatically constructed, so that the test cases have a wide coverage, and when performing data synchronization tests, the accuracy of the test results can be improved.
[0052] On the basis of the above embodiment, when the parameter information includes a first parameter, a first test case is generated, including: obtaining a table data structure of a data asset system, the table data structure representing at least one data change type and multiple data combination types of table data in the data asset system; and generating a first test case matching the data change type and the data combination type according to the table data structure.
[0053] The table data structure may include the table fields, field types, relationships between fields, possible types of changes in table data, and multiple types of data combinations. The table data structure can be obtained by querying the metadata of the data asset system. The data change type of the test data can be, for example, the data addition, modification, and deletion operations, which can be generated according to the configured parameters, and these three types of test cases can be generated at the same time. Generate test cases for various data combinations, for example, according to the table structure information, generate a test case for the longest record length data and a test case for the shortest record length data respectively. The test data of the longest record can be generated according to the maximum length value defined for each field in the table, and the test data of the shortest record can be generated by assigning a null value to a nullable field and a minimum length value to a non-null field. The test cases for various data combinations can be test cases containing special abnormal data such as special characters and rare characters. Special abnormal data can be assigned to the character table field value to generate test cases containing special abnormal characters. The test cases for various data combinations can be test cases for data addition, deletion, and modification that can be executed by various databases generated according to different source database types.
[0054] By obtaining the table data structure of the data asset system and generating the first test case matching the data change type and combination type according to the structure, it can be ensured that the test case can comprehensively and accurately test the data change and synchronization process in the data asset system. In this way, the efficiency and accuracy of database synchronization testing can be improved, thereby ensuring the stability and reliability of the database system.
[0055] Based on the above embodiment, the above operation S210 may further include: generating a second test case when the parameter information includes a second parameter, and the second parameter allows the production operation and maintenance system to serve as a data source for the second test case.
[0056] The production operation and maintenance system usually contains data and operation records in the actual operating environment, which are crucial for testing the performance of the database synchronization mechanism in the actual environment. Due to the role of the second parameter, the production operation and maintenance system becomes the data source for the second test case. This means that when the test case is executed, it will retrieve the required data from the production operation and maintenance system, such as actual data change records, operation logs, etc., and use these data to perform the test. When executing the second test case on the source database, the actual data change operation can be simulated based on the data obtained from the production operation and maintenance system. These data changes will trigger changes to the corresponding data in the target database. By linking with the production operation and maintenance system, test data can be obtained from the production operation and maintenance system to execute test cases close to production data, which can ensure the accuracy and reliability of the database synchronization mechanism in the actual operating environment.
[0057] It should be emphasized that the second parameter can be configured simultaneously with the first parameter or configured separately and independently, and this disclosure does not make any specific limitation.
[0058] On the basis of the above embodiment, when the parameter information includes a second parameter, a second test case is generated, including: obtaining characteristic information of production data in the production operation and maintenance system, the characteristic information including at least one of table record size, data volume and change frequency; based on the characteristic information, generating a second test case that matches the production data.
[0059] The characteristic information of production data includes many aspects, such as table record size (storage space occupied by each record), data volume (total number of records in the table), change frequency (rate at which data changes), etc. This information can reflect the actual situation and dynamic changes of production data. By obtaining and analyzing this characteristic information, test cases can simulate data changes with similar characteristics to production data, and simulate production of test cases that fit the real production environment.
[0060] As an example, you can obtain the number of requests per second (QPS) for production table data changes, and generate table data change test cases with corresponding QPS in multiple threads. You can obtain the average length of each field value in the production table, and simulate and generate test cases that are close to the actual length of production data. You can obtain the distribution of production table field data values, such as null, non-null, numeric values, character values, special characters, and other distribution characteristics, and simulate and generate table data change test cases with corresponding data characteristics. You can obtain the total number of records in the production environment table and generate the base data volume for the test environment table.
[0061] By obtaining the characteristic information of production data in the production operation and maintenance system and automatically generating test cases close to the production scenario based on this characteristic information, the performance and reliability of the database synchronization mechanism in the actual operating environment can be more accurately evaluated.
[0062] Based on the above embodiment, the above operation S230 may include: determining the synchronization test result according to the difference data between the third data and the fourth data, including: determining at least one of the data synchronization success rate and the data synchronization rate according to the difference data to obtain the synchronization test result.
[0063] The data synchronization success rate refers to the ratio of the number of successfully synchronized records to the total number of records. The data synchronization success rate can reflect the accuracy and reliability of the data synchronization process. The data synchronization rate refers to the number of successfully synchronized records per unit time. The data synchronization rate can reflect the efficiency and performance of the data synchronization process. Through quantitative analysis of differential data, the specific values of the data synchronization success rate and data synchronization rate can be obtained, and the automatic inspection and verification of data synchronization results can be realized, as well as the automatic summary and statistics of indicators such as data replication rate and success rate, to obtain comprehensive synchronization test results. These test results are of great significance for evaluating the performance and reliability of the data synchronization mechanism, and can provide a basis for subsequent optimization and improvement.
[0064] On the basis of the above embodiments, at least one of the data synchronization success rate and the data synchronization rate is determined according to the difference data, including: determining the number of successful synchronization items of the target database and the source database during the data synchronization process according to the difference data; determining the total number of data synchronization items during the data synchronization process, calculating the ratio of the number of successful synchronization items to the total number of data synchronization items, and obtaining the data synchronization success rate; determining the time span between the synchronization start time of the source database during the data synchronization process and the synchronization end time of the target database during the data synchronization process, calculating the ratio between the number of successful synchronization items and the time span, and obtaining the data synchronization rate.
[0065] The number of successful synchronizations, that is, the number of records that are successfully synchronized, can be achieved by filtering and counting the difference data. The number of successful synchronization records represents the amount of data that is correctly transmitted and applied during the data synchronization process. As an example, the test data of the source database test case can be used to check whether the record value synchronized by the target database is consistent. For example, the query comparison can be performed based on the record primary key and the synchronization mapping relationship. If they are consistent, it means that the synchronization is successful. If they are inconsistent or the record does not exist, it means that the synchronization has failed. The number of changes in the target database records can be checked. According to the number of records added, modified, and deleted in the test case, the number of changes in the target database table records after synchronization can be checked to see whether they are correct. After counting the number of successful synchronizations, the synchronization success rate and data synchronization rate can be calculated according to the preset program. The data synchronization success rate can be obtained by dividing the number of successful data synchronization records this time by the total number of data synchronizations. The data synchronization rate can be obtained by dividing the number of successful data synchronization records by the difference between the timestamp of the last data entry in the target database and the timestamp of the synchronization initiation of the first data entry in the source database. In this way, the data synchronization success rate and data synchronization rate can be obtained quickly and accurately.
[0066] Figure 3 The flowchart of the data synchronization test method according to some embodiments of the present disclosure is schematically shown.
[0067] like Figure 3 As shown, in some embodiments, the data synchronization test method may include operations S310 to S340.
[0068] In operation S310 , in response to user configuration parameter information, a test case corresponding to the parameter information is generated, where the parameter information is used to indicate at least one data source of the test case.
[0069] In operation S320 , in response to the source database executing the test case, at least one first data is changed to generate third data, and at least one second data in the target database is synchronously triggered to be changed to generate fourth data.
[0070] In operation S330, at least one of a synchronization success rate and a data synchronization rate is determined according to difference data between the third data and the fourth data.
[0071] The contents of operation S310 to operation S330 can be found in the previous related contents and will not be repeated here.
[0072] In operation S340, at least one of a synchronization success rate and a data synchronization rate is visually displayed to a user.
[0073] Visualization tools can include dashboards, report generators, data visualization libraries, etc. Appropriate chart types (such as bar charts, line charts, pie charts, etc.) can be used to display the synchronization success rate and data synchronization rate. If needed, interactive functions can be added to the visualization interface, such as data filtering, time range selection, chart zooming, etc., to help users analyze data more deeply and obtain the required information. By visually displaying key indicators such as synchronization success rate and data synchronization rate to users, users can better understand the performance and effect of the data synchronization process and provide a reliable basis for user decision-making.
[0074] Figure 4 The flowchart of the data synchronization test method according to some embodiments of the present disclosure is schematically shown.
[0075] like Figure 4 As shown, in some embodiments, the data synchronization test method may include operations S410 to S440.
[0076] In operation S410, in response to user configuration parameter information, a test case corresponding to the parameter information is generated, where the parameter information is used to indicate at least one data source of the test case.
[0077] In operation S420, in response to the source database executing the test case, at least one first data is changed to generate third data, and at least one second data in the target database is synchronously triggered to be changed to generate fourth data.
[0078] In operation S430, a synchronization test result is determined according to difference data between the third data and the fourth data.
[0079] The contents of operation S410 to operation S430 can be found in the previous related contents and will not be repeated here.
[0080] In operation S440, synchronization failure test cases and synchronization failure logs in the data synchronization process are obtained, and the synchronization failure test cases and synchronization failure logs are submitted to the defect management system so that the defect management system tracks and processes the data synchronization system.
[0081] For example, you can use a dedicated monitoring tool or script to regularly check the status and results of data synchronization. The synchronization failure log can include the time, cause, affected data set, and any related error codes or messages of the synchronization failure. As an example, when the test result verification and statistical device inspection find that a certain data synchronization failure has occurred, you can use the inspection result (the target database data is inconsistent, the target database data does not exist, etc.) as the problem description, attach the test case and test data that initiated the synchronization, and the log of the data synchronization product, call the defect management system problem new interface, and submit the problem.
[0082] By automatically submitting test failures to the defect management system for tracking, the entire process from test data design preparation to test defect submission can be automated, effectively improving the test efficiency and quality of data replication and synchronization.
[0083] According to the above multiple embodiments, comprehensive automated verification of data synchronization products can be achieved, including automatic generation of various data synchronization test cases, initiation and execution of data synchronization tests on the system under test, automatic verification of data synchronization results and statistics of various indicator information, which effectively solves the problem that the test efficiency is not high enough and the test quality depends on the test experience of the tester, and greatly improves the test efficiency and timeliness of the test. In terms of test data preparation, it can be linked with the data asset system to obtain the data structure of the table, and automatically build test cases covering various test data combinations based on information such as the table structure. It can be linked with the production operation and maintenance system to obtain information such as the table record size, data volume, and change frequency, and simulate and generate test data close to the production use scenario based on this information. The front-end configuration data synchronization test object information, the back-end automatically builds a method of parsing and generating test case test data, and the database and table that need to be tested and synchronized can be flexibly configured according to the needs of the project test, solving the problem of coupling between test case number making and tool script. It can support the preparation of data synchronization test data for multiple databases. Various normal and abnormal test data can be accumulated, precipitated and reused as test assets. In terms of data synchronization test execution, it can realize automatic triggering of data synchronization test, support manual triggering or scheduled automatic execution of test tasks, and support concurrent execution of multiple test tasks. It can realize automatic inspection and verification of data synchronization results, and automatically summarize and count the results of indicators such as data replication rate and success rate. It can automatically submit the problems that fail the test to the defect management system for tracking. It can realize the automation of the whole process from test data design preparation to test defect problem submission, effectively improving the test efficiency and test quality of data replication synchronization.
[0084] Based on the above data synchronization test method, the present disclosure also provides a data synchronization test device. Figure 5 The device is described in detail.
[0085] Figure 5 The structural block diagram of the data synchronization test device according to the embodiment of the present disclosure is schematically shown.
[0086] like Figure 5 As shown, the data synchronization testing device 500 of this embodiment includes a generating module 510 , a triggering module 520 and a determining module 530 .
[0087] The generation module 510 is used to generate a test case corresponding to the parameter information in response to the user configuration parameter information, the test case is configured to change the first data in the source database when the test case is executed in the source database, and the parameter information is used to indicate at least one data source of the test case. In one embodiment, the generation module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0088] The trigger module 520 is used to respond to the source database executing the test case, change at least one first data to generate third data, and synchronously trigger at least one second data in the target database to change to generate fourth data, and the first data and the second data are related to each other. In one embodiment, the trigger module 520 can be used to perform the operation S220 described above, which will not be repeated here.
[0089] The determination module 530 is used to determine the synchronization test result according to the difference data between the third data and the fourth data. In one embodiment, the determination module 530 can be used to perform the operation S230 described above, which will not be described in detail here.
[0090] According to an embodiment of the present disclosure, the generation module 510 can be specifically used to generate a first test case when the parameter information includes a first parameter, and the first parameter allows the data asset system to be the data source of the first test case. The generation module 510 can also be specifically used to obtain a table data structure of the data asset system, the table data structure represents at least one data change type and multiple data combination types of table data in the data asset system; based on the table data structure, a first test case matching the data change type and the data combination type is generated. The relevant content can be referred to the previous text and will not be repeated here.
[0091] According to an embodiment of the present disclosure, the generation module 510 can be specifically used to generate a second test case when the parameter information includes a second parameter, and the second parameter allows the production operation and maintenance system to be the data source of the second test case. The generation module 510 can also be specifically used to obtain characteristic information of production data in the production operation and maintenance system, the characteristic information including at least one of table record size, data volume and change frequency; based on the characteristic information, a second test case matching the production data is generated. The relevant content can be referred to the previous text and will not be repeated here.
[0092] According to an embodiment of the present disclosure, the determination module 530 can be specifically used to determine at least one of the data synchronization success rate and the data synchronization rate based on the difference data to obtain the synchronization test result. The determination module 530 can also be specifically used to determine the number of successful synchronizations of the target database and the source database during the data synchronization process based on the difference data; determine the total number of data synchronizations during the data synchronization process, calculate the ratio of the number of successful synchronizations to the total number of data synchronizations, and obtain the data synchronization success rate; determine the time span between the synchronization start time of the source database during the data synchronization process and the synchronization end time of the target database during the data synchronization process, calculate the ratio between the number of successful synchronizations and the time span, and obtain the data synchronization rate. The relevant content can be referred to the previous text and will not be repeated here.
[0093] According to an embodiment of the present disclosure, the data synchronization test device 500 may further include a display module. The display module is used to visually display at least one of the synchronization success rate and the data synchronization rate to the user. The relevant content can be referred to above and will not be repeated here.
[0094] According to an embodiment of the present disclosure, the data synchronization test device 500 may further include a submission module. The submission module is used to obtain synchronization failure test cases and synchronization failure logs during the data synchronization process; submit the synchronization failure test cases and synchronization failure logs to the defect management system so that the defect management system tracks and processes the data synchronization system. The relevant content can be referred to above and will not be repeated here.
[0095] According to an embodiment of the present disclosure, any multiple modules of the generation module 510, the trigger module 520 and the determination module 530 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the generation module 510, the trigger module 520 and the determination module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the generation module 510, the trigger module 520 and the determination module 530 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0096] Figure 6A block diagram of an electronic device suitable for implementing a data synchronization test method according to an embodiment of the present disclosure is schematically shown.
[0097] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0098] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0099] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0100] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0101] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0102] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the data synchronization test method provided by the embodiment of the present disclosure.
[0103] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0104] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0105] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0106] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0107] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0109] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data synchronization test method, characterized in that: The method comprises: In response to user-configured parameter information, generating a test case corresponding to the parameter information, wherein the test case is configured to change first data in the source database when the test case is executed in the source database, and the parameter information is used to indicate at least one data source of the test case; In response to the source database executing the test case, at least one of the first data is changed to generate third data, and at least one of the second data in the target database is synchronously triggered to be changed to generate fourth data, wherein the first data and the second data are associated with each other; A synchronization test result is determined according to difference data between the third data and the fourth data.
2. The data synchronization test method according to claim 1, characterized in that: The step of generating a test case corresponding to the parameter information in response to the user configuration parameter information includes: In a case where the parameter information includes a first parameter, a first test case is generated, where the first parameter allows the data asset system to serve as a data source for the first test case.
3. The data synchronization test method according to claim 2, characterized in that: The step of generating a first test case when the parameter information includes the first parameter includes: Acquire a table data structure of the data asset system, wherein the table data structure represents at least one data change type and multiple data combination types of table data in the data asset system; The first test case matching the data change type and the data combination type is generated according to the table data structure.
4. The data synchronization test method according to claim 1, characterized in that: The step of generating a test case corresponding to the parameter information in response to the user configuration parameter information further includes: In a case where the parameter information includes a second parameter, a second test case is generated, and the second parameter allows the production operation and maintenance system to serve as a data source for the second test case.
5. The data synchronization test method according to claim 4, characterized in that: The step of generating a second test case when the parameter information includes the second parameter includes: Acquire characteristic information of production data in the production operation and maintenance system, wherein the characteristic information includes at least one of table record size, data volume, and change frequency; The second test case matching the production data is generated according to the feature information.
6. The data synchronization test method according to claim 1, characterized in that: The step of determining a synchronization test result according to difference data between the third data and the fourth data includes: At least one of a data synchronization success rate and a data synchronization rate is determined based on the difference data to obtain the synchronization test result.
7. The data synchronization test method according to claim 6, characterized in that: The determining at least one of a data synchronization success rate and a data synchronization rate according to the difference data comprises: Determine the number of successful synchronizations between the target database and the source database during the data synchronization process according to the difference data; Determine the total number of data synchronizations during the data synchronization process, calculate the ratio of the number of successful synchronizations to the total number of data synchronizations, and obtain the data synchronization success rate; Determine the time span between the synchronization start time of the source database during the data synchronization process and the synchronization end time of the target database during the data synchronization process, calculate the ratio between the number of successful synchronizations and the time span, and obtain the data synchronization rate.
8. The data synchronization test method according to claim 6, characterized in that: The method further comprises: At least one of the synchronization success rate and the data synchronization rate is visually displayed to the user.
9. The data synchronization test method according to claim 1, characterized in that: The method further comprises: Obtain synchronization failure test cases and synchronization failure logs during data synchronization; Submit the synchronization failure test case and the synchronization failure log to a defect management system so that the defect management system can track and process the data synchronization system.
10. A data synchronization test device, characterized in that: The device comprises: a generating module, configured to generate a test case corresponding to the parameter information in response to user configuration parameter information, wherein the test case is configured to change first data in the source database when the test case is executed in the source database, and the parameter information is used to indicate at least one data source of the test case; a trigger module, configured to, in response to the source database executing the test case, change at least one of the first data to generate third data, and synchronously trigger at least one of the second data in the target database to change to generate fourth data, wherein the first data and the second data are associated with each other; and The determination module is used to determine the synchronization test result according to the difference data between the third data and the fourth data.
11. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.