CN112612773A - Database synchronization test method and device, computer equipment and storage medium - Google Patents

Database synchronization test method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112612773A
CN112612773A CN202011483087.4A CN202011483087A CN112612773A CN 112612773 A CN112612773 A CN 112612773A CN 202011483087 A CN202011483087 A CN 202011483087A CN 112612773 A CN112612773 A CN 112612773A
Authority
CN
China
Prior art keywords
database
upstream
data record
type
downstream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011483087.4A
Other languages
Chinese (zh)
Inventor
连苗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Consumer Finance Co Ltd
Original Assignee
Ping An Consumer Finance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Consumer Finance Co Ltd filed Critical Ping An Consumer Finance Co Ltd
Priority to CN202011483087.4A priority Critical patent/CN112612773A/en
Publication of CN112612773A publication Critical patent/CN112612773A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention relates to the technical field of test management, and provides a database synchronous test method and a test device, wherein the method comprises the following steps: acquiring a link list, wherein the link list comprises an upstream database and a downstream database which establish a link relation; executing preset operation on the upstream database to enable data records in the upstream database to generate a first type of change; the first type of change correspondingly comprises any one or more of data record addition, data record change and data record deletion; determining whether a corresponding second type change occurs to the data record in the downstream database based on the first type change of the data record in the upstream database; the second type of variation is the same as the first type of variation; under the condition that the data records in the downstream database are determined to have the second type of change, outputting database synchronization success information; otherwise, outputting the database synchronization failure information.

Description

Database synchronization test method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of test management, in particular to a database synchronous test method, a database synchronous test device, computer equipment and a storage medium.
Background
GG link synchronization refers to a mechanism between different systems that need to synchronize data with each other in a database of each other, and is called Oracle golden Gate. In the prior art, the upstream data of the business system needs to be synchronized to the downstream data warehouse, and then the data warehouse performs subsequent processing such as report processing.
At present, the GG link synchronization test adopts a manual test mode, the test method has the defects of incomplete operation type coverage, incomplete field coverage and the like, the functions need to be tested repeatedly in stages of site test, regression test and the like, the manual test is not beneficial to repeated execution, and the problems of excessive repeated work content and low efficiency can be caused. In addition, in the testing process, the development may repeatedly change the table structure according to the requirement, and the requirement on the timeliness of the test is high. Therefore, how to provide an accurate and efficient automated GG synchronization test scheme becomes a technical problem to be solved urgently in the field.
Disclosure of Invention
The invention aims to provide a technical scheme capable of accurately and efficiently carrying out synchronous testing on a database with a GG link, so as to solve the problems in the prior art.
In order to achieve the above object, the present invention provides a database synchronization testing method, which comprises the following steps:
acquiring a link list, wherein the link list comprises an upstream database and a downstream database which establish a link relation;
executing preset operation on the upstream database to enable data records in the upstream database to generate a first type of change; the preset operation comprises any one or more of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more of adding data records, changing data records and deleting data records;
determining whether a corresponding second type change occurs to the data record in the downstream database based on the first type change of the data record in the upstream database; the second type of variation is the same as the first type of variation;
under the condition that the data records in the downstream database are determined to have the second type of change, outputting database synchronization success information; otherwise, outputting the database synchronization failure information.
According to the database synchronization testing method provided by the invention, after the step of obtaining the link list, the method further comprises the following steps:
acquiring a first table structure in an upstream database and a second table structure in the downstream database;
comparing whether the second table structure and the first table structure are adapted;
and under the condition that the first table structure and the second table structure are not adaptive, outputting database synchronization failure information, and adding the upstream database and the downstream database into a new link list.
According to the database synchronization testing method provided by the invention, the step of executing the preset operation on the upstream database to enable the data records in the upstream database to generate the first type of change comprises the following steps:
inserting a new first data record into the upstream database at a first time, wherein the first data record comprises a flag bit; the first moment is any moment;
changing a second data record existing in the upstream database at a second moment, and receiving the change success information returned by the upstream database; wherein the second time is later than the first time;
and deleting a third data record existing in the upstream database at a third time, and receiving deletion success information returned by the upstream database, wherein the third time is later than the second time.
According to the database synchronization testing method provided by the present invention, the step of performing a preset operation on the upstream database to make a first type of change occur to a data record in the upstream database further includes:
and receiving the successful insertion information, the successful modification information or the successful deletion information returned by the upstream database.
According to the database synchronization testing method provided by the invention, the second data record and the first data record are the same data record, and the third data record and the second data record are the same record.
According to the database synchronization testing method provided by the invention, the step of determining whether the data record in the downstream database has a corresponding second type change or not based on the first type change of the data record in the upstream database comprises the following steps:
inquiring whether the downstream database contains the first data record at a fourth moment, wherein the fourth moment is between the first moment and the second moment;
inquiring whether the downstream database contains the second data record at a fifth moment, wherein the fifth moment is between the second moment and the third moment;
and inquiring whether the downstream database contains the third data record at a sixth moment, wherein the sixth moment is after the third moment.
According to the database synchronization testing method provided by the present invention, the step of querying whether the downstream database contains the third data record at the sixth time includes:
on the basis that the downstream database does not contain the third data record in the query, acquiring a query result of the downstream database for the first data record and the second data record;
determining that the third data record is successfully deleted in the downstream database if the first data record and the second data record have been queried in the downstream database.
In order to achieve the above object, the present invention further provides a database synchronization testing apparatus, including:
the link list acquisition module is suitable for acquiring a link list, and the link list comprises an upstream database and a downstream database which establish a link relation;
the first type change module is suitable for executing preset operation on the upstream database so as to enable data records in the upstream database to generate first type changes; the preset operation comprises any one or more of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more of adding data records, changing data records and deleting data records;
the second type change module is used for determining whether the data records in the downstream database have corresponding second type changes or not based on the first type changes of the data records in the upstream database; the second type of variation is the same as the first type of variation;
the synchronization information module is suitable for outputting database synchronization success information under the condition that the data records in the downstream database are determined to have the second type of change; otherwise, outputting the database synchronization failure information.
To achieve the above object, the present invention further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
To achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above method.
The database synchronization test method, the database synchronization test device, the computer equipment and the storage medium provide a scheme for accurately, quickly and automatically testing the synchronization performance between the upstream database and the downstream database. The method comprises the steps of firstly executing preset operation in the upstream database to change data in the upstream database, then detecting whether corresponding data have the same change in the downstream database, and determining whether the synchronization between the upstream database and the downstream database is successful according to the detected change condition. According to the method and the device, traversal detection is not needed to be carried out on all data records in the databases, and the synchronous state between the two databases can be obtained only by detecting the target data record which is subjected to the preset operation, so that the efficiency and the accuracy of synchronous detection of the databases are improved.
Drawings
FIG. 1 is a flowchart of a database synchronization test method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of program modules of a database synchronization test apparatus according to a first embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of a first embodiment of the database synchronization testing apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The database synchronization test method, the database synchronization test device, the computer equipment and the storage medium provide a scheme for accurately, quickly and automatically testing the synchronization performance between the upstream database and the downstream database. The method comprises the steps of firstly executing preset operation in the upstream database to change data in the upstream database, then detecting whether corresponding data have the same change in the downstream database, and determining whether the synchronization between the upstream database and the downstream database is successful according to the detected change condition. According to the method and the device, traversal detection is not needed to be carried out on all data records in the databases, and the synchronous state between the two databases can be obtained only by detecting the target data record which is subjected to the preset operation, so that the efficiency and the accuracy of synchronous detection of the databases are improved.
Example one
Referring to fig. 1, the present embodiment provides a database synchronization testing method, including the following steps:
s100, a link list is obtained, wherein the link list comprises an upstream database and a downstream database which establish a link relation.
The upstream database in this embodiment includes databases related to individual business systems, and the downstream database is used to receive all data in the upstream database and perform functions such as background backup, management, analysis, and the like, for example, a data warehouse. The upstream database and the downstream database which establish the link relation refer to the real-time data synchronization between the upstream database and the downstream database.
It is understood that the link list may include an upstream database name, an upstream data table name, a downstream database name, a downstream data table name, etc. It will be appreciated that a database will typically contain multiple data tables, where an upstream data table name refers to the name of a data table contained in an upstream database and a following data table name refers to the name of a data table contained in a downstream database.
S200, executing preset operation on the upstream database to enable data records in the upstream database to generate first-class changes; the preset operation comprises any one or more items of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more items of adding data records, changing data records and deleting data records.
It should be noted that, in this step, performing the preset operation on the upstream database is performed sequentially based on the data tables included in the link list. For example, if the upstream database includes a first data table, a second data table, and a third data table, the upstream database executes preset operations on the first data table, the second data table, and the third data table, respectively. Of course, if the upstream database only contains one data table, performing the predetermined operation on the upstream database is to operate on the only data table contained therein.
The purpose of the preset operation performed on the upstream database in this step is to make a preset change to the data record in the upstream database. For example, when an operation of adding a data record is performed on an upstream database, the data record in the upstream database is increased; when the operation of changing the data record is executed on the upstream database, the data record in the upstream database can be changed; when a delete operation is performed on the upstream database, the data records in the upstream database are decremented.
S300, determining whether the data records in the downstream database are changed in a corresponding second type or not based on the first type of change of the data records in the upstream database; the second type of variation is the same as the first type of variation.
This step is used to detect whether the data records in the downstream database have changed correspondingly when the data records in the upstream database have changed. For example, in the case of an increase in data records in the upstream database, it is detected whether the same increase has occurred in data records in the downstream database; when the data record in the upstream database is changed, detecting whether the data record in the downstream database is changed in the same way or not; in the event of a data record reduction in the upstream database, it is detected whether the data record in the downstream database has been similarly reduced.
S400, under the condition that the data records in the downstream database are determined to have the second type of change, outputting database synchronization success information; otherwise, outputting the database synchronization failure information.
It can be understood that if the change of the data record in the downstream database is the same as the change of the data record in the upstream database, it indicates that the change in the upstream database can be accurately reflected in the downstream database, so that the data record in the downstream database and the data record in the upstream database are kept synchronous, and the database synchronization success information can be output; otherwise, the data record in the downstream database is asynchronous with the data record in the upstream database, and the database synchronization failure information is output.
In the above steps of this embodiment, the change of the data record is actively made in the upstream database, and then whether the corresponding passive change of the data record is generated in the downstream database is detected to confirm whether the data synchronization is successful or not, so that the database synchronization detection process can be accurately and efficiently implemented.
Illustratively, after the step of obtaining the link list in step S100, the method further includes:
s110, a first table structure in an upstream database and a second table structure in the downstream database are obtained.
It should be noted that the first table structure and the second table structure refer to the table structures of the data tables with the same data table name in the upstream database and the downstream database, respectively. For example, the Name of the data table in the upstream database is Name1, and the corresponding table structure is the first table structure. The table structure corresponding to the data table in the downstream database also named Name1 is the second table structure. Data tables with the same data table name mean that data synchronization is required between the two tables.
S120, comparing whether the second table structure and the first table structure are adaptive.
The table structure in this embodiment may include a field name, a field number, a field length, and the like. Comparing whether the second table structure and the first table structure are compatible may include comparing whether the second field name is the same as the first field name, whether the second field number is the same as the first field number, and whether the second field length matches the first field length. The field length refers to the data bit number occupied by a single field, and as the first table structure corresponds to a source data table of an upstream database and the second table structure corresponds to a backup data table of a downstream database, the undifferentiated synchronous backup between the two data tables can be realized only on the basis that the field length in the second table structure is greater than or equal to the field length in the first table structure. The comparison of the length of the second field with the length of the first field in this step is performed, that is, whether the length of the field in the second table structure is greater than or equal to the length of the field in the first table structure is compared.
And S130, under the condition that the first table structure and the second table structure are not adaptive, outputting database synchronization failure information, and adding the upstream database and the downstream database into a new link list.
It will be appreciated that if the first table structure and the second table structure do not fit together, the data records in the corresponding data tables are necessarily not identical. In this case, the database synchronization failure information can be directly output without comparing the data records in the upstream database and the downstream database.
In this embodiment, the condition of determining the synchronization failure is summarized and sent to the relevant maintenance personnel, and after waiting for maintenance, the upstream database and the downstream database which have failed in synchronization are added to the new link list again, so that synchronization detection is performed again.
Illustratively, the step of S200 performing a preset operation on the upstream database to make a first type change occur to the data record in the upstream database includes:
and S210, inserting a new first data record into the upstream database at a first moment, wherein the first data record comprises a flag bit.
The step is used for adding a new data record to the upstream database. Where the first data record refers to a newly inserted data record that did not originally exist in the upstream database. In order to facilitate data search in the downstream database, a flag bit can be added to the newly added data record, so that when the newly added data record is searched in the subsequent downstream database, only the data record containing the flag bit needs to be searched, the whole amount of data in the downstream database does not need to be searched, and the detection efficiency is improved.
Whether the first data record is inserted successfully may be determined by detecting the number of impact line returns for the current preset operation in the upstream database. For example, if the number of impact lines returns a value of 1, it is indicated that the data was successfully inserted; if the impact row number return value is 0, it indicates that the data is not successfully inserted.
S220, changing the existing second data record in the upstream database at a second moment, and receiving the change success information returned by the upstream database; wherein the second time is later than the first time.
In this embodiment, the preset operations are sequentially executed based on the time sequence, for example, the operation of inserting the data record is executed first, then the operation of changing the data record is executed, and finally the operation of deleting the data record is executed. Therefore, the method can cover the adding and deleting actions in the database operation and ensure the comprehensiveness of data synchronous detection. Preferably, the second data record modified in this step is the newly added data record in step S210. By continuously executing the preset operation on the same data record, the influence of excessive dirty data on the accuracy of the database can be avoided.
This step may also determine whether the second data record was successfully modified by checking the return value of the number of impact lines currently preset in the upstream database. For example, if the number of impact lines returns a value of 1, it indicates that the data was successfully changed; if the number of impact rows returns a value of 0, it indicates that the data was not successfully changed.
And S230, deleting the existing third data record in the upstream database at a third moment, and receiving the deletion success information returned by the upstream database.
Preferably, the third data record in this step is the second data record in step S220. Therefore, the operations of adding, changing and deleting are carried out on the same data record in the upstream data table in sequence, the original data in the upstream database cannot be influenced, and the accuracy of the data record can be ensured. Likewise, whether the third data record is successfully deleted may be determined by detecting the number of influence lines returned for the current preset operation in the upstream database. For example, if the number of impact lines returns a value of 1, it indicates that the data was successfully deleted; if the number of influencing lines returns a value of 0, it is indicated that the data is not successfully deleted.
Illustratively, the step of S300 determining whether the data record in the downstream database has changed to the corresponding second type based on the first type of change of the data record in the upstream database includes:
s310, inquiring whether the downstream database contains the first data record at a fourth moment, wherein the fourth moment is between the first moment and the second moment.
In consideration of the time delay between database synchronization, the embodiment queries the first data record from the downstream database after a period of time later than the first time, so as to avoid the situation that no newly added data is detected due to time delay, and further ensure the accuracy of synchronization detection.
And S320, inquiring whether the downstream database contains the second data record at a fifth moment, wherein the fifth moment is between the second moment and the third moment.
S330, inquiring whether the downstream database contains the third data record at a sixth moment, wherein the sixth moment is after the third moment.
It should be noted that, for the case that the first data record, the second data record and the third data record are the same data record, it is required to determine that the first data record is included in step S310, and determine that the third data record is not included in step S330 on the basis that the second data record is included in step S320. The successful data synchronization is only indicated by the judgment of simultaneously meeting the three steps. If it is determined that the third data record is not included only in step S330, but the corresponding first data record and second data record are not queried in steps S310 and S320, it indicates that the new adding operation and the changing operation are not synchronized successfully, and therefore, the synchronization failure information is still output in this case.
Referring to fig. 2, a database synchronization testing apparatus is shown, in the embodiment, the database synchronization testing apparatus 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the database synchronization method. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than the program itself for describing the execution process of the database synchronization test apparatus 20 in the storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
the list acquiring module 21 is adapted to acquire a link list, where the link list includes an upstream database and a downstream database that establish a link relationship;
a first type change module 22, adapted to perform a preset operation on the upstream database to make a first type change occur to a data record in the upstream database; the preset operation comprises any one or more of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more of adding data records, changing data records and deleting data records;
a second type change module 23, adapted to determine whether a corresponding second type change occurs to the data record in the downstream database based on the first type change of the data record in the upstream database; the second type of variation is the same as the first type of variation;
a synchronization information module 24, adapted to output database synchronization success information in case that it is determined that the data records in the downstream database have undergone the second type of change; otherwise, outputting the database synchronization failure information.
The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. The computer device 30 of the present embodiment includes at least, but is not limited to: a memory 31, a processor 32, which may be communicatively coupled to each other via a system bus, as shown in FIG. 3. It is noted that fig. 3 only shows a computer device 30 with components 31-32, but it is to be understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
In the present embodiment, the memory 31 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 31 may be an internal storage unit of the computer device 30, such as a hard disk or a memory of the computer device 30. In other embodiments, the memory 31 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 30. Of course, the memory 31 may also include both internal and external storage devices of the computer device 30. In this embodiment, the memory 31 is generally used for storing an operating system installed on the computer device 30 and various application software, such as the program code of the database synchronization testing apparatus 20 in the first embodiment. Further, the memory 31 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 32 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 32 is typically used to control the overall operation of the computer device 30. In this embodiment, the processor 32 is configured to run the program code stored in the memory 31 or process data, for example, run the database synchronization testing apparatus 20, so as to implement the database synchronization testing method according to the first embodiment.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing the database synchronization apparatus 20, and when executed by a processor, the database synchronization apparatus implements the database synchronization method of the first embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example" or "some examples" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A database synchronization test method is characterized by comprising the following steps:
acquiring a link list, wherein the link list comprises an upstream database and a downstream database which establish a link relation;
executing preset operation on the upstream database to enable data records in the upstream database to generate a first type of change; the preset operation comprises any one or more of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more of adding data records, changing data records and deleting data records;
determining whether a corresponding second type change occurs to the data record in the downstream database based on the first type change of the data record in the upstream database; the second type of variation is the same as the first type of variation;
under the condition that the data records in the downstream database are determined to have the second type of change, outputting database synchronization success information; otherwise, outputting the database synchronization failure information.
2. The database synchronization testing method according to claim 1, further comprising, after the step of obtaining the link list, the steps of:
acquiring a first table structure in an upstream database and a second table structure in the downstream database;
comparing whether the second table structure and the first table structure are adapted;
and under the condition that the first table structure and the second table structure are not adaptive, outputting database synchronization failure information, and adding the upstream database and the downstream database into a new link list.
3. The database synchronization test method according to claim 1 or 2, wherein the step of performing a preset operation on the upstream database to make the data records in the upstream database undergo the first type of change comprises:
inserting a new first data record into the upstream database at a first time, wherein the first data record comprises a flag bit; the first moment is any moment;
changing a second data record existing in the upstream database at a second moment, and receiving the change success information returned by the upstream database; wherein the second time is later than the first time;
and deleting a third data record existing in the upstream database at a third time, and receiving deletion success information returned by the upstream database, wherein the third time is later than the second time.
4. The database synchronization testing method according to claim 3, wherein the step of performing a preset operation on the upstream database to make the data records in the upstream database undergo the first type of change further comprises:
and receiving the successful insertion information, the successful modification information or the successful deletion information returned by the upstream database.
5. The database synchronization test method of claim 3, wherein the second data record is the same data record as the first data record, and the third data record is the same record as the second data record.
6. The database synchronization testing method according to claim 5, wherein the step of determining whether the data records in the downstream database have undergone a corresponding second type change based on the first type change of the data records in the upstream database comprises:
inquiring whether the downstream database contains the first data record at a fourth moment, wherein the fourth moment is between the first moment and the second moment;
inquiring whether the downstream database contains the second data record at a fifth moment, wherein the fifth moment is between the second moment and the third moment;
and inquiring whether the downstream database contains the third data record at a sixth moment, wherein the sixth moment is after the third moment.
7. The database synchronization testing method according to claim 6, wherein the step of querying whether the downstream database contains the third data record at the sixth time comprises:
on the basis that the downstream database does not contain the third data record in the query, acquiring a query result of the downstream database for the first data record and the second data record;
determining that the third data record is successfully deleted in the downstream database if the first data record and the second data record have been queried in the downstream database.
8. A database synchronization test apparatus, comprising:
the link list acquisition module is suitable for acquiring a link list, and the link list comprises an upstream database and a downstream database which establish a link relation;
the first type change module is suitable for executing preset operation on the upstream database so as to enable data records in the upstream database to generate first type changes; the preset operation comprises any one or more of adding data records, modifying data records and deleting data records, and the first type of change correspondingly comprises any one or more of adding data records, changing data records and deleting data records;
the second type change module is used for determining whether the data records in the downstream database have corresponding second type changes or not based on the first type changes of the data records in the upstream database; the second type of variation is the same as the first type of variation;
the synchronization information module is suitable for outputting database synchronization success information under the condition that the data records in the downstream database are determined to have the second type of change; otherwise, outputting the database synchronization failure information.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011483087.4A 2020-12-15 2020-12-15 Database synchronization test method and device, computer equipment and storage medium Pending CN112612773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011483087.4A CN112612773A (en) 2020-12-15 2020-12-15 Database synchronization test method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011483087.4A CN112612773A (en) 2020-12-15 2020-12-15 Database synchronization test method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112612773A true CN112612773A (en) 2021-04-06

Family

ID=75239462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011483087.4A Pending CN112612773A (en) 2020-12-15 2020-12-15 Database synchronization test method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112612773A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244169A (en) * 2022-09-26 2023-06-09 上海合见工业软件集团有限公司 Regression testing system based on time sequence type coverage database

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244169A (en) * 2022-09-26 2023-06-09 上海合见工业软件集团有限公司 Regression testing system based on time sequence type coverage database
CN116244169B (en) * 2022-09-26 2023-10-27 上海合见工业软件集团有限公司 Regression testing system based on time sequence type coverage database

Similar Documents

Publication Publication Date Title
CN107391628B (en) Data synchronization method and device
CN113111129B (en) Data synchronization method, device, equipment and storage medium
CN111259004B (en) Method for indexing data in storage engine and related device
CN111414362B (en) Data reading method, device, equipment and storage medium
US20180032567A1 (en) Method and device for processing data blocks in a distributed database
CN113448862B (en) Software version testing method and device and computer equipment
CN111694612A (en) Configuration checking method, device, computer system and storage medium
CN108319711A (en) Transaction consistency test method, device, storage medium and the equipment of database
CN109284331B (en) Certificate making information acquisition method based on service data resources, terminal equipment and medium
CN112612773A (en) Database synchronization test method and device, computer equipment and storage medium
CN111522881B (en) Service data processing method, device, server and storage medium
CN114625554A (en) Fault repairing method and device, electronic equipment and storage medium
CN112651840B (en) Business data log processing method and system based on blockchain and digital finance
CN111209138A (en) Operation and maintenance method and device of data storage system
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN114625751A (en) Data tracing query method and device based on block chain
CN114090673A (en) Data processing method, equipment and storage medium for multiple data sources
CN110674214A (en) Big data synchronization method and device, computer equipment and storage medium
CN114780642B (en) Block chain data processing method and device and electronic equipment
CN112231218B (en) Method, system, terminal and storage medium for automatically updating test diagnosis script
CN117908990A (en) Method, device, equipment and medium for checking configuration parameters of high-availability service
CN115203158A (en) Data comparison method, device, equipment and storage medium
CN116204354A (en) Method for processing data writing error of database, storage medium and equipment
CN116414772A (en) Data dump method, device, equipment and storage medium
CN115756575A (en) Submission record acquisition method, device, equipment and storage medium

Legal Events

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