Automatic testing method and device for data real-time synchronization software

Through Kubernetes and Docker engine management containers, automated testing of real-time data synchronization software is realized, solving the problem of test database pollution and ensuring the accuracy of software function points.

CN119473878APending Publication Date: 2025-02-18WUHAN DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483943.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When the prior art synchronizes software in real-time test data, it is difficult to ensure the cleanliness and pollution-free of the test database, resulting in the inability to determine the accuracy of each functional point of the software.

Method used

The source library container and destination library container are instantiated through Kubernetes and Docker engines, and the port information of the container is obtained, the real-time data synchronization software is automatically installed, and SQL parsing and execution are performed to ensure the cleanliness and consistency of the test database.

Benefits of technology

It ensures that the test database is clean and pollution-free during each test, and ensures the accuracy of the real-time data synchronization software's various functional points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473878A_ABST
    Figure CN119473878A_ABST
Patent Text Reader

Abstract

The invention provides an automatic testing method and device for data real-time synchronization software, and belongs to the technical field of software test.The method comprises the steps that a source library container and a target library container are obtained based on Kubernetes and Docker engine instantiation, and first port information corresponding to the source library container and second port information corresponding to the target library container are obtained; automatically installing data real-time synchronization software into the source library container instance; obtaining a test case corresponding to a source library, performing SQL analysis and execution based on the test case and the first port information to create test case table data in the source library, and synchronizing the test case table data to a target library based on the real-time synchronization software and the second port information to obtain synchronous table data; and determining a data synchronization test result of the data real-time synchronization software based on the test case table data and the synchronization table data. The method can ensure that the test database is not polluted during each test so as to determine the accuracy of each function point of the data real-time synchronization software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to an automated testing method and device for real-time data synchronization software. Background Art

[0002] Data real-time synchronization software is a kind of data real-time synchronization software. Its main function is to synchronize data between mainstream relational databases in a homogeneous or heterogeneous, unidirectional or bidirectional, one-to-one, one-to-many or many-to-one manner. Its minimum runnable model includes: a source database, a destination database, and a data real-time synchronization process.

[0003] In order to test the accuracy of data synchronization by real-time data synchronization software, it is necessary to create a large number of test case entities in the form of SQL (Structured Query Language server database) scripts. By running SQL scripts on the source database and observing whether the real-time synchronization results are consistent with the source data on the destination, the accuracy of each functional point of the real-time data synchronization software can be determined.

[0004] In order to determine the accuracy of each functional point of the real-time data synchronization software, it is necessary to perform automated testing on the real-time data synchronization software. Before automated testing, the initial table data in the test database needs to be deleted. Currently, manual deletion is generally used, which may result in some data that needs to be deleted not being deleted cleanly, that is, the test database is unclean and contaminated, and the accuracy of each functional point of the real-time data synchronization software cannot be determined. Therefore, how to ensure that the test database is clean and not contaminated during each test, so as to determine the accuracy of each functional point of the real-time data synchronization software, has also become an urgent problem to be solved. Summary of the invention

[0005] In view of this, it is necessary to provide an automated testing method and device for real-time data synchronization software to ensure that the test database is not contaminated during each test, thereby determining the accuracy of each functional point of the real-time data synchronization software.

[0006] In order to achieve the above object, on the one hand, the present invention provides an automated testing method for real-time data synchronization software, comprising: Based on Kubernetes and Docker engines, instantiate the source library container and the destination library container, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; Automatically install the real-time data synchronization software into the source library container instance; Obtain the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronize the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data; Based on the test case table data and the synchronization table data, a data synchronization test result of the real-time data synchronization software is obtained.

[0007] In a possible implementation, instantiating a source library container and a destination library container based on Kubernetes and Docker engines, and obtaining first port information corresponding to the source library container and second port information corresponding to the destination library container include: Based on the Docker engine, the source library container image and the destination library container image are obtained from the Docker image repository, and then instantiated into the source library container and the destination library container; The first port information corresponding to the source library container and the second port information corresponding to the destination library container are obtained.

[0008] In a possible implementation, the real-time data synchronization software is automatically installed into the source library container instance, including: The Ansible tool is called to start the software installation process, and based on the software installation process, the real-time data synchronization software is automatically installed into the source library container instance.

[0009] In a possible implementation, the SQL parsing and execution based on the test case and the first port information to create test case table data in the source library, and synchronizing the test case table data to the target library based on the real-time synchronization software and the second port information to obtain synchronization table data includes: Sending the test case to an SQL parsing engine, so as to semantically segment the test case into a set of executable SQL statements based on the SQL parsing engine; The SQL statement set and the first port information are sent to the SQL execution engine, so as to connect to the destination library based on the SQL execution engine and execute the SQL statement set in sequence to create test case table data in the source library, and synchronize the test case table data to the destination library based on the real-time synchronization software and the second port information to obtain synchronization table data.

[0010] In a possible implementation, the segmenting of the test case into a set of executable SQL statements based on semantics based on the SQL parsing engine includes: Based on the Python-based SQLparser engine in the SQL parsing engine, the test case is segmented into a set of executable SQL statements according to semantics.

[0011] In a possible implementation, obtaining the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data includes: Compare the measurement table data with the tables with the same table name in the synchronization table data one by one to determine the table data comparison result; Based on the table data comparison result, the data synchronization test result of the real-time data synchronization software is obtained.

[0012] In a possible implementation, the source database and the target database are any two databases among a DM database, an Oracle database, a PG database, a DB2 database, a SQL Server database, and a MySQL database.

[0013] On the other hand, the present invention also provides an automated testing device for real-time data synchronization software, comprising: An instantiation module is used to instantiate a source library container and a destination library container based on Kubernetes and Docker engines, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; The software installation module is used to automatically install the real-time data synchronization software into the source library container instance; A table data acquisition module, used to acquire the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create the test case table data in the source database, and synchronize the test case table data to the target database based on the real-time synchronization software and the second port information to obtain the synchronized table data; The test result determination module is used to obtain the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data.

[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the automated testing method for real-time data synchronization software as described in any one of the above.

[0015] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the automated testing method for the real-time data synchronization software as described in any one of the above items.

[0016] The beneficial effect of adopting the above implementation mode is: the automated testing method and device of the real-time data synchronization software provided by the present invention obtains the source library container and the destination library container through Kubernetes and Docker engine instantiation, and obtains the port information corresponding to the source library container and the destination library container, and then installs the real-time data synchronization software to be tested into the source library container instance, and then performs SQL parsing based on the test case of the source library and the port information of the destination library container to obtain multiple executable SQL statements. After executing these SQL statements, the table data of the source library and the destination library are obtained, and then the data synchronization test result of the real-time data synchronization software can be determined.

[0017] The present invention instantiates source library containers and destination library containers based on Kubernetes and Docker engines to implement data synchronization testing of real-time data synchronization software. During the process, SQL statements can be parsed to generate and execute multiple SQL statements, thereby realizing batch execution of test cases. It also realizes efficient association of the test environment and consistency control of the initial environment, ensuring that the test database is clean and uncontaminated, and realizing the accuracy of determining each functional point of the real-time data synchronization software. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of an embodiment of an automated testing method for real-time data synchronization software provided by the present invention; Figure 2 A schematic diagram of Ansible reading a configuration file provided by the present invention; Figure 3 A schematic diagram of creating a database container image using Docker provided by the present invention; Figure 4 A schematic diagram of the operation of Kubernetes provided by the present invention; Figure 5 Schematic diagram of the extensions provided by the present invention to six mainstream databases; Figure 6 A schematic diagram of the interaction between the test engine and the SQL parsing engine provided by the present invention; Figure 7 A schematic diagram of point-to-point one-way data synchronization test between six databases provided by the present invention; Figure 8 A flowchart of another embodiment of the automated testing method for real-time data synchronization software provided by the present invention; Fig. 9 A principle block diagram of an embodiment of an automated testing device for real-time data synchronization software provided by the present invention; Fig.10 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more than two.

[0022] The terms "including" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product or equipment comprising a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or equipment.

[0023] The naming or numbering of the steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.

[0024] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0025] The present invention provides an automated testing method and device for real-time data synchronization software, which are described below.

[0026] like Figure 1 As shown, the present invention provides an automated testing method for real-time data synchronization software, which includes: S101. Instantiate a source library container and a destination library container based on Kubernetes and Docker engines, and obtain first port information corresponding to the source library container and second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; S102, automatically installing the data real-time synchronization software into the source library container instance; S103, obtaining a test case corresponding to the source database, performing SQL (Structured Query Language server database) parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronizing the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data; S104: Based on the test case table data and the synchronization table data, obtain the data synchronization test result of the real-time data synchronization software.

[0027] It can be understood that the source library is the source database; the destination library is the destination database, also called the target library or target database; the test case is the test case; the port information includes: port address and IP (Internet Protocol) address.

[0028] In order to determine the accuracy of each functional point of the real-time data synchronization software, it is necessary to ensure that the test database (that is, the source database and the destination database) is clean and uncontaminated during each test, so that the test results are closer to the real environment. In order to achieve this goal, the key problem that needs to be solved is: how to achieve efficient management of the test environment and initial environment consistency control, that is, the data of the source database and the destination database are consistent during each test.

[0029] In order to solve the above problems, the present invention uses Python programming technology, Docker container engine technology, Kubernetes container orchestration technology, and Ansible remote operation and maintenance technology.

[0030] First, the core problem is how to achieve the management of the test environment and the consistency control of the initial environment. If consistency cannot be achieved, it is easy to cause the failure of all tests in the automation practice. In order to efficiently manage and allocate limited hardware resources and ensure the consistency of the initial environment, the present invention adopts Docker container technology and Kubernetes container orchestration technology to overcome this problem.

[0031] It should be noted that Docker is a containerization platform that allows developers to package applications and all their dependencies into an independent unit called a container. This container can run in any environment that supports Docker, providing a lightweight, portable and self-contained deployment solution.

[0032] Kubernetes (often referred to as K8s) is an open source container orchestration platform for automating the deployment, expansion, and management of containerized applications. It provides a powerful tool set for simplifying the deployment, maintenance, and expansion of containerized applications. It can be used as a carrier for Docker. The present invention uses Kubernetes to perform cluster management on Docker.

[0033] Specifically, in some embodiments, instantiating a source library container and a destination library container based on Kubernetes and Docker engines, and obtaining first port information corresponding to the source library container and second port information corresponding to the destination library container include: Based on the Docker engine, the source library container image and the destination library container image are obtained from the Docker image repository, and then instantiated into the source library container and the destination library container; The first port information corresponding to the source library container and the second port information corresponding to the destination library container are obtained.

[0034] It is understandable that for version control and collaborative editing of test cases, they can be stored on an SVN (version control service) server instead of the test engine, which is called the test case storage center. When the test engine needs to start a test, it will download the test case from the test case storage center.

[0035] For all the required databases, they are no longer fixed on a specific host, but are encapsulated as container images using the Docker engine. When they are needed, they are released. The place where the database Docker container images are stored is called the Docker image warehouse. This echoes the database container instance of the present invention, which is released from the container image encapsulated here. All database container images made by Docker can be collectively referred to as Docker container images. For details, please refer to Figure 3 shown.

[0036] For example, Docker can be compared to a container worker, Kubernetes to an ocean liner, and the collaborative use of a series of containers to a commodity transaction. After Docker encapsulates the database into a container, Kubernetes selects all the types of containers required for a transaction and loads them onto the ship, which then sails to the sea. The process of loading the container is to build a small local area network for them to communicate with each other and monitor their health status. For details, refer to Figure 4 shown.

[0037] It is understandable that the process of Docker engine instantiating a container is based on Linux namespace and control group technology to provide resource isolation and restriction, and use the image as the root file system of the container, sharing the host kernel, but running the computer process in an independent namespace and file system view. This process realizes the isolation and independence of computer processes. It makes the process appear to be running on an independent host. Entering its namespace and file system view, other software and services can be installed. How to issue instructions to a host, you can also issue instructions to a container.

[0038] Secondly, core issue two: the existing solution uses OLDDB driver and DMOCI driver to execute test cases, but its support is limited to the DM database (DM database for short) and Oracle database, and does not include the DB2 database, PG database, MySQL database, and SQLServer database supported by the real-time data synchronization software. The present invention uses Python to be compatible with the SQL execution module of the above mainstream databases.

[0039] It should be noted that Python is a high-level programming language with a wide range of uses and a large number of users. In the embodiment of the present invention, the process of using Python programming to obtain an SQL execution module that is compatible with the above mainstream databases is not presented, and programming can be performed according to the requirements of the SQL execution module.

[0040] Finally, core question three: Before the test begins, the software to be tested needs to be deployed first. The present invention uses Ansible technology for remote and automatic deployment. It only needs to write the deployment steps into a script file that Ansible can parse and let Ansible read it. The process of Ansible reading the configuration file is as follows: Figure 2 As shown. Then enter the target machine address and connection method, and Ansible can connect to the target machine to execute the software installation operations described in the script.

[0041] It should be noted that Ansible is an open source automation tool for configuration management, application deployment, task automation and collaboration. It can read script files in a specific format and perform batch remote operations on a large number of machines based on the file content.

[0042] In some embodiments, automatically installing the real-time data synchronization software into the source library container instance includes: The Ansible tool is called to start the software installation process, and based on the software installation process, the real-time data synchronization software is automatically installed into the source library container instance.

[0043] In some embodiments, the SQL parsing and execution based on the test case and the first port information to create test case table data in the source library, and synchronizing the test case table data to the destination library based on the real-time synchronization software and the second port information to obtain synchronization table data includes: Sending the test case to an SQL parsing engine, so as to semantically segment the test case into a set of executable SQL statements based on the SQL parsing engine; The SQL statement set and the first port information are sent to the SQL execution engine, so as to connect to the destination library based on the SQL execution engine and execute the SQL statement set in sequence to create test case table data in the source library, and synchronize the test case table data to the destination library based on the real-time synchronization software and the second port information to obtain synchronization table data.

[0044] In some embodiments, the step of semantically segmenting the test case into a set of executable SQL statements based on the SQL parsing engine includes: Based on the Python-based SQLparser engine in the SQL parsing engine, the test case is segmented into a set of executable SQL statements according to semantics.

[0045] In order to run the SQL script as the test case entity smoothly, the present invention develops a general SQL execution program, such as Figure 5 As shown in the figure, the Python language is used to send and execute SQL statements for six mainstream databases based on the following extensions: dmPython->DaMeng database, cx_Oracle->Oracle database, pymySQL->MySQL database, pycopy2->PG database, pymsSQL->SQLServer database, ibmdb->DB2 database. This part is called the SQL execution engine.

[0046] However, these Python database extensions can only execute a single SQL statement without exception. A SQL script is a structured text composed of multiple SQL statements. Each time a SQL script is executed, it needs to be split into multiple statements and executed in sequence. In order to split it into multiple statements, the present invention uses Python's SQLparser module. The SQLparser module is a SQL script parsing engine. Through this engine, the SQL script will be split into a series of executable SQL statements. In order to be compatible with the grammatical differences of these six databases, the present invention can also make small changes to the engine source code. This part can be called the SQL parsing engine. The interaction between the SQL parsing engine and the test engine is as follows. Figure 6 shown.

[0047] In some embodiments, obtaining the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data includes: Compare the measurement table data with the tables with the same table name in the synchronization table data one by one to determine the table data comparison result; Based on the table data comparison result, the data synchronization test result of the real-time data synchronization software is obtained.

[0048] It is understandable that this test device only supports the following six types of point-to-point one-way data synchronization tests between databases, such as Figure 7 As shown, this is sufficient to cover all basic functional points of all upstream products and real-time data synchronization software.

[0049] In some embodiments, the source database and the target database are any two databases among a DM database, an Oracle database, a PG database, a DB2 database, a SQL Server database, and a MySQL database.

[0050] In other embodiments, the present invention provides an automated testing method for real-time data synchronization software. The process of the method is as follows: Figure 8 As shown, the tester only needs to enter the link type to start the test. Specifically, twelve processes need to be started, including: 1) Test engine process: The test engine process will access the test case storage process to obtain the test case, notify the SQL parsing engine process to parse the test case, and send the parsing result to the SQL execution engine process to execute the SQL statement. At the same time, the test engine process also instructs Kubernetes to group containers according to user requirements. At the same time, the test engine process also monitors whether the data synchronization behavior of the real-time data synchronization process has been completed, because real-time data synchronization still has a certain lag compared to the execution of SQL statements. Finally, the test engine process transfers the test report.

[0051] 2) SQL parsing engine process: Its role is to parse the SQL script, split it into a set of executable SQL statements according to semantics, and wait for the call of the test engine process.

[0052] 3) SQL execution engine process: The SQL execution engine process listens to the SQL and target database connection information sent by the test engine process, connects to the target database after obtaining the connection information, and executes the SQL statement set in sequence.

[0053] 4) Docker engine process: The role of the Docker engine process is to create images of various data containers that meet the test requirements. At the same time, it waits for the call of the Kubernetes container marshalling process and is ready to pull and release containers on demand at any time.

[0054] 5) Kubernetes container grouping process: Its role is to orchestrate, network, and monitor the life activities of a group of container instances with a common purpose. If a container instance fails or dies directly, it can wake it up again, and it waits for the call of the test engine, ready to group containers on demand at any time.

[0055] 6) Docker image repository process: The function of the Docker image repository process is to store Docker database container images and wait for the Docker engine to connect, upload, download, and other operations at any time.

[0056] 7) Database comparison process: The database comparison process is actually a database content comparison process started by a component of the real-time data synchronization software, waiting for the test engine to call.

[0057] 8) Test case storage process: The test case storage process is an SVN service on a server, which is used to store files and perform version control on files, and supports file upload and download operations.

[0058] 9) Software installation process: The software installation process is a process started by the test engine process calling Ansible. Its function here is to deploy the real-time data synchronization software to the container instance of the source database. This is the general deployment method of real-time data synchronization software.

[0059] 10) Real-time data synchronization process: The purpose of the real-time data synchronization process is to monitor changes in the source database and synchronize the changes to the destination database in real time.

[0060] 11) Source database process: The test environment, released by the Docker engine and organized by Kubernetes, is the operation target of the database comparison process.

[0061] 12) Destination database process: The test environment, released by the Docker engine and organized by Kubernetes, is the operation target of the database comparison process and the final output target of the test case.

[0062] In summary, the automated testing method for real-time data synchronization software provided by the present invention obtains a source library container and a destination library container through instantiation of Kubernetes and Docker engines, obtains port information corresponding to the source library container and the destination library container, installs the real-time data synchronization software to be tested into the source library container instance, and then performs SQL parsing based on the test case of the source library and the port information of the destination library container to obtain multiple executable SQL statements. After executing these SQL statements, the table data of the source library and the destination library are obtained, and then the data synchronization test result of the real-time data synchronization software can be determined.

[0063] The present invention instantiates source library containers and destination library containers based on Kubernetes and Docker engines to implement data synchronization testing of real-time data synchronization software. During the process, SQL statements can be parsed to generate and execute multiple SQL statements, thereby realizing batch execution of test cases. It also realizes efficient association of the test environment and consistency control of the initial environment, ensuring that the test database is clean and uncontaminated, and realizing the accuracy of determining each functional point of the real-time data synchronization software.

[0064] like Fig. 9 As shown, the present invention also provides an automated testing device 900 for real-time data synchronization software, which includes: The instantiation module 901 is used to instantiate a source library container and a destination library container based on Kubernetes and Docker engines, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; The software installation module 902 is used to automatically install the real-time data synchronization software into the source library container instance; The table data acquisition module 903 is used to acquire the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create the test case table data in the source database, and synchronize the test case table data to the target database based on the real-time synchronization software and the second port information to obtain the synchronized table data; The test result determination module 904 is used to obtain the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data.

[0065] The automated testing device for real-time data synchronization software provided in the above embodiment can implement the technical solution described in the automated testing method embodiment for real-time data synchronization software. The specific implementation principles of the above modules or units can refer to the corresponding contents in the automated testing method embodiment for real-time data synchronization software, which will not be repeated here.

[0066] like Fig.10 As shown, the present invention also provides an electronic device 1000. The electronic device 1000 includes a processor 1001, a memory 1002 and a display 1003. Fig.10 Only some components of the electronic device 1000 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0067] In some embodiments, the memory 1002 may be an internal storage unit of the electronic device 1000, such as a hard disk or memory of the electronic device 1000. In other embodiments, the memory 1002 may also be an external storage device of the electronic device 1000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 1000.

[0068] Furthermore, the memory 1002 may include both an internal storage unit of the electronic device 1000 and an external storage device. The memory 1002 is used to store application software installed in the electronic device 1000 and various data.

[0069] In some embodiments, the processor 1001 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in the memory 1002 or process data, such as the automated testing method of the real-time data synchronization software in the present invention.

[0070] In some embodiments, the display 1003 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 1003 is used to display information on the electronic device 1000 and to display a visual user interface. The components 1001-1003 of the electronic device 1000 communicate with each other via a system bus.

[0071] In some embodiments of the present invention, when the processor 1001 executes the automated testing program of the real-time data synchronization software in the memory 1002, the following steps may be implemented: Based on Kubernetes and Docker engines, instantiate the source library container and the destination library container, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; Automatically install the real-time data synchronization software into the source library container instance; Obtain the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronize the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data; Based on the test case table data and the synchronization table data, a data synchronization test result of the real-time data synchronization software is obtained.

[0072] It should be understood that: when the processor 1001 executes the automated testing program of the real-time data synchronization software in the memory 1002, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.

[0073] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 1000 mentioned, and the electronic device 1000 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 1000 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0074] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an automated testing method for real-time data synchronization software provided by the above methods, the method comprising: Based on Kubernetes and Docker engines, instantiate the source library container and the destination library container, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; Automatically install the real-time data synchronization software into the source library container instance; Obtain the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronize the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data; Based on the test case table data and the synchronization table data, a data synchronization test result of the real-time data synchronization software is obtained.

[0075] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0076] The above is a detailed introduction to the automated testing method and device for the real-time data synchronization software provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An automated testing method for real-time data synchronization software, characterized in that: include: Based on Kubernetes and Docker engines, instantiate the source library container and the destination library container, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; Automatically install the real-time data synchronization software into the source library container instance; Obtain the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronize the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data; Based on the test case table data and the synchronization table data, a data synchronization test result of the real-time data synchronization software is obtained.

2. The automated testing method for real-time data synchronization software according to claim 1, characterized in that: The instantiation based on Kubernetes and Docker engine obtains the source library container and the destination library container, and obtains the first port information corresponding to the source library container and the second port information corresponding to the destination library container, including: Based on the Docker engine, the source library container image and the destination library container image are obtained from the Docker image repository, and then instantiated into the source library container and the destination library container; The first port information corresponding to the source library container and the second port information corresponding to the destination library container are obtained.

3. The automated testing method for real-time data synchronization software according to claim 1, characterized in that: Automatically install the real-time data synchronization software into the source database container instance, including: The Ansible tool is called to start the software installation process, and based on the software installation process, the real-time data synchronization software is automatically installed into the source library container instance.

4. The automated testing method for real-time data synchronization software according to claim 1, characterized in that: The step of performing SQL parsing and execution based on the test case and the first port information to create test case table data in the source database, and synchronizing the test case table data to the destination database based on the real-time synchronization software and the second port information to obtain synchronization table data includes: Sending the test case to an SQL parsing engine, so as to semantically segment the test case into a set of executable SQL statements based on the SQL parsing engine; The SQL statement set and the first port information are sent to the SQL execution engine, so as to connect to the destination library based on the SQL execution engine and execute the SQL statement set in sequence to create test case table data in the source library, and synchronize the test case table data to the destination library based on the real-time synchronization software and the second port information to obtain synchronization table data.

5. The automated testing method for real-time data synchronization software according to claim 4, characterized in that: The step of semantically segmenting the test case into a set of executable SQL statements based on the SQL parsing engine includes: Based on the Python-based SQLparser engine in the SQL parsing engine, the test case is segmented into a set of executable SQL statements according to semantics.

6. The automated testing method for real-time data synchronization software according to claim 1, characterized in that: The step of obtaining the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data includes: Compare the measurement table data with the tables with the same table name in the synchronization table data one by one to determine the table data comparison result; Based on the table data comparison result, the data synchronization test result of the real-time data synchronization software is obtained.

7. The automated testing method for real-time data synchronization software according to any one of claims 1 to 6, characterized in that: The source database and the destination database are any two databases among a DM database, an Oracle database, a PG database, a DB2 database, a SQL Server database and a MySQL database.

8. An automated testing device for real-time data synchronization software, characterized in that: include: An instantiation module is used to instantiate a source library container and a destination library container based on Kubernetes and Docker engines, and obtain the first port information corresponding to the source library container and the second port information corresponding to the destination library container; the first port information includes the source library IP address and the source library port, and the second port information includes the destination library IP address and the destination library port; The software installation module is used to automatically install the real-time data synchronization software into the source library container instance; A table data acquisition module, used to acquire the test case corresponding to the source database, perform SQL parsing and execution based on the test case and the first port information to create the test case table data in the source database, and synchronize the test case table data to the target database based on the real-time synchronization software and the second port information to obtain the synchronized table data; The test result determination module is used to obtain the data synchronization test result of the real-time data synchronization software based on the test case table data and the synchronization table data.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the automated testing method for real-time data synchronization software as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automated testing method for the real-time data synchronization software according to any one of claims 1 to 7 is implemented.