Data hot backup method, device, server and storage medium

By replacing the identification data of the master server as the identification data of the slave server, generating an execution script update file and sending it to the slave server, the problem that the slave server cannot execute business when the master server fails, and customizing data hot backup is realized to ensure business Normal operation in the event of a primary server failure.

CN113312209BActive Publication Date: 2024-12-17BEIJING FEIXUN DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110587487.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-27
Publication Date
2024-12-17
Estimated Expiration
2041-05-27

AI Technical Summary

Technical Problem

The existing hot standby mode for master-slave fully replicating data in the event of a master server failure, causing the slave server to fail to perform services because the slave server uses the IP address associated with the master server, causing the service to fail to run normally.

Method used

By obtaining the execution script change operation information of the master database, replacing the identification data of the master server with the identification data of the slave server, generating the execution script update file, and sending it to the slave server, so that the slave server performs the execution information change operation according to the update file, This ensures that the slave server runs with its own identification data.

Benefits of technology

When the master server fails, the slave server can still operate normally, avoiding business interruptions and realizing customized data hot standby.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113312209B_ABST
    Figure CN113312209B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data hot backup method, device, server and storage medium, the method comprising: obtaining execution script change operation information of a master database; replacing identification data of the master server in the execution script change operation information with identification data of a slave server to obtain an execution script update file; receiving a change information query request sent by the slave server; sending the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file. By replacing the identification data of the master server in the execution script change operation information with the identification data of the slave server, the execution script update file obtained after the replacement is sent to the slave server, so that when the master server fails, the slave server can still use the script containing its own identification data to ensure the normal operation of the business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a data hot backup method, device, server and storage medium. Background Art

[0002] Currently, master-slave replication is usually used to achieve data hot backup, that is, the data of the master server is synchronously copied to the backup server, so that when the master server fails, it can be switched to the slave server in time to continue working, thus avoiding data loss and normal execution of tasks.

[0003] However, when performing data hot standby operations, master-slave full replication is usually used, that is, the data in the databases connected to the master and standby servers remain exactly the same, but based on the particularity of certain projects, each server should save some data specific to the server node, such as service equipment information associated with the node server. For example, when the data saved by the main service contains the IP address of the business execution, but the IP address is associated with the main server, if the main server completely transfers the data to the standby server, when the main server fails, since the IP address associated with the main server in the data is invalid, if the standby server continues to use the IP address in the received data, the business cannot be executed. Therefore, when the existing master-slave full replication data hot standby method is used, when the main server fails, the slave server will be unable to execute the business. Summary of the invention

[0004] The embodiments of the present invention provide a data hot backup method, device, server and storage medium to achieve customized data hot backup.

[0005] In a first aspect, an embodiment of the present invention provides a data hot standby method, which is applied to a primary server and includes: obtaining execution script change operation information of a primary database;

[0006] Replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file;

[0007] Receive a change information query request sent from the server;

[0008] The execution script update file is sent to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0009] In a second aspect, an embodiment of the present invention provides a data hot standby method, which is applied to a slave server and includes:

[0010] Send a request for change information to the main server;

[0011] Receiving an execution script update file sent by the primary server based on the change information query request, wherein the execution script update file includes execution script change operation information of a primary database associated with the primary server;

[0012] Replace the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain the execution script operation file;

[0013] The information change operation from the database is performed according to the execution script operation file.

[0014] In a third aspect, an embodiment of the present invention provides a data hot standby device, including:

[0015] An execution script change operation information acquisition module is used to acquire the execution script change operation information of the master database;

[0016] An execution script update file acquisition module is used to replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file;

[0017] A change information query request receiving module, used to receive a change information query request sent from a server;

[0018] The execution script update file sending module is used to send the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0019] In a fourth aspect, an embodiment of the present invention provides a data hot standby device, including:

[0020] A change information query request sending module is used to send a change information query request to the main server;

[0021] An execution script update file receiving module, used to receive an execution script update file sent by the main server based on a change information query request, wherein the execution script update file contains execution script change operation information of a main database associated with the main server;

[0022] An execution script operation file acquisition module is used to replace the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain the execution script operation file;

[0023] The slave database information change execution module is used to execute the slave database information change operation according to the execution script operation file.

[0024] In a fifth aspect, an embodiment of the present invention provides a main server, the main server comprising:

[0025] one or more processors;

[0026] a storage device for storing one or more programs,

[0027] When one or more programs are executed by one or more processors, the one or more processors implement the method described above.

[0028] In a sixth aspect, an embodiment of the present invention provides a slave server, the slave server comprising:

[0029] one or more processors;

[0030] a storage device for storing one or more programs,

[0031] When one or more programs are executed by one or more processors, the one or more processors implement the method described above.

[0032] In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements the method described above when executed by a processor.

[0033] The technical solution of the embodiment of the present invention replaces the identification data of the main server in the execution script change operation information with the identification data of the slave server, and sends the execution script update file obtained after the replacement to the slave server, so that when the main server fails, the slave server can still use the script containing its own identification data to ensure the normal operation of the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 This is a schematic diagram of an application scenario of the data hot backup method provided in the first embodiment of the present invention;

[0036] Figure 2 is a flow chart of a data hot standby method provided in Embodiment 1 of the present invention;

[0037] Figure 3 is a flow chart of a data hot standby method provided in Embodiment 2 of the present invention;

[0038] Figure 4 is a structural diagram of a data hot standby device provided in Embodiment 3 of the present invention;

[0039] Figure 5 is a structural diagram of a data hot standby device provided in Embodiment 4 of the present invention;

[0040] Figure 6 This is a schematic diagram of the structure of a main server provided in Embodiment 5 of the present invention;

[0041] Figure 7 It is a structural diagram of a slave server provided in Embodiment 6 of the present invention. DETAILED DESCRIPTION

[0042] The present invention 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 invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0043] It should also be noted that, for ease of description, only the part related to the present invention rather than the entire content is shown in the accompanying drawings. It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, software implementations, hardware implementations, etc.

[0044] Embodiment 1

[0045] Figure 1 is a flow chart of a data hot backup method provided by an embodiment of the present invention. This embodiment is applicable to the case where data is hot backed up through master-slave replication. This method can be executed by the data hot backup device in the third embodiment of the present invention, which can be implemented in software and / or hardware. Figure 1 As shown, it is a schematic diagram of the application scenario of the data hot standby method of the present application, that is, the data hot standby method of the present application can be specifically applied to a video surveillance center, in which a video surveillance device, a video server hot standby unit and a video storage server real-time hot standby unit are included, the video server hot standby unit includes a master server and a slave server, and the video storage server real-time hot standby unit includes a video storage server 1 and a video storage server 2. This embodiment is mainly described with reference to the master server and the slave server in the video server hot standby unit. Figure 2 As shown, the data hot backup method in this embodiment specifically includes the following operations:

[0046] Step S101, obtaining the execution script change operation information of the main database.

[0047] Specifically, in this embodiment, the master server is associated with the master database, and the master server monitors the master database in real time; the slave server is associated with the slave database, and the slave server can monitor the slave database in real time. When the user operates the master database and causes the data in the master database to change, the master server can intercept the change operation of the master database, thereby obtaining the execution script change operation information of the master database.

[0048] The execution script change operation information obtained in this embodiment may include multiple script records, as shown in Table 1 below:

[0049] Table 1

[0050]

[0051] In which, due to space limitation, Table 1 only takes the execution script change operation information including 3 script records as an example for explanation, and this implementation does not limit the specific number of script records included in the execution script change operation information.

[0052] Step S102: Replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain an execution script update file.

[0053] Optionally, before replacing the identification data of the main server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file, it may also include: determining to establish a two-way communication connection with the slave server; determining that the execution script change operation information contains the identification data of the main server, and the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the main server will not be synchronized and retained, and the identification data may specifically include: IP address or port, etc. Of course, this implementation is only an example and does not limit the specific type of identification data.

[0054] Specifically, before performing data hot backup, the master server will first determine to establish a two-way communication connection with the slave server to ensure that data hot backup can be performed between the master server and the slave server through master-slave replication. The user can set the data synchronization method of the master server in advance. For example, the preset data synchronization method can be specifically set to partial modification synchronization. When it is determined that the execution script change operation information contains the identification data of the master server, the identification data of the master server can be replaced with customized data, and the customized data can specifically be the identification data of the slave server. Among them, in this embodiment, the identification data includes an IP address as an example for explanation. For example, it is determined that the customized data is the IP address of the slave server, 192.168.10.93, so that the IP address of the master server in the execution script change operation information shown in Table 1 is replaced with the IP address of the slave server 192.168.10.93. The execution script change operation information after customization and modification is shown in Table 2 below:

[0055] Table 2

[0056]

[0057]

[0058] Among them, in this implementation, the execution script update file will be obtained according to the execution script change operation information after customization and modification, and the main server will create an output transmission path, and save the obtained execution script update file locally on the main server based on the output transmission path.

[0059] Step S103: receiving a request for querying change information sent from the server.

[0060] Optionally, receiving a change information inquiry request sent from a server may include: determining an I / O transmission path created from the server; receiving a change information inquiry request sent from the server through the I / O transmission path according to preset rules, wherein the preset rules include sending at a specified time interval, or sending according to a specified number of execution scripts.

[0061] When it is determined that the slave server copies data from the master server in a partially modified synchronization mode, an I / O transmission path and a slave database execution transmission path are created, and a change information query request is sent to the master server through the I / O transmission path. The corresponding master server receives the change information query request sent by the slave server through the I / O transmission path according to the preset rules, for example, the change information query request is sent periodically every 5 seconds, or the change information query request is sent according to the requirement of 30 execution scripts each time. Of course, this embodiment is only an example, and does not limit the specific method of the preset rules.

[0062] Step S104: sending the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0063] Optionally, sending the execution script update file to the slave server based on the change information query request may include: sending the execution script update file to the slave server through the I / O transmission path based on the change information query request, so that the slave server saves the execution script update file locally on the slave server in a specified format, and reads the execution script update file in the specified format through a pre-created slave database execution transmission path, and executes the information change operation from the database according to the reading result.

[0064] Specifically, the master server will send the locally saved execution script update file to the slave server based on the change information query request sent by the slave server. After receiving the execution script update file, the slave server will save the execution script update file locally on the slave server in a specified format. The specified format can be a relay log file that can be recognized by the machine. The specific type of the specified format is not limited in this embodiment. As long as it can be recognized by the slave server, it is within the protection scope of this application. In addition, the slave server will also read the execution script update file in the specified format based on the previously created slave database execution transmission path, and execute the information change operation of the slave database according to the reading result, to ensure that the execution script changes in the master database are synchronized in the slave database to perform data hot backup.

[0065] It should be noted that, since the present embodiment does not perform a complete copy, the IP address of the master server in the script change operation information has been replaced by the IP address of the slave server. When the master server fails during the task execution and the IP address of the master server cannot be used, since the task data of the master database associated with the master server has been copied to the slave server, and the task data has been customized during the copying process, when the slave server operates normally and the IP address of the slave server can be used normally, the slave server can ensure that the task uses the server's IP address to operate normally.

[0066] The technical solution of the embodiment of the present invention replaces the identification data of the main server in the execution script change operation information with the identification data of the slave server, and sends the execution script update file obtained after the replacement to the slave server, so that when the main server fails, the slave server can still use the script containing its own identification data to ensure the normal operation of the business.

[0067] Embodiment 2

[0068] Figure 3This is a flow chart of the data hot backup method provided by an embodiment of the present invention. This embodiment is applicable to the case where data is hot backed up through master-slave replication. The invention can be executed by the data hot backup device in the fourth embodiment of the present invention, and the device can be implemented in software and / or hardware. The difference between this embodiment and the above embodiments is that in this embodiment, the master server does not make customized modifications to the acquired execution script change operation information, but the slave server makes customized modifications after acquiring the execution script change operation information. Therefore, the execution subject and modification timing of this implementation method are different from those of the first embodiment. Figure 3 As shown, the data hot backup method in this embodiment specifically includes the following steps:

[0069] Step S201, sending a change information query request to the main server.

[0070] Optionally, before sending a change information inquiry request to the main server, it also includes: determining to establish a two-way communication connection with the main server; determining that the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the main server will not be synchronized and retained, and the identification data may specifically include: IP address or port, etc. Of course, this implementation is only an example and does not limit the specific type of identification data.

[0071] Before performing data hot backup, the slave server will first determine to establish a two-way communication connection with the master server to ensure that data hot backup can be performed between the slave server and the master server through master-slave replication. The user can set the data synchronization method of the slave server in advance, for example, the preset data synchronization method can be specifically set to partial modification synchronization.

[0072] Optionally, sending a change information inquiry request to the main server may include: creating an I / O transmission path; sending a change information inquiry request to the main server through the I / O transmission path according to preset rules, wherein the preset rules include sending at a specified time interval, or sending according to a specified number of execution scripts.

[0073] Specifically, when the slave server copies data from the master server using the partial modification synchronization method, an I / O transmission path and a slave database execution transmission path are created, so a change information query request is sent to the master server through the I / O transmission path. For example, a change information query request is sent periodically every 5 seconds, or a change information query request is sent according to a requirement of 30 execution scripts each time. Of course, this embodiment is only an example, and does not limit the specific method of the preset rules.

[0074] Step S202: receiving an execution script update file sent by the main server based on the change information query request.

[0075] The execution script update file includes execution script change operation information of the primary database associated with the primary server.

[0076] Specifically, in this embodiment, the master server is associated with the master database, and the master server monitors the master database in real time. When the user operates the master database and causes the data in the master database to change, the master server can intercept the change operation of the master database, thereby obtaining the execution script change operation information of the master database. Table 1 in the above-mentioned embodiment 1 is an example of the execution script change operation information obtained by the master server, and the execution script update file is obtained according to the execution script change operation information, and the slave server will receive the execution script update file sent by the master server based on the change information query request.

[0077] Optionally, receiving an execution script update file sent by the main server based on a change information query request may include: receiving the execution script update file sent by the main server based on a change information query request through an I / O transmission path; and saving the execution script update file locally on the slave server in a specified format.

[0078] Specifically, in this embodiment, the slave server receives the execution script update file sent by the master server through the I / O transmission path, and saves the execution script update file locally on the slave server in a specified format. The specified format can be a relay log file that can be recognized by the machine. The specific type of the specified format is not limited in this embodiment. As long as it can be recognized by the slave server, it is within the scope of protection of this application.

[0079] Step S203: Replace the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain the execution script operation file.

[0080] Specifically, the slave server will intercept the script operation file before executing the script operation file based on the previously created slave database execution transmission path. When it is determined that the execution script change operation information contains the identification data of the master server, the identification data of the master server can be replaced with customized data, and the customized data can specifically be the identification data of the slave server. Among them, in this embodiment, the identification data includes an IP address as an example for explanation. For example, it is determined that the customized data is the IP address of the slave server, 192.168.10.93, so that the IP address of the master server in the execution script change operation information contained in the execution script update file is replaced with the IP address 192.168.10.93 of the slave server.

[0081] Step S204, executing the information change operation from the database according to the execution script operation file.

[0082] Optionally, executing the information change operation from the database according to the execution script operation file may include: creating an execution transmission path from the database; reading the execution script operation file by executing the transmission path from the database, and executing the information change operation from the database according to the reading result.

[0083] Specifically, in this embodiment, the slave server will read the execution script operation file through the previously created slave database execution transmission path, and execute the information change operation of the slave database according to the reading result, thereby ensuring that the changes in the execution script of the main database are synchronized in the slave database to perform data hot backup.

[0084] It should be noted that, since the present embodiment does not perform a complete copy, the IP address of the master server in the script change operation information has been replaced by the IP address of the slave server. When the master server fails during the task execution and the IP address of the master server cannot be used, since the task data of the master database associated with the master server has been copied to the slave server, and the task data has been customized during the copying process, when the slave server operates normally and the IP address of the slave server can be used normally, the slave server can ensure that the task uses the server's IP address to operate normally.

[0085] Optionally, after executing the information change operation of the slave database according to the execution script operation file, it may also include: updating the synchronization schedule stored locally on the slave server according to the change operation, wherein the synchronization schedule includes: the location of the execution script and the status of the execution script.

[0086] Among them, after executing the information change operation from the database according to the execution script operation file, the slave server will also update the synchronization schedule saved locally according to the change operation. The synchronization schedule includes the location of the specified script completed by the slave server in the slave database and the status of the execution script. If it is determined that the execution script has completed the operation, the status is modified to changed, otherwise the status remains unchanged.

[0087] The technical solution of the embodiment of the present invention replaces the identification data of the main server in the execution script change operation information with the identification data of the slave server, and executes the execution script operation file obtained after the replacement, so that when the main server fails, the slave server can still use the script containing its own identification data to ensure the normal operation of the business.

[0088] Embodiment 3

[0089] Figure 4This is a structural diagram of a video quality detection device provided in an embodiment of the present invention, the device includes: an execution script change operation information acquisition module 310, an execution script update file acquisition module 320, a change information query request receiving module 330 and an execution script update file sending module 340.

[0090] The execution script change operation information acquisition module 310 is used to acquire the execution script change operation information of the main database;

[0091] An execution script update file acquisition module 320 is used to replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file;

[0092] The change information query request receiving module 330 is used to receive the change information query request sent from the server;

[0093] The execution script update file sending module 340 is used to send the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0094] Optionally, the device further comprises a two-way communication connection establishing module, which is used to determine to establish a two-way communication connection with the slave server;

[0095] It is determined that the execution script change operation information includes identification data of the primary server, and the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the primary server is not synchronized and retained.

[0096] Optionally, the device further comprises a script execution update file saving module for creating an output transmission path;

[0097] The execution script update file is saved locally on the master server based on the output transfer path.

[0098] Optionally, a change information query request receiving module is used to determine the I / O transmission path created from the server;

[0099] A change information query request is received from a server through an I / O transmission path according to a preset rule, wherein the preset rule includes sending at a specified time interval or sending according to a specified number of execution scripts.

[0100] Optionally, an execution script update file sending module is used to send the execution script update file to the slave server through the I / O transmission path based on the change information query request, so that the slave server saves the execution script update file locally on the slave server in a specified format, and reads the execution script update file in the specified format through a pre-created slave database execution transmission path, and executes the information change operation from the database according to the reading result.

[0101] The above device can execute the data hot standby method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the method provided in any embodiment of the present invention.

[0102] Embodiment 4

[0103] Figure 5 The schematic diagram of the structure of the video quality detection device provided by the embodiment of the present invention comprises: a change information query request sending module 410, an execution script update file receiving module 420, an execution script operation file acquisition module 430 and a database information change execution module 440.

[0104] The change information query request sending module 410 is used to send a change information query request to the main server;

[0105] An execution script update file receiving module 420 is used to receive an execution script update file sent by the primary server based on the change information query request, wherein the execution script update file includes execution script change operation information of the primary database associated with the primary server;

[0106] The execution script operation file acquisition module 430 is used to replace the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain the execution script operation file;

[0107] The slave database information change execution module 440 is used to execute the slave database information change operation according to the execution script operation file.

[0108] Optionally, the device further comprises a two-way communication connection establishing module, which is used to determine to establish a two-way communication connection with the main server;

[0109] Determine that the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the primary server is not synchronized and retained.

[0110] Optionally, a change information query request sending module is used to create an I / O transmission path;

[0111] Send a change information query request to the main server through the I / O transmission path according to the preset rules, wherein the preset rules include sending at a specified time interval or sending according to the specified number of execution scripts.

[0112] Optionally, an execution script update file receiving module is used to receive, through an I / O transmission path, an execution script update file sent by the main server based on the change information query request;

[0113] The script update file will be saved locally on the slave server in the specified format.

[0114] Optionally, the execution module is changed from the database information, and is used to create a transmission path for executing from the database;

[0115] The script operation file is read by executing the transmission path from the database, and the information change operation from the database is performed according to the read result.

[0116] Optionally, the device further comprises a synchronization schedule updating module, which is used to update the synchronization schedule stored locally on the slave server according to the change operation, wherein the synchronization schedule comprises: the location of the execution script and the status of the execution script.

[0117] The above device can execute the data hot standby method provided in any embodiment 2 of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the method provided in any embodiment of the present invention.

[0118] Embodiment 5

[0119] Figure 6 It is a structural diagram of a main server provided by an embodiment of the present invention. Figure 6 A block diagram of an exemplary host server 612 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The main server 612 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0120] like Figure 6 As shown, the main server 612 is in the form of a general-purpose computing device. The components of the main server 612 may include, but are not limited to: one or more processors 616, a memory 628, and a bus 618 connecting different system components (including the memory 628 and the processor 616).

[0121] Bus 618 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0122] The main server 612 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the main server 612, including volatile and non-volatile media, removable and non-removable media.

[0123] The memory 628 is used to store instructions. The memory 628 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 630 and / or cache memory 632. The host server 612 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 634 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 618 via one or more data medium interfaces. Memory 628 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.

[0124] A program / utility 640 having a set (at least one) of program modules 642 may be stored, for example, in the memory 628, such program modules 642 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 642 generally perform the functions and / or methods of the embodiments described herein.

[0125] The main server 612 may also communicate with one or more external devices 614 (e.g., keyboards, pointing devices, displays 624, etc.), may communicate with one or more devices that enable a user to interact with the main server 612, and / or may communicate with any device that enables the main server 612 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 622. In addition, the main server 612 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 620. As shown, the network adapter 620 communicates with other modules of the main server 612 via a bus 618. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the main server 612, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0126] The processor 616 executes various functional applications and data processing by running instructions stored in the memory 628, for example, implementing the data hot standby method provided in an embodiment of the present invention: obtaining the execution script change operation information of the master database; replacing the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file; receiving the change information query request sent by the slave server; and sending the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0127] Embodiment 6

[0128] Figure 7 It is a structural diagram of a slave server provided by an embodiment of the present invention. Figure 7 A block diagram of an exemplary slave server 712 suitable for use in implementing embodiments of the present invention is shown. Figure 7 The slave server 712 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0129] like Figure 7 As shown, the slave server 712 is in the form of a general-purpose computing device. The components of the slave server 712 may include, but are not limited to: one or more processors 716, a memory 728, and a bus 718 connecting different system components (including the memory 728 and the processor 716).

[0130] Bus 718 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0131] The slave server 712 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the slave server 712, including volatile and non-volatile media, removable and non-removable media.

[0132] The memory 728 is used to store instructions. The memory 728 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 730 and / or cache memory 732. The slave server 712 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 734 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 718 via one or more data medium interfaces. The memory 728 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0133] A program / utility 740 having a set (at least one) of program modules 742 may be stored, for example, in the memory 728, such program modules 742 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 742 generally perform the functions and / or methods of the embodiments described herein.

[0134] The slave server 712 may also communicate with one or more external devices 714 (e.g., keyboards, pointing devices, displays 724, etc.), may communicate with one or more devices that enable a user to interact with the slave server 712, and / or may communicate with any device that enables the slave server 712 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 722. Furthermore, the slave server 712 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 720. As shown, the network adapter 720 communicates with other modules of the slave server 712 via a bus 718. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with slave server 712, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0135] The processor 716 executes various functional applications and data processing by running instructions stored in the memory 728, for example, implementing the data hot standby method provided in an embodiment of the present invention: sending a change information query request to the master server; receiving an execution script update file sent by the master server based on the change information query request, wherein the execution script update file contains execution script change operation information of the master database associated with the master server; replacing the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain an execution script operation file; and executing the information change operation of the slave database according to the execution script operation file.

[0136] Embodiment 7

[0137] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data hot backup method provided in all the embodiments of the present invention is implemented:

[0138] Obtain the execution script change operation information of the master database; replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file; receive the change information query request sent by the slave server; send the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file.

[0139] or,

[0140] Send a change information inquiry request to the main server; receive an execution script update file sent by the main server based on the change information inquiry request, wherein the execution script update file contains execution script change operation information of a main database associated with the main server; replace the identification data of the main server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain an execution script operation file; and execute the information change operation of the slave database according to the execution script operation file.

[0141] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

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

[0143] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

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

[0145] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention 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 invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A data hot backup method, characterized in that: Applied to the master server, including: Obtain the execution script change operation information of the master database; Replacing the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain an execution script update file; Receiving the change information query request sent from the server; Sending the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file; Wherein, before replacing the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file, the method further includes: Determine to establish a two-way communication connection with the slave server; It is determined that the execution script change operation information includes identification data of the main server, and the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the main server is not synchronized and retained.

2. The method according to claim 1, characterized in that Before receiving the change information query request sent from the server, the method further includes: Create output transfer paths; The execution script update file is saved locally on the main server based on the output transmission path.

3. The method according to claim 1, characterized in that The receiving the change information query request sent from the server includes: Determine the I / O transmission path created from the server; A change information query request is received from the server through the I / O transmission path according to a preset rule, wherein the preset rule includes sending at a specified time interval or sending according to a specified number of execution scripts.

4. The method according to claim 3, characterized in that The sending the execution script update file to the slave server based on the change information query request includes: Based on the change information inquiry request, the execution script update file is sent to the slave server through the I / O transmission path, so that the slave server saves the execution script update file locally in the slave server according to the specified format, and reads the execution script update file in the specified format through the pre-created slave database execution transmission path, and executes the information change operation of the slave database according to the reading result.

5. A data hot backup method, characterized in that: Applicable to slave servers, including: Send a request for change information to the main server; Receiving an execution script update file sent by the primary server based on the change information query request, wherein the execution script update file includes execution script change operation information of a primary database associated with the primary server; Replacing the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server to obtain an execution script operation file; Execute the information change operation from the database according to the execution script operation file; Before sending the change information query request to the main server, the method further includes: Determine to establish a two-way communication connection with the main server; It is determined that the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the primary server is not synchronized and retained.

6. The method according to claim 5, characterized in that The sending of a change information inquiry request to the main server comprises: Create an I / O transfer path; Sending a change information inquiry request to the main server through the I / O transmission path according to a preset rule, wherein the preset rule includes sending at a specified time interval or sending according to a specified number of execution scripts.

7. The method according to claim 6, characterized in that The receiving the execution script update file sent by the main server based on the change information query request includes: receiving, through the I / O transmission path, an execution script update file sent by the main server based on the change information query request; The execution script update file is saved locally on the slave server in a specified format.

8. The method according to claim 7, characterized in that The step of performing the information change operation from the database according to the execution script operation file includes: Create a transfer path to execute from the database; The execution script operation file is read through the transmission path from the database, and the information change operation from the database is performed according to the reading result.

9. The method according to claim 6, characterized in that After executing the information change operation from the database according to the execution script operation file, the method further includes: The synchronization schedule stored locally on the slave server is updated according to the change operation, wherein the synchronization schedule includes: the location of the execution script and the status of the execution script.

10. A data hot backup device, characterized in that: include: An execution script change operation information acquisition module is used to acquire the execution script change operation information of the master database; An execution script update file acquisition module, used to replace the identification data of the master server in the execution script change operation information with the identification data of the slave server to obtain the execution script update file; A change information query request receiving module, used to receive the change information query request sent from the server; An execution script update file sending module, used for sending the execution script update file to the slave server based on the change information query request, so that the slave server executes the information change operation of the slave database according to the execution script update file; The device also includes: A two-way communication connection establishment module is used to determine whether a two-way communication connection is established with the slave server; determine whether the execution script change operation information contains the identification data of the master server, and the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the master server will not be synchronized and retained.

11. A data hot backup device, characterized in that: include: A change information query request sending module is used to send a change information query request to the main server; An execution script update file receiving module, configured to receive an execution script update file sent by the primary server based on the change information query request, wherein the execution script update file includes execution script change operation information of a primary database associated with the primary server; An execution script operation file acquisition module, used to replace the identification data of the master server in the execution script change operation information contained in the execution script update file with the identification data of the slave server, so as to acquire the execution script operation file; A slave database information change execution module, used to execute the slave database information change operation according to the execution script operation file; The device also includes: A two-way communication connection establishment module is used to determine whether to establish a two-way communication connection with the main server; determine whether the preset data synchronization mode is set to partial modification synchronization, wherein the partial modification synchronization is used to indicate that the identification data of the main server is not synchronized and retained.

12. A main server, characterized in that: The main server comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

13. A slave server, characterized in that: The slave server comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 5 to 9.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 4 or claims 5 to 9 is implemented.

Citation Information

Patent Citations

  • Distributed system and data synchronization method thereof

    CN102202073A

  • Data updating method, device and system

    CN107544783A