Methods, devices and electronic equipment for detecting database synchronization function

By constructing a pre-defined test sample library and exchanging data synchronization messages with the network gateway device, the database synchronization process is simulated, which solves the problem of large testing workload in existing technologies and achieves efficient database synchronization function testing.

CN115269557BActive Publication Date: 2026-04-03BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-12
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, various real-world database environments need to be set up to verify the database synchronization function, which greatly increases the workload of testing.

Method used

A pre-defined test sample library is constructed, containing different types of databases and corresponding pre-defined test cases. By exchanging data synchronization messages with the network gateway device, the database synchronization process is simulated to perform functional testing.

Benefits of technology

It reduces the arduous work of setting up the testing environment, saves labor costs, and enables rapid configuration of information, facilitating the management of multiple network gateway devices and improving testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269557B_ABST
    Figure CN115269557B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, and electronic device for testing database synchronization functionality. The method includes: loading a predetermined test sample library, which contains only a database of a predetermined type and multiple predetermined test cases corresponding to the database of the predetermined type. The database of the predetermined type includes multiple versions of the database of the predetermined type, and the predetermined test cases include preset test data; establishing a connection with a predetermined gateway device and sending predetermined configuration information to the predetermined gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function; obtaining version information of the database to be tested and the predetermined test cases corresponding to the version information of the database to be tested; and exchanging data synchronization messages with the predetermined gateway device according to the version information of the database to be tested and the predetermined test cases to test the database synchronization function. This disclosure eliminates the need to rebuild the test environment, fundamentally reducing the heavy workload of test environment setup.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of database interaction, and in particular to a method, apparatus, and electronic device for detecting database synchronization function. Background Technology

[0002] Database synchronization is a primary function of network gateway devices and is widely used. Database synchronization refers to synchronizing one or more data tables from one end of a network device to another (the databases on both ends may be the same or different). This is achieved by connecting the network gateway device to the database, synchronizing data tables from one database to another. For example, it could be synchronizing an external network data table to an internal network data table, or vice versa.

[0003] Because different types of databases may be used in business operations, the database synchronization function needs to support different types of databases. To test each type of database, it is necessary to install the corresponding database (actually install a database) to build a complete test environment. As a result, in order to verify the database synchronization function, various real database environments need to be built in the testing work, which greatly increases the workload of testers. Summary of the Invention

[0004] In view of this, the present disclosure proposes a method, apparatus and electronic device for detecting database synchronization function, in order to solve the following problems of the prior art: In order to verify the database synchronization function, various real database environments need to be built in the testing work, which greatly increases the workload of testers.

[0005] On one hand, this disclosure proposes a method for testing database synchronization functionality, comprising: loading a predetermined test sample library, wherein the predetermined test sample library includes only: a database of a predetermined type and multiple predetermined test cases corresponding to the database of the predetermined type, the database of the predetermined type including multiple versions of the database of the predetermined type, and the predetermined test cases including preset test data; establishing a connection with a predetermined gateway device and sending predetermined configuration information to the predetermined gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function; obtaining version information of the database to be tested and the predetermined test cases corresponding to the version information of the database to be tested; and exchanging data synchronization messages with the predetermined gateway device according to the version information of the database to be tested and the predetermined test cases to test the database synchronization function.

[0006] In some embodiments, the step of interacting with the predetermined gateway device using data synchronization messages based on the version information of the database under test and predetermined test cases includes: sending a first data synchronization message to the predetermined gateway device based on the preset test data in the predetermined test cases, wherein the first data synchronization message carries preset test data of a first database corresponding to the version information of the database under test; receiving a second data synchronization message from the predetermined gateway device, wherein the second data synchronization message is a message generated by the predetermined gateway device based on the preset test data that satisfies the corresponding data structure of the second database; and determining whether the database synchronization function meets predetermined requirements based on the first data synchronization message and the second data synchronization message.

[0007] In some embodiments, the method further includes: obtaining a predetermined number of tests for the predetermined test cases; detecting whether the predetermined number of tests that the predetermined test cases have completed has been reached; and if the predetermined number of tests has not been reached, updating the number of tests that have been completed by interacting with the predetermined gateway device again based on the version information of the database to be tested and the data synchronization message of the predetermined test cases.

[0008] In some embodiments, after detecting whether the predetermined number of times the predetermined test case has been tested has been reached, the method further includes: if the predetermined number of tests has been reached, generating a test report based on the interaction results of the data synchronization message.

[0009] In some embodiments, before obtaining the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test, the method further includes: receiving the version information of two databases to be synchronized selected by the user on a predetermined interface and the predetermined test cases corresponding to the version information of each database.

[0010] On the other hand, this disclosure provides a database synchronization function testing device, comprising: a loading module for loading a predetermined test sample library, wherein the predetermined test sample library includes only a database of a predetermined type and multiple predetermined test cases corresponding to the database of the predetermined type, the database of the predetermined type including multiple versions of the database of the predetermined type, and the predetermined test cases including preset test data; a connection module for establishing a connection with a predetermined gateway device and sending predetermined configuration information to the predetermined gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function; a first acquisition module for acquiring version information of the database to be tested and the predetermined test cases corresponding to the version information of the database to be tested; and an interaction module for interacting with the predetermined gateway device to exchange data synchronization messages according to the version information of the database to be tested and the predetermined test cases, so as to test the database synchronization function.

[0011] In some embodiments, the interaction module includes: a sending unit, configured to send a first data synchronization message to the predetermined gateway device according to the preset test data in the predetermined test case, wherein the first data synchronization message carries preset test data of a first database corresponding to the version information of the database under test; a receiving unit, configured to receive a second data synchronization message from the predetermined gateway device, wherein the second data synchronization message is a message generated by the predetermined gateway device based on the preset test data that satisfies the corresponding data structure of the second database; and a determining unit, configured to determine whether the database synchronization function meets predetermined requirements based on the first data synchronization message and the second data synchronization message.

[0012] In some embodiments, the system further includes: a second acquisition module, configured to acquire a predetermined number of tests for the predetermined test cases; a detection module, configured to detect whether the predetermined number of tests for the predetermined test cases has been completed has reached the predetermined number of tests; and the interaction module, configured to, if the predetermined number of tests has not been reached, again interact with the predetermined gateway device based on the version information of the database to be tested and the predetermined test cases to exchange data synchronization messages, and update the number of tests completed.

[0013] In some embodiments, the system further includes a generation module, configured to generate a test report based on the interaction results of data synchronization messages when the predetermined number of tests has been reached.

[0014] In some embodiments, the system further includes a receiving module, configured to receive version information of two databases to be synchronized selected by the user on a predetermined interface, and predetermined test cases corresponding to the version information of each database.

[0015] On the other hand, embodiments of this disclosure provide an electronic device, including at least a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method provided in any embodiment of this disclosure when executing the computer program in the memory.

[0016] This disclosure embodiment constructs a predetermined test sample library, which includes different types of databases and predetermined test cases corresponding to different types of databases. The databases in this predetermined test sample library do not store the actual data to be synchronized, but the predetermined test cases include preset test data for testing the synchronization function. After establishing a connection with the predetermined network gateway device and implementing the configuration, the database synchronization function can be tested based on the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The entire process does not involve actual database content synchronization, but the database synchronization function is tested. For testing different types of databases, it is no longer necessary to rebuild the test environment, which fundamentally reduces the heavy test environment setup work, saves manpower costs, and allows for quick configuration of information for different network gateway devices, facilitating the management of multiple network gateway devices. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of a database synchronization function detection method provided in the first embodiment of this disclosure;

[0019] Figure 2 The system architecture diagram of the database testing system and the network gateway device provided in the first embodiment of this disclosure;

[0020] Figure 3 A schematic diagram of the structure of the database synchronization function detection device provided in the second embodiment of this disclosure;

[0021] Figure 4 A schematic diagram of the structure of an electronic device provided in the third embodiment of this disclosure. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0023] Unless otherwise defined, the technical or scientific terms used in this disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms “first,” “second,” and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as “comprising” or “including” mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as “connected” or “linked” are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as “upper,” “lower,” “left,” and “right” are used only to indicate relative positional relationships, and these relative positional relationships may change accordingly when the absolute position of the described objects changes.

[0024] To keep the following description of the embodiments of this disclosure clear and concise, detailed descriptions of known functions and known components are omitted.

[0025] In existing technologies, testing each type of database (e.g., different data structures, different versions) requires installing the corresponding database (actually installing a database) to build a complete test environment before executing test scripts to achieve the desired test results. However, this process consumes a lot of time to build test environments for different database types. Furthermore, each gateway device requires different configuration information to distinguish the different functions of different gateway devices. Existing gateway devices also lack unified management, resulting in chaotic management. When there are multiple gateway devices, unified management and configuration are impossible.

[0026] The first embodiment of this disclosure provides a method for detecting database synchronization function, the process of which is as follows: Figure 1 As shown, steps S101 to S104 are included:

[0027] S101, Load the pre-defined test sample library. The pre-defined test sample library only includes: a pre-defined type of database and multiple pre-defined test cases corresponding to the pre-defined type of database. The pre-defined type of database includes multiple versions of the pre-defined type of database. The pre-defined test cases include preset test data.

[0028] S102, establish a connection with the predetermined network gateway device and send predetermined configuration information to the predetermined network gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function;

[0029] S103, Obtain the version information of the database under test and the pre-defined test cases corresponding to the version information of the database under test;

[0030] S104. Based on the version information of the database under test and the predetermined test cases, exchange data synchronization messages with the predetermined network gateway device to test the database synchronization function.

[0031] This disclosure embodiment constructs a predetermined test sample library, which includes different types of databases and predetermined test cases corresponding to different types of databases. The databases in this predetermined test sample library do not store the actual data to be synchronized, but the predetermined test cases include preset test data for testing the synchronization function. After establishing a connection with the predetermined network gateway device and implementing the configuration, the database synchronization function can be tested based on the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The entire process does not involve actual database content synchronization, but the database synchronization function is tested. For testing different types of databases, it is no longer necessary to rebuild the test environment, which fundamentally reduces the heavy test environment setup work, saves manpower costs, and allows for quick configuration of information for different network gateway devices, facilitating the management of multiple network gateway devices.

[0032] The above-mentioned testing method can typically be presented as a database testing system for user convenience. For example, users can select the version information of the database to be tested and the corresponding predefined test cases through the database testing system. Those skilled in the art can design the functional interface of the database testing system according to actual needs. For example, multiple drop-down selection boxes can be set in the predefined interface, and then the version information of the two databases to be synchronized and the predefined test cases corresponding to the version information of each database can be received by the user through the drop-down selection boxes. Of course, those skilled in the art can also use other methods, which will not be elaborated here.

[0033] During the process of exchanging data synchronization messages with the predetermined gateway device based on the version information of the database under test and the predetermined test cases, a first data synchronization message can be sent to the predetermined gateway device according to the preset test data in the predetermined test cases. The first data synchronization message carries the preset test data of the first database corresponding to the version information of the database under test. When the predetermined gateway device receives the preset test data, it is equivalent to receiving the data that needs to be synchronized. Then, it processes the preset test data and sends the processed preset test data back to the database testing system. Receiving the processed preset test data marks the beginning of the synchronization of data between the second database and the predetermined gateway device. The database testing system receives a second data synchronization message from the predetermined gateway device, which is a message generated by the predetermined gateway device based on the preset test data that meets the corresponding data structure of the second database. Subsequently, it can determine whether the database synchronization function meets the predetermined requirements based on the first and second data synchronization messages.

[0034] Before sending the first data synchronization message to the predetermined gateway device based on the preset test data in the predetermined test cases, the database testing system will simulate the actual data synchronization process. Therefore, it will send a third data synchronization message to the predetermined gateway device to inform it that there is data to be synchronized. Then, the predetermined gateway device will obtain the preset test data based on the third data synchronization message, and only then will the database testing system send the first data synchronization message to the predetermined gateway device.

[0035] To verify the stability of the data synchronization function, the predetermined test cases need to be executed multiple times. During implementation, the predetermined number of tests for each test case is obtained, the number of completed tests is recorded, and it is checked whether the predetermined number of completed tests for each test case has been reached. If the predetermined number of tests has not been reached, the data synchronization messages between the database under test and the predetermined network gateway device are exchanged again based on the version information of the database under test and the predetermined test cases, and the number of completed tests is updated. If the predetermined number of tests has been reached, a test report for the current test case can be generated based on the interaction results of the data synchronization messages.

[0036] The above process will be illustrated with examples below.

[0037] This embodiment describes the interaction process between the database testing system and the network gateway device (the device under test). Its system architecture is as follows: Figure 2 As shown, it includes a pre-defined test sample library, a database testing system, and a network gateway device, and includes the following steps:

[0038] Step 1: Start the database testing system. During this process, the pre-defined test sample library will be loaded.

[0039] The pre-built test sample library in this step is pre-created. The data in this pre-built test sample library simulates the database communication protocol and test case verification steps. For example, importing and loading a pre-built test sample library containing "MySQL database (a type of database) - data table modification test cases". In practice, test cases can be added or removed from the pre-built test sample library as needed, and updates can be made after modification.

[0040] Step Two: Connecting to the Gateway Device. This step primarily involves logging into the gateway device via the SSH protocol. The database testing system establishes communication with the gateway device via a TCP connection. Using the gateway device's IP address as an index, multiple gateway devices can be managed and tested simultaneously. Furthermore, based on the different sample libraries imported in Step One, various types of database synchronization functions can be tested concurrently.

[0041] Step 3: Select the database type to be tested as MySQL, the test device as the network gateway device connected in Step 2, and the test case as "MySQL database - data table modification test case".

[0042] Step Four: Start the test and follow the data interaction process. Based on the selection in Step Three, the database testing system will first issue the corresponding configuration commands to the gateway device. Then, the gateway device and the database will synchronize. The database testing system will select the correct data from the sample database based on the received information from the gateway device and respond to the gateway device with simulated MySQL communication protocol messages. Simultaneously, the test case can be repeated based on the test count configuration options in the database testing system to verify the stability of the database synchronization function.

[0043] Step 5: After the testing process is completed, the system will automatically generate a test report based on the test results. The report can be in HTML format and supports report export; the report can count the number of successes, the number of failures, and the reasons for failures, etc.

[0044] The method provided in this disclosure overcomes the shortcomings of existing testing methods based on real database services. When testers need to perform database synchronization function testing on a certain database, they only need to connect the database testing system to the gateway device, import the predetermined test sample library into the database testing system, and select the corresponding test cases to complete the automated testing environment setup for that test case, greatly reducing the workload of setting up the testing environment. This disclosure embodiment can simultaneously test the synchronization function of multiple types of databases and can uniformly configure, manage, and statistically analyze test results for the gateway device. This disclosure embodiment does not require the configuration of a real database, improving testing efficiency, and facilitates maintenance and management through unified supervision.

[0045] The second embodiment of this disclosure provides a database synchronization function detection device, the structure of which is shown in the figure below. Figure 3 As shown, it includes:

[0046] The loading module 10 is used to load a predetermined test sample library, which includes only a predetermined type of database and multiple predetermined test cases corresponding to the predetermined type of database. The predetermined type of database includes multiple versions of the predetermined type of database, and the predetermined test cases include preset test data. The connection module 20, coupled to the loading module 10, is used to establish a connection with the predetermined network gateway device and send predetermined configuration information to the predetermined network gateway device. The predetermined configuration information is used to initialize the database synchronization function. The first acquisition module 30, coupled to the connection module 20, is used to acquire the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The interaction module 40, coupled to the first acquisition module 30, is used to interact with the predetermined network gateway device to exchange data synchronization messages according to the version information of the database under test and the predetermined test cases, so as to test the database synchronization function.

[0047] The aforementioned testing method is typically presented as a database testing system for user convenience. For example, the device may include a receiving module for receiving version information of two databases to be synchronized, selected by the user on a predetermined interface, along with corresponding predetermined test cases. Those skilled in the art can design the functional interface of this database testing system according to actual needs. For instance, multiple drop-down selection boxes can be set on the predetermined interface, allowing the system to receive version information of the two databases to be synchronized and corresponding predetermined test cases. Of course, other methods can also be used, which will not be elaborated upon here.

[0048] The aforementioned interaction module includes: a sending unit, configured to send a first data synchronization message to a predetermined gateway device based on preset test data in a predetermined test case, wherein the first data synchronization message carries preset test data of a first database corresponding to the version information of the database under test; a receiving unit, configured to receive a second data synchronization message from the predetermined gateway device, wherein the second data synchronization message is a message generated by the predetermined gateway device based on the preset test data that satisfies the corresponding data structure of the second database; and a determining unit, configured to determine whether the database synchronization function meets predetermined requirements based on the first data synchronization message and the second data synchronization message.

[0049] The aforementioned interaction module may further include: a sending unit, which is further configured to send a third data synchronization message to the predetermined gateway device before sending the first data synchronization message to the predetermined gateway device based on the preset test data in the predetermined test case, so as to inform the predetermined gateway device that there is data to be synchronized; and a receiving unit, which is further configured to receive a request to obtain the preset test data from the predetermined gateway device.

[0050] To verify the stability of the data synchronization function, the above-mentioned device may further include: a second acquisition module 50, coupled to the interaction module 40, for acquiring the predetermined number of tests for predetermined test cases; a detection module 60, coupled to the second acquisition module 50, for detecting whether the predetermined number of tests for predetermined test cases has been completed; the interaction module 40, coupled to the detection module 60, for further interacting with the predetermined network gateway device again based on the version information of the database under test and the predetermined test cases if the predetermined number of tests has not been reached, and updating the number of tests completed; and a generation module 70, coupled to the detection module 60, for generating a test report based on the interaction results of the data synchronization messages if the predetermined number of tests has been reached.

[0051] This disclosure embodiment constructs a predetermined test sample library, which includes different types of databases and predetermined test cases corresponding to different types of databases. The databases in this predetermined test sample library do not store the actual data to be synchronized, but the predetermined test cases include preset test data for testing the synchronization function. After establishing a connection with the predetermined network gateway device and implementing the configuration, the database synchronization function can be tested based on the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The entire process does not involve actual database content synchronization, but the database synchronization function is tested. For testing different types of databases, it is no longer necessary to rebuild the test environment, which fundamentally reduces the heavy test environment setup work, saves manpower costs, and allows for quick configuration of information for different network gateway devices, facilitating the management of multiple network gateway devices.

[0052] The database testing system of this disclosure loads test samples, connects to a network gateway device, and performs database synchronization function tests based on a simulation of a real database environment and the test samples. The database testing system connects to the network gateway device, issues unified instructions according to test cases, and detects and summarizes test results, which facilitates management and maintenance.

[0053] The third embodiment of this disclosure provides an electronic device, the structural schematic diagram of which is shown below. Figure 4 As shown, the device includes at least a memory 901 and a processor 902. The memory 901 stores a computer program, and the processor 902 implements the methods provided in any embodiment of this disclosure when executing the computer program in the memory 901. Exemplarily, the steps of the electronic device computer program are as follows: S21 to S24:

[0054] S21, Load the pre-defined test sample library. The pre-defined test sample library only includes: a pre-defined type of database and multiple pre-defined test cases corresponding to the pre-defined type of database. The pre-defined type of database includes multiple versions of the pre-defined type of database. The pre-defined test cases include preset test data.

[0055] S22, establish a connection with the predetermined network gateway device and send predetermined configuration information to the predetermined network gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function;

[0056] S23, Obtain the version information of the database under test and the pre-defined test cases corresponding to the version information of the database under test;

[0057] S24. Based on the version information of the database under test and the predetermined test cases, exchange data synchronization messages with the predetermined network gateway device to test the database synchronization function.

[0058] When the processor executes a computer program stored in memory that interacts with a predetermined gateway device using version information of the database under test and predetermined test cases, the specific computer program executed is as follows: It sends a first data synchronization message to the predetermined gateway device based on preset test data in the predetermined test cases. The first data synchronization message carries preset test data of the first database corresponding to the version information of the database under test. It receives a second data synchronization message from the predetermined gateway device, wherein the second data synchronization message is a message generated by the predetermined gateway device based on the preset test data that satisfies the corresponding data structure of the second database. It then determines whether the database synchronization function meets predetermined requirements based on the first and second data synchronization messages.

[0059] When the processor executes the computer program stored in the memory, it also executes the following computer programs: sending a third data synchronization message to the predetermined network gateway device to inform the predetermined network gateway device that there is data to be synchronized; and receiving a request to obtain preset test data from the predetermined network gateway device.

[0060] When the processor executes the computer program stored in the memory, it also executes the following computer program: obtains the predetermined number of tests for the predetermined test cases; detects whether the predetermined number of tests for the predetermined test cases has been completed; if the predetermined number of tests has not been completed, it updates the number of tests completed based on the version information of the database under test and the data synchronization message between the predetermined test cases and the predetermined gateway device.

[0061] After executing the computer program stored in memory that checks whether the predetermined number of tests for the predefined test cases has been completed has been reached, the processor also executes the following computer program: if the predetermined number of tests has been reached, a test report is generated based on the interaction results of the data synchronization messages.

[0062] Before executing the computer program stored in memory that retrieves the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test, the processor also executes the following computer program: receiving the version information of the two databases to be synchronized selected by the user on a predetermined interface and the predetermined test cases corresponding to the version information of each database.

[0063] This disclosure embodiment constructs a predetermined test sample library, which includes different types of databases and predetermined test cases corresponding to different types of databases. The databases in this predetermined test sample library do not store the actual data to be synchronized, but the predetermined test cases include preset test data for testing the synchronization function. After establishing a connection with the predetermined network gateway device and implementing the configuration, the database synchronization function can be tested based on the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The entire process does not involve actual database content synchronization, but the database synchronization function is tested. For testing different types of databases, it is no longer necessary to rebuild the test environment, which fundamentally reduces the heavy test environment setup work, saves manpower costs, and allows for quick configuration of information for different network gateway devices, facilitating the management of multiple network gateway devices.

[0064] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this disclosure that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, and such examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the full scope of the following claims and their equivalents.

[0065] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more thereof) can be used in combination with each other. Other embodiments may be used by those skilled in the art upon reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the disclosure. This should not be construed as an intention that a feature of the disclosure that is not claimed is necessary for any claim. Rather, the subject matter of this disclosure may be less than all the features of a particular disclosed embodiment. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated to be combined with each other in various combinations or arrangements. The scope of this disclosure should be determined by reference to the appended claims and the full scope of their equivalents.

[0066] The foregoing has provided a detailed description of several embodiments of this disclosure. However, this disclosure is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this disclosure, and all such variations and modifications should fall within the scope of protection claimed by this disclosure.

Claims

1. A method for detecting database synchronization function, characterized in that, include: Load a pre-defined test sample library, which includes only a pre-defined type of database and multiple pre-defined test cases corresponding to the pre-defined type of database. The pre-defined type of database includes multiple versions of the pre-defined type of database, and the pre-defined test cases include preset test data. Establish a connection with the predetermined network gateway device and send predetermined configuration information to the predetermined network gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function; Obtain the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test; The database synchronization function is tested by interacting with the predetermined network gateway device based on the version information of the database under test and the data synchronization messages of the predetermined test cases, including: According to the preset test data in the predetermined test case, a first data synchronization message is sent to the predetermined network gateway device. The first data synchronization message carries the preset test data of the first database corresponding to the version information of the database under test. The received second data synchronization message from the predetermined network gateway device, wherein the second data synchronization message is a message generated by the predetermined network gateway device based on the preset test data that satisfies the corresponding data structure of the second database; Determine whether the database synchronization function meets the predetermined requirements based on the first data synchronization message and the second data synchronization message.

2. The method as described in claim 1, characterized in that, Also includes: Obtain the predetermined number of tests for the predetermined test cases; Check whether the predetermined number of times the predetermined test cases have been tested has been reached; If the predetermined number of tests has not been reached, the system will again exchange data synchronization messages with the predetermined gateway device based on the version information of the database to be tested and the predetermined test cases, and update the number of tests that have been completed.

3. The method as described in claim 2, characterized in that, After detecting whether the predetermined number of times the predetermined test cases have been tested has been reached, the method further includes: If the predetermined number of tests is reached, a test report is generated based on the interaction results of the data synchronization messages.

4. The method according to any one of claims 1 to 3, characterized in that, Before obtaining the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test, the method further includes: Receive the version information of the two databases to be synchronized selected by the user on the reservation interface, as well as the reserved test cases corresponding to the version information of each database.

5. A detection device for database synchronization function, characterized in that, include: The loading module is used to load a predetermined test sample library, which includes only a predetermined type of database and multiple predetermined test cases corresponding to the predetermined type of database. The predetermined type of database includes multiple versions of the predetermined type of database, and the predetermined test cases include preset test data. A connection module is used to establish a connection with a predetermined network gateway device and send predetermined configuration information to the predetermined network gateway device, wherein the predetermined configuration information is used to initialize the database synchronization function; The first acquisition module is used to acquire the version information of the database under test and the predetermined test cases corresponding to the version information of the database under test. The interaction module is used to test the database synchronization function by exchanging data synchronization messages with the predetermined network gateway device based on the version information of the database under test and the predetermined test cases, including: The sending unit is configured to send a first data synchronization message to the predetermined network gateway device according to the preset test data in the predetermined test case. The first data synchronization message carries the preset test data of the first database corresponding to the version information of the database under test. The receiving unit is used to receive a second data synchronization message from the predetermined network gateway device, wherein the second data synchronization message is a message generated by the predetermined network gateway device based on the preset test data and satisfying the corresponding data structure of the second database; The determining unit is used to determine whether the database synchronization function meets the predetermined requirements based on the first data synchronization message and the second data synchronization message.

6. The apparatus as claimed in claim 5, characterized in that, Also includes: The second acquisition module is used to acquire the predetermined number of tests for the predetermined test cases; The detection module is used to detect whether the predetermined number of times the predetermined test cases have been tested has been reached; The interaction module is also used to, if the predetermined number of tests has not been reached, to interact with the predetermined gateway device again using the version information of the database to be tested and the predetermined test cases, and to update the number of tests that have been completed.

7. The apparatus as described in any one of claims 5 to 6, characterized in that, Also includes: The receiving module is used to receive the version information of the two databases to be synchronized selected by the user on the pre-defined interface, as well as the pre-defined test cases corresponding to the version information of each database.

8. An electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, characterized in that, The processor implements the steps of the method according to any one of claims 1 to 4 when executing a computer program on the memory.

Citation Information

Patent Citations

  • Test case sending method and test case server of network activities

    CN104133765A

  • Database synchronization test method and apparatus, and computer device and storage medium

    WO2021189348A1