CN115454846A - Data consistency verification method, device, system and medium based on production environment - Google Patents

Data consistency verification method, device, system and medium based on production environment Download PDF

Info

Publication number
CN115454846A
CN115454846A CN202211111728.2A CN202211111728A CN115454846A CN 115454846 A CN115454846 A CN 115454846A CN 202211111728 A CN202211111728 A CN 202211111728A CN 115454846 A CN115454846 A CN 115454846A
Authority
CN
China
Prior art keywords
interface
data
return value
verification
production environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211111728.2A
Other languages
Chinese (zh)
Inventor
马楷泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202211111728.2A priority Critical patent/CN115454846A/en
Publication of CN115454846A publication Critical patent/CN115454846A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Abstract

The invention discloses a method, a device, a system and a medium for verifying data consistency based on a production environment, wherein the method comprises the following steps: generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment; confirming and comparing configuration information in response to a configuration input operation; responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent; respectively calling a first interface of a new system and a second interface of an old system according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface; and comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a verification result. The consistency of the interface data is verified through the configured data comparison task and various and abundant production environment data, and the efficiency and the accuracy of the consistency verification of the interface data during the migration of new and old systems are effectively improved.

Description

Data consistency verification method, device, system and medium based on production environment
Technical Field
The invention relates to the technical field of interface testing, in particular to a data consistency checking method, a device, a system and a medium based on a production environment.
Background
After the old system is reconstructed and the new system is online, the consistency of data needs to be ensured so as to ensure the stability and the correctness of the operation of the new system. For example, when a liquidation batch system for fund reimbursement is reconstructed, the asset data is generated by the new code logic processing of a new system, and a new data query interface is provided.
At present, in the field of financial technology, a flow recording and playback mode is usually adopted to solve the problem, for example, the open source jvm-sandbox-repeater records and plays back based on the existing flow, so as to achieve the purpose of checking the returned data of the new interface.
However, in the existing method, playback traffic data is difficult to cover data of all users, so that the efficiency and accuracy of data consistency check are insufficient.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides a method, an apparatus, a system and a medium for verifying data consistency based on production environment, which can be applied to financial technology or other related fields, and aims to improve the efficiency and accuracy of data consistency verification of new and old system interfaces.
The technical scheme of the invention is as follows:
a data consistency checking method based on a production environment comprises the following steps:
generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment;
confirming and comparing configuration information in response to a configuration input operation;
responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent;
when a task execution instruction is triggered, calling a first interface of a new system and a second interface of an old system respectively according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface;
and comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a verification result.
In one embodiment, the generating the interface reference file according to the data generated by the new system and the old system running in the production environment comprises:
respectively acquiring first data and second data generated by the operation of a new system and an old system in a production environment;
importing the first data and the second data into a test database of a test environment;
and performing field query in the test database, acquiring the field value of the input parameter and generating an interface input parameter file.
In one embodiment, when the task execution instruction is triggered, respectively calling a first interface of a new system and a second interface of an old system according to the interface entry file to obtain a first return value of the first interface and a second return value of the second interface, including:
when the task execution instruction is triggered, traversing the interface parameter file to obtain a request parameter corresponding to the current task;
and calling a first interface of a new system and a second interface of an old system respectively according to the request entry, and obtaining a first return value of the first interface and a second return value of the second interface.
In one embodiment, the contrast configuration information includes a task name, an address of the first interface, an address of the second interface, an ignore contrast field, and a fault tolerance range.
In one embodiment, the comparing whether the first return value and the second return value satisfy a preset consistency rule and displaying a check result includes:
comparing the character strings of the first return value and the second return value, if the character strings are completely consistent, the verification of the request is successful, otherwise, the verification of the request is failed;
and displaying a corresponding checking result.
In an embodiment, after the request fails to be verified, the method further includes:
and determining whether the inconsistent difference field belongs to the neglected contrast field, if so, updating the verification result of the request to be verification success, and otherwise, keeping verification failure.
In an embodiment, after the request fails to be verified, the method further includes:
and calculating the difference value of the difference fields in the first return value and the second return value, if the difference value is less than or equal to the fault-tolerant range, updating the verification result of the request to be verification success, and if not, keeping the verification failure.
A data consistency verification apparatus based on a production environment, comprising:
the generating module is used for generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment;
the configuration module is used for responding to configuration input operation and confirming and comparing configuration information;
the task creating module is used for responding to a task creating instruction and creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent;
the task execution module is used for calling a first interface of a new system and a second interface of an old system respectively according to the interface access file when a task execution instruction is triggered to obtain a first return value of the first interface and a second return value of the second interface;
and the comparison and verification module is used for comparing whether the first return value and the second return value meet a preset consistency rule or not and displaying a verification result.
A production environment based data consistency verification system, the system comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the production environment based data consistency verification method described above.
A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the production environment-based data consistency verification method described above.
Has the advantages that: compared with the prior art, the embodiment of the invention effectively improves the efficiency and the accuracy of the consistency check of the interface data when the new and old systems are migrated by checking the consistency of the interface data through a configured data comparison task and various and abundant production environment data.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a data consistency verification method based on a production environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of step S100 of the method for verifying data consistency based on a production environment according to an embodiment of the present invention;
FIG. 3 is a flowchart of step S400 of the data consistency checking method based on the production environment according to the embodiment of the present invention;
FIG. 4 is a flowchart of step S500 of the data consistency checking method based on the production environment according to the embodiment of the present invention;
FIG. 5 is another flowchart of step S500 of the data consistency checking method based on the production environment according to the embodiment of the present invention;
FIG. 6 is another flowchart of step S500 of the data consistency checking method based on the production environment according to the embodiment of the present invention;
FIG. 7 is a functional block diagram of a data consistency verification apparatus according to an embodiment of the present invention;
fig. 8 is a schematic hardware structure diagram of a data consistency verification system based on a production environment according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. Embodiments of the present invention are described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of a data consistency verification method based on a production environment according to the present invention. The data consistency verification method based on the production environment provided by the embodiment is suitable for verifying and displaying the consistency of data returned by an interface after a new system is online, and is particularly applied to a system comprising terminal equipment, a network and a server, wherein the network is a medium for directly providing a communication link between the terminal equipment and the server, and the network can comprise various connection types, such as a wired communication link, a wireless communication link or an optical fiber cable; the operating system on the terminal device may include an iPhone operating system (iOS system), an android system, or another operating system, and the terminal device is connected to the server through a network to perform an interaction, so as to perform operations such as receiving or sending data, and may specifically be various electronic devices having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a portable computer, a desktop server, and the like. As shown in fig. 1, the method specifically includes the following steps:
and S100, generating an interface input parameter file according to the data generated by the operation of the new system and the old system in the production environment.
In this embodiment, when the reconstructed new system is online, the new system and the old system will run in parallel for a period of time, and in order to improve richness and diversity of flow data and coverage of clients during data consistency check, flow is recorded from a production environment, and a corresponding interface entry parameter file is reversely generated based on data generated by respective running of the new system and the old system in the production environment and used as a call basis for subsequent interface data check.
In an embodiment, please refer to fig. 2, which is a flowchart illustrating a step S100 of a data consistency verification method based on a production environment according to an embodiment of the present invention, as shown in fig. 2, the step S100 includes:
s101, respectively acquiring first data and second data generated by the operation of a new system and an old system in a production environment;
s102, importing the first data and the second data into a test database of a test environment;
s103, field query is carried out in the test database, the field value of the input parameter is obtained, and an interface input parameter file is generated.
In this embodiment, when generating the interface entry parameter file, first, second, data generated by the new system and the old system operating in the production environment are acquired, and the specifically acquired data may be flexibly set according to verification requirements, for example, when the system is applied to a system in the field of financial technology, if data consistency verification needs to be performed on an asset query interface, a revenue query interface, and the like, user asset data generated by the new system and the old system operating in the production environment may be acquired respectively.
And then, the first data and the second data are imported into a test database of the test environment so as to carry out isolation test on the consistency of the interface data and avoid influencing the system use of users in the production environment. By inquiring the fields of the first data and the second data imported into the test database, the field values of the entries of each interface, such as the client number, the card number and the like, are reversely acquired, and interface entry files are further produced, so that flexible and various data consistency verification is performed on the interfaces of the new system and the old system.
And S200, responding to configuration input operation, and confirming and comparing configuration information.
In this embodiment, a tester may configure relevant parameters for data consistency verification according to a test requirement, and when a corresponding configuration input operation is detected, the configuration input operation is performed correspondingly, and input content is acquired to obtain comparative configuration information, for example, the tester may configure a functional module that needs to be verified currently, a new system interface address related to the functional module, an old system interface address, a rule for data consistency verification, and the like, so as to implement fast and accurate data verification.
S300, responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent.
In this embodiment, after the configuration information is prepared for comparison, if a task creation instruction is received, the task creation instruction is responded, and a data comparison task in response is created according to the comparison configuration information, so as to accurately and efficiently judge and verify whether interface return data of the new system and interface return data of the old system are consistent.
S400, when the task execution instruction is triggered, calling a first interface of a new system and a second interface of an old system respectively according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface.
In this embodiment, when a tester triggers a task execution instruction, a successfully created data comparison task is executed, and multi-thread processing is performed according to generated interface entry parameter files and comparison configuration information in the data comparison task, where the comparison configuration information includes, but is not limited to, a task name, an address of a first interface, an address of a second interface, a comparison field to be ignored, and a fault tolerance range, based on the interface addresses in the comparison configuration information, the first interface of a new system is respectively called to obtain a corresponding first return value, and the second interface of an old system is called to obtain a corresponding second return value, so that consistency verification is performed on interface return values of the same service request in different systems, and data is derived from diverse production environments, thereby effectively improving accuracy and efficiency of interface data verification.
In an embodiment, please refer to fig. 3, which is a flowchart illustrating a step S400 of a data consistency verification method based on a production environment according to an embodiment of the present invention, as shown in fig. 3, the step S400 includes:
s401, when a task execution instruction is triggered, traversing the interface parameter file to obtain a request parameter corresponding to the current task;
s402, calling a first interface of a new system and a second interface of an old system respectively according to the request entry, and obtaining a first return value of the first interface and a second return value of the second interface.
In this embodiment, when the task execution instruction is triggered, the interface entry file is traversed according to the comparative configuration information generated when the task is created, and the request entry corresponding to the current task is obtained, that is, interfaces to be tested for different tasks may be different, and the corresponding request entry may also have differences.
The method comprises the steps of specifically, the number of request access parameters is multiple, multithreading parallel processing is carried out on the multiple request access parameters, after each request access parameter is obtained, a first interface of a new system is called, a first return value of the first interface is obtained, a second interface of an old system is called, and a second return value of the second interface is obtained.
S500, comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a checking result.
In this embodiment, for the same request, whether the interface return data of the new system and the interface return data of the old system are consistent or not is compared, that is, whether the first return value of the new system and the second return value of the old system meet a preset consistency rule or not is compared, the consistency rule can be flexibly adjusted according to different requirements, if the first return value of the new system and the second return value of the old system meet the preset consistency rule, the verification is successful, if the first return value of the new system and the second return value of the old system do not meet the preset consistency rule, the verification is failed, the verification result is visually displayed on the interface of the test terminal, the visualization program of the data consistency verification result is improved, and accurate and efficient data verification is achieved.
Furthermore, the return value of the display part can be screened through conditions on the display page of the verification result, or the difference data can be further displayed when the verification fails, so that the rapid difference data positioning function is realized, and a reliable basis is provided for subsequent system debugging.
In an embodiment, please refer to fig. 4, which is a flowchart illustrating a step S500 of the data consistency verification method based on the production environment according to an embodiment of the present invention, as shown in fig. 4, the step S500 includes:
s501, comparing character strings of the first return value and the second return value, if the character strings are completely consistent, the verification of the request is successful, otherwise, the verification of the request is failed;
and S502, displaying a corresponding verification result.
In this embodiment, when consistency check is performed on interface returned data, json character string comparison is performed on the first returned value and the second returned value, and if the consistency check rule is that the character strings are completely consistent, the check is successful, otherwise, the check is failed, and a corresponding check result is displayed on the front-end interface, so that accurate character comparison check is realized.
In an embodiment, please refer to fig. 5, which is another flowchart of step S500 in the method for verifying data consistency based on a production environment according to an embodiment of the present invention, as shown in fig. 5, after step S501, the method further includes:
s503, confirming whether the inconsistent difference field belongs to the neglected contrast field, if so, updating the verification result of the request to be verification success, otherwise, keeping verification failure.
In this embodiment, when consistency check is performed on interface returned data, on the basis of string comparison, if strings of the first returned value and the second returned value are not completely consistent, an inconsistent difference field is obtained, whether the inconsistent difference field can be ignored is determined based on a neglected comparison field in comparison configuration information, if the difference field belongs to the neglected comparison field, for example, a field such as a thread number which does not affect consistency verification accuracy determination is displayed, if the difference field belongs to the field, a verification result of this time is updated and then is displayed, that is, a verification failure is updated to a verification success, and if the difference field does not belong to the field, the verification failure is maintained to the verification failure, thereby avoiding the influence of the difference of the neglected comparison field on the consistency verification result, and improving the accuracy of data comparison.
In an embodiment, please refer to fig. 6, which is another flowchart of step S500 in the method for verifying data consistency based on a production environment according to an embodiment of the present invention, as shown in fig. 6, after step S501, the method further includes:
s504, calculating a difference value of the difference fields in the first return value and the second return value, if the difference value is smaller than or equal to the fault-tolerant range, updating the verification result of the request to be verification success, and if not, keeping verification failure.
In this embodiment, when performing consistency check on interface returned data, on the basis of character string comparison, if the character strings of the first returned value and the second returned value are not completely consistent, a difference value of a difference field in the first returned value and the second returned value is calculated, of course, on the basis of confirming that the difference field does not belong to an ignored comparison field, the difference value of the difference field is further calculated, if the difference value is less than or equal to a fault-tolerant range, the check result of the request is considered to be successful, the check result is updated and then displayed, otherwise, the check is kept to be failed, and a certain fault-tolerant range is configured for consistency check of the interface data, so as to flexibly adapt to the check requirements of different interfaces.
Further, a custom filter rule can be further configured in the comparison configuration information, for example, a first return value (modification or deletion, etc.) of the first interface is modified according to the custom filter rule before comparison, or a second return value (modification or deletion, etc.) of the second interface is modified according to the custom filter rule before comparison, when the return values are compared, on the basis of character string comparison, if the character strings are not completely consistent, for example, there are situations such as deletion of fields, etc., whether the custom filter rule is satisfied is further judged, and if the check result is satisfied, the check result is updated to be successful, so that diversified data comparison requirements can be satisfied.
Another embodiment of the present invention provides a data consistency verification apparatus based on a production environment, as shown in fig. 7, the apparatus 1 includes:
the generating module 11 is configured to generate an interface access file according to data generated by operation of the new system and the old system in a production environment;
a configuration module 12 for confirming the comparison configuration information in response to the configuration input operation;
a task creating module 13, configured to create, in response to a task creating instruction, a data comparison task according to the comparison configuration information, where the data comparison task is used to compare whether interface return data of the new system and interface return data of the old system are consistent;
the task execution module 14 is configured to, when a task execution instruction is triggered, respectively call a first interface of a new system and a second interface of an old system according to the interface entry-reference file to obtain a first return value of the first interface and a second return value of the second interface;
and the comparison and verification module 15 is used for comparing whether the first return value and the second return value meet a preset consistency rule or not and displaying a verification result.
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 module referred to in the present invention refers to a series of computer program instruction segments capable of completing a specific function, and is more suitable for describing an execution process of data consistency verification based on a production environment than a program, and the specific implementation of each module refers to the corresponding method embodiment, and is not described herein again.
In one embodiment, the generating module 11 includes:
the system comprises a data acquisition unit, a data processing unit and a data processing unit, wherein the data acquisition unit is used for respectively acquiring first data and second data generated by the operation of a new system and an old system in a production environment;
the data import unit is used for importing the first data and the second data into a test database of a test environment;
and the generating unit is used for carrying out field query in the test database, acquiring the field value of the input parameter and generating an interface input parameter file.
In one embodiment, the task execution module 14 includes:
the traversing unit is used for traversing in the interface parameter file to obtain the request parameter corresponding to the current task when the task execution instruction is triggered;
and the calling unit is used for respectively calling the first interface of the new system and the second interface of the old system according to the request access parameters and obtaining a first return value of the first interface and a second return value of the second interface.
In one embodiment, the contrast configuration information includes a task name, an address of the first interface, an address of the second interface, an ignore contrast field, and a fault tolerance range.
In one embodiment, the comparison and verification module 15 includes:
the comparison unit is used for comparing the character strings of the first return value and the second return value, if the character strings are completely consistent, the verification of the request is successful, and if the verification of the request is not successful, the verification of the request is failed;
and the display unit is used for displaying the corresponding verification result.
In one embodiment, the comparison and verification module 15 further includes:
and the first updating unit is used for confirming whether the inconsistent difference field belongs to the neglected contrast field, if so, updating the verification result of the request to be verification success, and otherwise, keeping verification failure.
In one embodiment, the comparison and verification module 15 further includes:
and the second updating unit is used for calculating the difference value of the difference fields in the first return value and the second return value, if the difference value is less than or equal to the fault-tolerant range, updating the verification result of the request to be verification success, and if not, keeping the verification failure.
Another embodiment of the present invention provides a data consistency verification system based on a production environment, as shown in fig. 8, the system 10 includes:
one or more processors 110 and a memory 120, where one processor 110 is illustrated in fig. 8, the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 8 illustrates a connection by a bus as an example.
Processor 110 is used to implement various control logic for system 10, which may 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 device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. Processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the data consistency check method based on the production environment in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by executing the nonvolatile software programs, instructions and units stored in the memory 120, namely, implements the data consistency checking method based on the production environment in the above method embodiment.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the system 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to system 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, and when executed by the one or more processors 110, perform the steps of:
generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment;
confirming and comparing configuration information in response to configuration input operation;
responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent;
when a task execution instruction is triggered, calling a first interface of a new system and a second interface of an old system respectively according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface;
and comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a verification result.
In one embodiment, the generating the interface entry file according to the data generated by the new system and the old system running in the production environment comprises:
respectively acquiring first data and second data generated by the operation of a new system and an old system in a production environment;
importing the first data and the second data into a test database of a test environment;
and performing field query in the test database, acquiring the field value of the input parameter and generating an interface input parameter file.
In one embodiment, when the task execution instruction is triggered, respectively invoking a first interface of a new system and a second interface of an old system according to the interface entry file to obtain a first return value of the first interface and a second return value of the second interface, including:
when the task execution instruction is triggered, traversing the interface parameter file to obtain a request parameter corresponding to the current task;
and respectively calling a first interface of a new system and a second interface of an old system according to the request access parameters, and obtaining a first return value of the first interface and a second return value of the second interface.
In one embodiment, the contrast configuration information includes a task name, an address of the first interface, an address of the second interface, an ignore contrast field, and a fault tolerance range.
In one embodiment, the comparing whether the first return value and the second return value satisfy a preset consistency rule and displaying a check result includes:
comparing the character strings of the first return value and the second return value, if the character strings are completely consistent, the verification of the request is successful, otherwise, the verification of the request is failed;
and displaying a corresponding checking result.
In an embodiment, after the request fails to be verified, the method further includes:
and determining whether the inconsistent difference field belongs to the neglected contrast field, if so, updating the verification result of the request to be verification success, and otherwise, keeping verification failure.
In an embodiment, after the request fails to be verified, the method further includes:
and calculating the difference value of the difference fields in the first return value and the second return value, if the difference value is less than or equal to the fault-tolerant range, updating the verification result of the request to be verification success, and if not, keeping the verification failure.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, for example, to perform method steps S100-S500 of fig. 1 described above.
By way of 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), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
To sum up, in the data consistency verification method, device, system and medium based on the production environment disclosed by the invention, the method generates the interface access file according to the data generated by the new system and the old system running in the production environment; confirming and comparing configuration information in response to configuration input operation; responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent; respectively calling a first interface of a new system and a second interface of an old system according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface; and comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a verification result. The consistency of the interface data is verified through the configured data comparison task and various and abundant production environment data, and the efficiency and the accuracy of the consistency verification of the interface data during the migration of new and old systems are effectively improved.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, which may be stored in a non-volatile computer-readable storage medium, and the computer program may include the processes of the above method embodiments when executed. The storage medium can be a memory, a magnetic disk, a floppy disk, a flash memory, an optical memory and the like.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A data consistency checking method based on a production environment is characterized by comprising the following steps:
generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment;
confirming and comparing configuration information in response to a configuration input operation;
responding to a task creating instruction, creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent;
when a task execution instruction is triggered, respectively calling a first interface of a new system and a second interface of an old system according to the interface access file to obtain a first return value of the first interface and a second return value of the second interface;
and comparing whether the first return value and the second return value meet a preset consistency rule, and displaying a verification result.
2. The method for verifying data consistency based on production environment as claimed in claim 1, wherein the generating of the interface entry file according to the data generated by the new system and the old system running in the production environment comprises:
respectively acquiring first data and second data generated by the operation of a new system and an old system in a production environment;
importing the first data and the second data into a test database of a test environment;
and performing field query in the test database, acquiring the field value of the input parameter and generating an interface input parameter file.
3. The data consistency checking method based on the production environment according to claim 1, wherein when the task execution instruction is triggered, the method calls a first interface of a new system and a second interface of an old system according to the interface reference file to obtain a first return value of the first interface and a second return value of the second interface respectively, and comprises:
when the task execution instruction is triggered, traversing the interface parameter file to obtain a request parameter corresponding to the current task;
and calling a first interface of a new system and a second interface of an old system respectively according to the request entry, and obtaining a first return value of the first interface and a second return value of the second interface.
4. The production environment-based data consistency checking method according to claim 1, wherein the contrast configuration information comprises a task name, an address of the first interface, an address of the second interface, an ignore contrast field, and a fault tolerance range.
5. The data consistency checking method based on the production environment according to claim 4, wherein the comparing whether the first return value and the second return value satisfy a preset consistency rule and displaying a checking result comprises:
comparing the character strings of the first return value and the second return value, if the character strings are completely consistent, the verification of the request is successful, otherwise, the verification of the request is failed;
and displaying a corresponding checking result.
6. The data consistency verification method based on the production environment as claimed in claim 5, wherein after the verification of the current request fails, the method further comprises:
and determining whether the inconsistent difference field belongs to the neglected contrast field, if so, updating the verification result of the request to be verification success, and otherwise, keeping verification failure.
7. The data consistency verification method based on the production environment as claimed in claim 5 or 6, wherein after the verification of the current request fails, the method further comprises:
and calculating the difference value of the difference fields in the first return value and the second return value, if the difference value is less than or equal to the fault-tolerant range, updating the verification result of the request to be verification success, and if not, keeping the verification failure.
8. A data consistency verification device based on production environment is characterized by comprising:
the generating module is used for generating an interface input parameter file according to data generated by the operation of the new system and the old system in the production environment;
the configuration module is used for responding to configuration input operation and confirming and comparing configuration information;
the task creating module is used for responding to a task creating instruction and creating a data comparison task according to the comparison configuration information, wherein the data comparison task is used for comparing whether the interface return data of the new system and the interface return data of the old system are consistent;
the task execution module is used for calling a first interface of a new system and a second interface of an old system respectively according to the interface access file when a task execution instruction is triggered to obtain a first return value of the first interface and a second return value of the second interface;
and the comparison and verification module is used for comparing whether the first return value and the second return value meet a preset consistency rule or not and displaying a verification result.
9. A production environment based data consistency verification system, characterized in that said system comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the production environment based data consistency checking method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the production environment-based data consistency verification method of any one of claims 1 to 7.
CN202211111728.2A 2022-09-13 2022-09-13 Data consistency verification method, device, system and medium based on production environment Pending CN115454846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211111728.2A CN115454846A (en) 2022-09-13 2022-09-13 Data consistency verification method, device, system and medium based on production environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211111728.2A CN115454846A (en) 2022-09-13 2022-09-13 Data consistency verification method, device, system and medium based on production environment

Publications (1)

Publication Number Publication Date
CN115454846A true CN115454846A (en) 2022-12-09

Family

ID=84302260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211111728.2A Pending CN115454846A (en) 2022-09-13 2022-09-13 Data consistency verification method, device, system and medium based on production environment

Country Status (1)

Country Link
CN (1) CN115454846A (en)

Similar Documents

Publication Publication Date Title
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN105005532A (en) System for automatically testing stability of application program interface and method
CN110347545A (en) A kind of test method and device of business platform cache policy
CN113448862B (en) Software version testing method and device and computer equipment
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN107357721B (en) Method and device for testing system
CN110063042A (en) A kind of response method and its terminal of database failure
CN111414309B (en) Automatic test method of application program, computer equipment and storage medium
CN114594714B (en) Equipment control method, device, equipment and storage medium
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN116257438A (en) Updating method of interface test case and related equipment
CN109697158B (en) Log analysis method and device based on fault
CN107102937B (en) User interface testing method and device
CN110727575B (en) Information processing method, system, device and storage medium
CN112612706A (en) Automated testing method, computer device and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN115454846A (en) Data consistency verification method, device, system and medium based on production environment
CN113468058B (en) Regression testing method and device for software as service platform and electronic equipment
CN115629940A (en) Micro-service full-link tracking method, device, system and medium
WO2021121130A1 (en) Method and apparatus for information collection, computer device, and storage medium
WO2019062087A1 (en) Attendance check data testing method, terminal and device, and computer readable storage medium
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN114238129A (en) Method, device and equipment for generating interface data and storage medium
CN111857744A (en) Installation method, system, equipment and medium of super-fusion system
CN112261072A (en) Service calling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination