[go: up one dir, main page]

CN113312209B - Data hot standby method, device, server and storage medium - Google Patents

Data hot standby method, device, server and storage medium Download PDF

Info

Publication number
CN113312209B
CN113312209B CN202110587487.8A CN202110587487A CN113312209B CN 113312209 B CN113312209 B CN 113312209B CN 202110587487 A CN202110587487 A CN 202110587487A CN 113312209 B CN113312209 B CN 113312209B
Authority
CN
China
Prior art keywords
server
execution script
slave
execution
change
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110587487.8A
Other languages
Chinese (zh)
Other versions
CN113312209A (en
Inventor
徐文进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Feixun Digital Technology Co ltd
Original Assignee
Beijing Feixun Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Feixun Digital Technology Co ltd filed Critical Beijing Feixun Digital Technology Co ltd
Priority to CN202110587487.8A priority Critical patent/CN113312209B/en
Publication of CN113312209A publication Critical patent/CN113312209A/en
Application granted granted Critical
Publication of CN113312209B publication Critical patent/CN113312209B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data hot backup method, a device, a server and a storage medium, wherein the method comprises the steps of obtaining execution script change operation information of a main database; the method comprises the steps of replacing identification data of a master server in execution script change operation information with identification data of a slave server to obtain an execution script update file, receiving a change information inquiry request sent by the slave server, and sending the execution script update file to the slave server based on the change information inquiry request so that the slave server can execute information change operation of the slave database according to the execution script update file. The identification data of the master server in the execution script change operation information is replaced by the identification data of the slave server, and the execution script update file obtained after replacement is sent to the slave server, so that when the master server fails, the slave server can still adopt the script containing the self identification data to ensure the normal operation of the service.

Description

Data hot standby method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data hot standby method, a device, a server and a storage medium.
Background
At present, master-slave replication is generally adopted to realize data hot standby, namely, data of a master server are synchronously replicated to a standby server, so that after the master server fails, the master server can be switched to a slave server in time to continue working, and data loss and normal execution of tasks can be avoided.
However, when performing data hot standby operation, it is generally adopted that the data in the database connected to the primary server and the data in the database connected to the secondary server are completely duplicated, but based on the specificity of some projects, part of data specific to the server node, such as service equipment information associated with the node server, should be stored in each server. For example, when the data stored in the main service contains the IP address of the service execution, but the IP address is associated with the main server, if the main server completely transmits the data to the standby server, when the main server fails, the standby server can not execute the service if the IP address in the received data is continuously adopted because the IP address associated with the main server in the data is invalid. Therefore, the existing data hot standby mode of master-slave complete copying is adopted, and when the master server fails, the situation that the slave server cannot execute the service occurs.
Disclosure of Invention
The embodiment of the invention provides a data hot backup method, a device, a server and a storage medium, which are used for realizing customized data hot backup.
In a first aspect, an embodiment of the present invention provides a data hot standby method, which is applied to a main server, and includes acquiring execution script change operation information of a main database;
the identification data of the master server in the execution script change operation information is replaced by the identification data of the slave server, so that an execution script update file is obtained;
receiving a change information inquiry request sent from a server;
And sending the execution script update file to the slave server based on the change information inquiry request so that the slave server executes the information change operation of the slave database according to the execution script update file.
In a second aspect, an embodiment of the present invention provides a data hot standby method, which is applied to a slave server, including:
sending a change information inquiry request to a main server;
receiving an execution script update file sent by a main server based on a 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;
The identification data of the master server in the execution script change operation information contained in the execution script update file is replaced by the identification data of the slave server, so that an execution script operation file is obtained;
And executing the information change operation from the database according to the execution script operation file.
In a third aspect, an embodiment of the present invention provides a data hot standby device, including:
The execution script changing operation information acquisition module is used for acquiring the execution script changing operation information of the main database;
the execution script updating file acquisition module is used for replacing the identification data of the master server in the execution script changing operation information with the identification data of the slave server so as to acquire an execution script updating file;
A change information inquiry request receiving module for receiving a change information inquiry request transmitted from the server;
and the execution script update file sending module is used for sending the execution script update file to the slave server based on the change information inquiry request so that the slave server can execute the information change operation of the slave database according to the execution script update file.
In a fourth aspect, an embodiment of the present invention provides a data hot standby device, including:
The change information inquiry request sending module is used for sending a change information inquiry request to the main server;
The execution script updating file receiving module is used for receiving an execution script updating file sent by the main server based on the change information inquiry request, wherein the execution script updating file contains execution script change operation information of a main database associated with the main server;
The execution script operation file acquisition module is used for 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 so as to acquire the execution script operation file;
And the slave database information change execution module is used for executing information change operation of the slave database according to the execution script operation file.
In a fifth aspect, an embodiment of the present invention provides a primary server, including:
One or more processors;
Storage means 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 are caused to implement the methods as described above.
In a sixth aspect, an embodiment of the present invention provides a slave server, including:
One or more processors;
Storage means 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 are caused to implement the methods as described above.
In a seventh aspect, an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements a method as described above.
According to the technical scheme, the identification data of the master server in the execution script change operation information is replaced by the identification data of the slave server, and the execution script update file obtained after replacement is sent to the slave server, so that when the master server fails, the slave server can still adopt the script containing the self identification data to ensure the normal operation of the service.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of a data hot standby method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a data backup method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a data backup method according to a second embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a data hot standby device according to a third embodiment of the present invention;
Fig. 5 is a schematic structural diagram of a data hot standby device according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a primary server according to a fifth embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a slave server according to a sixth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
It should be further noted that, for convenience of description, only some, but not all of the matters related to the present invention are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, software implementations, hardware implementations, etc.
Example 1
Fig. 1 is a flowchart of a data hot standby method provided in an embodiment of the present application, where the present embodiment is applicable to a case of hot standby of data by master-slave replication, the method may be performed by a data hot standby device in the third embodiment of the present application, and the device may be implemented in a software and/or hardware manner. Fig. 1 is a schematic view of an application scenario of a data hot standby method according to the present application, that is, the data hot standby method according to the present application may be applied to a video monitoring center, where the video monitoring center includes a video monitoring device, a video server hot standby unit, and a video storage server real-time hot standby unit, 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, and this embodiment is mainly described with respect to the master server and the slave server in the video server hot standby unit. As shown in fig. 2, the data hot standby method in this embodiment specifically includes the following operations:
step S101, acquiring execution script changing operation information of a main database.
Specifically, in this embodiment, the master server is associated with a master database, the master server monitors the master database in real time, and the slave server is associated with a slave database, and can monitor the slave database in real time. When the user operates the main database to cause the data in the main database to be changed, the main server can intercept the change operation of the main database, so that the execution script change operation information of the main database is obtained.
The execution script change operation information acquired in this embodiment may include a plurality of script records, as shown in table 1 below:
TABLE 1
Here, the description of the space restriction table 1 is given by taking the example that 3 script records are included in the execution script changing operation information, and the specific number of script records included in the execution script changing operation information is not limited in the present embodiment.
Step S102, the identification data of the master server in the execution script changing operation information is replaced by the identification data of the slave server, so as to obtain an execution script updating file.
Optionally, the method for replacing the identification data of the master server with the identification data of the slave server in the execution script change operation information to obtain the execution script update file may further include determining that a bidirectional communication connection is established with the slave server, determining that the execution script change operation information includes the identification data of the master server, and setting a preset data synchronization mode to be a partial modification type synchronization, where the partial modification type synchronization is used to indicate that the identification data of the master server is not preserved synchronously, and the identification data may include an IP address or a port, etc., which is only illustrated in the embodiment and does not limit the specific type of the identification data.
Specifically, before data backup is performed, the master server first determines to establish a bidirectional communication connection with the slave server, so as to ensure that the master server and the slave server can perform data backup through master-slave replication. The user may set the data synchronization manner of the master server in advance, for example, the preset data synchronization manner may be specifically set to be partially modified synchronization, and when determining that the script modification operation information includes the identification data of the master server, the identification data of the master server may be replaced by customized data, where the customized data may be specifically the identification data of the slave server. In the present embodiment, the identification data including the IP address is described as an example, and for example, the customized data is determined to be the IP address of the slave server 192.168.10.93, and the IP address of the master server in the execution scenario change operation information shown in table 1 is replaced with the IP address 192.168.10.93 of the slave server. The information of the customized modified execution script change operation is shown in the following table 2:
TABLE 2
In this embodiment, the execution script update file is obtained according to the customized modified execution script change operation information, and the host server creates an output transmission path, and stores the obtained execution script update file locally in the host server based on the output transmission path.
Step S103, receiving a change information inquiry request transmitted from the server.
Alternatively, receiving the change information inquiry request sent from the server may include determining an I/O transmission path created from the server, and receiving the change information inquiry request sent from the server through the I/O transmission path according to a preset rule, where the preset rule includes sending at a specified time interval or sending according to a specified number of execution scripts.
When the slave server is determined to copy data from the master server in a partially modified synchronous mode, an I/O transmission path and a slave database execution transmission path are created, and a change information inquiry request is sent to the master server through the I/O transmission path. The corresponding master server receives the change information inquiry requests sent by the slave servers according to the preset rules through the I/O transmission paths, for example, the change information inquiry requests are sent periodically at intervals of 5 seconds, or the change information inquiry requests are sent according to 30 execution scripts required each time. Of course, this embodiment is merely illustrative, and not limited to a specific manner of preset rules.
Step S104, the execution script update file is sent to the slave server based on the change information inquiry request, so that the slave server executes the information change operation of the slave database according to the execution script update file.
Optionally, the method for transmitting the execution script update file to the slave server based on the change information inquiry request may include transmitting the execution script update file to the slave server through an I/O transmission path based on the change information inquiry request, so that the slave server saves the execution script update file in a specified format locally to the slave server, reads the execution script update file in the specified format through a pre-created execution transmission path from the database, and performs an information change operation from the database according to a read result.
Specifically, the master server will send the locally stored execution script update file to the slave server based on the change information inquiry request sent by the slave server, and after receiving the execution script update file, the slave server will store the execution script update file locally in the slave server according to a specified format, where the specified format may be a machine-recognizable relay log file, and the specific type of the specified format is not limited in this embodiment, and is within the scope of the present application as long as the specific type of the specified format can be recognized by the slave server. And the slave server can read the execution script update file with the specified format based on the execution transmission path of the slave database, and execute the information change operation of the slave database according to the read result, so as to ensure that the change of the execution script generated by the master database is synchronously changed in the slave database, thereby carrying out data backup.
It should be noted that, in this embodiment, since the copy is not complete, the IP address of the master server in the information about the script change operation is replaced by the IP address of the slave server, in the case where 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 and modified during the copy, in the case where the slave server works normally and the IP address of the slave server can also be used normally, the slave server can ensure that the task adopts the IP address of the server to operate normally.
According to the technical scheme, the identification data of the master server in the execution script change operation information is replaced by the identification data of the slave server, and the execution script update file obtained after replacement is sent to the slave server, so that when the master server fails, the slave server can still adopt the script containing the self identification data to ensure the normal operation of the service.
Example two
Fig. 3 is a flowchart of a data hot standby method provided by the embodiment of the present invention, where the present embodiment is applicable to a case of hot standby of data by master-slave replication, the present invention may be implemented by a data hot standby device in the fourth embodiment of the present invention, and the device may be implemented in a software and/or hardware manner. The difference between the present embodiment and the above-described embodiment is that the main server in the present embodiment does not perform the customization modification of the acquired execution script changing operation information, but performs the customization modification from the server after the execution script changing operation information is acquired, so that the execution subject and the modification timing of the present embodiment are different from those of the first embodiment. As shown in fig. 3, the data hot standby method in this embodiment specifically includes the following steps:
step S201, a change information inquiry request is sent to the main server.
Optionally, before sending the change information query request to the main server, the method further comprises determining that a bidirectional communication connection is established with the main server, and determining that a preset data synchronization mode is set to be partially modified synchronization, wherein the partially modified synchronization is used for indicating that the identification data of the main server is not synchronously reserved, and the identification data can include an IP address or a port, etc., and of course, the embodiment is only illustrative and not limited to the specific type of the identification data.
Before the data backup is carried out, the slave server can first determine that the bidirectional communication connection is established with the master server, so that the data backup can be carried out between the slave server and the master server through master-slave replication. The user may set the data synchronization manner of the slave server in advance, for example, the preset data synchronization manner may be specifically set to a partially modified synchronization.
Optionally, the sending of the change information query request to the main server may include creating an I/O transmission path, and sending the change information query request to the main server through the I/O transmission path according to a preset rule, where the preset rule includes sending the change information query request according to a specified time interval or sending the change information query request according to a specified number of execution scripts.
Specifically, when the slave server copies data from the master server in a partially modified synchronization manner, an I/O transmission path and a slave database execution transmission path are created, and thus a change information inquiry request is transmitted to the master server specifically through the I/O transmission path. For example, the change information inquiry request is transmitted periodically at 5 seconds intervals, or 30 execution scripts are requested each time. Of course, this embodiment is merely illustrative, and not limited to a specific manner of preset rules.
Step S202, the execution script update file sent by the main server based on the change information inquiry request is received.
The execution script update file contains execution script change operation information of a main database associated with the main server.
Specifically, in this embodiment, the main database is associated with the main server, and the main server monitors the main database in real time, and when the user operates the main database to cause the change of the data in the main database, the main server can intercept the change operation of the main database, so as to obtain the execution script change operation information of the main database. As shown in table 1 in the first embodiment, the execution script changing operation information acquired by the master server is shown as an example, and the execution script update file is acquired according to the execution script changing operation information, and the slave server receives the execution script update file sent by the master server based on the changing information inquiry request.
Optionally, receiving the execution script update file sent by the master server based on the change information query request may include receiving, via the I/O transmission path, the execution script update file sent by the master server based on the change information query request, and storing the execution script update file locally at the slave server according to a specified format.
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 stores the execution script update file locally on the slave server according to a specified format, where the specified format may specifically be a relay log file that can be identified by a machine, and the specific type of the specified format is not limited in this embodiment, and it is within the scope of the present application as long as the specified format can be identified by the slave server.
Step S203, the identification data of the master server in the execution script change operation information included in the execution script update file is replaced with the identification data of the slave server, so as to obtain the execution script operation file.
Specifically, the slave server intercepts 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 identification data of the master server is included in the execution script change operation information, the identification data of the master server may be replaced with customized data, and the customized data may be specifically the identification data of the slave server. In the present embodiment, the case where the identification data includes an IP address is described as an example, for example, it is determined that the customized data is the IP address of the slave server 192.168.10.93, and the IP address of the master server in the execution script change operation information included in the execution script update file is replaced with the IP address 192.168.10.93 of the slave server.
Step S204, the information changing operation from the database is executed according to the execution script operation file.
Alternatively, performing the information altering operation of the slave database according to the execution script operation file may include creating a slave database execution transmission path, and performing the information altering operation of the slave database according to the read result by reading the execution script operation file from the database execution transmission path.
Specifically, in this embodiment, the slave server reads the execution script operation file through the previously created slave database execution transmission path, and executes the information change operation of the slave database according to the read result, so as to ensure that the change of the execution script generated in the master database is synchronously changed in the slave database, so as to perform data backup.
It should be noted that, in this embodiment, since the copy is not complete, the IP address of the master server in the information about the script change operation is replaced by the IP address of the slave server, and in the case where 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 and modified during the copy, in the case where the slave server works normally and the IP address of the slave server can also be used normally, the slave server can ensure that the task adopts the IP address of the server to operate normally.
Optionally, after the information change operation of the slave database is executed according to the script execution operation file, updating a synchronization schedule stored locally on the slave server according to the change operation, wherein the synchronization schedule comprises the position of the script execution and the state of the script execution.
After the information change operation of the slave database is executed according to the execution script operation file, the slave server also updates a locally stored synchronization schedule according to the change operation, wherein the synchronization schedule comprises the position of the appointed script completed by the slave server in the slave database and the state of the execution script, and if the execution script is determined to have completed the operation, the state is changed to be changed, otherwise, the state is kept unchanged.
According to the technical scheme, the identification data of the master server in the execution script change operation information is replaced by the identification data of the slave server, and the execution script operation file obtained after the replacement is executed, so that when the master server fails, the slave server can still adopt the script containing the self identification data to ensure the normal operation of the service.
Example III
Fig. 4 is a schematic structural diagram of a video quality detection apparatus according to an embodiment of the present invention, where the apparatus includes an execution script change operation information obtaining module 310, an execution script update file obtaining module 320, a change information inquiry request receiving module 330, and an execution script update file sending module 340.
The execution script change operation information obtaining module 310 is configured to obtain execution script change operation information of the main database;
An execution script update file obtaining module 320, configured to replace the identification data of the master server in the execution script change operation information with the identification data of the slave server, so as to obtain an execution script update file;
A change information inquiry request receiving module 330 for receiving a change information inquiry request transmitted from the server;
The execution script update file sending module 340 is configured to send the execution script update file to the slave server based on the change information inquiry request, so that the slave server performs an information change operation of the slave database according to the execution script update file.
Optionally, the apparatus further comprises a bidirectional communication connection establishment module for determining to establish a bidirectional communication connection with the slave server;
The method comprises the steps that identification data of a main server are contained in execution script change operation information, and a preset data synchronization mode is set to be partial modification type synchronization, wherein the partial modification type synchronization is used for indicating that the identification data of the main server are not synchronously reserved.
Optionally, the device further comprises an execution script update file save module for creating an output transmission path;
The execution script update file is saved locally at the host server based on the output transmission path.
Optionally, the change information inquiry request receiving module is used for determining an I/O transmission path created from the server;
And receiving a change information inquiry request sent by the server through the I/O transmission path according to a preset rule, wherein the preset rule comprises sending according to a specified time interval or sending according to a specified number of execution scripts.
Optionally, the execution script update file sending module is configured 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 in a local area of the slave server according to a specified format, reads the execution script update file in the specified format through a pre-created execution transmission path of the slave database, and executes an information change operation of the slave database according to a read result.
The device can execute the data hot standby method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the method provided by any embodiment of the present invention.
Example IV
Fig. 5 is a schematic structural diagram of a video quality detection apparatus according to an embodiment of the present invention, where the apparatus includes a change information inquiry request sending module 410, an execution script update file receiving module 420, an execution script operation file obtaining module 430, and a database information change execution module 440.
Wherein, the change information inquiry request sending module 410 is configured to send a change information inquiry request to the main server;
an execution script update file receiving module 420, configured to receive an execution script update file sent by a main server based on a change information query request, where the execution script update file includes execution script change operation information of a main database associated with the main server;
An execution script operation file obtaining module 430, configured to replace the identification data of the master server with the identification data of the slave server in the execution script change operation information included in the execution script update file, so as to obtain an execution script operation file;
the slave database information change execution module 440 is configured to execute an information change operation of the slave database according to the execution script operation file.
Optionally, the device further comprises a bidirectional communication connection establishment module, configured to determine to establish a bidirectional communication connection with the main server;
and determining a preset data synchronization mode to be set as partial modification type synchronization, wherein the partial modification type synchronization is used for indicating that the identification data of the main server is not synchronously reserved.
Optionally, the change information inquiry request sending module is used for creating an I/O transmission path;
and 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 comprises sending according to a specified time interval or sending according to a specified number of execution scripts.
Optionally, the execution script update file receiving module is configured to receive, through the I/O transmission path, an execution script update file sent by the main server based on the change information query request;
and storing the execution script update file in a specified format locally from the server.
Optionally, the slave database information change execution module is used for creating a slave database execution transmission path;
And reading the script operation file from the transmission path of the database, and executing the information change operation from the database according to the reading result.
Optionally, the device further comprises a synchronization schedule updating module, which is used for updating the synchronization schedule stored locally from the server according to the change operation, wherein the synchronization schedule comprises the position of the execution script and the state of the execution script.
The device can execute the data hot standby method provided by any embodiment II of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the method provided by any embodiment of the present invention.
Example five
Fig. 6 is a schematic structural diagram of a main server according to an embodiment of the present invention. Fig. 6 illustrates a block diagram of an exemplary host server 612 suitable for use in implementing embodiments of the invention. The primary server 612 shown in fig. 6 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, the main server 612 is in the form of a general purpose computing device. Components of main server 612 may include, but are not limited to, one or more processors 616, memory 628, and bus 618 connecting the various system components, including memory 628 and processor 616.
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, and not limitation, such architectures include 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.
The primary server 612 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by main server 612 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 628 is used to store instructions. 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/nonvolatile computer system storage media. By way of example only, storage system 634 can be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 618 through 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 configured to carry out the functions of embodiments of the invention.
A program/utility 640 having a set (at least one) of program modules 642 may be stored in, for example, 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 or some combination of which may include an implementation of a network environment. Program modules 642 generally perform the functions and/or methods of the described embodiments of the present invention.
The primary server 612 may also communicate with one or more external devices 614 (e.g., keyboard, pointing device, display 624, etc.), one or more devices that enable a user to interact with the primary server 612, and/or any device (e.g., network card, modem, etc.) that enables the primary server 612 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 622. Also, the host server 612 may communicate with one or more networks such as 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, network adapter 620 communicates with the other modules of main server 612 over bus 618. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in connection with the primary server 612, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 616 executes various functional applications and data processing by executing instructions stored in the memory 628, for example, to implement a data provisioning method according to an embodiment of the present invention, including obtaining execution script change operation information of a master database, replacing identification data of the master server with identification data of a slave server in the execution script change operation information to obtain an execution script update file, receiving a change information query request sent from 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 performs an information change operation of the slave database according to the execution script update file.
Example six
Fig. 7 is a schematic structural diagram of a slave server according to an embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary slave server 712 suitable for use in implementing embodiments of the present invention. The slave server 712 shown in fig. 7 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 7, the slave server 712 takes 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 that connects the different system components (including the memory 728 and the processor 716).
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. By way of example, and not limitation, such architectures include 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.
The slave server 712 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed from server 712 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 728 is used for storing instructions. 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 comprise other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage system 734 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 718 through one or more data media interfaces. Memory 728 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 740 having a set (at least one) of program modules 742 may be stored, for example, in memory 728, such program modules 742 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 742 generally perform the functions and/or methodologies of the described embodiments of the invention.
The slave server 712 may also communicate with one or more external devices 714 (e.g., keyboard, pointing device, display 724, etc.), one or more devices that enable a user to interact with the slave server 712, and/or any devices (e.g., network card, modem, etc.) that enable the slave server 712 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 722. And, the slave server 712 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the internet, via the network adapter 720. As shown, the network adapter 720 communicates with other modules of the slave server 712 via the bus 718. It should be appreciated that although not shown in FIG. 7, other hardware and/or software modules may be used in connection with the slave server 712, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 716 executes various functional applications and data processing by executing instructions stored in the memory 728, for example, to implement the data hot standby method provided by the embodiment of the invention, and includes sending a change information inquiry request to a master server, receiving an execution script update file sent by the master server based on the change information inquiry request, where the execution script update file includes execution script change operation information of a master database associated with the master server, replacing identification data of the master server in the execution script change operation information included in the execution script update file with identification data of a slave server to obtain an execution script operation file, and executing information change operation of the slave database according to the execution script operation file.
Example seven
The embodiment of the application provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the data hot standby method provided by all the embodiments of the application:
The method comprises the steps of obtaining execution script changing operation information of a master database, replacing identification data of the master server in the execution script changing operation information with identification data of a slave server to obtain an execution script updating file, receiving a changing information inquiry request sent by the slave server, and sending the execution script updating file to the slave server based on the changing information inquiry request so that the slave server can execute information changing operation of the slave database according to the execution script updating file.
Or alternatively
The method comprises the steps of sending a change information inquiry request to a main server, receiving 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, replacing identification data of the main server in the execution script change operation information contained in the execution script update file with identification data of a slave server to obtain an execution script operation file, and executing information change operation of the slave database according to the execution script operation file.
Any combination of one or more computer readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a 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.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (14)

1. A data hot standby method, applied to a main server, comprising:
Acquiring execution script change operation information of a main 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 inquiry request sent by the server;
transmitting the execution script update file to the slave server based on the change information inquiry request so that the slave server executes information change operation of a slave database according to the execution script update file;
The method for updating the execution script comprises the steps of replacing the identification data of a master server in the execution script changing operation information with the identification data of a slave server to obtain an execution script updating file, and further comprises:
determining to establish a bi-directional communication connection with the slave server;
and determining that the execution script changing operation information contains the identification data of the main server, and setting a preset data synchronization mode to be partial modification type synchronization, wherein the partial modification type synchronization is used for indicating that the identification data of the main server is not synchronously reserved.
2. The method of claim 1, wherein prior to receiving the change information query request sent from the server, further comprising:
creating an output transmission path;
and storing the execution script update file locally on the main server based on the output transmission path.
3. The method of claim 1, wherein receiving the change information query request sent from the server comprises:
determining an I/O transmission path created from a server;
and receiving a change information inquiry request sent by the server through the I/O transmission path according to a preset rule, wherein the preset rule comprises sending according to a specified time interval or sending according to a specified number of execution scripts.
4. The method of claim 3, wherein the sending the execution script update file to the slave server based on the change information query request comprises:
And sending the execution script update file to the slave server through the I/O transmission path based on the change information inquiry request so that the slave server stores the execution script update file in the local of the slave server according to a specified format, reads the execution script update file in the specified format through a pre-created execution transmission path of the slave database, and executes the information change operation of the slave database according to a read result.
5. A data hot standby method, applied to a slave server, comprising:
sending a change information inquiry request to a main server;
Receiving an execution script update file sent by a 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;
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;
Executing information change operation from the database according to the execution script operation file;
Before sending the change information inquiry request to the main server, the method further comprises the following steps:
determining to establish a bi-directional communication connection with the primary server;
And determining a preset data synchronization mode to be set as partial modification type synchronization, wherein the partial modification type synchronization is used for indicating that the identification data of the main server is not synchronously reserved.
6. The method of claim 5, wherein sending a change information query request to a primary server comprises:
Creating an I/O transmission path;
And 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 comprises sending according to a specified time interval or sending according to a specified number of execution scripts.
7. The method of claim 6, wherein the receiving the execution script update file sent by the host server based on the change information query request comprises:
Receiving an execution script update file sent by the main server based on the change information inquiry request through the I/O transmission path;
and storing the execution script update file locally from the server according to a specified format.
8. The method of claim 7, wherein the performing an information change operation from a database according to the execution script operation file comprises:
creating a transmission path to be executed from the database;
And reading the execution script operation file through the execution transmission path of the slave database, and executing information change operation of the slave database according to a reading result.
9. The method of claim 6, wherein after the information change operation from the database is performed according to the execution script operation file, further comprising:
And updating a synchronization schedule stored locally from the server according to the change operation, wherein the synchronization schedule comprises the position of the execution script and the state of the execution script.
10. A data backup device, comprising:
The execution script changing operation information acquisition module is used for acquiring the execution script changing operation information of the main database;
The execution script updating file acquisition module is used for replacing the identification data of the master server in the execution script changing operation information with the identification data of the slave server so as to acquire an execution script updating file;
A change information inquiry request receiving module, configured to receive the change information inquiry request sent from the server;
The execution script update file sending module is used for sending the execution script update file to the slave server based on the change information inquiry request so that the slave server executes information change operation of a slave database according to the execution script update file;
the apparatus further comprises:
And determining that the script execution change operation information contains the identification data of the main server, and setting a preset data synchronization mode to be partial modification synchronization, wherein the partial modification synchronization is used for indicating that the identification data of the main server is not synchronously reserved.
11. A data backup device, comprising:
The change information inquiry request sending module is used for sending a change information inquiry request to the main server;
The execution script updating file receiving module is used for receiving an execution script updating file sent by a main server based on the change information inquiry request, wherein the execution script updating file contains execution script change operation information of a main database associated with the main server;
The execution script operation file acquisition module is used for 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 so as to acquire an execution script operation file;
The slave database information change execution module is used for executing information change operation of the slave database according to the execution script operation file;
the apparatus further comprises:
and determining that a preset data synchronization mode is set as partial modification synchronization, wherein the partial modification synchronization is used for indicating that the identification data of the main server is not synchronously reserved.
12. A primary server, the primary server comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
13. A slave server, the slave server comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 5-9.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method as claimed in any one of claims 1-4 or 5-9.
CN202110587487.8A 2021-05-27 2021-05-27 Data hot standby method, device, server and storage medium Active CN113312209B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110587487.8A CN113312209B (en) 2021-05-27 2021-05-27 Data hot standby method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110587487.8A CN113312209B (en) 2021-05-27 2021-05-27 Data hot standby method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN113312209A CN113312209A (en) 2021-08-27
CN113312209B true CN113312209B (en) 2024-12-17

Family

ID=77375783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110587487.8A Active CN113312209B (en) 2021-05-27 2021-05-27 Data hot standby method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN113312209B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490696A (en) * 2022-02-24 2022-05-13 中国工商银行股份有限公司 Data modification method, device, storage medium, and electronic device
CN116756157A (en) * 2023-05-29 2023-09-15 中国银行股份有限公司 Data warehouse thermal updating method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
CN107544783A (en) * 2016-06-27 2018-01-05 腾讯科技(深圳)有限公司 A kind of data-updating method, apparatus and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008042989A2 (en) * 2006-10-03 2008-04-10 Snapin Software Inc. Systems and methods for storing or performing functions within removable memory
US8214393B2 (en) * 2009-10-15 2012-07-03 Microsoft Corporation Integrating database deployment with code deployment
US8959107B2 (en) * 2011-09-02 2015-02-17 Bbs Technologies, Inc. Enumerating WMI object properties through T-SQL

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
CN107544783A (en) * 2016-06-27 2018-01-05 腾讯科技(深圳)有限公司 A kind of data-updating method, apparatus and system

Also Published As

Publication number Publication date
CN113312209A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
US7571268B2 (en) Consistent updates across storage subsystems coupled to a plurality of primary and secondary units at selected times
US20100138687A1 (en) Recording medium storing failure isolation processing program, failure node isolation method, and storage system
US8335766B2 (en) Flash-copying within asynchronous mirroring environment
US20080195827A1 (en) Storage control device for storage virtualization system
US10726042B2 (en) Replication control using eventually consistent meta-data
US20200104404A1 (en) Seamless migration of distributed systems
US11799839B2 (en) Cross-regional replication of keys
CN113312209B (en) Data hot standby method, device, server and storage medium
CN115292408A (en) Master-slave synchronization method, device, equipment and medium for MySQL database
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
CN109471647B (en) A method, device, electronic device and readable medium for updating data
CN113064766A (en) Data backup method, device, equipment and storage medium
CN114077518B (en) Data snapshot method, device, equipment and storage medium
US8112598B2 (en) Apparatus and method for controlling copying
CN111818145B (en) File transmission method, device, system, equipment and storage medium
JP2009080705A (en) Virtual machine system and method for restoring virtual machine in the system
CN111031126B (en) Cluster cache sharing method, system, equipment and storage medium
US9430440B2 (en) Environment construction apparatus and method, environment registration apparatus and method, environment switching apparatus and method
US10728323B2 (en) Method and apparatus for operating infrastructure layer in cloud computing architecture
WO2023019953A1 (en) Data synchronization method and system, server, and storage medium
CN113886500A (en) A data processing method, device, server and storage medium
US9223513B2 (en) Accessing data in a dual volume data storage system using virtual identifiers
US7509302B2 (en) Device, method and program for providing a high-performance storage access environment while issuing a volume access request including an address of a volume to access
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases
CN113760597B (en) Intermediate data processing method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant