CN111444200A - Data updating method and storage medium - Google Patents

Data updating method and storage medium Download PDF

Info

Publication number
CN111444200A
CN111444200A CN202010122949.4A CN202010122949A CN111444200A CN 111444200 A CN111444200 A CN 111444200A CN 202010122949 A CN202010122949 A CN 202010122949A CN 111444200 A CN111444200 A CN 111444200A
Authority
CN
China
Prior art keywords
log file
target database
database log
target
disaster recovery
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.)
Pending
Application number
CN202010122949.4A
Other languages
Chinese (zh)
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202010122949.4A priority Critical patent/CN111444200A/en
Publication of CN111444200A publication Critical patent/CN111444200A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The embodiment of the application provides a data updating method and a storage medium, which are applied to a data updating system, wherein the data updating system comprises a database server, disaster recovery library equipment, message subscription management equipment and terminal equipment, and the method comprises the following steps: after detecting that the target database log file is updated, the database server sends the target database log file to the disaster recovery backup device so that the disaster recovery backup device can identify the processing type corresponding to the log file label, and if the processing type is the designated forwarding processing type, the target database log file is sent to the message subscription management device; the message subscription management device writes the target database log file into a partition of a theme corresponding to the target database log file, determines an application program subscribed with the theme, and sends a notification message to the terminal device running the application program. By adopting the method and the device, the working pressure of the database server can be reduced, and the data change of the application program can be more timely.

Description

Data updating method and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data updating method and a storage medium.
Background
In the business system architecture, the database is mainly used for persisting data, storing data change sets and recording state conversion relations, and is an indispensable part in the existing business system. Since almost all data is stored in the database, data changes of each row of data, such as deletion, update, addition and the like, also occur in the database. At present, business systems are complex in relation and high in dependence, and other systems need to acquire data change information in a database and then trigger corresponding logic based on change contents.
At present, an application program mainly interacts with a database actively, and cannot passively acquire database data updating changes. For scenes needing to obtain data updating, a timing polling mode is mostly needed to repeatedly access the database to obtain a data change set. Since the polling time interval is fixed and needs to be actively triggered by the application program, the method particularly consumes resources of the database server, and increases the working pressure of the database server. Moreover, the timeliness of the data change of the application program has serious hysteresis, and the data change is not timely enough.
Disclosure of Invention
The embodiment of the application provides a data updating method and a storage medium, which can reduce the working pressure of a database server and can enable the data of an application program to be changed more timely.
In a first aspect, a data updating method provided in an embodiment of the present application is applied to a data updating system, where the data updating system includes a database server, a disaster recovery library device, a message subscription management device, and a terminal device, and the method includes:
after detecting that a target database log file is updated, the database server sends the target database log file to the disaster recovery backup device, wherein the target database log file carries a log file label;
the disaster recovery backup library device receives the target database log file sent by the database server, identifies a processing type corresponding to the log file label carried by the target database log file, and sends the target database log file to the message subscription management device if the processing type is an appointed forwarding processing type;
the message subscription management equipment receives the target database log file sent by the disaster recovery backup database equipment and writes the target database log file into a partition of a theme corresponding to the target database log file;
the message subscription management device determines an application program subscribed to the theme, and sends a notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme of existence data update.
Optionally, the sending, by the database server, the target database log file to the disaster recovery library device includes:
and the database server sends the target database log file to the disaster recovery backup database device through the bound database log processing component.
Optionally, the sending, by the disaster recovery library device, the target database log file to the message subscription management device includes:
and the disaster backup library equipment sends the target database log file to the message subscription management equipment through the bound database log processing component.
Optionally, the sending, by the disaster recovery library device, the target database log file to the message subscription management device includes:
the disaster recovery backup library equipment determines the identification of the corresponding theme of the target database log file according to the corresponding relation between the preset database log file and the identification of the theme;
and the disaster backup library equipment generates a message comprising the target database log file and the identification of the corresponding theme of the target database log file, and sends the message to the message subscription management equipment.
Optionally, the receiving, by the message subscription management device, the target database log file sent by the disaster recovery library device, and writing the target database log file into the partition of the theme corresponding to the target database log file, includes:
and the message subscription management equipment receives the message sent by the disaster backup library equipment and writes the target database log file into the partition of the corresponding theme of the target database log file according to the identification of the corresponding theme of the target database log file.
Optionally, the method further comprises:
the terminal equipment receives the notification message, and the notification message carries the target database log file; or the like, or, alternatively,
and after receiving the notification message, the terminal equipment acquires the target database log file from the message subscription management equipment.
Optionally, the method further comprises:
and the terminal equipment analyzes the target database log file through the application program to obtain target data, and updates local data of the application program by using the target data.
Optionally, the analyzing, by the terminal device, the target database log file through the application program to obtain target data, where the analyzing includes:
and the terminal equipment converts the target database log file into a text file through the application program and extracts target data from the text file.
Optionally, the updating the local data of the application program by using the target data includes:
and updating the local data of the application program by using the database operation statement corresponding to the specified database operation.
In a second aspect, the present application provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method according to the first aspect.
To sum up, the database server may send the target database log file to the disaster recovery backup device after detecting that the target database log file is updated; the disaster recovery library device can receive a target database log file sent by the database server, can identify the processing type of a log file label carried by the target database log file, and sends the target database log file to the message subscription management device if the processing type is an appointed forwarding processing type; the message subscription management device can receive a target database log file sent by the disaster recovery backup device and write the target database log file into a partition of a theme corresponding to the target database log file; the message subscription management device can determine the application program subscribed with the theme and can send the notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme that the data updating exists.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a data updating method provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating another data updating method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data updating system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Please refer to fig. 1, which is a flowchart illustrating a data updating method according to an embodiment of the present application. The method can be applied to a data updating system, and the subscription updating processing system comprises a database server, a disaster recovery library device, a message subscription management device and a terminal device. Specifically, the method may comprise the steps of:
s101, after detecting that a target database log file is updated, the database server sends the target database log file to the disaster recovery backup device, wherein the target database log file carries a log file label.
The database server mentioned in the embodiment of the present application may be a server corresponding to the target database.
In one embodiment, when the target database is a first database, the target database log file may be a binlog binary log file included in the first database, wherein the first database may be a Mysql database or a TIDB database. When the target database is a second database, the target database log file may be a redo log file included in the second database.
Wherein the aforementioned target database log file may include one or more update events. The update event may include, for example, time-to-trigger, pre-change data, and the like. In one embodiment, when the target database log file is a binlog file, the target database file may be set to row mode. The row mode enables the binlog file not to record the context-related information of the executed sql statement, but only to record the information of each row of modified data, and the recorded content is clearer, more detailed and more convenient to understand.
The log file tag mentioned in the embodiment of the present application may be a category tag, where the category tag is information for identifying a category to which the target database log file belongs. For example, the log file tag of the target database log file may be a category tag 1, where the category tag 1 indicates that the target database log file belongs to the first category. As another example, the label of the target database log file may also be a category label 2, where the category label 2 indicates that the target database log file belongs to the second category. The classification may be based on the requirements of a service or a scene, and the like, which is not limited in the embodiment of the present application.
In one embodiment, the log file tag mentioned in the embodiments of the present application may also be a process type tag. The process type tag refers to information for identifying the process type of the target database log file. For example, the log file tag of the target database log file may be a processing type tag 1, and the processing type tag 1 indicates that the processing type of the target database log file is a storage processing type. As another example, the tag of the target database log file may also specify a forwarding process type for process tag 2, where process tag 2 indicates the process type of the target database log file.
In one embodiment, the log file tag may include the category tag and the process type tag. When the log file tag includes the category tag and the processing type tag, the server may identify, based on the processing type tag, a processing type corresponding to the processing type tag carried by the target database log file.
In one embodiment, the manner in which the database server sends the target database log file to the disaster recovery library device may be: and the database server sends the target database log file to the disaster recovery database device through the bound database log processing component. For example, when the database server is a server corresponding to the TIDB database, the database log processing component bound by the database server may be a pump component, and the pump component may implement a function of recording a binlog file and synchronizing the binlog file.
In one embodiment, the database server detecting the target database log file update may refer to the database server detecting that the target database log file is written with a new update event.
For example, the database server may obtain, when a specified database operation on the target database is detected, an update event corresponding to the specified database operation, and write the update event corresponding to the specified database operation into the target database log file. Wherein the specified database operation includes, but is not limited to, any of: adding data, deleting data and modifying data.
S102, the disaster recovery backup library device receives the target database log file sent by the database server, identifies a processing type corresponding to the log file label carried by the target database log file, and sends the target database log file to the message subscription management device if the processing type is an appointed forwarding processing type.
In this embodiment of the application, the disaster recovery library device may receive the target database log file sent by the database server, identify a processing type corresponding to the log file tag carried in the database log file, and send the target database log file to the message subscription management device if the processing type is an assigned forwarding processing type. Compared with the prior art that the database server needs to synchronize the disaster recovery backup device and the message subscription management device at the same time, the database server in the embodiment of the application does not need to synchronize the message subscription management device, so that the working pressure of the database server can be effectively reduced.
In an embodiment, the disaster recovery library device may include a correspondence between a log file tag and a processing type, and the server may determine, according to the correspondence between the log file tag and the processing type, that the log file tag carried by the target database log file corresponds to the designated forwarding processing type. In an embodiment, if the processing type corresponding to the log file tag carried by the target database log file is a storage processing type, the disaster recovery library device may perform storage processing on the target database log file. Or, if the processing type corresponding to the log file tag carried by the target database log file is the first forwarding processing type, the disaster recovery library device may forward the target database log file to the first device. Or, if the processing type corresponding to the log file tag carried by the target database log file is the second forwarding processing type, the disaster recovery library device may forward the target database log file to the second device.
In an embodiment, the target database log file may further carry compression indication information, where the compression indication information may include information on whether to compress the target database log file. In one embodiment, when the compression indication information includes information for performing compression processing on the target database log file, the compression indication information may further include a compression manner at the time of the compression processing and/or identification information of the first file compressed together with the target database log file at the time of the compression processing. In an embodiment, if the compression indication information carried by the target database log file includes information for performing compression processing on the target database log file, the target database log file is compressed to obtain a compressed packet including the target database log file. Accordingly, the process of the disaster recovery library device sending the target database log file to the message subscription management device may be sending a compressed packet including the target database log file to the message subscription management device. If the target database log file is carried in a compression mode of compression processing, the disaster recovery library device can compress the target database log file according to the compression mode. If the target database log file also carries identification information of a first file compressed together with the target database log file during compression processing, the disaster recovery library device can acquire the first file according to the identification information of the first file, and can compress the target database log file and the first file to obtain a compressed packet including the target database log file and the first file. Accordingly, the disaster recovery library device sends the target database log file to the message subscription management device, so that the disaster recovery library device sends a compressed packet including the target database log file and the first file to the message subscription management device. If the target database log file also carries a compression mode of compression processing and identification information of a first file compressed together with the target database log file during the compression processing, the disaster recovery backup device can acquire the first file according to the identification information of the first file, and can compress the target database log file and the first file by adopting the compression mode to obtain a compression packet comprising the target database log file and the first file. In an embodiment, if the compression indication information includes information that does not perform compression processing on the target database log file, the disaster recovery library device may perform a step of identifying a processing type corresponding to the log file tag carried by the target database log file or perform a step of sending the target database log file to the message subscription management device.
In an embodiment, the target database log file may further carry merging indication information, where the merging indication information may include information on whether to merge the target database log file. In an embodiment, when the merging indication information includes information for performing merging processing on the target database log file, the merging indication information may further carry identification information of a second file that performs data content merging with the target database log file during the merging processing. In an embodiment, if the target database log file also carries identification information of a second file that performs data content merging with the target database log file during compression processing, the disaster recovery backup device may obtain the second file according to the identification information of the second file, and may perform data content merging processing on the target database log file and the second file by using the compression method to obtain a merged file, where the merged file includes the data content of the target database log file and the data content of the second file. Correspondingly, the disaster recovery library device sends the target database log file to the message subscription management device, so that the combined file can be sent to the message subscription management device for the disaster recovery library device. In an embodiment, if the merging indication information includes information that compression processing is not performed on the target database log file, the disaster recovery library device may perform a step of identifying a processing type corresponding to the log file tag carried by the target database log file or perform a step of sending the target database log file to the message subscription management device.
In one embodiment, the target database log file may carry the merging indication information and the target compression indication information. The target compression instruction information may include information whether to perform compression processing on the merged file. In one embodiment, when the target compression instruction information includes information for performing compression processing on the merged file, the target compression instruction information may further include a compression manner at the time of the compression processing and/or identification information of a third file compressed together with the merged file at the time of the compression processing. After the disaster recovery library device obtains the merged file, if the compression indication information includes information that compression processing is not performed on the merged file, the disaster recovery library device sends the target database log file to the message subscription management device, so that the disaster recovery library device can send the merged file to the message subscription management device. And if the compression indication information comprises information for compressing the merged file, the disaster recovery library equipment compresses the merged file. In one embodiment, if the compression indication information further includes a compression mode during compression, the disaster recovery library device may perform compression processing on the merged file according to the compression mode. If the compression indication information further includes identification information of a third file compressed together with the merged file during compression processing, the disaster recovery library device may obtain the third file according to the identification of the third file, and perform compression processing on the merged file and the third file to obtain a compressed package including the merged file and the third file. Accordingly, the disaster recovery library device sends the target database log file to the message subscription management device, and may send a compressed packet including the merged file and the third file to the message subscription management device for the disaster recovery library device. If the compression instruction information includes a compression method in the compression process and identification information of a third file compressed together with the merged file in the compression process, the server may perform compression processing on the merged file and the third file according to the compression method to obtain a compressed package including the merged file and the third file. In an embodiment, if the compression indication information includes information that does not perform compression processing on the target database log file, the disaster recovery library device may perform a step of identifying a processing type corresponding to the log file tag carried by the target database log file or perform a step of sending the target database log file to the message subscription management device. If the compression indication information includes information that compression processing is not performed on the merged file, the disaster recovery library device may perform a step of identifying a processing type corresponding to the log file tag carried by the target database log file or perform a step of sending the merged file to the message subscription management device.
In an embodiment, the manner in which the disaster recovery library device sends the target database log file to the message subscription management device may be as follows: and the disaster backup library device sends the target database log file to the message subscription management device through the bound database log processing component. For example, when the database server is a server corresponding to the TIDB database, the database log processing component bound by the disaster recovery library device may be a pump component.
In one embodiment, the disaster backup library device may be a same city disaster backup library device. The same-city disaster recovery backup library device can be in the same city with the database server. The message subscription management device may refer to a kafka server. The kafka server may refer to a server running a kafka application.
In one embodiment, the disaster backup library device may generate a copy of the target database log file for saving to backup. In an application scenario, when the database server fails, switching to the disaster recovery backup device to detect the update of the target database log file, and sending the target database log file to the message subscription management device after detecting the update of the target database log file; the message subscription management device receives the target database log file sent by the disaster recovery backup device, and writes the target database log file into the partition of the corresponding theme of the target database log file; the message subscription management device determines an application program subscribed to the topic, and sends a notification message to the terminal device running the application program. In another application scenario, after the database server resumes normal operation, the target database log file stored by the disaster recovery backup database device may be acquired, and the update of the target database log file may be detected.
In an embodiment, the manner in which the disaster recovery library device sends the target database log file to the message subscription management device may be as follows: the disaster recovery backup library equipment determines the identification of the corresponding theme of the target database log file according to the corresponding relation between the preset database log file and the identification of the theme; and the disaster recovery library equipment generates a message comprising the target database log file and the identification of the corresponding theme of the target database log file, and sends the message to the message subscription management equipment.
In one embodiment, when the message subscription management device is a kafka server, the message may be a kafka message.
In one embodiment, the disaster recovery library device may send the message to the message subscription management device through the bound database log processing component.
S103, the message subscription management device receives the target database log file sent by the disaster recovery backup device, and writes the target database log file into the partition of the corresponding theme of the target database log file.
In one embodiment, the number of partitions for the topic may be 1.
In an embodiment, a manner that the message subscription management device receives the target database log file sent by the disaster recovery library device, and writes the target database log file into the partition of the theme corresponding to the target database log file may be: and the message subscription management device receives the message sent by the disaster recovery library device and writes the target database log file into the partition of the theme corresponding to the target database log file according to the identification of the theme corresponding to the target database log file.
In one embodiment, the message subscription management device may obtain the target database log file from a message including the target database log file and an identification of a topic corresponding to the target database log file.
In one embodiment, the message subscription management device may write a message including the target database log file and an identification of a topic corresponding to the target database log file into a partition of the topic corresponding to the target database log file.
S104, the message subscription management device determines the application program subscribed to the theme and sends a notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme existence data update.
In the embodiment of the application, the message subscription management device can determine the application program subscribed to the theme, and send the notification message to the terminal device running the application program, compared with a mode that the application program needs to continuously train the database server to check whether the theme is updated or not in the prior art, the embodiment of the application can enable the data of the application program to be updated more timely, and reduce the pressure of the database server. The terminal device includes, but is not limited to, a smart terminal such as a smart phone, a tablet computer, a notebook computer, a desktop computer, and a smart wearable device.
In one embodiment, the message subscription management device may directly send the target database log file to the terminal device running the application. In an embodiment, the notification message may carry the target database log file, the message subscription management device may send the notification message to a terminal device running the application program, and the terminal device may receive the notification message and obtain the target database log file carried by the notification message through the application program.
In one embodiment, the message subscription management device may receive a compressed package or a merged file sent by the server, and write the compressed package or the merged file into a partition of a corresponding topic of the target database log file.
In one embodiment, the message subscription management device may send the merged file or the compressed package directly to the terminal device running the application program, in addition to sending the notification message. In one embodiment, the notification message may carry the merged file or the compressed package, the message subscription management device may send the notification message to the terminal device running the application program, and the terminal device may receive the notification message and obtain, through the application program, the merged file or the compressed package carried by the notification message.
In one embodiment, the terminal device may split the merged file or decompress the compressed packet to obtain the specified data, and update the local data with the specified data. In one embodiment, the specific data may include the target database log file, and the terminal device parses the target database log file through the application program to obtain target data, and updates local data of the application program with the target data.
As can be seen, in the embodiment shown in fig. 1, after detecting that the target database log file is updated, the database server sends the target database log file to the disaster recovery library device; the disaster recovery library equipment receives a target database log file sent by a database server, identifies the processing type of a log file label carried by the target database log file, and sends the target database log file to the message subscription management equipment if the processing type is an appointed forwarding processing type; the message subscription management equipment receives a target database log file sent by the disaster recovery backup device and writes the target database log file into a partition of a theme corresponding to the target database log file; the message subscription management device determines the application program subscribed with the theme and sends the notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme that the data is updated.
In an application scenario, after a server corresponding to the TIDB database detects that a binlog file is updated, the binlog file is sent to disaster recovery database equipment. The disaster recovery library equipment receives a binlog file sent by a server corresponding to the TIDB database and sends the binlog file to the kafka server; and the kafka server receives the binlog file sent by the disaster recovery library equipment and writes the binlog file into the partition of the corresponding theme of the binlog file. The kafka server determines the applications subscribed to the theme, such as application 1, application 2, and application 3, and sends notification messages to the terminal device 1 running application 1, the terminal device 2 running application 2, and the terminal device 3 running application 3. Wherein the notification message is used to notify the subject that there is a data update. In another application scenario, after detecting that the binlog file is updated, the server corresponding to the TIDB database sends the binlog file to the disaster recovery database device. The disaster recovery library equipment receives a binlog file sent by a server corresponding to the TIDB database, the binlog file carries a log file label, and after the processing type of the log file label carried by the binlog file is identified as a designated forwarding processing type, the binlog file is sent to a kafka server; and the kafka server receives the binlog file sent by the disaster recovery library equipment and writes the binlog file into the partition of the corresponding theme of the binlog file. The kafka server determines the applications subscribed to the theme, such as application 1, application 2, and application 3, and sends notification messages to the terminal device 1 running application 1, the terminal device 2 running application 2, and the terminal device 3 running application 3. Wherein the notification message is used to notify the subject that there is a data update.
Please refer to fig. 2, which is a flowchart illustrating another data updating method according to an embodiment of the present application. The data updating system comprises a database server, disaster recovery library equipment, message subscription management equipment and terminal equipment. Specifically, the method may comprise the steps of:
s201, after detecting that a target database log file is updated, the database server sends the target database log file to the disaster recovery backup device, wherein the target database log file carries a log file label.
S202, the disaster recovery backup library device receives the target database log file sent by the database server, identifies the processing type corresponding to the log file label carried by the target database log file, and sends the target database log file to the message subscription management device if the processing type is the designated forwarding processing type.
S203, the message subscription management device receives the target database log file sent by the disaster recovery library device, and writes the target database log file into the partition of the corresponding theme of the target database log file.
S204, the message subscription management device determines the application program subscribed to the theme and sends a notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme to update the data.
In the embodiment of the present application, steps S201 to S204 may refer to steps S101 to S104 in the embodiment of fig. 1, which is not described herein again.
And S205, after receiving the notification message, the terminal device acquires the target database log file from the message subscription management device.
S206, the terminal device analyzes the target database log file through the application program to obtain target data, and updates local data of the application program by using the target data.
In step S205 to step S206, after receiving the notification message, the terminal device may obtain the target database log file from the message subscription management device, and may analyze the target database log file through the application program to obtain target data, so as to update the local data of the application program with the target data.
In one embodiment, the terminal device may convert the target database log file into a text file through the application program and extract target data from the text file.
In an embodiment, the target database log file includes an update event corresponding to a specified database operation, the target data includes a database operation statement corresponding to the specified database operation, and the specific manner in which the terminal device updates the local data of the application program by using the target data may be that the terminal device updates the local data of the application program by using the database operation statement corresponding to the specified database operation. For example, the specified database operation is an operation of adding data, the target data includes a database operation statement corresponding to the operation of adding data, and the terminal device may add data to the local data of the application program by using the operation of adding data.
In one embodiment, the database log file may be converted to a text file using a binary protocol, such as a binary parsing protocol.
In an embodiment, after acquiring the target database log file, the terminal device may output a prompt message to prompt whether to perform data update, and if a confirmation instruction output according to the prompt message is detected, the terminal device parses the target database log file through the application program to obtain target data, and updates local data of the application program by using the target data.
As can be seen, in the embodiment shown in fig. 2, after detecting that the target database log file is updated, the database server sends the target database log file to the disaster recovery library device; the disaster recovery library equipment receives a target database log file sent by a database server, identifies the processing type of a log file label carried by the target database log file, and sends the target database log file to the message subscription management equipment if the processing type is an appointed forwarding processing type; the message subscription management equipment receives a target database log file sent by the disaster recovery backup device and writes the target database log file into a partition of a theme corresponding to the target database log file; the message subscription management device determines an application program subscribed with a theme and sends a notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme of data update; the terminal device can obtain the target database log file from the message subscription management device after receiving the notification message, and update the local data of the application program by using the target database log file.
Please refer to fig. 3, which is a schematic structural diagram of a data updating system according to an embodiment of the present application. The data updating system comprises a database server 10, a disaster recovery library device 20, a message subscription management device 30 and a terminal device 40. The database server 10 can establish communication with the disaster recovery library device 20, the disaster recovery library device 20 can establish communication with the message subscription management device 30, and the message subscription management device 30 can establish communication with the terminal device 40. Wherein:
the database server 10 may execute step S101 to send the target database log file to the disaster recovery library device 20 after detecting that the target database log file is updated, where the target database log file carries a log file tag; the disaster recovery library device 20 may execute step S102 to receive the target database log file sent by the database server 10, and send the target database log file to the message subscription management device 30 after recognizing that the processing type of the log file tag carried by the target database log file is the designated forwarding processing type; the message subscription management device 30 may execute step S103 to receive the target database log file sent by the disaster recovery library device 20, and write the target database log file into the partition of the theme corresponding to the target database log file; the message subscription management device 30 may determine the application program subscribed to the topic by performing step S104, and transmit a notification message for notifying that the topic exists data update to the terminal device 40 running the application program. By adopting the mode, the resource consumption and the working pressure of the database server can be reduced, and the data change of the application program can be more timely.
In one embodiment, it can be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when executed. The medium is a computer-readable storage medium, which may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A data updating method is characterized in that the method is applied to a data updating system, the data updating system comprises a database server, a disaster recovery library device, a message subscription management device and a terminal device, and the method comprises the following steps:
after detecting that a target database log file is updated, the database server sends the target database log file to the disaster recovery backup device, wherein the target database log file carries a log file label;
the disaster recovery backup library device receives the target database log file sent by the database server, identifies a processing type corresponding to the log file label carried by the target database log file, and sends the target database log file to the message subscription management device if the processing type is an appointed forwarding processing type;
the message subscription management equipment receives the target database log file sent by the disaster recovery backup database equipment and writes the target database log file into a partition of a theme corresponding to the target database log file;
the message subscription management device determines an application program subscribed to the theme, and sends a notification message to the terminal device running the application program, wherein the notification message is used for notifying the theme of existence data update.
2. The method of claim 1, wherein the database server sending the target database log file to the disaster recovery library device comprises:
and the database server sends the target database log file to the disaster recovery backup database device through the bound database log processing component.
3. The method according to claim 1 or 2, wherein the sending, by the disaster recovery repository device, the target database log file to the message subscription management device comprises:
and the disaster backup library equipment sends the target database log file to the message subscription management equipment through the bound database log processing component.
4. The method of claim 1, wherein the sending, by the disaster recovery repository device, the target database log file to the message subscription management device comprises:
the disaster recovery backup library equipment determines the identification of the corresponding theme of the target database log file according to the corresponding relation between the preset database log file and the identification of the theme;
and the disaster backup library equipment generates a message comprising the target database log file and the identification of the corresponding theme of the target database log file, and sends the message to the message subscription management equipment.
5. The method according to claim 4, wherein the receiving, by the message subscription management device, the target database log file sent by the disaster recovery library device, and writing the target database log file into the partition of the theme corresponding to the target database log file, comprises:
and the message subscription management equipment receives the message sent by the disaster backup library equipment and writes the target database log file into the partition of the corresponding theme of the target database log file according to the identification of the corresponding theme of the target database log file.
6. The method of claim 1, further comprising:
the terminal equipment receives the notification message, and the notification message carries the target database log file; or the like, or, alternatively,
and after receiving the notification message, the terminal equipment acquires the target database log file from the message subscription management equipment.
7. The method of claim 1 or 6, further comprising:
and the terminal equipment analyzes the target database log file through the application program to obtain target data, and updates local data of the application program by using the target data.
8. The method of claim 7, wherein the terminal device parses the target database log file through the application program to obtain target data, and the method comprises:
and the terminal equipment converts the target database log file into a text file through the application program and extracts target data from the text file.
9. The method of claim 7, wherein the target database log file comprises an update event corresponding to a specified database operation, the target data comprises a database operation statement corresponding to the specified database operation, and the terminal device updates the local data of the application program by using the target data, and comprises:
and the terminal equipment updates the local data of the application program by using the database operation statement corresponding to the specified database operation.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method according to any one of claims 1-9.
CN202010122949.4A 2020-02-27 2020-02-27 Data updating method and storage medium Pending CN111444200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010122949.4A CN111444200A (en) 2020-02-27 2020-02-27 Data updating method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010122949.4A CN111444200A (en) 2020-02-27 2020-02-27 Data updating method and storage medium

Publications (1)

Publication Number Publication Date
CN111444200A true CN111444200A (en) 2020-07-24

Family

ID=71650984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010122949.4A Pending CN111444200A (en) 2020-02-27 2020-02-27 Data updating method and storage medium

Country Status (1)

Country Link
CN (1) CN111444200A (en)

Similar Documents

Publication Publication Date Title
CN109034993B (en) Account checking method, account checking equipment, account checking system and computer readable storage medium
CN111339186B (en) Workflow engine data synchronization method, device, medium and electronic equipment
WO2019174129A1 (en) Event reminder method, apparatus, computer device, and storage medium
CN113297166B (en) Data processing system, method and device
CN107562556B (en) Failure recovery method, recovery device and storage medium
CN109933439B (en) Message transmission method, device, computer equipment and storage medium
US8909662B2 (en) Message based mobile object with native PIM integration
EP3480705A1 (en) Database data modification request processing method and apparatus
CN113806301A (en) Data synchronization method, device, server and storage medium
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN112865927B (en) Message delivery verification method, device, computer equipment and storage medium
CN112181724A (en) Big data disaster tolerance method and device and electronic equipment
CN109445966B (en) Event processing method, device, medium and computing equipment
CN111831954A (en) Content data updating method and device, computer equipment and storage medium
CN111444200A (en) Data updating method and storage medium
CN114564458B (en) Method, device, equipment and storage medium for synchronizing data among clusters
CN109254880B (en) Method and device for processing database downtime
CN114238264A (en) Data processing method, data processing device, computer equipment and storage medium
CN114691455A (en) Method and device for monitoring alarm data and dynamically pushing multiple platforms
CN115730016B (en) Data synchronization method, system, device, computer equipment and storage medium
CN104052852A (en) Communication method and device
CN112804312B (en) File uploading method, equipment and computer readable medium
CN112702270B (en) Node calling method, system and storage medium based on event distribution mechanism
CN110908958B (en) File processing method, device, terminal and storage medium
CN109547290B (en) Cloud platform garbage data detection processing method, device, equipment 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