CN109086427A - Data comparison method, apparatus, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN109086427A
CN109086427A CN201810906166.8A CN201810906166A CN109086427A CN 109086427 A CN109086427 A CN 109086427A CN 201810906166 A CN201810906166 A CN 201810906166A CN 109086427 A CN109086427 A CN 109086427A
Authority
CN
China
Prior art keywords
data
correlation
correlation data
comparison
test
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.)
Withdrawn
Application number
CN201810906166.8A
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.)
Shenzhen Dingfeng Cattle Technology Co Ltd
Original Assignee
Shenzhen Dingfeng Cattle Technology 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 Shenzhen Dingfeng Cattle Technology Co Ltd filed Critical Shenzhen Dingfeng Cattle Technology Co Ltd
Priority to CN201810906166.8A priority Critical patent/CN109086427A/en
Publication of CN109086427A publication Critical patent/CN109086427A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a kind of data comparison method, apparatus, computer equipment and storage mediums.The described method includes: data-interface is called to save the test data that tested object present batch executes;The correlation data compared required for being pulled from preset database according to preset rules;The test data and the correlation data are subjected to batch comparison;And if the test data has differences with the correlation data, will imported into database with the test data that the correlation data has differences.A possibility that method by implementing the embodiment of the present invention can realize that batch data compares, and improve the coverage rate in test process, and reduction causes problem to be omitted into production due to data.

Description

Data comparison method, apparatus, computer equipment and storage medium
Technical field
The present invention relates to technical field of data processing more particularly to a kind of data comparison method, apparatus, computer equipment and Storage medium.
Background technique
With the development of information and science and technology, in daily life, daily all with a large amount of data close contact.Believing In the breath epoch, the data of flood tide will be generated daily, will handle the data of flood tide daily.Especially in testing field, one As test method be to be tested using a limited number of data, the final result of comparison operation, but is limited survey by hand Examination data are difficult to cover application scenarios increasingly complicated till now;Either using the operation of tool batch, but only select It selects limited data and carries out Comparative result, all results can not similarly be verified.
Summary of the invention
The embodiment of the invention provides a kind of data comparison method, apparatus, computer equipment and storage mediums, it is intended to solve Amount of test data is few and verification result amount is few, it is difficult to the problem of covering all complex scenes.
In a first aspect, the embodiment of the invention provides a kind of data comparison methods comprising: call data-interface that will be tested The test data that examination object present batch executes is saved;Required for being pulled from preset database according to preset rules into The correlation data of row comparison;The test data and the correlation data are subjected to batch comparison;And if the test data It has differences, will be imported into database with the test data that the correlation data has differences with the correlation data.
Second aspect, the embodiment of the invention also provides a kind of data comparison devices comprising:
First call unit, for calling data-interface to protect the test data that tested object present batch executes It deposits;Unit is pulled, the correlation data for comparing required for pulling from preset database according to preset rules;Comparison Unit, for the test data and the correlation data to be carried out batch comparison;And storage unit, if being used for the test Data have differences with the correlation data, will imported into database with the test data that the correlation data has differences In.
The third aspect, the embodiment of the invention also provides a kind of computer equipments comprising memory and processor, it is described Computer program is stored on memory, the processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the storage medium storage There is computer program, the computer program includes program instruction, and described program instruction can be realized when being executed by a processor State method.
The embodiment of the invention provides a kind of data comparison method, apparatus, computer equipment and storage mediums.Wherein, institute The method of stating includes: that data-interface is called to save the test data that tested object present batch executes;According to default rule The correlation data compared required for then being pulled from preset database;By the test data and the correlation data into Row batch compares;And if the test data has differences with the correlation data, will have differences with the correlation data The test data imported into database.The embodiment of the present invention is due to the test number that executes tested object present batch According to batch comparison is carried out with the correlation data that pulls from database, it can be achieved that batch data compares, improve in test process A possibility that coverage rate, reduction causes problem to be omitted into production due to data.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the application scenarios schematic diagram of data comparison method provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of data comparison method provided in an embodiment of the present invention;
Fig. 3 be another embodiment of the present invention provides data comparison method flow diagram;
Fig. 4 is the sub-process schematic diagram of data comparison method provided in an embodiment of the present invention;
Fig. 5 is the sub-process schematic diagram of data comparison method provided in an embodiment of the present invention;
Fig. 6 is the flow diagram for the data comparison method that further embodiment of this invention provides;
Fig. 7 is the schematic block diagram of data comparison device provided in an embodiment of the present invention;
Fig. 8 is the schematic block diagram for the data comparison device that further embodiment of this invention provides;
Fig. 9 is the specific schematic block diagram of data comparison device provided in an embodiment of the present invention;
Figure 10 be another embodiment of the present invention provides data comparison device schematic block diagram;And
Figure 11 is the schematic block diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
Fig. 1 and Fig. 2 are please referred to, Fig. 1 is the application scenarios schematic diagram of data comparison method provided in an embodiment of the present invention.Figure 2 be the schematic flow chart of data comparison method provided in an embodiment of the present invention.The data comparison method is applied in terminal 10, The data comparison method is completed jointly by the interaction between terminal 10 and server 20.
Fig. 2 is the flow diagram of data comparison method provided in an embodiment of the present invention.As shown, this method include with Lower step S110-150.
S110, data-interface is called to save the test data that tested object present batch executes.
In one embodiment, batch is obtained firstly the need of testing for updated tested object after test Test data, test data are the data for comparing with correlation data, the test data for calling data-interface that will obtain Save for preparing to compare with correlation data.
It in one embodiment, further include step S110a as shown in figure 3, before the step S110.
The implementing result batch of tested object in production environment imported into preset by S110a, calling data-interface Data as a comparison in database.
In one embodiment, need to choose correlation data of a batch for comparison before carrying out data comparison, formal During environmental applications, whether updated tested object is on earth correctly bad determination, because which is held for bad confirmation For row the result is that problematic, which implementing result is that there is no problem.But tested object is run in formal environments , had an implementing result, thus the data that can be run on line according to tested object and the data currently tested into The batch of row data compares, and whether verify data has exception to this tested object.In the present embodiment, production environment be by Test object formally provides the application environment externally serviced.Before being tested, by calling data-interface by tested object Implementing result in production environment is that the batch data that tested object is run on line is imported into database, by the execution As a result as the correlation data for comparing.Of course, it should be understood that can also be by tested object in test environment Implementing result imported into database data as a comparison.Wherein, the implementing result of object in production environment is tested to deposit In the server, database is the database for executing data comparison method terminal for storage.
S120, the correlation data compared required for being pulled from preset database according to preset rules.
In one embodiment, due to including a large amount of data in database, partial data is required when comparing , partial data is the data unrelated with comparison.It is necessary to set preset rules pulled from database it is required when comparison Correlation data.Wherein, preset rules are the series of rules for correlation data required for choosing in the database.
In one embodiment, as shown in figure 4, the step S120 may include step S121-S122.
S121, the key-value pair that data are contrasted according to preset rules.
In one embodiment, key-value pair refers to the mapping relations of key (Key) Yu value (Value), wherein key is key Word, it is uniquely, and correlation data is stored in the database by way of key-value pair.It to be pulled by way of key-value pair Correlation data first has to the key-value pair for first establishing correlation data.In the present embodiment, correlation data is established by preset rules Key-value pair, for example, enabling " key ": " $ 1_1 ", " type ": " regular ", " valve ": " * * ", wherein key refers to comparing The keyword of data, type specified is the mode for obtaining correlation data, and valve refers to the value of correlation data.$ 1_1 in this example It is the keyword that correlation data is assigned according to preset rules, regular is the acquisition correlation data set according to preset rules Mode, * * are the value of correlation data.Since correlation data is the implementing result of tested object, key-value pair is based on tested Object is formed according to preset rules.
S122, the value that the correlation data is pulled according to the keyword of the correlation data.
In one embodiment, due to the mapping relations of key-value pair, value can be found by keyword.Compared After the key-value pair of data, the value of correlation data is found by the keyword of correlation data.For example, " key ": " $ 1_2 ", " type ": " json ", " valve ": " id ", wherein $ 1_2 is the keyword of correlation data, and json is the acquisition side of correlation data Formula, id are the values of correlation data, when pulling required correlation data, input keyword $ 1_2, by way of json, i.e., It can obtain value id.
S130, the test data and the correlation data are subjected to batch comparison.
In one embodiment, in the comparison number for obtaining the currently performed test data of measurand and being pulled from database According to rear, test data and correlation data are carried out to the correctness of batch contrast verification test data.Wherein, used in batch comparison Mode be to be inquired in test data according to keyword, it is corresponding with keyword by whether being inquired in test data Value carry out the correctness of validation test data.
In one embodiment, as shown in figure 5, the step S130 may include step S131-S133.
S131, the value for inquiring the correlation data in the test data according to the keyword of the correlation data.
In one embodiment, it after being contrasted the key-value pair of data, can be found by the keyword of correlation data The value of correlation data, therefore by the keyword of correlation data come the lookup pair in the tested currently performed test data of object Than the value of data.For example, " key ": " $ 1_3 ", " type ": " random ", " valve ": " int ", wherein $ 1_3 is comparison number According to keyword, random be obtain correlation data mode, int is the value of correlation data, is being tested by keyword $ 1_3 Int is searched in data, if can find int in test data, showing test data and correlation data, there is no differences, if It can not find int in test data, then show that test data has differences with correlation data.
If there are the values of the correlation data in S132, the test data, the test data and the comparison are determined Difference is not present in data.
In one embodiment, it is inquired in the test data that the tested object present batch of preservation executes, according to The keyword of correlation data finds the value of correlation data, illustrate currently performed test data and correlation data be it is identical, be There is no difference, show that the test data is correct.
If in S133, the test data be not present the correlation data value, determine the test data with it is described right It is had differences than data.
In one embodiment, it is inquired in the test data that the tested object present batch of preservation executes, however The value that not correlation data is but looked for according to the keyword of correlation data illustrates that currently performed test data and correlation data are not phases With, it has differences, shows that the test data is incorrect.
If S140, the test data have differences with the correlation data, by what is had differences with the correlation data The test data is imported into database.
In one embodiment, by the way that test data and correlation data progress are compared the test number being had differences in batches According to efficiently locate wrong data.The test data that difference will be present is imported into database so that tester checks Find out it is wrong because.
The data comparison method that the embodiment of the present invention is shown, by calling data-interface by tested object present batch The test data of execution is saved;The comparison number compared required for being pulled from preset database according to preset rules According to;The test data and the correlation data are subjected to batch comparison;And if the test data and the correlation data It has differences, will be imported into database with the test data that the correlation data has differences, lot number may be implemented According to comparison, coverage rate is improved.
Fig. 6 be another embodiment of the present invention provides a kind of data comparison method flow diagram.As shown in fig. 6, this The data comparison method of embodiment includes step S210-S250.The wherein step in step S210-S250 and above-described embodiment S110-S150 is similar, and details are not described herein.The following detailed description of in the present embodiment increase step S210a.
It in one embodiment, further include step S210a before the step S210.
S210a, call data-interface that the implementing result that the tested object last time executes is imported into preset database In data as a comparison.
In one embodiment, it is also an option that the implementing result data as a comparison that the tested object last time is executed, Whether newer implementing result is correct more valuable for verifying currently performed test data.Therefore, by calling data to connect The implementing result that the tested object last time executes is imported into database by mouth, using the implementing result as pair for being used to compare Compare data.
The data comparison method that the embodiment of the present invention is shown, by calling data-interface by tested object present batch The test data of execution is saved;The comparison number compared required for being pulled from preset database according to preset rules According to;The test data and the correlation data are subjected to batch comparison;And if the test data and the correlation data It has differences, will be imported into database with the test data that the correlation data has differences, lot number may be implemented According to comparison, coverage rate is improved.
Fig. 7 is a kind of schematic block diagram of data comparison device 300 provided in an embodiment of the present invention.As shown in fig. 7, corresponding In above data control methods, the present invention also provides a kind of data comparison devices 300.The data comparison device 300 includes being used for Execute the unit of above-mentioned data comparison method, the device can be configured in desktop computer, tablet computer, laptop computer, etc. eventually In end.Specifically, referring to Fig. 7, the data comparison device 300 includes the first call unit 310, pulls unit 320, comparison list Member 330 and storage unit 340.
First call unit 310, test data for calling data-interface to execute tested object present batch into Row saves.
In one embodiment, batch is obtained firstly the need of testing for updated tested object after test Test data, test data are the data for comparing with correlation data, the test data for calling data-interface that will obtain Save for preparing to compare with correlation data.
In one embodiment, as shown in figure 8, the data comparison device, further includes the second call unit 310a.
Second call unit 310a, for calling the implementing result batch of data-interface in production environment by tested object Amount imported into preset database data as a comparison.
In one embodiment, need to choose correlation data of a batch for comparison before carrying out data comparison, formal During environmental applications, whether updated tested object is on earth correctly bad determination, because which is held for bad confirmation For row the result is that problematic, which implementing result is that there is no problem.But tested object is run in formal environments , had an implementing result, thus the data that can be run on line according to tested object and the data currently tested into The batch of row data compares, and whether verify data has exception to this tested object.In the present embodiment, production environment be by Test object formally provides the application environment externally serviced.Before being tested, by calling data-interface by tested object Implementing result in production environment is that the batch data that tested object is run on line is imported into database, by the execution As a result as the correlation data for comparing.Of course, it should be understood that can also be by tested object in test environment Implementing result imported into database data as a comparison.Wherein, the implementing result of object in production environment is tested to deposit In the server, database is the database for executing data comparison method terminal for storage.
Unit 320 is pulled, the comparison for comparing required for pulling from preset database according to preset rules Data.
In one embodiment, due to including a large amount of data in database, partial data is required when comparing , partial data is the data unrelated with comparison.It is necessary to set preset rules pulled from database it is required when comparison Correlation data.Wherein, preset rules are the series of rules for correlation data required for choosing in the database.
In one embodiment, as shown in figure 9, the unit 320 that pulls may include subelement: forming unit 321 and pull Subelement 322.
Unit 321 is formed, for being contrasted the key-value pair of data according to preset rules.
In one embodiment, key-value pair refers to the mapping relations of key (Key) Yu value (Value), wherein key is key Word, it is uniquely, and correlation data is stored in the database by way of key-value pair.It to be pulled by way of key-value pair Correlation data first has to the key-value pair for first establishing correlation data.In the present embodiment, correlation data is established by preset rules Key-value pair, for example, enabling " key ": " $ 1_1 ", " type ": " regular ", " valve ": " * * ", wherein key refers to comparing The keyword of data, type specified is the mode for obtaining correlation data, and valve refers to the value of correlation data.$ 1_1 in this example It is the keyword that correlation data is assigned according to preset rules, regular is the acquisition correlation data set according to preset rules Mode, * * are the value of correlation data.Since correlation data is the implementing result of tested object, key-value pair is based on tested Object is formed according to preset rules.
Subelement 322 is pulled, for pulling the value of the correlation data according to the keyword of the correlation data.
In one embodiment, due to the mapping relations of key-value pair, value can be found by keyword.Compared After the key-value pair of data, the value of correlation data is found by the keyword of correlation data.For example, " key ": " $ 1_2 ", " type ": " json ", " valve ": " id ", wherein $ 1_2 is the keyword of correlation data, and json is the acquisition side of correlation data Formula, id are the values of correlation data, when pulling required correlation data, input keyword $ 1_2, by way of json, i.e., It can obtain value id.
Comparison unit 330, for the test data and the correlation data to be carried out batch comparison.
In one embodiment, in the comparison number for obtaining the currently performed test data of measurand and being pulled from database According to rear, test data and correlation data are carried out to the correctness of batch contrast verification test data.Wherein, used in batch comparison Mode be to be inquired in test data according to keyword, it is corresponding with keyword by whether being inquired in test data Value carry out the correctness of validation test data.
In one embodiment, as shown in figure 9, the comparison unit 330 may include subelement: query unit 331 and first Judging unit 332 and the second judging unit 333.
Query unit 331, for inquiring the comparison in the test data according to the keyword of the correlation data The value of data.
In one embodiment, it after being contrasted the key-value pair of data, can be found by the keyword of correlation data The value of correlation data, therefore by the keyword of correlation data come the lookup pair in the tested currently performed test data of object Than the value of data.For example, " key ": " $ 1_3 ", " type ": " random ", " valve ": " int ", wherein $ 1_3 is comparison number According to keyword, random be obtain correlation data mode, int is the value of correlation data, is being tested by keyword $ 1_3 Int is searched in data, if can find int in test data, showing test data and correlation data, there is no differences, if It can not find int in test data, then show that test data has differences with correlation data.
First judging unit 332, if determining the test for there are the values of the correlation data in the test data Difference is not present in data and the correlation data.
In one embodiment, it is inquired in the test data that the tested object present batch of preservation executes, according to The keyword of correlation data finds the value of correlation data, illustrate currently performed test data and correlation data be it is identical, be There is no difference, show that the test data is correct.
Second judging unit 333, if the value for the correlation data to be not present in the test data, determines the survey Examination data have differences with the correlation data.
In one embodiment, it is inquired in the test data that the tested object present batch of preservation executes, however The value that not correlation data is but looked for according to the keyword of correlation data illustrates that currently performed test data and correlation data are not phases With, it has differences, shows that the test data is incorrect.
Being put in storage unit 340 will be with the correlation data if having differences for the test data and the correlation data The test data having differences is imported into database.
In one embodiment, by the way that test data and correlation data progress are compared the test number being had differences in batches According to efficiently locate wrong data.The test data that difference will be present is imported into database so that tester checks Find out it is wrong because.
The data comparison device that the embodiment of the present invention is shown, by calling data-interface by tested object present batch The test data of execution is saved;The comparison number compared required for being pulled from preset database according to preset rules According to;The test data and the correlation data are subjected to batch comparison;And if the test data and the correlation data It has differences, will be imported into database with the test data that the correlation data has differences, lot number may be implemented According to comparison, coverage rate is improved.
Figure 10 be another embodiment of the present invention provides a kind of data comparison device 400 schematic block diagram.Such as Figure 10 institute Show, the data comparison device 400 of the present embodiment is on the basis of above-described embodiment by third call unit 410a replacement second Call unit 310a.
Third call unit 410a calls data-interface to imported into the implementing result that the tested object last time executes pre- If database in data as a comparison.
In one embodiment, it is also an option that the implementing result data as a comparison that the tested object last time is executed, Whether newer implementing result is correct more valuable for verifying currently performed test data.Therefore, by calling data to connect The implementing result that the tested object last time executes is imported into database by mouth, using the implementing result as pair for being used to compare Compare data.
The data comparison device that the embodiment of the present invention is shown, by calling data-interface by tested object present batch The test data of execution is saved;The comparison number compared required for being pulled from preset database according to preset rules According to;The test data and the correlation data are subjected to batch comparison;And if the test data and the correlation data It has differences, will be imported into database with the test data that the correlation data has differences, lot number may be implemented According to comparison, coverage rate is improved.
It should be noted that it is apparent to those skilled in the art that, above-mentioned 400 He of data comparison device The specific implementation process of each unit can refer to the corresponding description in preceding method embodiment, for convenience of description and succinctly, Details are not described herein.
Above-mentioned data comparison device can be implemented as a kind of form of computer program, which can such as scheme It is run in computer equipment shown in 11.
Figure 11 is please referred to, Figure 11 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.The calculating Machine equipment 500 can be terminal, wherein terminal can be smart phone, tablet computer, laptop, desktop computer, individual Digital assistants and wearable device etc. have the electronic equipment of communication function.
Refering to fig. 11, which includes processor 502, memory and the net connected by system bus 501 Network interface 505, wherein memory may include non-volatile memory medium 503 and built-in storage 504.
The non-volatile memory medium 503 can storage program area 5031 and computer program 5032.The computer program 5032 include program instruction, which is performed, and processor 502 may make to execute a kind of data comparison method.
The processor 502 is for providing calculating and control ability, to support the operation of entire computer equipment 500.
The built-in storage 504 provides environment for the operation of the computer program 5032 in non-volatile memory medium 503, should When computer program 5032 is executed by processor 502, processor 502 may make to execute a kind of data comparison method.
The network interface 505 is used to carry out network communication with other equipment.It will be understood by those skilled in the art that in Figure 11 The structure shown, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme The restriction of computer equipment 500 thereon, specific computer equipment 500 may include more more or fewer than as shown in the figure Component perhaps combines certain components or with different component layouts.
Wherein, the processor 502 is for running computer program 5032 stored in memory, to realize following step It is rapid: data-interface being called to save the test data that tested object present batch executes;According to preset rules from default Database in pull required for the correlation data that compares;The test data and correlation data progress batch is right Than;And if the test data has differences with the correlation data, the survey that will be had differences with the correlation data Examination data are imported into database.
In one embodiment, processor 502 executes tested object present batch in the realization calling data-interface Test data carry out preservation step before, be implemented as follows step: calling data-interface by tested object in production ring Implementing result batch in border imported into preset database data as a comparison.
In one embodiment, processor 502 executes tested object present batch in the realization calling data-interface Test data carry out preservation step before, also realization following steps: call data-interface the tested object last time is executed Implementing result imported into preset database data as a comparison.
In one embodiment, processor 502 realize it is described pulled from preset database according to preset rules needed for When the correlation data step to be compared, also realizes following steps: being contrasted the key-value pair of data according to preset rules;Root The value of the correlation data is pulled according to the keyword of the correlation data.
In one embodiment, processor 502 is described by the test data and correlation data progress batch in realization When comparison, also realizes following steps: inquiring the comparison number in the test data according to the keyword of the correlation data According to value;If there are the values of the correlation data in the test data, the test data and the correlation data are determined not It has differences;If the value of the correlation data is not present in the test data, the test data and the comparison number are determined According to having differences.
It should be appreciated that in the embodiment of the present application, processor 502 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or Person's processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process, It is that relevant hardware can be instructed to complete by computer program.The computer program includes program instruction, computer journey Sequence can be stored in a storage medium, which is computer readable storage medium.The program instruction is by the department of computer science At least one processor in system executes, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium.This is deposited Storage media is stored with computer program, and wherein computer program includes program instruction.The program instruction makes when being executed by processor Processor executes following steps: data-interface being called to save the test data that tested object present batch executes;Root The correlation data compared required for being pulled from preset database according to preset rules;By the test data with it is described right Batch comparison is carried out than data;And if the test data has differences with the correlation data, will be with the correlation data The test data having differences is imported into database.
In one embodiment, the processor is instructed in execution described program and realizing the calling data-interface will be tested Before the test data that examination object present batch executes carries out preservation step, it is implemented as follows step: calling data-interface will The implementing result batch of tested object in production environment imported into preset database data as a comparison.
In one embodiment, the processor is instructed in execution described program and realizing the calling data-interface will be tested Before the test data that examination object present batch executes carries out preservation step, also realization following steps: call data-interface will be by The implementing result that the test object last time executes imports the preset data as a comparison into database.
In one embodiment, the processor execute described program instruction and realize it is described according to preset rules from default Database in pull required for compare correlation data step when, also realization following steps: formed according to preset rules The key-value pair of correlation data;The value of the correlation data is pulled according to the keyword of the correlation data.
In one embodiment, the processor is realized described by the test data and institute in the instruction of execution described program When stating correlation data progress batch comparison step, following steps are also realized: according to the keyword of the correlation data in the survey The value of the correlation data is inquired in examination data;If there are the values of the correlation data in the test data, the survey is determined It tries data and difference is not present in the correlation data;If the value of the correlation data is not present in the test data, institute is determined Test data is stated to have differences with the correlation data.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk Or the various computer readable storage mediums that can store program code such as CD.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not It is considered as beyond the scope of this invention.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair Unit in bright embodiment device can be combined, divided and deleted according to actual needs.In addition, in each implementation of the present invention Each functional unit in example can integrate in one processing unit, is also possible to each unit and physically exists alone, can also be with It is that two or more units are integrated in one unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can store in one storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing skill The all or part of part or the technical solution that art contributes can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, terminal or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection scope subject to.

Claims (10)

1. a kind of data comparison method characterized by comprising
Data-interface is called to save the test data that tested object present batch executes;
The correlation data compared required for being pulled from preset database according to preset rules;
The test data and the correlation data are subjected to batch comparison;And
If the test data has differences with the correlation data, the test number that will be had differences with the correlation data According to importeding into the database.
2. data comparison method according to claim 1, which is characterized in that the calling data-interface is by tested object Before the test data that present batch executes is saved, further includes:
It calls data-interface that the implementing result batch of tested object in production environment is imported into preset database to make For correlation data.
3. data comparison method according to claim 1, which is characterized in that the calling data-interface is by tested object Before the test data that present batch executes is saved, further includes:
Data-interface is called to imported into the implementing result that the tested object last time executes in preset database as a comparison Data.
4. data comparison method according to claim 1, which is characterized in that it is described according to preset rules from preset data The correlation data compared required for being pulled in library, comprising:
The key-value pair of data is contrasted according to preset rules;
The value of the correlation data is pulled according to the keyword of the correlation data.
5. data comparison method according to claim 4, which is characterized in that described by the test data and the comparison Data carry out batch comparison, comprising:
The value of the correlation data is inquired in the test data according to the keyword of the correlation data;
If determining that the test data is not present with the correlation data there are the value of the correlation data in the test data Difference;
If the value of the correlation data is not present in the test data, determine that the test data and the correlation data exist Difference.
6. a kind of data comparison device characterized by comprising
First call unit, for calling data-interface to save the test data that tested object present batch executes;
Unit is pulled, the correlation data for comparing required for pulling from preset database according to preset rules;
Comparison unit, for the test data and the correlation data to be carried out batch comparison;And
It is put in storage unit, if having differences for the test data and the correlation data, it is poor to exist with the correlation data The different test data is imported into database.
7. data comparison device according to claim 6 characterized by comprising
Unit is formed, for being contrasted the key-value pair of data according to preset rules;
Subelement is pulled, for pulling the value of the correlation data according to the keyword of the correlation data.
8. data comparison device according to claim 6 characterized by comprising
Query unit, for inquiring the correlation data in the test data according to the keyword of the correlation data Value;
First judging unit, if for there are the value of the correlation data, determine in the test data test data with Difference is not present in the correlation data;
Second judging unit, if the value for the correlation data to be not present in the test data, determines the test data It is had differences with the correlation data.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory and processor, on the memory It is stored with computer program, the processor is realized as described in any one of claim 1-5 when executing the computer program Method.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, the computer program packet Program instruction is included, described program instruction can realize method according to any one of claims 1 to 5 when being executed by a processor.
CN201810906166.8A 2018-08-10 2018-08-10 Data comparison method, apparatus, computer equipment and storage medium Withdrawn CN109086427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810906166.8A CN109086427A (en) 2018-08-10 2018-08-10 Data comparison method, apparatus, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810906166.8A CN109086427A (en) 2018-08-10 2018-08-10 Data comparison method, apparatus, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109086427A true CN109086427A (en) 2018-12-25

Family

ID=64834543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810906166.8A Withdrawn CN109086427A (en) 2018-08-10 2018-08-10 Data comparison method, apparatus, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109086427A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813821A (en) * 2020-03-27 2020-10-23 国泰财产保险有限责任公司 Data comparison method and device
CN112948246A (en) * 2021-02-26 2021-06-11 北京百度网讯科技有限公司 AB test control method, device, equipment and storage medium of data platform
CN113448317A (en) * 2021-06-29 2021-09-28 上海移远通信技术股份有限公司 Module testing system and module testing method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813821A (en) * 2020-03-27 2020-10-23 国泰财产保险有限责任公司 Data comparison method and device
CN112948246A (en) * 2021-02-26 2021-06-11 北京百度网讯科技有限公司 AB test control method, device, equipment and storage medium of data platform
CN112948246B (en) * 2021-02-26 2023-08-04 北京百度网讯科技有限公司 AB test control method, device and equipment of data platform and storage medium
CN113448317A (en) * 2021-06-29 2021-09-28 上海移远通信技术股份有限公司 Module testing system and module testing method

Similar Documents

Publication Publication Date Title
CN109086427A (en) Data comparison method, apparatus, computer equipment and storage medium
CN109408262B (en) Service data processing method and related equipment
CN109918291A (en) Software interface detection method, device, computer equipment and storage medium
CN112527838B (en) Business decision method, device, equipment and storage medium based on rule engine
CN109815111A (en) Gray scale test method, device, computer equipment and storage medium
CN109800104A (en) Detection method, device, storage medium and the electronic device of data storage
CN109901842A (en) Application deployment method, apparatus, computer equipment and storage medium
CN109240915A (en) System detection method, device, computer equipment and storage medium
CN109597798A (en) Network file delet method, device, computer equipment and storage medium
WO2021188196A1 (en) Causality determination of upgrade regressions via comparisons of telemetry data
CN111199146B (en) Test report generation method, device, computer equipment and storage medium
CN112799953A (en) Interface testing method and device, computer equipment and storage medium
CN111723102A (en) Intelligent contract updating method and device
CN114003510A (en) Script testing method, device, equipment and medium based on Mock service
CN114036074A (en) Test method and test device for terminal equipment
CN109684213A (en) A kind of test method, device and storage medium
CN107341074B (en) A kind of abnormal restorative procedure of upgrading upgrades abnormal prosthetic device and intelligent terminal
CN104917720B (en) The method and device of password resetting
CN107423140B (en) Return code identification method and device
EP2820547B1 (en) Debugging method and computer program product
CN110633196A (en) Automatic use case execution method and device of application program
CN110727537B (en) Method, device, computer equipment and storage medium for uniformly processing response message
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN110457362A (en) High-volume verification of data method, apparatus, computer equipment and storage medium
CN111475400A (en) Verification method of service platform and related equipment

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20181225

WW01 Invention patent application withdrawn after publication