CN111767286A - Data mirror image backup method, test method and system based on order - Google Patents
Data mirror image backup method, test method and system based on order Download PDFInfo
- Publication number
- CN111767286A CN111767286A CN202010610029.7A CN202010610029A CN111767286A CN 111767286 A CN111767286 A CN 111767286A CN 202010610029 A CN202010610029 A CN 202010610029A CN 111767286 A CN111767286 A CN 111767286A
- Authority
- CN
- China
- Prior art keywords
- data
- database
- mirror image
- test
- preset priority
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000010998 test method Methods 0.000 title abstract description 9
- 238000012360 testing method Methods 0.000 claims abstract description 130
- 238000004519 manufacturing process Methods 0.000 claims abstract description 46
- 238000011084 recovery Methods 0.000 claims description 16
- 230000008676 import Effects 0.000 claims description 9
- 238000012986 modification Methods 0.000 claims description 5
- 230000004048 modification Effects 0.000 claims description 5
- 238000007792 addition Methods 0.000 claims description 3
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- GOLXNESZZPUPJE-UHFFFAOYSA-N spiromesifen Chemical compound CC1=CC(C)=CC(C)=C1C(C(O1)=O)=C(OC(=O)CC(C)(C)C)C11CCCC1 GOLXNESZZPUPJE-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/14—Travel agencies
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- Tourism & Hospitality (AREA)
- Computer Hardware Design (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Economics (AREA)
- Software Systems (AREA)
- Primary Health Care (AREA)
- Health & Medical Sciences (AREA)
- General Business, Economics & Management (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Strategic Management (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a data mirror image backup method, a test method and a system based on orders, wherein the data mirror image backup method comprises the steps of generating a database query statement corresponding to a target order number, querying a production database according to the database query statement, acquiring first data corresponding to the target order number in the production database, serializing the first data to form a data packet so as to obtain a data mirror image; the data mirror image is used for importing an external test system, and the external test system uses the data mirror image to recover and test the first data corresponding to the target order number. The order-based data mirror image backup method, the order-based data mirror image test method and the order-based data mirror image backup system can quickly and accurately restore data in a test process, save a large amount of test time and greatly improve the test efficiency of an automatic test case.
Description
Technical Field
The invention belongs to the technical field of data backup systems, and particularly relates to a data mirror backup method, a data mirror backup testing method and a data mirror backup system based on orders.
Background
Database systems used in the OTA (Online Travel Agency) industry are often very complex, and one order number may involve thousands of data tables, related system databases, and non-relational databases. In the system test, in order to make the test conform to the actual scene, the data used in the test should be consistent with the real data of the corresponding scene in the actual database system, and the data is often changed in the test process, so that the data needs to be imported again when testing other cases, which requires repeatedly creating and updating the data in the test process, consumes a lot of time and manpower, cannot meet the requirements of an automatic test tool on the data, and greatly limits the execution efficiency of the automatic test case.
Disclosure of Invention
The invention provides a data mirror image backup method, a test method and a system based on an order, aiming at overcoming the defects that in the prior art, when a plurality of tests are executed based on the order, data needs to be repeatedly created and updated, a large amount of time is consumed, and the execution efficiency of an automatic test case is greatly limited.
The invention solves the technical problems through the following technical scheme:
the invention provides a data mirror image backup method based on an order, which comprises the following steps:
s1, generating a database query statement corresponding to the target order number;
s2, inquiring a production database according to the database query statement, and acquiring first data corresponding to the target order number in the production database;
s3, serializing the first data to form a data packet so as to obtain a data mirror image;
the data mirror image is used for importing an external test system, and the external test system uses the data mirror image to recover and test the first data corresponding to the target order number.
Preferably, the data mirror backup method further includes the following steps:
configuring a database name and a data table name in the production database;
the database name and the data table name are used to generate the database query statement corresponding to the target order number in step S1.
Preferably, the data mirror backup method further includes the following steps: setting the priority of a database and/or the priority of a data table in the production database;
in step S2, the production database includes a database with a first preset priority and a database with a second preset priority; inquiring the database with the first preset priority according to the database inquiry statement, judging whether the inquiry result is empty, if not, continuously inquiring the database with the second preset priority, and if not, not inquiring the database with the second preset priority; and/or
In step S2, the production database includes a data table with a third preset priority and a data table with a fourth preset priority; inquiring the data table of the third preset priority according to the database query statement, judging whether the query result is empty, if not, continuously inquiring the data table of the fourth preset priority, and if not, not inquiring the data table of the fourth preset priority;
the first preset priority is higher than the second preset priority, and the third preset priority is higher than the fourth preset priority.
Preferably, step S1 includes the following steps:
generating a plurality of database sub-query sentences corresponding to the target order number;
and automatically splicing a plurality of the database sub-query sentences to generate the database query sentence.
Preferably, in step S2, a multithreading manner is adopted to obtain the first data corresponding to the target order number in the generation database.
Preferably, step S3 is: serializing the first data to form a data packet, and compressing the data packet to obtain the data mirror image.
Preferably, the data mirror backup method further includes the following steps:
according to the value of the field of the data table, the label corresponding to the data mirror image mark is compared; the tag is used to retrieve the data image.
Preferably, the external test system generates the data image through a Web API (Web application programming interface); and the external test platform imports the data mirror image through a Web API.
The invention also provides a test method based on the order, which comprises the following steps:
generating a plurality of data images by using the order-based data image backup method;
importing a target data mirror image corresponding to the order number to be tested based on the test requirement;
performing data recovery on the target data mirror image to obtain second data;
according to the second data, performing addition, deletion and modification operation on the data corresponding to the order number to be tested in the test database, so that the data corresponding to the order number to be tested in the test database is consistent with the second data;
and automatically executing a plurality of test cases corresponding to the order number to be tested.
Preferably, the data mirror image corresponding to the order number to be tested is composed of the target data mirror image and the residual data mirror image;
before the step of performing an operation of adding or deleting data corresponding to the order number to be tested in the test database, the method further comprises the following steps: and locking the residual data mirror image so as to prohibit the residual data mirror image from being imported into the test database during the execution of the plurality of test cases corresponding to the order number to be tested.
The invention also provides a data mirror image backup system based on the order, which comprises a database query statement generation module, a data acquisition module and a data mirror image generation module;
the database query statement generation module is used for generating a database query statement corresponding to the target order number;
the data acquisition module is used for inquiring a production database according to the database query statement and acquiring first data corresponding to the target order number in the production database;
the data mirror image generation module is used for serializing the first data to form a data packet so as to obtain a first data mirror image;
the data mirror image is used for importing an external test system, and the external test system uses the data mirror image to recover and test the first data corresponding to the target order number.
Preferably, the data mirror backup system further comprises a configuration module;
the configuration module is used for configuring database names and data table names in the production database;
and the database name and the data table name are used for generating the database query statement corresponding to the target order number in the database query statement generation module.
Preferably, the configuration module is further configured to set a priority of a database in the production database and/or a priority of a data table;
the production database comprises a database with a first preset priority and a database with a second preset priority; the data acquisition module is further used for querying the database with the first preset priority according to the database query statement, judging whether the query result is empty, if not, continuing to query the database with the second preset priority, and if not, further querying the database with the second preset priority; and/or
The production database comprises a data table with a third preset priority and a data table with a fourth preset priority; the data acquisition module is further configured to query the data table with the third preset priority according to the database query statement, determine whether the query result is empty, continue to query the data table with the fourth preset priority if the query result is not empty, and not query the data table with the fourth preset priority if the query result is empty;
the first preset priority is higher than the second preset priority, and the third preset priority is higher than the fourth preset priority.
Preferably, the database query statement generation module comprises a generation unit and a splicing unit;
the generating unit is used for generating a plurality of database sub-query sentences corresponding to the target order number;
the splicing unit is used for automatically splicing a plurality of the database sub-query sentences to generate the database query sentences.
Preferably, the data obtaining module is configured to obtain first data corresponding to the target order number in the generation database in a multi-thread manner.
Preferably, the data mirror image generating module is configured to serialize the first data to form a data packet, and compress the data packet to obtain the data mirror image.
Preferably, the data mirror backup system further comprises a tag marking module;
the label marking module is used for marking a label corresponding to the data mirror image according to the value of the field of the data table; the tag is used to retrieve the data image.
The invention also provides a test system based on the order, which comprises a data mirror image import module, a data recovery module, a data synchronization module, a test case execution module and the data mirror image backup system based on the order;
the data mirror image importing module is used for importing a target data mirror image corresponding to the order number to be tested from the data mirror image backup system based on the test requirement;
the data recovery module is used for performing data recovery on the target data mirror image to obtain second data;
the data synchronization module is used for performing adding, deleting and modifying operation on the data corresponding to the order number to be tested in the test database according to the second data, so that the data corresponding to the order number to be tested in the test database is consistent with the second data;
the test case execution module is used for automatically executing a plurality of test cases corresponding to the order number to be tested.
Preferably, the data mirror image corresponding to the order number to be tested is composed of the target data mirror image and the residual data mirror image;
the data synchronization module is further configured to lock the remaining data mirror image before performing add-delete-modify operation on data corresponding to the order number to be tested in the test database, so that the remaining data mirror image is prohibited from being imported into the test database during calling of the test case execution module.
The positive progress effects of the invention are as follows: compared with the prior art, the data mirror image backup method, the test method and the system based on the order can quickly and accurately restore data in the test process, save a large amount of test time and greatly improve the test efficiency of the automatic test case.
Drawings
Fig. 1 is a flowchart of a data mirror backup method based on an air ticket order according to embodiment 1 of the present invention.
Fig. 2 is a flowchart of a test method based on an air ticket order according to embodiment 2 of the present invention.
Fig. 3 is a block diagram of a data mirroring backup system based on an air ticket order according to embodiment 3 of the present invention.
Fig. 4 is a block diagram of a test system based on an air ticket order according to embodiment 4 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The embodiment provides a data mirror backup method based on an air ticket order, as shown in fig. 1, including the following steps:
the database name comprises a reservation library and an order library; the data table name comprises a reservation table, an order table, a ticket refund main table, a ticket refund detailed information table and the like. Setting the priority of a database and the priority of a data table in a production database, specifically: setting a reservation base in a production database as a first preset priority, an order base as a second preset priority, a ticket refunding main table as a third preset priority and a ticket refunding detailed information table as a fourth preset priority; the priority level of the first preset priority is higher than the second preset priority, and the priority level of the third preset priority is higher than the fourth preset priority.
and automatically splicing the plurality of database sub-query sentences to generate the database query sentence.
102, inquiring a production database according to a database query statement, and acquiring first data corresponding to a target order number in the production database in a multithreading mode;
the query in step 102 follows the following principles: firstly, inquiring a reservation base with higher priority level, judging whether the inquiry result is empty, if not, continuously inquiring the reservation base with lower priority level, and if not, not inquiring the reservation base; and if the inquiry data table is empty, continuously inquiring the ticket refunding detailed information table with the relatively low priority level, and if the inquiry result is empty, not inquiring the ticket refunding detailed information table.
And 103, serializing the first data to form a data packet, compressing the data packet, and encrypting to obtain a data mirror image.
104, marking a corresponding label for the data mirror image according to the value of the field of the data table; the tag is used to retrieve the data image.
In the embodiment, the data mirror image is marked as a domestic air ticket label or an international air ticket label according to whether the destination field in the preset table is in the Chinese continent or not; it will be appreciated by those skilled in the art that the fields upon which the tags are tagged may be multiple and that these fields may span multiple databases and multiple tables.
In this embodiment, the data mirror is used to import an external test system, and the external test system uses the data mirror to recover and test the first data corresponding to the target order number.
In a specific implementation process, a data mirror image is generated for the data of the production database of the order by using the data mirror image backup method based on the order every preset period, for example, every day.
The external test platform may generate a data image by using the order-based data image backup method of this embodiment through a Web API or import the data image into an external test system.
It should be understood by those skilled in the art that the present embodiment describes the solution of the present invention by taking the air ticket order as an example, and the solution of the present invention can also be applied to other kinds of orders.
In the order-based data mirror image backup method provided by this embodiment, a data mirror image is generated by obtaining data corresponding to a target order number in a production database, the data mirror image stores real data of the production database at that time, and when an external test system performs a test, the corresponding data mirror image is imported for recovery, so as to obtain test data consistent with an actual scene and perform the test. According to the embodiment, accurate data restoration can be rapidly and conveniently carried out in the test process, a large amount of test time is saved, and the test efficiency of the automatic test case is greatly improved.
Example 2
The embodiment provides a testing method based on an air ticket order, as shown in fig. 2, the testing method includes the following steps:
200, generating a plurality of data mirrors by using the order-based data mirror backup method in the embodiment 1;
and step 204, automatically executing a plurality of test cases corresponding to the order number to be tested.
It should be understood by those skilled in the art that the present embodiment describes the solution of the present invention by taking the air ticket order as an example, and the solution of the present invention can also be applied to other kinds of orders.
According to the order-based test method provided by the embodiment, data recovery is performed on the target data mirror image in the test process, data corresponding to the order of the production database at a certain time point are accurately restored, accurate data restoration can be rapidly performed in the test process, a large amount of test time is saved, and the test efficiency of the automatic test case is greatly improved.
Example 3
The embodiment provides a data mirroring backup system 1 based on an air ticket order, as shown in fig. 3, the data mirroring backup system includes a configuration module 11, a database query statement generation module 12, a data acquisition module 13, a data mirroring generation module 14, and a tag marking module 15.
The configuration module 11 is configured to configure database names and data table names in the production database, and set priorities of the databases and the data tables in the production database.
The database name comprises a reservation library and an order library; the data table name comprises a reservation table, an order table, a ticket refund main table, a ticket refund detailed information table and the like. Setting the priority of a database and the priority of a data table in a production database, specifically: setting a reservation base in a production database as a first preset priority, an order base as a second preset priority, a ticket refunding main table as a third preset priority and a ticket refunding detailed information table as a fourth preset priority; the priority level of the first preset priority is higher than the second preset priority, and the priority level of the third preset priority is higher than the fourth preset priority.
The database query statement generating module 12 includes a generating unit 121 and a splicing unit 122, where the generating unit 121 is configured to generate a plurality of database sub-query statements corresponding to the target order number by using the reservation base, the order base, the reservation table, the order table, the ticket refund master table, and the ticket refund detailed information table; the concatenation unit 122 is configured to automatically concatenate the plurality of database sub-query statements to generate a database query statement.
The data obtaining module 13 queries the production database according to the database query statement, and obtains first data corresponding to the target order number in the production database in a multithreading manner.
The data acquisition module 13 follows the following principle: firstly, inquiring a reservation base with higher priority level, judging whether the inquiry result is empty, if not, continuously inquiring the reservation base with lower priority level, and if not, not inquiring the reservation base; and if the inquiry data table is empty, continuously inquiring the ticket refunding detailed information table with the relatively low priority level, and if the inquiry result is empty, not inquiring the ticket refunding detailed information table.
The data mirror image generation module 14 is configured to serialize the first data to form a data packet, compress the data packet, and then encrypt the data packet to obtain a data mirror image.
The label marking module 15 is used for marking a corresponding label on the data mirror image according to the value of the field of the data table; the tag is used to retrieve the data image.
In the embodiment, the data mirror image is marked as a domestic air ticket label or an international air ticket label according to whether the destination field in the preset table is in the Chinese continent or not; it will be appreciated by those skilled in the art that the fields upon which the tags are tagged may be multiple and that these fields may span multiple databases and multiple tables.
In this embodiment, the data mirror is used to import an external test system, and the external test system uses the data mirror to recover and test the first data corresponding to the target order number.
In a specific implementation process, the data mirror image is generated for the data of the production database of the order by using the data mirror image backup system based on the order in the embodiment every preset period, for example, every day.
The external test platform can generate a data image by using the order-based data image backup system of the embodiment through a Web API or import the data image into the external test system.
It should be understood by those skilled in the art that the present embodiment describes the solution of the present invention by taking the air ticket order as an example, and the solution of the present invention can also be applied to other kinds of orders.
In the data mirror image backup system based on the order provided by this embodiment, a data mirror image is generated by obtaining data corresponding to a target order number in a production database, the data mirror image stores real data of the production database at that time, and when an external test system performs a test, the corresponding data mirror image is imported for recovery, so as to obtain test data consistent with an actual scene and perform the test. According to the embodiment, accurate data restoration can be rapidly and conveniently carried out in the test process, a large amount of test time is saved, and the test efficiency of the automatic test case is greatly improved.
Example 4
The present embodiment provides a test system 2 based on an air ticket order, as shown in fig. 4, the test system 2 includes a data mirroring import module 21, a data recovery module 22, a data synchronization module 23, a test case execution module 24, and the order-based data mirroring backup system 1 of embodiment 3.
The order-based data mirroring backup system 1 in embodiment 3 is used to generate a number of data mirrors.
The data mirror image importing module 21 is configured to import a target data mirror image corresponding to the order number to be tested from the data mirror image backup system based on the test requirement.
The data recovery module 22 is configured to perform data recovery on the target data image to obtain second data.
The data synchronization module 23 is configured to lock the remaining data mirror image, so that the remaining data mirror image is prohibited from being imported into the test database during the period of invoking the test case execution module, and then perform an add/delete operation on data corresponding to the order number to be tested in the test database according to the second data, so that the data corresponding to the order number to be tested in the test database is consistent with the second data.
The test case execution module 24 is configured to automatically execute a plurality of test cases corresponding to the order number to be tested.
It should be understood by those skilled in the art that the present embodiment describes the solution of the present invention by taking the air ticket order as an example, and the solution of the present invention can also be applied to other kinds of orders.
According to the order-based test system provided by the embodiment, data recovery is performed on the target data mirror image in the test process, data corresponding to the order of the production database at a certain time point are accurately restored, accurate data restoration can be rapidly performed in the test process, a large amount of test time is saved, and the test efficiency of the automatic test case is greatly improved.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.
Claims (14)
1. A data mirror image backup method based on an order is characterized by comprising the following steps:
s1, generating a database query statement corresponding to the target order number;
s2, inquiring a production database according to the database query statement, and acquiring first data corresponding to the target order number in the production database;
s3, serializing the first data to form a data packet so as to obtain a data mirror image;
the data mirror image is used for importing an external test system, and the external test system uses the data mirror image to recover and test the first data corresponding to the target order number.
2. The order-based data mirroring backup method according to claim 1, wherein the data mirroring backup method further comprises the steps of:
configuring a database name and a data table name in the production database;
the database name and the data table name are used to generate the database query statement corresponding to the target order number in step S1.
3. The order-based data mirroring backup method according to claim 2, wherein the data mirroring backup method further comprises the steps of: setting the priority of a database and/or the priority of a data table in the production database;
in step S2, the production database includes a database with a first preset priority and a database with a second preset priority; inquiring the database with the first preset priority according to the database inquiry statement, judging whether the inquiry result is empty, if not, continuously inquiring the database with the second preset priority, and if not, not inquiring the database with the second preset priority; and/or
In step S2, the production database includes a data table with a third preset priority and a data table with a fourth preset priority; inquiring the data table of the third preset priority according to the database query statement, judging whether the query result is empty, if not, continuously inquiring the data table of the fourth preset priority, and if not, not inquiring the data table of the fourth preset priority;
the first preset priority is higher than the second preset priority, and the third preset priority is higher than the fourth preset priority.
4. The order-based data mirror backup method according to claim 1, wherein the step S1 comprises the steps of:
generating a plurality of database sub-query sentences corresponding to the target order number;
and automatically splicing a plurality of the database sub-query sentences to generate the database query sentence.
5. The order-based data mirroring backup method according to claim 1, wherein the data mirroring backup method further comprises the steps of:
according to the value of the field of the data table, the label corresponding to the data mirror image mark is compared; the tag is used to retrieve the data image.
6. An order-based testing method, the testing method comprising:
generating a plurality of data images by using the order-based data image backup method of any one of claims 1 to 5;
importing a target data mirror image corresponding to the order number to be tested based on the test requirement;
performing data recovery on the target data mirror image to obtain second data;
according to the second data, performing addition, deletion and modification operation on the data corresponding to the order number to be tested in the test database, so that the data corresponding to the order number to be tested in the test database is consistent with the second data;
and automatically executing a plurality of test cases corresponding to the order number to be tested.
7. The order-based testing method of claim 6, wherein the data image corresponding to the order number to be tested is composed of the target data image and the remaining data images;
before the step of performing an operation of adding or deleting data corresponding to the order number to be tested in the test database, the method further comprises the following steps: and locking the residual data mirror image so as to prohibit the residual data mirror image from being imported into the test database during the execution of the plurality of test cases corresponding to the order number to be tested.
8. A data mirror image backup system based on an order is characterized by comprising a database query statement generation module, a data acquisition module and a data mirror image generation module;
the database query statement generation module is used for generating a database query statement corresponding to the target order number;
the data acquisition module is used for inquiring a production database according to the database query statement and acquiring first data corresponding to the target order number in the production database;
the data mirror image generation module is used for serializing the first data to form a data packet so as to obtain a first data mirror image;
the data mirror image is used for importing an external test system, and the external test system uses the data mirror image to recover and test the first data corresponding to the target order number.
9. The order-based data mirroring backup system of claim 8 wherein the data mirroring backup system further comprises a configuration module;
the configuration module is used for configuring database names and data table names in the production database;
and the database name and the data table name are used for generating the database query statement corresponding to the target order number in the database query statement generation module.
10. The order-based data mirroring backup system according to claim 9 wherein the configuration module is further configured to set a priority of a database and/or a priority of a data table in the production database;
the production database comprises a database with a first preset priority and a database with a second preset priority; the data acquisition module is further used for querying the database with the first preset priority according to the database query statement, judging whether the query result is empty, if not, continuing to query the database with the second preset priority, and if not, further querying the database with the second preset priority; and/or
The production database comprises a data table with a third preset priority and a data table with a fourth preset priority; the data acquisition module is further configured to query the data table with the third preset priority according to the database query statement, determine whether the query result is empty, continue to query the data table with the fourth preset priority if the query result is not empty, and not query the data table with the fourth preset priority if the query result is empty;
the first preset priority is higher than the second preset priority, and the third preset priority is higher than the fourth preset priority.
11. The order-based data mirroring backup system according to claim 8, wherein the database query statement generating module comprises a generating unit and a splicing unit;
the generating unit is used for generating a plurality of database sub-query sentences corresponding to the target order number;
the splicing unit is used for automatically splicing a plurality of the database sub-query sentences to generate the database query sentences.
12. The order-based data mirroring backup system of claim 8 further comprising a label tagging module;
the label marking module is used for marking a label corresponding to the data mirror image according to the value of the field of the data table; the tag is used to retrieve the data image.
13. An order-based test system, comprising a data mirror import module, a data recovery module, a data synchronization module, a test case execution module, and an order-based data mirror backup system according to any one of claims 8 to 12;
the data mirror image importing module is used for importing a target data mirror image corresponding to the order number to be tested from the data mirror image backup system based on the test requirement;
the data recovery module is used for performing data recovery on the target data mirror image to obtain second data;
the data synchronization module is used for performing adding, deleting and modifying operation on the data corresponding to the order number to be tested in the test database according to the second data, so that the data corresponding to the order number to be tested in the test database is consistent with the second data;
the test case execution module is used for automatically executing a plurality of test cases corresponding to the order number to be tested.
14. The order-based test system of claim 13, wherein the data image corresponding to the order number to be tested is comprised of the target data image and a remaining data image;
the data synchronization module is further configured to lock the remaining data mirror image before performing add-delete-modify operation on data corresponding to the order number to be tested in the test database, so that the remaining data mirror image is prohibited from being imported into the test database during calling of the test case execution module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010610029.7A CN111767286A (en) | 2020-06-29 | 2020-06-29 | Data mirror image backup method, test method and system based on order |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010610029.7A CN111767286A (en) | 2020-06-29 | 2020-06-29 | Data mirror image backup method, test method and system based on order |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111767286A true CN111767286A (en) | 2020-10-13 |
Family
ID=72722961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010610029.7A Pending CN111767286A (en) | 2020-06-29 | 2020-06-29 | Data mirror image backup method, test method and system based on order |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111767286A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104866395A (en) * | 2014-02-24 | 2015-08-26 | ***通信集团福建有限公司 | Data backup method, data backup system, main-backup switching method and main-backup switching system |
US20160328405A1 (en) * | 2015-05-08 | 2016-11-10 | International Business Machines Corporation | Dynamic test case prioritization for relational database systems |
CN106126427A (en) * | 2016-07-06 | 2016-11-16 | ***股份有限公司 | A kind of method and system of fast quick-recovery test |
CN108536798A (en) * | 2018-04-02 | 2018-09-14 | 携程旅游网络技术(上海)有限公司 | The restoration methods and system of the other database data of order level |
CN110457187A (en) * | 2019-06-28 | 2019-11-15 | 武汉迎风聚智科技有限公司 | Based on backup test data can convenient operation TPC-E test method and testing service device |
-
2020
- 2020-06-29 CN CN202010610029.7A patent/CN111767286A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104866395A (en) * | 2014-02-24 | 2015-08-26 | ***通信集团福建有限公司 | Data backup method, data backup system, main-backup switching method and main-backup switching system |
US20160328405A1 (en) * | 2015-05-08 | 2016-11-10 | International Business Machines Corporation | Dynamic test case prioritization for relational database systems |
CN106126427A (en) * | 2016-07-06 | 2016-11-16 | ***股份有限公司 | A kind of method and system of fast quick-recovery test |
CN108536798A (en) * | 2018-04-02 | 2018-09-14 | 携程旅游网络技术(上海)有限公司 | The restoration methods and system of the other database data of order level |
CN110457187A (en) * | 2019-06-28 | 2019-11-15 | 武汉迎风聚智科技有限公司 | Based on backup test data can convenient operation TPC-E test method and testing service device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7219104B2 (en) | Data cleansing | |
CN110321254B (en) | Software version rollback method, device, server and storage medium | |
US8549046B2 (en) | Test data generation and scale up for database testing using unique common factor sequencing | |
CN103810212A (en) | Automated database index creation method and system | |
CN104423960A (en) | Continuous project integration method and continuous project integration system | |
CN112256318B (en) | Construction method and equipment for dependent product | |
CN111143368A (en) | Relational database data comparison method and system | |
CN110109981B (en) | Information display method and device for work queue, computer equipment and storage medium | |
US20060015483A1 (en) | SQL query enhancement technique | |
CN105446824B (en) | Table increment acquisition methods and long-distance data backup method | |
CN105808559A (en) | Data conflict processing method and apparatus | |
CN113537943A (en) | Universal workflow engine and construction method thereof | |
CN106713032B (en) | A kind of method and device for realizing network management service management | |
CN112433753A (en) | Interface document generation method, device, equipment and medium based on parameter information | |
US20210064660A1 (en) | Graph search using index vertices | |
CN111767286A (en) | Data mirror image backup method, test method and system based on order | |
CN111159040A (en) | Test data generation method, device, equipment and storage medium | |
CN114996758A (en) | Data desensitization method and device and electronic equipment | |
CN111143356B (en) | Report retrieval method and device | |
CN112817931B (en) | Incremental version file generation method and device | |
CN112052257A (en) | Service processing method, device and equipment | |
CN107180072B (en) | Method and device for processing time sequence data | |
CN111752927A (en) | Clone-based data form generation method, device, terminal equipment and medium | |
CN112346961A (en) | Debugging method and device for client | |
CN108984793A (en) | A kind of data-updating method and system, 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 |