CN115757472A - Data comparison method and device, storage medium and computer equipment - Google Patents

Data comparison method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN115757472A
CN115757472A CN202211531630.2A CN202211531630A CN115757472A CN 115757472 A CN115757472 A CN 115757472A CN 202211531630 A CN202211531630 A CN 202211531630A CN 115757472 A CN115757472 A CN 115757472A
Authority
CN
China
Prior art keywords
parameter
field
comparison result
compared
parameter value
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
CN202211531630.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.)
Guangzhou Pinwei Software Co Ltd
Original Assignee
Guangzhou Pinwei Software 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 Guangzhou Pinwei Software Co Ltd filed Critical Guangzhou Pinwei Software Co Ltd
Priority to CN202211531630.2A priority Critical patent/CN115757472A/en
Publication of CN115757472A publication Critical patent/CN115757472A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a data comparison method, a data comparison device, a storage medium and computer equipment, wherein the method comprises the following steps: acquiring a preset table to be compared, wherein the table to be compared records parameter fields to be compared and parameter value ranges corresponding to the parameter fields to be compared; extracting each log parameter field in the development log, and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result; for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, and respectively comparing each parameter value with a parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result; and obtaining a data comparison result according to the field comparison result and the parameter value comparison result. Therefore, automatic comparison of a large amount of data can be realized, so that the data volume of manual verification can be reduced in a reply manner, and the testing efficiency and the testing accuracy can be improved at the same time.

Description

Data comparison method and device, storage medium and computer equipment
Technical Field
The present application relates to the field of automatic testing, and in particular, to a data comparison method, apparatus, storage medium, and computer device.
Background
Before the application or the new function is on line, a data type test needs to be performed on the updated application program to verify whether the updated application program meets the preset development requirement and whether program defects exist from the data side. Data type test often possesses characteristics such as data volume is big, parameter field is many, data logic complicacy, however, when carrying out data type test at present, generally compare data one by the manual work, the consumption time is long and the process is loaded down with trivial details, also can not guarantee the accuracy of data comparison.
Disclosure of Invention
The present application aims to solve at least one of the above-mentioned technical drawbacks, in particular, the technical drawbacks of the prior art, such as low testing efficiency and low testing accuracy.
In a first aspect, an embodiment of the present application provides a data comparison method, where the method includes:
acquiring a preset table to be compared, wherein the table to be compared records parameter fields to be compared and parameter value ranges corresponding to the parameter fields to be compared;
extracting each log parameter field in the development log, and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result;
for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, and respectively comparing each parameter value with a parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result;
and obtaining a data comparison result according to the field comparison result and the parameter value comparison result.
In one embodiment, the step of comparing each log parameter field with each parameter field to be compared to obtain a field comparison result includes:
for each parameter field to be compared, judging whether the parameter field to be compared exists in each log parameter field, if not, recording the parameter field to be compared in the field comparison end specification
And (4) obtaining the fruit.
In one embodiment, the step of comparing each parameter value with the parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result includes:
and judging whether the parameter value falls into a parameter value range corresponding to the parameter field to be compared or not for each parameter value, and if not, recording the parameter value in the parameter value comparison result.
In one embodiment, the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result includes:
and if the field comparison result and the parameter value comparison result are both empty, obtaining a data comparison result for reflecting that the data test is passed, otherwise, obtaining a data comparison result for reflecting that the data test is not passed.
In one embodiment, the method further comprises: and if the data comparison result reflects that the data test fails, pushing the field comparison result and the parameter value comparison result to a user.
In one embodiment, the step of extracting the parameter values corresponding to the parameter fields to be compared from the development log includes:
filling the parameter field to be compared into an initial SQL query statement to obtain a target SQL query statement;
and executing the target SQL query statement to extract each parameter value corresponding to the parameter field to be compared from the development log.
In one embodiment, before the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result, the method further includes:
for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, respectively processing each parameter value by adopting a preset parameter processing logic to obtain a processing result, and comparing the processing result with a target result recorded in the development log to obtain a logic comparison result, wherein the target result refers to result data corresponding to the preset parameter processing logic;
the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result comprises the following steps:
and obtaining the data comparison result according to the field comparison result, the parameter value comparison result and the logic comparison result.
In a second aspect, an embodiment of the present application provides a data comparison apparatus, where the apparatus includes:
the table acquisition module is used for acquiring a preset table to be compared, and the table to be compared records each parameter field to be compared and a parameter value range corresponding to each parameter field to be compared;
the field comparison module is used for extracting each log parameter field in the development log and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result;
the parameter value comparison module is used for extracting each parameter value corresponding to the parameter field to be compared from the development log aiming at each parameter field to be compared, and comparing each parameter value with the parameter value range corresponding to the parameter field to be compared respectively to obtain a parameter value comparison result;
and the result acquisition module is used for acquiring a data comparison result according to the field comparison result and the parameter value comparison result.
In a third aspect, the present application provides a storage medium having stored therein computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the data comparison method according to any one of the above embodiments.
In a fourth aspect, an embodiment of the present application provides a computer device, including: one or more processors, and a memory;
the memory stores computer readable instructions which, when executed by the one or more processors, perform the steps of the data comparison method of any of the above embodiments.
In the data comparison method, the data comparison device, the storage medium and the computer equipment, the computer equipment can acquire a preset table to be compared so as to acquire parameter fields to be compared recorded in the table to be compared and a parameter value range corresponding to each parameter field to be compared. The computer equipment can extract each log parameter field in the development log and compare each log parameter field with each parameter field to be compared so as to automatically realize field comparison and obtain a field comparison result. For each parameter field to be compared, the computer equipment can extract each parameter value corresponding to the parameter field to be compared from the development log, and respectively compare each parameter value with the parameter value range corresponding to the parameter field to be compared, so as to automatically realize parameter value comparison and obtain a parameter value comparison result. After the field comparison result and the parameter value comparison result are obtained, the computer equipment can obtain a data comparison result according to the field comparison result and the parameter value comparison result. Therefore, the computer equipment can realize automatic comparison of a large amount of data, so that the data volume of manual verification can be reduced in reply, and the test efficiency and the test accuracy can be improved simultaneously.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram illustrating a data comparison method in one embodiment;
FIG. 2 is a schematic diagram of the structure of a data comparison apparatus in one embodiment;
FIG. 3 is a block diagram of a computer device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As background, currently, data types are typically compared manually one by one when performing data type testing. If the parameter fields, data and verification program logic are compared manually in the testing stage, it takes a long time and the process is tedious. Therefore, in order to shorten the on-line period of the application or new function, the prior art only needs to manually check the accuracy of the field in the testing stage. And after the application or the new function is on-line, the business party performs data verification on-line under the gray scale condition. Therefore, in addition to the technical problems recorded in the background art, the prior art cannot simultaneously realize a short online period and high test accuracy.
In order to solve the problems, the application provides a data comparison method, a data comparison device, a storage medium and computer equipment, which can realize automatic comparison of a large amount of data, so that the data volume of manual verification can be reduced in reply, and the test efficiency and the test accuracy can be improved simultaneously. Meanwhile, because a large amount of data can be compared under the condition of consuming time and being short, after the data are taken out of a warehouse, the method can be used for intervening in advance to carry out data type testing, the online period can be further shortened, and the short online period and the high testing accuracy are considered.
In one embodiment, the present application provides a data comparison method. The following embodiments are described by taking the method as an example applied to a computer device, and it is understood that the computer device may be, but is not limited to, various notebook computers or servers. As shown in fig. 1, the method specifically includes the following steps:
s102: the method comprises the steps of obtaining a preset table to be compared, wherein the table to be compared records parameter fields to be compared and parameter value ranges corresponding to the parameter fields to be compared.
The table to be compared may be a preset table, and is used to record one or more parameter fields to be compared and a parameter value range corresponding to each parameter field to be compared. The parameter field to be compared may be a parameter field that needs to be determined whether it exists in the development log. The parameter field may be a key field for uniquely identifying each parameter, and in one embodiment, the parameter field may be a parameter name. For example, if the number of customers in a certain store for one minute is customerNum =3, customerNum is a parameter field, and 3 is a parameter value corresponding to the parameter field customerNum.
In one embodiment, the parameter fields to be compared may be extracted from a product requirement document, where the parameter fields corresponding to the parameters and the meanings corresponding to each parameter field are recorded in the product requirement document, so that upstream and downstream developers can develop the application program based on a standard unified by a specification.
The parameter value range corresponding to each parameter field to be compared reflects the standard value range corresponding to the parameter field to be compared, in other words, under normal conditions, the parameter value of the parameter field to be compared should fall within the corresponding parameter value range.
S104: and extracting each log parameter field in the development log, and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result.
The development log may be a log automatically generated by the application program to be tested after the application program to be tested is run, and may record various parameters of the application program to be tested in the running process.
Specifically, the computer device may extract the respective log parameter fields included in the development log from the development log, for example, the computer device may execute an SQL (Structured Query Language) Query statement select to extract the respective log parameter fields. The computer equipment can compare each extracted log parameter field with each parameter field to be compared recorded in the table to be compared to obtain a field comparison result. Therefore, whether the parameter field to be compared is consistent with the log parameter field can be automatically checked, and whether the problem of field use errors exists in the process of writing a program by a developer is further judged.
In one embodiment, the step of comparing each log parameter field with each parameter field to be compared to obtain a field comparison result includes: and judging whether the parameter field to be compared exists in each log parameter field or not aiming at each parameter field to be compared, and if not, recording the parameter field to be compared in the field comparison result.
Specifically, after obtaining each parameter field to be compared and each log parameter field, the computer device may determine whether each log parameter field includes all parameter fields to be compared, and further determine whether each parameter field to be compared is recorded in the development log. Therefore, for each parameter field to be compared, the computer device can match the parameter field to be compared with each log parameter field to determine whether one log parameter field is the same as the parameter field to be compared in each log parameter field, and further determine whether each log parameter field includes the parameter field to be compared. For each parameter field to be compared, if the parameter field to be compared does not exist in each log parameter field, it indicates that there is a problem that the field use error may exist in the parameter field to be compared, and therefore, the parameter field to be compared can be recorded in the field comparison result. Furthermore, after the comparison of each parameter field to be compared is completed, if the field comparison result is not empty, the field comparison result can be pushed to the tester, so that the tester can review the parameter field to be compared recorded by the field comparison result, and further determine whether a field use error or a field change condition exists.
In one embodiment, in some cases, the tester does not have sufficient access to the online development log, and therefore, the computer device needs to simulate the storage structure of the online data warehouse in the test data warehouse before extracting data from the development log. Specifically, the computer device may obtain a part of the online development log in advance as a test data source, establish a base table in the test data warehouse according to a database table structure of the online data warehouse, and store the test data source in the newly established base table to simulate the online data warehouse. And then, finishing data comparison according to the development log stored in the test data warehouse to obtain a test result.
S106: and for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, and respectively comparing each parameter value with the parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result.
Besides the problems of field use errors and the like, when a data type test is carried out, whether the value of the parameter value corresponding to each parameter field is normal needs to be judged. Specifically, for each parameter field to be compared, the computer device may extract each parameter value corresponding to the parameter field to be compared from the development log, and compare each extracted parameter value with the corresponding parameter value range, so as to determine whether the value of each parameter value is normal, and obtain a parameter value comparison result.
In one embodiment, the step of extracting the parameter values corresponding to the parameter field to be compared from the development log includes: filling the parameter field to be compared into an initial SQL query statement to obtain a target SQL query statement; and executing the target SQL query statement to extract each parameter value corresponding to the parameter field to be compared from the development log. Specifically, in order to enable the computer device to automatically extract the parameter value corresponding to each parameter field to be compared from the development log, for each parameter field to be compared, the computer device may fill the parameter field to be compared into the initial SQL query statement to obtain the target SQL query statement that can be used to query the parameter value corresponding to the parameter field to be compared. And the computer equipment can automatically extract each parameter value corresponding to the parameter field to be compared from the development log by executing the target SQL query statement.
In one embodiment, the step of comparing each parameter value with the parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result includes: and judging whether the parameter value falls into a parameter value range corresponding to the parameter field to be compared or not for each parameter value, and if not, recording the parameter value in the parameter value comparison result. Specifically, for each parameter field to be compared, after extracting each parameter value of the parameter field to be compared from the development log, whether each parameter value falls within a parameter value range corresponding to the parameter field to be compared can be respectively judged, and for a parameter value which does not fall within the corresponding parameter value range, the computer device can record the parameter value in a parameter value comparison result.
Further, after the parameter value comparison of all the parameter fields to be compared is completed, if the parameter value comparison result is not empty, the parameter value comparison result can be pushed to a tester, so that the tester can recheck the parameter values recorded by the parameter value comparison result, and further determine whether the problems of field negation, unit error, negative data precision and/or unsatisfactory data precision exist.
S108: and obtaining a data comparison result according to the field comparison result and the parameter value comparison result. The data comparison result can be used to indicate whether the development log can pass the data class test.
In one embodiment, the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result includes: and if the field comparison result and the parameter value comparison result are both empty, obtaining a data comparison result for reflecting that the data test is passed, otherwise, obtaining a data comparison result for reflecting that the data test is not passed.
Specifically, if the field comparison result is null, it indicates that all the parameter fields to be compared exist in the development log. And if the parameter value comparison result is null, indicating that all the parameter values fall into the standard value range. Therefore, when the field comparison result and the parameter value comparison result are both empty, it is indicated that all the parameter fields to be compared exist in the development log, and all the parameter values fall within the standard value range, so that the data test can be confirmed to pass, and the corresponding data comparison result can be obtained. When at least one of the field comparison result and the parameter value comparison result is not empty, it is indicated that at least one parameter field to be compared does not exist in the development log, and/or at least one parameter value does not fall into the corresponding parameter value range, so that it can be confirmed that the data test fails, and a corresponding data comparison result is obtained.
In one embodiment, if the data comparison result reflects that the data test fails, the field comparison result and the parameter value comparison result are pushed to a user, so that the user can conveniently review the parameter field and/or the parameter value which fails the data test.
In this embodiment, the computer device may obtain a preset table to be compared to obtain the parameter fields to be compared recorded in the table to be compared and the parameter value range corresponding to each parameter field to be compared. The computer equipment can extract each log parameter field in the development log and compare each log parameter field with each parameter field to be compared so as to automatically realize field comparison and obtain a field comparison result. For each parameter field to be compared, the computer equipment can extract each parameter value corresponding to the parameter field to be compared from the development log, and respectively compare each parameter value with the parameter value range corresponding to the parameter field to be compared, so as to automatically realize parameter value comparison and obtain a parameter value comparison result. After the field comparison result and the parameter value comparison result are obtained, the computer equipment can obtain a data comparison result according to the field comparison result and the parameter value comparison result. Therefore, the computer equipment can realize automatic comparison of a large amount of data, so that the data volume of manual verification can be reduced in reply, and the test efficiency and the test accuracy can be improved simultaneously.
In an embodiment, before the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result, the method further includes:
and for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, respectively processing each parameter value by adopting a preset parameter processing logic to obtain a processing result, and comparing the processing result with a target result recorded in the development log to obtain a logic comparison result, wherein the target result refers to result data corresponding to the preset parameter processing logic.
The step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result comprises the following steps: and obtaining the data comparison result according to the field comparison result, the parameter value comparison result and the logic comparison result.
Specifically, in addition to parameter fields and parameter values, the computer device may also perform field logic tests to automatically test whether the field logic is correct. The computer device may extract a portion of the parameters from the test source data and process the extracted parameters according to the logic and aperture expected to be performed by the application to obtain a processed result. And comparing the processing result with the result recorded in the development log to determine whether the processing result and the result are consistent, and further judging whether the field logic of the program to be tested can realize the expected function.
For example, customerNum, the number of user receptions within 10 minutes of the store, and an average response rate responsedrate of the store per minute are recorded in the development log, and the parameter value of customerNum is 75, and the parameter value of responsedrate is 6 in the development log. The computer device may extract the parameter value for customerNum from the development log and calculate a ratio of the parameter value for customerNum to 10 to obtain the processing result. And then, comparing whether the processing result is consistent with the parameter value of responseRate recorded in the development log or not, and further obtaining a logic comparison result.
After the logical comparison result is obtained, the computer device may obtain a final data comparison result according to the field comparison result, the parameter value comparison result, and the logical comparison result. Therefore, the field logic test can be automatically completed, so that the manual participation degree is further reduced, and the test efficiency is improved.
The data comparison device provided by the embodiment of the present application is described below, and the data comparison device described below and the data comparison method described above may be referred to correspondingly.
In one embodiment, the present application provides a data comparison apparatus 200. As shown in FIG. 2, the apparatus 200 includes a table acquisition module 210, a field comparison module 220, a parameter value comparison module 230, and a result acquisition module 240. Wherein:
the table acquiring module 210 is configured to acquire a preset table to be compared, where the table to be compared records parameter fields to be compared and parameter value ranges corresponding to the parameter fields to be compared;
the field comparison module 220 is configured to extract each log parameter field in the development log, and compare each log parameter field with each parameter field to be compared to obtain a field comparison result;
a parameter value comparison module 230, configured to, for each parameter field to be compared, extract each parameter value corresponding to the parameter field to be compared from the development log, and compare each parameter value with a parameter value range corresponding to the parameter field to be compared, so as to obtain a parameter value comparison result;
and the result obtaining module 240 is configured to obtain a data comparison result according to the field comparison result and the parameter value comparison result.
In one embodiment, field comparison module 220 includes a field comparison unit. The field comparison unit is used for judging whether the parameter field to be compared exists in each log parameter field or not aiming at each parameter field to be compared, and if not, recording the parameter field to be compared in the field comparison result.
In one embodiment, the parameter value comparison module 230 includes a range falling determination unit. The range falling judging unit is used for judging whether the parameter value falls into the parameter value range corresponding to the parameter field to be compared or not for each parameter value, and if not, the parameter value is recorded in the parameter value comparison result.
In one embodiment, the result obtaining module 240 includes a first result obtaining unit and a second result obtaining unit. The first result obtaining unit is used for obtaining a data comparison result used for reflecting the passing of the data test under the condition that the field comparison result and the parameter value comparison result are both empty. The second result obtaining unit is used for obtaining a data comparison result used for reflecting the failed data test under the condition that the field comparison result is not null and/or the parameter value comparison result is not null.
In one embodiment, the apparatus 200 further comprises a push module. The pushing module is used for pushing the field comparison result and the parameter value comparison result to a user under the condition that the data comparison result reflects that the data test fails.
In one embodiment, parameter value comparison module 230 includes a fill unit and an execution unit. The filling unit is used for filling the parameter field to be compared into the initial SQL query statement to obtain a target SQL query statement. The execution unit is used for executing the target SQL query statement so as to extract each parameter value corresponding to the parameter field to be compared from the development log.
In one embodiment, the apparatus 200 further comprises a logic comparison module. The logic comparison module is used for extracting each parameter value corresponding to the parameter field to be compared from the development log aiming at each parameter field to be compared, processing each parameter value by adopting preset parameter processing logic respectively to obtain a processing result, and comparing the processing result with a target result recorded in the development log to obtain a logic comparison result, wherein the target result refers to result data corresponding to the preset parameter processing logic. The result obtaining module 240 is configured to obtain the data comparison result according to the field comparison result, the parameter value comparison result, and the logic comparison result.
In one embodiment, the present application further provides a storage medium having computer-readable instructions stored therein, which when executed by one or more processors, cause the one or more processors to perform the steps of the data comparison method of any of the above embodiments.
In one embodiment, the present application also provides a computer device. The computer device has stored therein computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the data comparison method described in any of the embodiments above.
Fig. 3 is a schematic diagram of an internal structure of a computer device provided in an embodiment of the present application, where the computer device may be a server in one example. Referring to fig. 3, computer device 900 includes a processing component 902 that further includes one or more processors, and memory resources, represented by memory 901, for storing instructions, e.g., applications, that are executable by processing component 902. The application programs stored in memory 901 may include one or more modules that each correspond to a set of instructions. Further, the processing component 902 is configured to execute instructions to perform the steps of the data comparison method described in any of the embodiments above.
The computer device 900 may also include a power component 903 configured to perform power management of the computer device 900, a wired or wireless network interface 904 configured to connect the computer device 900 to a network, and an input/output (I/O) interface 905. The computer device 900 may operate based on an operating system stored in memory 901, such as Windows Server, mac OS XTM, unix, linux, free BSDTM, or the like.
Those skilled in the art will appreciate that the internal structure of the computer device shown in the present application is a block diagram of only a portion of the structure associated with the embodiments of the present application, and does not constitute a limitation of the computer device to which the embodiments of the present application may be applied, and that a particular computer device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element. As used herein, the terms "a," "an," "the," and "the" can also include the plural forms as well, unless the context clearly indicates otherwise. Plural means at least two, such as 2, 3, 5 or 8, etc. "and/or" includes any and all combinations of the associated listed items.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, the embodiments may be combined as needed, and the same and similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data comparison, the method comprising:
acquiring a preset table to be compared, wherein the table to be compared records parameter fields to be compared and parameter value ranges corresponding to the parameter fields to be compared;
extracting each log parameter field in the development log, and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result;
for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, and respectively comparing each parameter value with a parameter value range corresponding to the parameter field to be compared to obtain a parameter value comparison result;
and obtaining a data comparison result according to the field comparison result and the parameter value comparison result.
2. The method of claim 1, wherein the step of comparing each log parameter field with each parameter field to be compared to obtain a field comparison result comprises:
and judging whether the parameter field to be compared exists in each log parameter field or not aiming at each parameter field to be compared, and if not, recording the parameter field to be compared in the field comparison result.
3. The method of claim 1, wherein the step of comparing each parameter value with the parameter value range corresponding to the parameter field to be compared to obtain the parameter value comparison result comprises:
and judging whether the parameter value falls into a parameter value range corresponding to the parameter field to be compared or not for each parameter value, and if not, recording the parameter value in the parameter value comparison result.
4. The method according to claim 2 or 3, wherein the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result comprises:
and if the field comparison result and the parameter value comparison result are both empty, obtaining a data comparison result for reflecting that the data test is passed, otherwise, obtaining a data comparison result for reflecting that the data test is not passed.
5. The method of claim 4, further comprising:
and if the data comparison result reflects that the data test fails, pushing the field comparison result and the parameter value comparison result to a user.
6. The method according to any one of claims 1 to 3, wherein the step of extracting the parameter values corresponding to the parameter field to be compared from the development log comprises:
filling the parameter field to be compared into the initial SQL query statement to obtain a target SQL query statement;
and executing the target SQL query statement to extract each parameter value corresponding to the parameter field to be compared from the development log.
7. The method according to any one of claims 1 to 3, further comprising, before the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result:
for each parameter field to be compared, extracting each parameter value corresponding to the parameter field to be compared from the development log, respectively processing each parameter value by adopting a preset parameter processing logic to obtain a processing result, and comparing the processing result with a target result recorded in the development log to obtain a logic comparison result, wherein the target result refers to result data corresponding to the preset parameter processing logic;
the step of obtaining a data comparison result according to the field comparison result and the parameter value comparison result comprises the following steps:
and obtaining the data comparison result according to the field comparison result, the parameter value comparison result and the logic comparison result.
8. A data comparison apparatus, said apparatus comprising:
the table acquisition module is used for acquiring a preset table to be compared, and the table to be compared records each parameter field to be compared and a parameter value range corresponding to each parameter field to be compared;
the field comparison module is used for extracting each log parameter field in the development log and comparing each log parameter field with each parameter field to be compared to obtain a field comparison result;
the parameter value comparison module is used for extracting each parameter value corresponding to the parameter field to be compared from the development log aiming at each parameter field to be compared, and comparing each parameter value with the parameter value range corresponding to the parameter field to be compared respectively to obtain a parameter value comparison result;
and the result acquisition module is used for acquiring a data comparison result according to the field comparison result and the parameter value comparison result.
9. A storage medium having stored therein computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the data comparison method of any one of claims 1 to 7.
10. A computer device, comprising: one or more processors, and a memory;
the memory has stored therein computer-readable instructions that, when executed by the one or more processors, perform the steps of the data comparison method of any of claims 1 to 7.
CN202211531630.2A 2022-12-01 2022-12-01 Data comparison method and device, storage medium and computer equipment Pending CN115757472A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211531630.2A CN115757472A (en) 2022-12-01 2022-12-01 Data comparison method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211531630.2A CN115757472A (en) 2022-12-01 2022-12-01 Data comparison method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN115757472A true CN115757472A (en) 2023-03-07

Family

ID=85342424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211531630.2A Pending CN115757472A (en) 2022-12-01 2022-12-01 Data comparison method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN115757472A (en)

Similar Documents

Publication Publication Date Title
US8386419B2 (en) Data extraction and testing method and system
US7712087B2 (en) Methods and systems for identifying intermittent errors in a distributed code development environment
CN107943694B (en) Test data generation method and device
US8311794B2 (en) Testing executable logic
US9940215B2 (en) Automatic correlation accelerator
US10210227B2 (en) Processing a data set
CN110543356A (en) abnormal task detection method, device and equipment and computer storage medium
US20070100783A1 (en) Method, system, and program for determining discrepancies between database management systems
JP2005222108A (en) Bug analysis method and device
CN116126843A (en) Data quality evaluation method and device, electronic equipment and storage medium
CN112416782A (en) Test result verification method and device and electronic equipment
CN109376285B (en) Data sorting verification method based on json format, electronic device and medium
CN115757472A (en) Data comparison method and device, storage medium and computer equipment
CN116483888A (en) Program evaluation method and device, electronic equipment and computer readable storage medium
CN107273293B (en) Big data system performance test method and device and electronic equipment
CN113656318A (en) Software version testing method and device and computer equipment
CN114490413A (en) Test data preparation method and device, storage medium and electronic equipment
CN112099838B (en) Method, device and storage medium for determining version difference
CN116661758B (en) Method, device, electronic equipment and medium for optimizing log framework configuration
CN111367820B (en) Sequencing method and device for test cases
CN116361179A (en) Data verification method and device
CN116303588A (en) Data verification method and device for upstream and downstream tables, electronic equipment and medium
US20220366270A1 (en) Knowledge graph guided database completion and correction system and methods
CN117370158A (en) Test processing method, system, electronic equipment and medium
CN115470149A (en) Database preprocessing function testing 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