Method for testing flash-back function of database

By automatically generating database table structure and test cases, performing data operations and triggering database flashback functions, comparing to judge the success of flashback functions, solving the problems of low efficiency and poor accuracy of manual testing in the existing technology, and achieving efficient and accurate database flashback function testing.

CN120216379APending Publication Date: 2025-06-27TIANJIN NANKAI UNIV GENERAL DATA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510340245.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, the testing of database flashback function mainly relies on manual manual testing, is inefficient and has the risk of operational errors or omissions.

Method used

Provides an automated database flashback functional testing method, generates database table structure, flashback test cases and query instructions through preset configurations, automatically performs data insertion, update or delete operations, and records timestamps and logical log numbers. Then trigger the database's flashback function to restore it to the specified time point or state, and finally compare the result set to judge the success of the flashback function.

Benefits of technology

Replacing manual testing by automated testing methods greatly improves testing efficiency, avoids human errors, ensures the accuracy and consistency of the testing process, covers a wider range of test scenarios, and significantly improves the stability and reliability of the flashback function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216379A_ABST
    Figure CN120216379A_ABST
Patent Text Reader

Abstract

The invention provides a method for testing a flash-back function of a database. The method comprises the following steps: generating a database table structure, a flash-back test case and a query instruction according to preset configuration; and according to a database table structure and the flashback test case, automatically executing data insertion, data updating or data deletion operation, and after the operation is completed, recording a current timestamp and a logic log number corresponding to each operation. And executing query operation in the database based on the query instruction to obtain a result set of the current database. And triggering a flash-back function of the database, so that the database is recovered to a specified time point or a specified database state. And after the flash-back is completed, executing a query operation in the database after the flash-back based on the query instruction, and obtaining a result set after the flash-back. And comparing the result set after flashing back with the result set to obtain a comparison result, and judging whether the flashing back function is successful or not based on the comparison result. According to the method, the flash-back function of the database can be efficiently tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technologies, and particularly to a method for testing the flashback function of a database. Background Art

[0002] With the continuous development of technology, the database, as the core component for data storage, plays an increasingly important role in various application systems. The existing technology for testing the flashback function mainly relies on manual testing by humans, resulting in low efficiency.

[0003] Therefore, how to efficiently test the flashback function of a database has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0004] Based on the above problems, this application provides a method for testing the flashback function of a database, and the method includes: Generate a database table structure, flashback test cases, and query instructions according to preset configurations; Automatically perform data insertion, data update, or data deletion operations according to the database table structure and the flashback test cases. After the data insertion, data update, or data deletion operations are completed, record the current timestamp and logical log number corresponding to each operation; Execute a query operation in the database based on the query instructions to obtain the result set of the current database; Trigger the flashback function of the database to restore the database to a specified time point or a specified database state; After the flashback is completed, execute a query operation in the flashbacked database based on the query instructions to obtain the result set after the flashback; Compare the result set after the flashback with the result set to obtain a comparison result, and determine whether the flashback function is successful based on the comparison result.

[0005] In a possible implementation manner, the database table structure is generated in the following way: Read and parse the number of columns, number of rows, data types, column default values, and constraint conditions of the table from the configuration file, and the constraint conditions include primary key constraints and foreign key constraints; Initialize an empty table structure based on the read parameters; Determine the column names based on the configuration file and randomly specify the data type of each column in the empty table structure; If the column default value is specified in the configuration file, assign the corresponding default value to the column in the empty table structure; If not specified, generate a default value in the empty table structure according to the data type; If the constraint conditions of the columns are specified in the configuration file, add corresponding constraints to the columns in the empty table structure to obtain the database table structure.

[0006] In a possible implementation manner, the comparing the result set after flashback with the result set to obtain a comparison result, and determining whether the flashback function is successful based on the comparison result includes: If the comparison result indicates that the result set after flashback is inconsistent with the result set, it is determined that the flashback fails; Output an error log based on the comparison result of the flashback failure. The error log records all operations in the query instruction corresponding to the specific failure, the automatically executed data insertion, data update, or data deletion operation, and the database table structure; If the comparison result indicates that the result set after flashback is consistent with the result set, it is determined that the flashback is successful.

[0007] The present application provides a test device for the database flashback function. The device includes: A generation module, configured to generate a database table structure, a flashback test case, and a query instruction according to a preset configuration; A recording module, configured to automatically execute data insertion, data update, or data deletion operations according to the database table structure and the flashback test case, and record the current timestamp and logical log number corresponding to each operation after the data insertion, data update, or data deletion operation is completed; A first acquisition module, configured to execute a query operation in the database based on the query instruction to obtain the result set of the current database; A flashback module, configured to trigger the flashback function of the database to restore the database to a specified time point or a specified database state; A second acquisition module, configured to execute a query operation in the flashbacked database based on the query instruction after the flashback is completed to obtain the result set after flashback; A comparison module, configured to compare the result set after flashback with the result set to obtain a comparison result, and determine whether the flashback function is successful based on the comparison result.

[0008] In a possible implementation manner, the generation module is specifically configured to: Read and parse the number of columns, number of rows, data type, column default value, and constraint conditions of the table from the configuration file. The constraint conditions include primary key constraint and foreign key constraint; Initialize an empty table structure based on the read parameters; Determine the column names based on the configuration file, and randomly specify the data type of each column in the empty table structure; If a default value of a column is specified in the configuration file, assign the corresponding default value to the column in the empty table structure; If not specified, generate a default value according to the data type in the empty table structure; If a constraint condition of a column is specified in the configuration file, add the corresponding constraint to the column in the empty table structure to obtain a database table structure.

[0009] In a possible implementation manner, the comparison module is specifically configured to: If the comparison result indicates that the result set after flashback is inconsistent with the result set, determine that the flashback fails; Output an error log based on the comparison result of the flashback failure. The error log records all operations in the query instruction corresponding to the specific failure, the automatically executed data insertion, data update, or data deletion operation, and the database table structure; If the comparison result indicates that the result set after flashback is consistent with the result set, determine that the flashback is successful.

[0010] This application also provides an electronic device, which includes a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the steps of the above test method for the database flashback function according to the instructions in the computer program.

[0011] This application also provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by an electronic device, the steps of the above test method for the database flashback function are implemented.

[0012] Compared with the prior art, this application has the following beneficial effects: The method provided by this application replaces manual testing with an automated testing method, greatly improving the efficiency of test execution. Manual testing usually requires a large amount of time and effort to repeatedly perform operations, while this application can complete the execution of a large number of test cases in a short time by automatically performing operations such as data insertion, update, deletion, etc., and triggering the database flashback function, significantly saving test time. In the prior art, there is an inevitable risk of operation errors or omissions in manual testing, such as inaccurate data operations, incorrect operation sequences, etc. The automated testing method in this application automatically generates table structures and test cases through preset configurations and strictly executes them according to predetermined steps, avoiding human errors and ensuring the accuracy and consistency of the test process. Manual testing in the prior art is often limited by the experience and time of testers, making it difficult to cover all possible scenarios and easily overlooking some details. In contrast, this application can cover a wider range of test scenarios through automatically generated diverse table structures and test cases, ensuring that the flashback function can be comprehensively verified under different circumstances. At the same time, automatically comparing the test results with the expected results helps to improve the accuracy of the test and ensure the effectiveness and consistency of the flashback function. By triggering the flashback operation and comparing it with the expected results, this application can effectively verify whether the flashback function works as expected, ensuring that the database can be restored to the specified time point or state when an exception or error occurs. Compared with manual testing, the automated method of this application can detect the stability and reliability of the flashback function more comprehensively and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0014] Figure 1 It is a flowchart of a method for testing the database flashback function provided by an embodiment of this application; Figure 2 It is a schematic structural diagram of a device for testing the database flashback function provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0015] As described above, the prior art mainly relies on manual testing for the flashback function test, with low efficiency.

[0016] To enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solution in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.

[0017] It can be understood that the method provided in this application can be applied to a processing device, which is a processing device that can generate a database table structure, flashback test cases, and query instructions according to preset configurations. For example, it can be a terminal device or a server that can generate a database table structure, flashback test cases, and query instructions according to preset configurations. The method provided in this application can be independently executed by a terminal device or a server, or can be applied to a network scenario where a terminal device and a server communicate, and is executed in cooperation with the terminal device and the server. Among them, the terminal device can be a device such as a computer or a mobile phone. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.

[0018] Figure 1 The figure is a flowchart of a method for testing the flashback function of a database provided in this application, and the method includes the following steps: S101: Generate a database table structure, flashback test cases, and query instructions according to preset configurations.

[0019] The processing device generates a database table structure, flashback test cases, and query instructions according to preset configurations.

[0020] This step is the starting point of the entire test process, which involves automatically generating the basic structure of the database, test cases, and query instructions according to preset configurations. The preset configurations usually include the number of columns, data types, constraint conditions (such as primary keys, foreign keys) of the table, and other database-related settings (such as the amount of data, indexes, etc.). According to these configurations, the system will generate a database table structure with various data types and constraint conditions. In addition, the test cases are also generated according to the configurations, covering various data operations (such as insert, update, and delete, etc.) to ensure that the flashback test can cover all aspects of the database state.

[0021] In a possible implementation manner, the processing device can generate the database table structure in the following way: The processing device can read and parse the number of columns, number of rows, data types, column default values, and constraints of the table from the configuration file. The constraints include primary key constraints and foreign key constraints. After that, based on the read parameters, an empty table structure is initialized. At the same time, the column names can be determined based on the configuration file, and the data type of each column in the empty table structure is randomly specified. If the default value of the column is specified in the configuration file, the corresponding default value is assigned to the column in the empty table structure. If not specified, the default value is generated according to the data type in the empty table structure. If the constraint condition of the column is specified in the configuration file, the corresponding constraint is added to the column in the empty table structure to obtain the database table structure.

[0022] S102: Automatically execute data insertion, data update, or data deletion operations according to the database table structure and the flashback test case. After the data insertion, data update, or data deletion operation is completed, record the current timestamp and logical log number corresponding to each operation.

[0023] The processing device automatically executes data insertion, data update, or data deletion operations according to the database table structure and the flashback test case. After the data insertion, data update, or data deletion operation is completed, record the current timestamp and logical log number corresponding to each operation.

[0024] The processing device automatically executes operations such as data insertion, update, or deletion according to the previously generated table structure and test cases. Specifically, the data insertion operation inserts eligible data into the database, the update operation changes the existing data, and the deletion operation removes certain data. These operations will cause different state changes in the database. After each operation is completed, the system records the timestamp and logical log number corresponding to the current operation. The timestamp is the accurate time identifying the current operation, and the logical log number is the identifier used in the database to track and record the operation sequence. Both are essential information in the flashback test because the flashback function relies on this information to determine the database to be restored to a specific time point or state.

[0025] S103: Execute a query operation in the database based on the query instruction to obtain the result set of the current database.

[0026] The processing device executes a query operation in the database based on the query instruction to obtain the result set of the current database.

[0027] After the data operation is completed, the processing device executes a query operation according to the query instruction in the current database state to obtain the data set (i.e., the result set) in the current database. The query operation is usually implemented through SQL statements, which may be automatically generated from the configuration or executed according to manually set query instructions. The result set is a complete reflection of the current database state, and it contains all the data in the database that meets the query conditions. Therefore, the key to this process is to accurately reflect the database state after the current operation, providing a comparison basis for subsequent flashback verification.

[0028] S104: Trigger the flashback function of the database to restore the database to a specified point in time or a specified database state.

[0029] The processing device triggers the flashback function of the database to restore the database to a specified point in time or a specified database state.

[0030] The processing device triggers the flashback function of the database. The flashback function is an important feature of the database that allows the database to be restored to a certain historical point in time or state. To verify whether the flashback function is normal, the processing device can trigger a flashback operation based on the timestamp or logical log number recorded in the previous step to restore the database to the corresponding state. For example, if the test needs to verify whether the database can be restored to the state at a certain point in time, the system will perform a flashback according to the recorded timestamp; if it is necessary to verify whether the database can be restored to the state before a certain logical operation, the logical log number can be used for restoration.

[0031] S105: After the flashback is completed, execute a query operation in the flashbacked database based on the query instruction to obtain the flashbacked result set.

[0032] After the flashback is completed, the processing device executes a query operation in the flashbacked database based on the query instruction to obtain the flashbacked result set.

[0033] After the flashback operation is completed, the processing device executes a query operation in the flashbacked database based on the same query instruction generated before to obtain the flashbacked result set. The purpose of this process is to verify whether the state of the database after restoration meets the expectations. The flashbacked database should correspond to the state before restoration, the data should be consistent, and no abnormalities should occur. The result set returned by the query operation will be used for subsequent comparative analysis to help determine whether the flashback is successful.

[0034] S106: Compare the flashbacked result set with the result set to obtain a comparison result, and judge whether the flashback function is successful based on the comparison result.

[0035] The processing device compares the flashbacked result set with the result set to obtain a comparison result, and judges whether the flashback function is successful based on the comparison result.

[0036] The processing device will compare the result set after flashback with the initial query result set to check whether the data of the two is consistent. If the result sets are consistent, it indicates that the flashback function is correct and can successfully restore the state of the database. If the result sets are inconsistent, it indicates that there may be a problem with the flashback function and it fails to correctly restore to the expected state. The comparison result will be used as the key output of the test to help testers determine whether the flashback function has achieved the expected effect. Based on the comparison result, the system may output a log file, error message, or other test feedback for subsequent optimization or repair.

[0037] In a possible implementation, if the comparison result indicates that the result set after flashback is inconsistent with the result set, it is determined that the flashback fails. An error log is output based on the comparison result of the flashback failure. The error log records the query instructions corresponding to the specific failure, all operations in the automatically executed data insertion, data update, or data deletion operations, and the database table structure. If the comparison result indicates that the result set after flashback is consistent with the result set, it is determined that the flashback is successful.

[0038] The method provided by this application replaces manual testing with an automated testing method, greatly improving the efficiency of test execution. Manual testing usually requires a lot of time and effort to repeatedly execute operations. However, this application can complete the execution of a large number of test cases in a short time by automatically executing data insertion, update, deletion, etc. operations, and triggering the database flashback function, significantly saving test time. In the prior art, there is an inevitable risk of operation errors or omissions in manual testing, such as inaccurate data operations and incorrect operation sequences. The automated testing method in this application automatically generates table structures and test cases through preset configurations and strictly executes them according to the predetermined steps, avoiding human errors and ensuring the accuracy and consistency of the test process. Manual testing in the prior art is often limited by the experience and time of testers and is difficult to cover all possible scenarios, easily overlooking some details. In contrast, this application can cover a wider range of test scenarios through automatically generated diverse table structures and test cases, ensuring that the flashback function can be comprehensively verified under different circumstances. At the same time, automatically comparing the test results with the expected results helps to improve the accuracy of the test and ensure the effectiveness and consistency of the flashback function. By triggering the flashback operation and comparing it with the expected result, this application can effectively verify whether the flashback function works as expected and ensure that the database can be restored to the specified time point or state when an exception or error occurs. Compared with manual testing, the automated method of this application can detect the stability and reliability of the flashback function more comprehensively and efficiently.

[0039] This application also provides a method as Figure 2Schematic structural diagram of a test device for a database flashback function. The test device 200 for the database flashback function includes: A generation module 201, configured to generate a database table structure, a flashback test case, and a query instruction according to a preset configuration; A recording module 202, configured to automatically perform data insertion, data update, or data deletion operations according to the database table structure and the flashback test case, and record the current timestamp and logical log number corresponding to each operation after the data insertion, data update, or data deletion operation is completed; A first acquisition module 203, configured to perform a query operation in the database based on the query instruction to obtain a result set of the current database; A flashback module 204, configured to trigger the flashback function of the database to restore the database to a specified time point or a specified database state; A second acquisition module 205, configured to perform a query operation in the flashbacked database based on the query instruction after the flashback is completed to obtain a flashbacked result set; A comparison module 206, configured to compare the flashbacked result set with the result set to obtain a comparison result, and determine whether the flashback function is successful based on the comparison result.

[0040] The method provided in this application replaces manual testing with an automated testing method, greatly improving the efficiency of test execution. Manual testing usually requires a large amount of time and effort to repeatedly perform operations. However, in this application, by automatically performing operations such as data insertion, update, and deletion, and triggering the database flashback function, a large number of test cases can be executed in a relatively short time, significantly saving test time. In the prior art, there is an inevitable risk of operation errors or omissions in manual testing, such as inaccurate data operations and incorrect operation sequences. In contrast, the automated testing method in this application automatically generates a table structure and test cases through a preset configuration and strictly executes according to a predetermined procedure, avoiding human errors and ensuring the accuracy and consistency of the test process. Manual testing in the prior art is often limited by the experience and time of testers, making it difficult to cover all possible scenarios and easily overlooking some details. In contrast, this application can cover a wider range of test scenarios through automatically generated diverse table structures and test cases, ensuring that the flashback function can be comprehensively verified under different circumstances. At the same time, automatically comparing the test results with the expected results helps to improve the accuracy of the test and ensure the effectiveness and consistency of the flashback function. By triggering the flashback operation and comparing it with the expected results, this application can effectively verify whether the flashback function works as expected, ensuring that the database can be restored to a specified time point or state when an exception or error occurs. Compared with manual testing, the automated method in this application can more comprehensively and efficiently detect the stability and reliability of the flashback function.

[0041] An embodiment of the present application further provides a test device for the database flashback function. Wherein, the device includes a memory and a processor. The memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the steps of the test method for the database flashback function described in any embodiment of the present application.

[0042] In practical applications, the computer-readable storage medium may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.

[0043] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0044] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0045] The program code contained on the computer-readable medium may be transmitted by any appropriate medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0046] Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0047] It should be noted that the various embodiments in this specification are described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiments. The apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components referred to as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative effort.

[0048] As described above, this is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for testing a database flashback function, characterized in that: include: Generate database table structure, flashback test cases and query instructions according to preset configuration; According to the database table structure and the flashback test case, automatically perform data insertion, data update or data deletion operations, and after the data insertion, data update or data deletion operations are completed, record the current timestamp and logical log number corresponding to each operation; Execute a query operation in the database based on the query instruction to obtain a result set of the current database; Triggering a flashback function of the database to restore the database to a specified time point or a specified database state; After the flashback is completed, a query operation is executed in the flashed-back database based on the query instruction to obtain a flashed-back result set; The result set after the flashback is compared with the result set to obtain a comparison result, and whether the flashback function is successful is determined based on the comparison result.

2. The method according to claim 1, characterized in that The database table structure is generated in the following way: Read and parse the number of columns, number of rows, data types, column default values ​​and constraints of the table from the configuration file, wherein the constraints include primary key constraints and foreign key constraints; Initialize an empty table structure based on the read parameters; Determine a column name based on the configuration file, and randomly specify a data type for each column in the empty table structure; If a default value for a column is specified in the configuration file, a corresponding default value is assigned to the column in the empty table structure; If not specified, a default value is generated in the empty table structure according to the data type; If the configuration file specifies a constraint condition for a column, a corresponding constraint is added to the column in the empty table structure to obtain a database table structure.

3. The method according to claim 1, characterized in that The comparing the flashback result set with the result set to obtain a comparison result, and judging whether the flashback function is successful based on the comparison result includes: If the comparison result indicates that the result set after the flashback is inconsistent with the result set, it is determined that the flashback has failed; Outputting an error log based on the comparison result of the flashback failure, wherein the error log records the query instruction corresponding to the specific failure, all operations in the automatically executed data insertion, data update or data deletion operation, and the database table structure; If the comparison result indicates that the result set after the flashback is consistent with the result set, then the flashback is determined to be successful.

4. A test device for database flashback function, characterized in that: include: A generation module, used to generate database table structure, flashback test cases and query instructions according to preset configurations; A recording module, used to automatically perform data insertion, data update or data deletion operations according to the database table structure and the flashback test case, and record the current timestamp and logical log number corresponding to each operation after the data insertion, data update or data deletion operation is completed; A first acquisition module, configured to execute a query operation in a database based on the query instruction to obtain a result set of the current database; A flashback module, used to trigger the flashback function of the database to restore the database to a specified time point or a specified database state; A second acquisition module is used to execute a query operation in the flashed-back database based on the query instruction after the flashback is completed, and obtain a result set after the flashback; The comparison module is used to compare the result set after the flashback with the result set to obtain a comparison result, and to determine whether the flashback function is successful based on the comparison result.

5. The device according to claim 4, characterized in that The generation module is specifically used for: Read and parse the number of columns, number of rows, data types, column default values ​​and constraints of the table from the configuration file, wherein the constraints include primary key constraints and foreign key constraints; Initialize an empty table structure based on the read parameters; Determine a column name based on the configuration file, and randomly specify a data type for each column in the empty table structure; If a default value for a column is specified in the configuration file, a corresponding default value is assigned to the column in the empty table structure; If not specified, a default value is generated in the empty table structure according to the data type; If the configuration file specifies a constraint condition for a column, a corresponding constraint is added to the column in the empty table structure to obtain a database table structure.

6. The device according to claim 4, characterized in that The comparison module is specifically used for: If the comparison result indicates that the result set after the flashback is inconsistent with the result set, it is determined that the flashback has failed; Outputting an error log based on the comparison result of the flashback failure, wherein the error log records the query instruction corresponding to the specific failure, all operations in the automatically executed data insertion, data update or data deletion operation, and the database table structure; If the comparison result indicates that the result set after the flashback is consistent with the result set, then the flashback is determined to be successful.

7. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the method for testing the database flashback function according to any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method for testing the database flashback function according to any one of claims 1 to 3 is implemented.