A cross-segment database synchronization method, device, storage medium and electronic device
By converting binary data from heterogeneous databases across network segments into string format and transmitting it via optical fiber, synchronization of databases across network segments was achieved, solving the problem of inconsistent data transmission and ensuring data integrity and consistency.
Patent Information
- Application Number
- CN202111215086.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-10-19
AI Technical Summary
Synchronizing binary data across heterogeneous databases in different network segments presents the problem of non-stream transmission, and the size and content of the synchronized data are inconsistent.
The binary data array in the source database is converted into a string, saved as a file, and transmitted to the target database via fiber optic cable. Cross-network segment database synchronization is performed using either full or incremental synchronization methods.
It solves the problem of cross-network segment heterogeneous databases not being able to stream, and ensures the consistency of size and content of binary data after synchronization.
Smart Images

Figure CN113886498B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of database synchronization, and in particular, to a method, device, storage medium, and electronic device for synchronizing a database across network segments. Background Art
[0002] With the rapid development of database technology, enterprises have more database products to choose from. Different products located in different network segments are likely to use different types of database products due to technical or demand factors. At the same time, the requirements for information sharing within enterprises are constantly increasing, and automated data synchronization has become an inevitable requirement. As an important research direction, the cross-segment database synchronization problem has far-reaching significance in both theory and practical application.
[0003] There are relatively mature solutions on the market for the synchronization of homogeneous and heterogeneous databases in the same network segment, but there is insufficient research on the synchronization of heterogeneous databases across network segments, especially for the synchronization of binary type fields in heterogeneous databases across network segments.
[0004] This results in a large deviation between the binary data in the source database and the target database after synchronization. Summary of the invention
[0005] The embodiments of the present application provide a cross-segment database synchronization method, device, storage medium and electronic device, which solve the problem that heterogeneous databases across network segments cannot be streamed, and solve the problem of inconsistent size and content of binary type data after synchronization.
[0006] In a first aspect, an embodiment of the present application provides a cross-segment database synchronization method, the method comprising:
[0007] Obtain a target array in a source database; wherein the target array is composed of binary type data;
[0008] Convert the target array into a target string according to a preset encoding format, and save the target string into a target file;
[0009] The target file is transmitted to the target database by using optical fiber to synchronize binary data of the database across network segments.
[0010] In a second aspect, an embodiment of the present application provides a cross-segment database synchronization device, the device comprising:
[0011] A target array acquisition module is used to acquire a target array in a source database; wherein the target array is composed of binary type data;
[0012] A target file generation module, used for converting the target array into a target string according to a preset encoding format, and saving the target string into a target file;
[0013] The file transmission module is used to transmit the target file to the target database by using optical fiber, so as to synchronize binary type data of the database across network segments.
[0014] In a third aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the cross-network segment database synchronization method as described in the embodiment of the present application is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the cross-segment database synchronization method as described in the embodiment of the present application is implemented.
[0016] The technical solution provided in the embodiment of the present application obtains the target array in the source database, converts the target array into a target string according to a preset encoding format, saves the target string into a target file, and transmits the target file to the target database using optical fiber to synchronize binary data of databases across network segments. This technical solution can solve the problem that heterogeneous databases across network segments cannot be streamed, and solve the problem of inconsistent size and content of binary data after synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of a cross-segment database synchronization method provided in Example 1 of the present application;
[0018] Figure 2 It is a schematic diagram of the cross-segment database synchronization process provided in Example 2 of the present application;
[0019] Figure 3 This is a schematic diagram of database synchronization provided in Example 2 of the present application;
[0020] Figure 4 It is a structural diagram of a cross-segment database synchronization device provided in Embodiment 3 of the present application;
[0021] Figure 5 It is a structural schematic diagram of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION
[0022] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0023] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0024] Embodiment 1
[0025] Figure 1 It is a flowchart of the cross-segment database synchronization method provided in Example 1 of the present application. This embodiment can be applicable to the situation of binary type data synchronization of heterogeneous databases across network segments. The method can be executed by the cross-segment database synchronization device provided in the embodiment of the present application. The device can be implemented by software and / or hardware, and can be integrated into devices such as smart terminals for data synchronization processing.
[0026] like Figure 1 As shown, the cross-segment database synchronization method includes:
[0027] S110, obtaining a target array in a source database; wherein the target array is composed of binary data;
[0028] In this solution, a network segment refers to a part of a computer network that can communicate directly using the same physical layer device. The source database and the target database belong to different network segments and have different database types. In order to ensure that the binary data of heterogeneous databases across network segments are consistent in size and content after synchronization, the binary data in the source database needs to be processed. Database types include Oracle database, Mysql database, and SQL Server database.
[0029] The binary data in the source database is stored in the source database in the form of an array. The target array of a column in a table in the source database can be synchronized across network segments to a column in a table in the target database.
[0030] In this embodiment, the target array may be obtained from the source database based on a pre-configured scheduled task.
[0031] S120, converting the target array into a target character string according to a preset encoding format, and saving the target character string into a target file;
[0032] In this solution, conventional technical means can be used to convert the target array into data in the form of a string, and the string can be saved as a file.
[0033] S130: Transmit the target file to the target database by using optical fiber to synchronize binary data of databases across network segments.
[0034] Among them, optical fiber is a medium that converts information into light and transmits it from one end to another.
[0035] In this solution, since the synchronization is across network segments and data cannot be transmitted in a streaming manner, the target array in the acquired source database is converted into a string form and saved as a target file. The target file is transmitted from the source database to the target database using optical fiber. This can solve the problem that heterogeneous databases across network segments cannot be streamed, as well as the problem of inconsistent size and content of binary data after synchronization.
[0036] In this technical solution, optionally, the target file is transmitted to the target database using optical fiber, including:
[0037] Based on the database synchronization sending end service, the target file is transmitted to the database synchronization receiving end service by using optical fiber;
[0038] The target file is parsed by the database synchronization receiving end service to obtain a target array, and the target array is stored in a target database according to preset synchronization configuration information; wherein the synchronization configuration information is used to determine a target database associated with a source database.
[0039] The synchronization configuration message is used to determine the target database that is first associated with the source database for synchronization of heterogeneous databases across network segments. For example, by configuring the synchronization configuration information, the data in the first column of table 1 in database A can be synchronized to the first column of table 1 in database B.
[0040] In this solution, a database synchronization sending service and a database synchronization receiving service are deployed in two different network segments respectively. The database synchronization sending service uses optical fiber to transmit the target file to the database synchronization receiving service. The database synchronization receiving service parses the content of the received target file and stores the parsed results in the corresponding location in the target database.
[0041] By deploying database synchronization sender services and database synchronization receiver services in different network segments, synchronization of binary data in heterogeneous databases across network segments can be achieved.
[0042] In the present technical solution, optionally, the synchronization configuration information includes the IP address, port number, user name and password of the source database and the target database with remote access permission, database type, database name, and synchronization interval.
[0043] Among them, IP (Internet Protocol) is the network layer protocol in the TCP / IP system; the port can refer to the exit for the computer to communicate with the outside world; the synchronization interval time can refer to the time interval between the source database and the target database data synchronization, which can be set according to the data transmission requirements.
[0044] In this solution, synchronization configuration information of the source database and the target database is configured at the database sending end service, and the synchronization configuration information is sent to the database receiving end service using optical fiber.
[0045] By configuring synchronization configuration information, you can determine the source database and target database in different network segments for synchronization of heterogeneous databases across network segments.
[0046] In this technical solution, optionally, transferring the target file to a target database includes:
[0047] If it is the first time to transfer, a full synchronization method is adopted to transfer the target file to the target database;
[0048] If it is not the first transmission, a full synchronization method or an incremental synchronization method is used to transfer the target file to the target database.
[0049] Among them, incremental synchronization and full synchronization are two ways of database synchronization. Full synchronization is to synchronize all data at one time, while incremental synchronization only synchronizes the different parts of the two databases.
[0050] In this solution, after synchronization is started, in the case of the first transmission, the target file is transferred to the target database in full synchronization; in the case of non-first transmission, the target file is transferred to the target database in full synchronization or incremental synchronization according to the structure of the table in the source database.
[0051] Using different synchronization methods to transfer target files from a source database to a target database can improve the transmission efficiency of the target files.
[0052] The technical solution provided in the embodiment of the present application obtains the target array in the source database, converts the target array into a target string according to a preset encoding format, saves the target string into a target file, and transmits the target file to the target database using optical fiber to synchronize binary data of databases across network segments. By implementing this technical solution, the problem of heterogeneous databases across network segments being unable to stream can be solved, as well as the problem of inconsistent size and content of binary data after synchronization can be solved.
[0053] Embodiment 2
[0054] Figure 2 It is a schematic diagram of the cross-segment database synchronization process provided by the embodiment of the present application. This embodiment 2 is further optimized on the basis of embodiment 1. The specific optimization is: before obtaining the target array in the source database, the method also includes: determining the database synchronization sending end service and the database synchronization receiving end service deployed in at least two network segments; determining the synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, and generating a scheduled task based on the synchronization configuration information; accordingly, obtaining the target array in the source database, including: based on the scheduled task, obtaining the byte array in the source database. Among them, the content not fully described in this embodiment is detailed in embodiment 1. As Figure 2 As shown, the method comprises the following steps:
[0055] S210, determining a database synchronization sending end service and a database synchronization receiving end service deployed in at least two network segments;
[0056] In this embodiment, the database synchronization sending-end service and the database synchronization receiving-end service may be deployed in different network segments in response to the deployment operation of the user.
[0057] S220, determining synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, and generating a scheduled task based on the synchronization configuration information;
[0058] In this solution, the synchronization configuration information of the source database and the target database is configured in the database synchronization sending service. After the configuration is saved, each synchronization configuration information generates a corresponding scheduled task. At the same time, the database sending service stores the synchronization configuration information in the form of a sql (Structured Query Language) file and sends the synchronization configuration information to the database synchronization receiving service through optical fiber unidirectional transmission.
[0059] In this technical solution, optionally, after determining the synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, the method further includes:
[0060] Acquire table information and column information of the source database; wherein the table information includes database task, synchronization mode, table name of the source database, primary key of the source database, table name of the target database, primary key of the target database, and update time; the column information includes column name of the source database, type of the source database, column name of the target database, type of the target database, and update time;
[0061] According to the table information and column information, the table information and column information of the target database are configured for synchronization between the source database and the target database.
[0062] In this embodiment, the table information and column information corresponding to the target database can be configured according to the table information and column information in the source database. If the tables and columns of the source database and the target database are the same, the default configuration can be used.
[0063] By configuring the table and column information of the target database, the database synchronization problem of binary fields in heterogeneous databases across network segments can be solved.
[0064] S230, based on the scheduled task, obtaining the byte array in the source database;
[0065] Among them, the byte array represents 8-bit binary data.
[0066] In this embodiment, the data in the source database is stored in the source database in the form of a byte array. After synchronization is started, the database sending end service obtains the byte array in the source data.
[0067] S240, converting the byte array into a target string according to the ISO8859-1 encoding format, and saving the target string into a csv file;
[0068] Among them, ISO8859-1 encoding is a single-byte encoding, which can quickly convert a byte array into a target string.
[0069] In this embodiment, the csv (comma separated value file format) file is a common, relatively simple file format application for transferring tabular data between programs that themselves operate on incompatible formats. Since heterogeneous database synchronization is supported, the csv file uses the table in the database as a unit to store field names, field values, and operation types (add, update, delete), and does not directly store SQL statements.
[0070] S250. The csv file is transmitted to the target database by using optical fiber to synchronize binary data of databases across network segments.
[0071] In this embodiment, the byte array obtained from the source database is converted into a string in the ISO8859-1 encoding format and then stored in the corresponding field position in the csv file. After the database receiving end service takes out the string from the csv, it is converted into a byte array in the encoding format ISO8859-1 and stored in the corresponding field of the target database, which can solve the database synchronization problem of binary fields of heterogeneous databases across network segments.
[0072] For example, Figure 3 This is a schematic diagram of database synchronization provided in Example 2 of the present application. Figure 3 As shown, a database synchronization sending end service and a database synchronization receiving end service are deployed in two different network segments respectively. The database sending end service is used to configure the synchronization configuration information of the source database and the target database, and send the synchronization configuration information to the database synchronization receiving end service. Then, the source database data is obtained based on the database sending end service (in both full acquisition and incremental acquisition modes), and different types of data are converted into strings in a specified format and stored in a csv file. Then, the csv file is sent to the database receiving end service through one-way transmission of optical fiber. After the database receiving end service takes out the string from the csv, it is converted into a byte array in the encoding format ISO8859-1 and stored in the corresponding field of the destination library table to solve the database synchronization problem of binary fields of heterogeneous databases across network segments.
[0073] The technical solution provided in the embodiment of the present application obtains the target array in the source database, converts the target array into a target string according to a preset encoding format, saves the target string into a target file, and transmits the target file to the target database using optical fiber to synchronize binary data of databases across network segments. By implementing this technical solution, the problem that heterogeneous databases across network segments cannot be streamed can be solved, and binary data can be converted into ISO8859-1 encoding format, which can solve the problem of inconsistent size and content of binary data after synchronization.
[0074] Embodiment 3
[0075] Figure 4 is a schematic diagram of the structure of the cross-segment database synchronization device provided in the third embodiment of the present application, such as Figure 4 As shown, the cross-segment database synchronization device includes:
[0076] The target array acquisition module 410 is used to acquire the target array in the source database; wherein the target array is composed of binary type data;
[0077] A target file generating module 420 is used to convert the target array into a target string according to a preset encoding format, and save the target string into a target file;
[0078] The file transmission module 430 is used to transmit the target file to the target database by using optical fiber, so as to synchronize binary type data of databases across network segments.
[0079] In this technical solution, optionally, the file transmission module 430 includes:
[0080] A target file transmission unit, used to transmit the target file to the database synchronization receiving end service by using an optical fiber based on the database synchronization sending end service;
[0081] The target array storage unit is used to parse the target file through the database synchronization receiving end service to obtain the target array, and store the target array into the target database according to the preset synchronization configuration information; wherein the synchronization configuration information is used to determine the target database associated with the source database.
[0082] In the present technical solution, optionally, the synchronization configuration information includes the IP address, port number, user name and password of the source database and the target database with remote access permission, database type, database name, and synchronization interval.
[0083] In this technical solution, optionally, the device further includes:
[0084] A database synchronization end determination module, used to determine a database synchronization sending end service and a database synchronization receiving end service deployed in at least two network segments;
[0085] A scheduled task generation module, used to determine the synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, and generate a scheduled task based on the synchronization configuration information;
[0086] Accordingly, the target array acquisition module 410 is specifically used for:
[0087] Based on the scheduled task, obtain the byte array in the source database.
[0088] In this technical solution, optionally, the target file generation module 420 is specifically used to:
[0089] The byte array is converted into a target string according to the ISO8859-1 encoding format, and the target string is saved as a csv file.
[0090] In this technical solution, optionally, the device further includes:
[0091] A database information acquisition module is used to acquire the table information and column information of the source database; wherein the table information includes the database task, synchronization mode, the table name of the source database, the primary key of the source database, the table name of the target database, the primary key of the target database, and the update time; the column information includes the column name of the source database, the type of the source database, the column name of the target database, the type of the target database, and the update time;
[0092] The database information configuration module is used to configure the table information and column information of the target database according to the table information and column information, so as to be used for synchronization between the source database and the target database.
[0093] In this technical solution, optionally, the file transmission module 430 is specifically used for:
[0094] If it is the first time to transfer, a full synchronization method is adopted to transfer the target file to the target database;
[0095] If it is not the first transmission, a full synchronization method or an incremental synchronization method is used to transfer the target file to the target database.
[0096] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
[0097] Embodiment 4
[0098] The embodiment of the present application further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a cross-segment database synchronization method when executed by a computer processor, the method comprising:
[0099] Obtain a target array in a source database; wherein the target array is composed of binary type data;
[0100] Convert the target array into a target string according to a preset encoding format, and save the target string into a target file;
[0101] The target file is transmitted to the target database by using optical fiber to synchronize binary data of the database across network segments.
[0102] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system, which is connected to the computer system via a network (such as the Internet). The second computer system can provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0103] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application is not limited to the cross-segment database synchronization operation as described above, and can also execute related operations in the cross-segment database synchronization method provided in any embodiment of the present application.
[0104] Embodiment 5
[0105] An embodiment of the present application provides an electronic device, in which the cross-network segment database synchronization device provided by the embodiment of the present application can be integrated. Figure 5 Schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present application. Figure 5 As shown, this embodiment provides an electronic device 500, which includes: one or more processors 520; a storage device 510, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the cross-segment database synchronization method provided in the embodiment of the present application, and the method includes:
[0106] Obtain a target array in a source database; wherein the target array is composed of binary type data;
[0107] Convert the target array into a target string according to a preset encoding format, and save the target string into a target file;
[0108] The target file is transmitted to the target database by using optical fiber to synchronize binary data of the database across network segments.
[0109] Of course, those skilled in the art can understand that the processor 520 also implements the technical solution of the cross-segment database synchronization method provided by any embodiment of the present application.
[0110] Figure 5 The electronic device 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0111] like Figure 5 As shown, the electronic device 500 includes a processor 520, a storage device 510, an input device 530, and an output device 540; the number of the processor 520 in the electronic device can be one or more. Figure 5 A processor 520 is taken as an example; the processor 520, the storage device 510, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The connection via bus 550 is taken as an example.
[0112] The storage device 510, as a computer-readable storage medium, can be used to store software programs, computer executable programs and module units, such as program instructions corresponding to the cross-segment database synchronization method in the embodiment of the present application.
[0113] The storage device 510 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 510 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 510 may further include a memory remotely arranged relative to the processor 520, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] The input device 530 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include electronic devices such as a display screen and a speaker.
[0115] The electronic device provided in the embodiment of the present application can achieve the purpose of solving the problem that heterogeneous databases cannot be streamed across network segments, and solving the problem of inconsistent size and content of binary data after synchronization.
[0116] The cross-segment database synchronization device, storage medium, and electronic device provided in the above embodiments can execute the cross-segment database synchronization method provided in any embodiment of the present application, and have the corresponding functional modules and beneficial effects of executing the method. For technical details not described in detail in the above embodiments, please refer to the cross-segment database synchronization method provided in any embodiment of the present application.
[0117] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A cross-segment database synchronization method, characterized in that: include: Obtain a target array in a source database; wherein the target array is composed of binary type data; Convert the target array into a target string according to a preset encoding format, and save the target string into a target file; The target file is transmitted to the target database by using optical fiber to synchronize binary data of the database across network segments; Before obtaining the target array in the source database, the method further includes: Determine the database synchronization sending end service and database synchronization receiving end service deployed in at least two network segments; Determine synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, and generate a scheduled task based on the synchronization configuration information; Accordingly, the target array in the source database is obtained, including: Based on the scheduled task, obtain the byte array in the source database; Converting the target array into a target string according to a preset encoding format, and saving the target string into a target file, including: The byte array is converted into a target string according to the ISO8859-1 encoding format, and the target string is saved as a csv file, wherein the csv file stores field names, field values, and operation types in units of tables in the database.
2. The method according to claim 1, characterized in that The target file is transmitted to the target database by using optical fiber, comprising: Based on the database synchronization sending end service, the target file is transmitted to the database synchronization receiving end service by using optical fiber; The target file is parsed by the database synchronization receiving end service to obtain a target array, and the target array is stored in a target database according to preset synchronization configuration information; wherein the synchronization configuration information is used to determine a target database associated with a source database.
3. The method according to claim 2, characterized in that The synchronization configuration information includes the IP addresses, ports, user names and passwords of the source database and the target database with remote access permissions enabled, database types, database names, and synchronization intervals.
4. The method according to claim 1, characterized in that After determining the synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, the method further includes: Acquire table information and column information of the source database; wherein the table information includes database task, synchronization mode, table name of the source database, primary key of the source database, table name of the target database, primary key of the target database, and update time; the column information includes column name of the source database, type of the source database, column name of the target database, type of the target database, and update time; According to the table information and column information, the table information and column information of the target database are configured for synchronization between the source database and the target database.
5. The method according to claim 1, characterized in that The target file is transferred to a target database, comprising: If it is the first time to transfer, a full synchronization method is adopted to transfer the target file to the target database; If it is not the first transmission, a full synchronization method or an incremental synchronization method is used to transfer the target file to the target database.
6. A cross-segment database synchronization device, characterized in that: include: A target array acquisition module is used to acquire a target array in a source database; wherein the target array is composed of binary type data; A target file generation module, used for converting the target array into a target string according to a preset encoding format, and saving the target string into a target file; A file transfer module, used to transfer the target file to the target database by using optical fiber, so as to synchronize binary data of the database across network segments; A database synchronization end determination module, used to determine a database synchronization sending end service and a database synchronization receiving end service deployed in at least two network segments; A scheduled task generation module, used to determine the synchronization configuration information of the database synchronization sending end service and the database synchronization receiving end service, and generate a scheduled task based on the synchronization configuration information; Correspondingly, the target array acquisition module is specifically used to: acquire the byte array in the source database based on the scheduled task; The target file generation module is specifically used to convert the byte array into a target string according to the ISO8859-1 encoding format, and save the target string into a csv file, wherein the csv file stores field names, field values, and operation types in units of tables in a database.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the cross-segment database synchronization method as described in any one of claims 1 to 5 is implemented.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the cross-segment database synchronization method according to any one of claims 1 to 5 is implemented.
