Data Consistency Verification Method, Device, System and Medium Based on Production Environment

By generating interface parameter files and configuration comparison configuration information in the field of financial technology, creating data comparison tasks and calling interfaces between old and new systems, the problem of insufficient efficiency and accuracy of interface data consistency verification in the existing technology is solved, and more efficient and accurate data consistency verification is achieved.

CN115454846BActive Publication Date: 2025-06-24PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211111728.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2025-06-24
Estimated Expiration
2042-09-13

AI Technical Summary

Technical Problem

The prior art is not efficient and accurate in the field of financial technology for data consistency verification of new and old system interfaces, especially the difficulty in playing back traffic data is difficult to cover the data of all users.

Method used

By generating interface parameter files in the production environment, configuring comparison configuration information, creating data comparison tasks, and calling the interfaces of the old and new systems during task execution, comparing whether the returned data meets the preset consistency rules and displaying the verification results.

Benefits of technology

It improves the efficiency and accuracy of interface data consistency verification when the new and old systems are migrated, and ensures the coverage and accuracy of data consistency verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115454846B_ABST
    Figure CN115454846B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, system and medium for data consistency verification based on a production environment. The method includes: generating an interface input parameter file according to the data generated by the new system and the old system during operation in the production environment; in response to a configuration input operation, confirming comparison configuration information; in response to a task creation instruction, creating a data comparison task according to the comparison configuration information, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent; respectively calling a first interface of the new system and a second interface of the old system according to the interface input parameter file to obtain a first return value of the first interface and a second return value of the second interface; comparing whether the first return value and the second return value meet a preset consistency rule, and displaying the verification result. By means of a configured data comparison task and diverse and rich production environment data, the consistency of interface data is verified, effectively improving the efficiency and accuracy of interface data consistency verification during the migration of new and old systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interface testing, and in particular to a method, device, system and medium for data consistency verification based on a production environment. Background Art

[0002] After reconstructing an old system and putting a new system online, it is necessary to ensure data consistency to guarantee the stability and correctness of the new system's operation. For example, when the liquidation batch processing system for fund distribution is reconstructed, the asset data is generated by the new code logic of the new system and a new data query interface is provided. For the new system, it is necessary to ensure the consistency of the data returned by all customers when calling the new interface and the old income interface.

[0003] Currently, in the field of fintech, the method of traffic recording and playback is usually adopted to solve this problem. For example, the open-source jvm-sandbox-repeater records and plays back based on the existing traffic to achieve the purpose of checking the data returned by the new interface.

[0004] However, in the existing method, it is difficult to cover the data of all users when playing back the traffic data, resulting in insufficient efficiency and accuracy of data consistency verification. Summary of the Invention

[0005] In view of the above deficiencies of the prior art, the purpose of the present invention is to provide a method, device, system and medium for data consistency verification based on a production environment that can be applied to fintech or other related fields, aiming to improve the efficiency and accuracy of data consistency verification for the interfaces of new and old systems.

[0006] The technical solution of the present invention is as follows:

[0007] A method for data consistency verification based on a production environment includes:

[0008] Generating an interface input parameter file according to the data generated during the operation of the new system and the old system in the production environment;

[0009] Responding to a configuration input operation to confirm comparison configuration information;

[0010] Responding to a task creation instruction, creating a data comparison task according to the comparison configuration information, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent;

[0011] When a task execution instruction is triggered, respectively calling a first interface of the new system and a second interface of the old system according to the interface input parameter file to obtain a first return value of the first interface and a second return value of the second interface;

[0012] Compare whether the first return value and the second return value meet a preset consistency rule, and display the verification result.

[0013] In one embodiment, generating an interface input parameter file according to data generated by the new system and the old system running in the production environment includes:

[0014] Obtain first data and second data generated by the new system and the old system running in the production environment respectively;

[0015] Import the first data and the second data into the test database in the test environment;

[0016] Perform a field query in the test database, obtain the field values of the input parameters, and generate an interface input parameter file.

[0017] In one embodiment, when the task execution instruction is triggered, calling the first interface of the new system and the second interface of the old system respectively according to the interface input parameter file to obtain the first return value of the first interface and the second return value of the second interface includes:

[0018] When the task execution instruction is triggered, traverse the interface input parameter file to obtain the request input parameters corresponding to the current task;

[0019] Call the first interface of the new system and the second interface of the old system respectively according to the request input parameters, and obtain the first return value of the first interface and the second return value of the second interface.

[0020] In one embodiment, the comparison configuration information includes the task name, the address of the first interface, the address of the second interface, the fields to be ignored in comparison, and the fault tolerance range.

[0021] In one embodiment, comparing whether the first return value and the second return value meet a preset consistency rule and displaying the verification result includes:

[0022] Perform a string comparison on the first return value and the second return value. If the strings are exactly the same, the verification of this request is successful; otherwise, the verification of this request fails;

[0023] Display the corresponding verification result.

[0024] In one embodiment, after the verification of this request fails, the method further includes:

[0025] Confirm whether the inconsistent difference fields belong to the fields to be ignored in comparison. If so, update the verification result of this request to successful verification; otherwise, keep it as failed verification.

[0026] In one embodiment, after the current request verification fails, the method further includes:

[0027] Calculate the difference of the different fields between the first return value and the second return value. If the difference is less than or equal to the fault tolerance range, update the verification result of the current request to verification success; otherwise, keep it as verification failure.

[0028] A data consistency verification device based on a production environment, including:

[0029] A generation module, configured to generate an interface input parameter file according to the data generated by the new system and the old system running in the production environment;

[0030] A configuration module, configured to confirm comparison configuration information in response to a configuration input operation;

[0031] A task creation module, configured to create a data comparison task according to the comparison configuration information in response to a task creation instruction, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent;

[0032] A task execution module, configured to, when a task execution instruction is triggered, call a first interface of the new system and a second interface of the old system respectively according to the interface input parameter file, and obtain a first return value of the first interface and a second return value of the second interface;

[0033] A comparison and verification module, configured to compare whether the first return value and the second return value meet a preset consistency rule, and display the verification result.

[0034] A data consistency verification system based on a production environment, the system includes at least one processor; and,

[0035] A memory communicatively connected to the at least one processor; wherein,

[0036] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned data consistency verification method based on a production environment.

[0037] A non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned data consistency verification method based on a production environment.

[0038] Beneficial effects: The present invention discloses a method, apparatus, system and medium for data consistency verification based on a production environment. Compared with the prior art, the embodiments of the present invention verify the interface data consistency through configured data comparison tasks and diverse and rich production environment data, effectively improving the efficiency and accuracy of interface data consistency verification during the migration of old and new systems. Brief Description of the Drawings

[0039] The present invention will be further described below in conjunction with the drawings and embodiments. In the drawings:

[0040] Figure 1 It is a flowchart of a method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0041] Figure 2 It is a flowchart of step S100 in the method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0042] Figure 3 It is a flowchart of step S400 in the method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0043] Figure 4 It is a flowchart of step S500 in the method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0044] Figure 5 It is another flowchart of step S500 in the method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0045] Figure 6 It is another flowchart of step S500 in the method for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0046] Figure 7 It is a schematic diagram of the functional modules of a device for data consistency verification based on a production environment provided by an embodiment of the present invention;

[0047] Figure 8 It is a schematic diagram of the hardware structure of a system for data consistency verification based on a production environment provided by an embodiment of the present invention. Detailed Embodiments

[0048] To make the objectives, technical solutions and effects of the present invention clearer and more definite, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. The embodiments of the present invention are introduced below in conjunction with the drawings.

[0049] Please refer to Figure 1 , Figure 1The flowchart of an embodiment of the data consistency verification method based on the production environment provided by the present invention. The data consistency verification method based on the production environment provided by this embodiment is applicable to the situation of verifying and displaying the consistency of the interface return data after the new system is launched, and is specifically applied to a system composed of a terminal device, a network, and a server. The network is a medium for providing a communication link directly between the terminal device and the server, and it can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.; the operating system on the terminal device can include a handheld device operating system (iPhone operating system, iOS system), Android system, or other operating systems. The terminal device is connected to the server through the network to achieve interaction, so as to perform operations such as receiving or sending data. Specifically, it can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, portable computers, and desktop servers, etc. As Figure 1 shown, the method specifically includes the following steps:

[0050] S100. Generate an interface input parameter file according to the data generated by the new system and the old system running in the production environment.

[0051] In this embodiment, when the reconstructed new system is launched, the new system and the old system will run in parallel for a period of time. In order to improve the richness, diversity, and customer coverage of traffic data during data consistency verification, traffic is recorded from the production environment, and based on the data generated by the new system and the old system running in the production environment respectively, the corresponding interface input parameter file is generated reversely as the call basis for subsequent interface data verification.

[0052] In one embodiment, please refer to Figure 2 , which is the flowchart of step S100 in the data consistency verification method based on the production environment provided by the embodiment of the present invention. As Figure 2 shown, step S100 includes:

[0053] S101. Obtain the first data and the second data generated by the new system and the old system running in the production environment respectively;

[0054] S102. Import the first data and the second data into the test database in the test environment;

[0055] S103. Perform a field query in the test database, obtain the field values of the input parameters, and generate an interface input parameter file.

[0056] In this embodiment, when generating the interface input parameter file, first collect and obtain the first data and the second data generated by the new system and the old system during operation in the production environment. The specific data to be collected can be flexibly set according to the verification requirements. For example, when applied to a system in the fintech field, if it is necessary to perform data consistency verification on interfaces such as the asset query interface and the income query interface, the user asset data generated by the new system and the old system during operation in the production environment can be collected respectively. Of course, to ensure that user privacy is not leaked, the collected data needs to be desensitized. The desensitization process is to confuse and hide the data. For example, data information such as the user's mobile phone number and address is hidden using preset symbols to avoid leaking personal privacy information.

[0057] After that, import the first data and the second data into the test database in the test environment to perform isolation testing on the consistency of the interface data, so as to avoid affecting the user's system usage in the production environment. By querying the fields of the first data and the second data imported into the test database, and then reversely obtaining the field values of the input parameters of each interface, such as the customer number, card number, etc., and then generating the interface input parameter file to perform flexible and diverse data consistency verification on the interfaces of the new and old systems.

[0058] S200. In response to the configuration input operation, confirm the comparison configuration information.

[0059] In this embodiment, the tester can configure the relevant parameters for data consistency verification according to the test requirements. When detecting the corresponding configuration input operation, the operation is responded to, and the input content is obtained to get the comparison configuration information. For example, the tester can configure the function module that needs to be verified currently, the interface addresses of the new system and the old system involved in this function module, the rules for data consistency verification, etc., to achieve fast and accurate data verification.

[0060] S300. In response to the task creation instruction, create a data comparison task according to the comparison configuration information, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent.

[0061] In this embodiment, when the comparison configuration information is ready, if a task creation instruction is received, the instruction is responded to, and a corresponding data comparison task is created according to the comparison configuration information to accurately and efficiently judge and verify whether the interface return data of the new system and the old system is consistent.

[0062] S400. When the task execution instruction is triggered, call the first interface of the new system and the second interface of the old system respectively according to the interface input parameter file to obtain the first return value of the first interface and the second return value of the second interface.

[0063] In this embodiment, when a tester triggers a task execution instruction, a successfully created data comparison task is executed, and multi-threaded processing is performed on the generated interface input parameter file according to the comparison configuration information in the data comparison task. Specifically, the comparison configuration information includes, but is not limited to, a task name, the address of a first interface, the address of a second interface, fields to be ignored in comparison, and a fault tolerance range. Based on the interface addresses in the comparison configuration information, the first interface of the new system is called respectively to obtain corresponding first return values, and the second interface of the old system is called to obtain corresponding second return values, so as to verify the consistency of the interface return values of the same service request in different systems. Moreover, the data comes from diverse production environments, effectively improving the accuracy and efficiency of interface data verification.

[0064] In one embodiment, please refer to Figure 3 , which is a flowchart of step S400 in the data consistency verification method based on a production environment provided by an embodiment of the present invention. As Figure 3 shown, step S400 includes:

[0065] S401. When a task execution instruction is triggered, traverse the interface input parameter file to obtain request input parameters corresponding to the current task;

[0066] S402. Call the first interface of the new system and the second interface of the old system respectively according to the request input parameters, and obtain the first return value of the first interface and the second return value of the second interface.

[0067] In this embodiment, when a task execution instruction is triggered, the interface input parameter file is traversed according to the comparison configuration information generated when creating the task to obtain request input parameters corresponding to the current task. That is, the interfaces to be tested for different tasks may be different, and the corresponding request input parameters may also be different. Therefore, it is necessary to traverse the interface input parameter file according to the configuration information in the current task to obtain request input parameters that meet the current requirements.

[0068] The number of specific request input parameters is multiple. Multi-threaded parallel processing is performed on the multiple request input parameters. After obtaining each request input parameter, the first interface of the new system is called to obtain the first return value of the first interface, and the second interface of the old system is called to obtain the second return value of the second interface. It can be understood that the services provided by the first interface and the second interface in the new system and the old system are the same, and there are only differences in the interface addresses. The first interface and the second interface are called respectively for the same service request to verify whether the corresponding return values are consistent, ensuring the reliability of the data after system migration and avoiding affecting the normal use of the new system by users.

[0069] S500. Compare whether the first return value and the second return value meet a preset consistency rule, and display the verification result.

[0070] In this embodiment, for the same request, it is compared whether the interface return data of the new and old systems is consistent, that is, it is compared whether the first return value of the new system and the second return value of the old system meet the preset consistency rule. This consistency rule can be flexibly adjusted according to different requirements. If it is met, the verification is successful; if not, the verification fails. The verification result is visually displayed on the interface of the test terminal, improving the visualization program of the data consistency verification result and achieving accurate and efficient data verification.

[0071] Furthermore, on the display page of the verification result, some return values can also be displayed through conditional filtering, or the difference data can be further displayed when the verification fails, etc., to achieve the function of quickly locating the difference data and providing a reliable basis for subsequent system debugging.

[0072] In one embodiment, please refer to Figure 4 , which is a flowchart of step S500 in the data consistency verification method based on the production environment provided by the embodiment of the present invention. As Figure 4 shown, step S500 includes:

[0073] S501. Compare the first return value and the second return value as strings. If the strings are exactly the same, the verification of this request is successful; otherwise, the verification of this request fails.

[0074] S502. Display the corresponding verification result.

[0075] In this embodiment, when performing consistency verification on the interface return data, the first return value and the second return value are compared as json strings, and the consistency verification rule is that if the strings are exactly the same, the verification is successful; otherwise, the verification fails. The corresponding verification result is displayed on the front-end interface to achieve accurate character comparison verification.

[0076] In one embodiment, please refer to Figure 5 , which is another flowchart of step S500 in the data consistency verification method based on the production environment provided by the embodiment of the present invention. As Figure 5 shown, after step S501, the method further includes:

[0077] S503. Confirm whether the inconsistent difference fields belong to the ignored comparison fields. If so, update the verification result of this request to verification successful; otherwise, keep it as verification failed.

[0078] In this embodiment, when performing consistency verification on the interface return data, based on string comparison, if the strings of the first return value and the second return value are not completely consistent, the different fields with inconsistencies are obtained, and it is determined whether the different fields with inconsistencies can be ignored based on the fields to be ignored in the comparison configuration information. If the different fields belong to the fields to be ignored, such as the thread number and other fields that do not affect the accuracy judgment of consistency verification, if so, the verification result of this time is updated and then displayed, that is, changing the verification failure to verification success. If not, it remains as verification failure, avoiding the influence of the differences in the fields to be ignored on the consistency verification result and improving the accuracy of data comparison.

[0079] In one embodiment, please refer to Figure 6 , which is another flowchart of step S500 in the data consistency verification method based on the production environment provided by the embodiment of the present invention. As Figure 6 shown, after step S501, the method further includes:

[0080] S504. Calculate the difference between the different fields in the first return value and the second return value. If the difference is less than or equal to the error tolerance range, update the verification result of this request to verification success; otherwise, keep it as verification failure.

[0081] In this embodiment, when performing consistency verification on the interface return data, based on string comparison, if the strings of the first return value and the second return value are not completely consistent, calculate the difference between the different fields in the first return value and the second return value. Of course, on the basis of confirming that the different fields do not belong to the fields to be ignored, further calculate the difference of the different fields. If the difference is less than or equal to the error tolerance range, it is considered that the verification is successful, and the verification result of this request is updated and then displayed; otherwise, it remains as verification failure. This embodiment configures a certain error tolerance range for the consistency verification of interface data to flexibly adapt to the verification requirements of different interfaces.

[0082] Furthermore, custom filtering rules can be further configured in the comparison configuration information. For example, modify the first return value of the first interface (modify or delete, etc.) according to the custom filtering rules before comparison, or modify the second return value of the second interface (modify or delete, etc.) according to the custom filtering rules before comparison. When performing the comparison of the return values, based on string comparison, if the strings are not completely consistent, for example, in the case of field deletion, etc., further determine whether the custom filtering rules are satisfied. If satisfied, update the verification result to verification success, so as to meet diverse data comparison requirements.

[0083] Another embodiment of the present invention provides a data consistency verification device based on the production environment, as Figure 7 shown. The device 1 includes:

[0084] A generation module 11, configured to generate an interface input parameter file according to data generated by the new system and the old system during operation in the production environment;

[0085] A configuration module 12, configured to confirm comparison configuration information in response to a configuration input operation;

[0086] A task creation module 13, configured to create a data comparison task according to the comparison configuration information in response to a task creation instruction, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent;

[0087] A task execution module 14, configured to, when a task execution instruction is triggered, call a first interface of the new system and a second interface of the old system respectively according to the interface input parameter file, and obtain a first return value of the first interface and a second return value of the second interface;

[0088] A comparison and verification module 15, configured to compare whether the first return value and the second return value meet a preset consistency rule, and display a verification result.

[0089] The generation module 11, the configuration module 12, the task creation module 13, the task execution module 14, and the comparison and verification module 15 are connected in sequence. The modules referred to in the present invention refer to a series of computer program instruction segments that can complete specific functions, which are more suitable for describing the execution process of data consistency verification based on the production environment. For the specific implementation manners of each module, please refer to the corresponding method embodiments above, and details are not described herein again.

[0090] In one embodiment, the generation module 11 includes:

[0091] A data acquisition unit, configured to acquire first data and second data generated by the new system and the old system during operation in the production environment respectively;

[0092] A data import unit, configured to import the first data and the second data into a test database in the test environment;

[0093] A generation unit, configured to perform a field query in the test database, obtain field values of input parameters, and generate an interface input parameter file.

[0094] In one embodiment, the task execution module 14 includes:

[0095] A traversal unit, configured to, when a task execution instruction is triggered, traverse in the interface input parameter file to obtain request input parameters corresponding to the current task;

[0096] A calling unit, configured to call a first interface of a new system and a second interface of an old system respectively according to the request input parameters, and obtain a first return value of the first interface and a second return value of the second interface.

[0097] In one embodiment, the comparison configuration information includes a task name, an address of the first interface, an address of the second interface, fields to be ignored in comparison, and a fault tolerance range.

[0098] In one embodiment, the comparison verification module 15 includes:

[0099] A comparison unit, configured to perform a string comparison on the first return value and the second return value. If the strings are exactly the same, the verification of this request is successful; otherwise, the verification of this request fails.

[0100] A display unit, configured to display the corresponding verification result.

[0101] In one embodiment, the comparison verification module 15 further includes:

[0102] A first update unit, configured to confirm whether the inconsistent difference fields belong to the fields to be ignored in comparison. If so, update the verification result of this request to successful verification; otherwise, keep it as failed verification.

[0103] In one embodiment, the comparison verification module 15 further includes:

[0104] A second update unit, configured to calculate the difference between the difference fields in the first return value and the second return value. If the difference is less than or equal to the fault tolerance range, update the verification result of this request to successful verification; otherwise, keep it as failed verification.

[0105] Another embodiment of the present invention provides a data consistency verification system based on a production environment, as Figure 8 shown. The system 10 includes:

[0106] One or more processors 110 and a memory 120. Figure 8 Here, taking one processor 110 as an example for introduction, the processor 110 and the memory 120 can be connected through a bus or other means. Figure 8 Here, taking the connection through a bus as an example.

[0107] The processor 110 is used to complete various control logics of the system 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Moreover, the processor 110 can also be any conventional processor, microprocessor, or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0108] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the data consistency verification method based on the production environment in the embodiments of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions, and units stored in the memory 120, that is, implements the data consistency verification method based on the production environment in the above method embodiments.

[0109] The memory 120 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the system 10, etc. In addition, the memory 120 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 120 optionally includes a memory remotely set relative to the processor 110, and these remote memories can be connected to the system 10 through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0110] One or more units are stored in the memory 120, and when executed by one or more processors 110, the following steps are implemented:

[0111] Generate an interface input parameter file according to the data generated by the new system and the old system running in the production environment;

[0112] Respond to the configuration input operation and confirm the comparison configuration information;

[0113] Respond to the task creation instruction, and create a data comparison task according to the comparison configuration information. The data comparison task is used to compare whether the interface return data of the new system and the old system is consistent;

[0114] When the task execution instruction is triggered, the first interface of the new system and the second interface of the old system are respectively called according to the interface input parameter file, and the first return value of the first interface and the second return value of the second interface are obtained;

[0115] Compare whether the first return value and the second return value meet the preset consistency rule, and display the verification result.

[0116] In one embodiment, generating the interface input parameter file according to the data generated by the new system and the old system running in the production environment includes:

[0117] Respectively obtain the first data and the second data generated by the new system and the old system running in the production environment;

[0118] Import the first data and the second data into the test database in the test environment;

[0119] Perform field queries in the test database, obtain the field values of the input parameters, and generate the interface input parameter file.

[0120] In one embodiment, when the task execution instruction is triggered, calling the first interface of the new system and the second interface of the old system respectively according to the interface input parameter file, and obtaining the first return value of the first interface and the second return value of the second interface includes:

[0121] When the task execution instruction is triggered, traverse the interface input parameter file to obtain the request input parameters corresponding to the current task;

[0122] Call the first interface of the new system and the second interface of the old system respectively according to the request input parameters, and obtain the first return value of the first interface and the second return value of the second interface.

[0123] In one embodiment, the comparison configuration information includes the task name, the address of the first interface, the address of the second interface, the fields to be ignored in comparison, and the fault tolerance range.

[0124] In one embodiment, comparing whether the first return value and the second return value meet the preset consistency rule, and displaying the verification result includes:

[0125] Perform a string comparison on the first return value and the second return value. If the strings are exactly the same, the verification of this request is successful; otherwise, the verification of this request fails;

[0126] Display the corresponding verification result.

[0127] In one embodiment, after the verification of this request fails, the method further includes:

[0128] Check whether the inconsistent differential fields belong to the ignored comparison fields. If so, update the verification result of this request to successful verification; otherwise, keep it as failed verification.

[0129] In one embodiment, after the verification of this request fails, the method further includes:

[0130] Calculate the difference of the differential fields in the first return value and the second return value. If the difference is less than or equal to the error tolerance range, update the verification result of this request to successful verification; otherwise, keep it as failed verification.

[0131] An embodiment of the present invention provides a non - volatile computer - readable storage medium. The computer - readable storage medium stores computer - executable instructions, and these computer - executable instructions are executed by one or more processors. For example, execute the Figure 1 method steps S100 to S500 described above.

[0132] As an example, non - volatile storage media can include read - only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double - data - rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memories.

[0133] In summary, in the method, device, system and medium for data consistency verification based on a production environment disclosed by the present invention, the method generates an interface input parameter file according to the data generated by the new system and the old system during operation in the production environment; in response to a configured input operation, the comparison configuration information is confirmed; in response to a task creation instruction, a data comparison task is created according to the comparison configuration information, and the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent; the first interface of the new system and the second interface of the old system are respectively called according to the interface input parameter file to obtain a first return value of the first interface and a second return value of the second interface; it is compared whether the first return value and the second return value meet a preset consistency rule, and the verification result is displayed. Through the configured data comparison task and diverse and rich production environment data, the consistency of the interface data is verified, effectively improving the efficiency and accuracy of the interface data consistency verification during the migration of the new and old systems.

[0134] Certainly, those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, a floppy disk, a flash memory, an optical memory, etc.

[0135] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.

Claims

1. A data consistency verification method based on a production environment, characterized in that Including: Generating an interface input parameter file based on the data generated by the new system and the old system during operation in the production environment; Responding to a configuration input operation to confirm comparison configuration information; the comparison configuration information includes a task name, the address of a first interface, the address of a second interface, fields to be ignored in comparison, and a fault tolerance range; Responding to a task creation instruction to create a data comparison task according to the comparison configuration information, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent; When a task execution instruction is triggered, calling the first interface of the new system and the second interface of the old system respectively according to the interface input parameter file to obtain a first return value of the first interface and a second return value of the second interface; Comparing whether the first return value and the second return value meet a preset consistency rule and displaying the verification result; The generating an interface input parameter file based on the data generated by the new system and the old system during operation in the production environment includes: Respectively obtaining first data and second data generated by the new system and the old system during operation in the production environment; Importing the first data and the second data into a test database in the test environment; Performing a field query in the test database to obtain the field values of the input parameters and generating an interface input parameter file; The when a task execution instruction is triggered, calling the first interface of the new system and the second interface of the old system respectively according to the interface input parameter file to obtain a first return value of the first interface and a second return value of the second interface includes: When a task execution instruction is triggered, traversing in the interface input parameter file to obtain request input parameters corresponding to the current task; Calling the first interface of the new system and the second interface of the old system respectively according to the request input parameters and obtaining a first return value of the first interface and a second return value of the second interface.

2. The data consistency verification method based on the production environment according to claim 1, wherein The comparing whether the first return value and the second return value meet a preset consistency rule and displaying the verification result includes: Performing a string comparison on the first return value and the second return value. If the strings are exactly the same, the verification of this request is successful; otherwise, the verification of this request fails; Displaying the corresponding verification result.

3. The data consistency verification method based on a production environment according to claim 2, wherein After the verification of this request fails, the method further includes: Confirming whether the inconsistent difference fields belong to the fields to be ignored in comparison. If so, updating the verification result of this request to verification successful; otherwise, keeping it as verification failed.

4. The data consistency verification method based on the production environment according to claim 2 or 3, characterized in that After the verification of this request fails, the method further includes: Calculating the difference between the difference fields in the first return value and the second return value. If the difference is less than or equal to the fault tolerance range, updating the verification result of this request to verification successful; otherwise, keeping it as verification failed.

5. A data consistency verification device based on a production environment, characterized in that, Including: A generating module for generating an interface input parameter file based on the data generated by the new system and the old system during operation in the production environment; A configuration module for responding to a configuration input operation to confirm comparison configuration information; the comparison configuration information includes a task name, the address of a first interface, the address of a second interface, fields to be ignored in comparison, and a fault tolerance range; A task creation module, configured to create a data comparison task according to the comparison configuration information in response to a task creation instruction, where the data comparison task is used to compare whether the interface return data of the new system and the old system is consistent; A task execution module, configured to, when a task execution instruction is triggered, call a first interface of the new system and a second interface of the old system respectively according to the interface input parameter file, and obtain a first return value of the first interface and a second return value of the second interface; A comparison and verification module, configured to compare whether the first return value and the second return value meet a preset consistency rule, and display the verification result; The generation module includes: A data acquisition unit, configured to acquire first data and second data generated by the new system and the old system during operation in the production environment respectively; A data import unit, configured to import the first data and the second data into a test database in the test environment; A generation unit, configured to perform a field query in the test database, obtain the field values of the input parameters, and generate an interface input parameter file; The task execution module includes: A traversal unit, configured to, when a task execution instruction is triggered, traverse in the interface input parameter file to obtain request input parameters corresponding to the current task; A call unit, configured to call a first interface of the new system and a second interface of the old system respectively according to the request input parameters, and obtain a first return value of the first interface and a second return value of the second interface.

6. A data consistency verification system based on a production environment, characterized in that, The system 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, and the instructions are executed by the at least one processor, so that the at least one processor can execute the data consistency verification method based on the production environment according to any one of claims 1-4.

7. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the one or more processors can be enabled to execute the data consistency verification method based on the production environment according to any one of claims 1-4.

Citation Information

Patent Citations

  • An automated test method based on server log playback

    CN109101423A

  • Big data flow synchronization and monitoring test method and device and storage medium

    CN114936150A