WO2009074031A1 - Procédé de sauvegarde de données et système de traitement d'application - Google Patents
Procédé de sauvegarde de données et système de traitement d'application Download PDFInfo
- Publication number
- WO2009074031A1 WO2009074031A1 PCT/CN2008/072183 CN2008072183W WO2009074031A1 WO 2009074031 A1 WO2009074031 A1 WO 2009074031A1 CN 2008072183 W CN2008072183 W CN 2008072183W WO 2009074031 A1 WO2009074031 A1 WO 2009074031A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- module
- standby
- sent
- data
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Definitions
- the present invention relates to the field of data backup technologies, and in particular, to a data backup method and an application processing system. Background technique
- HA Highly Available
- processing systems are required to have very high availability (HA: Highly Available) in many critical applications, such as telecommunications systems, banking systems, and billing systems, which need to be available at all times while still ensuring responsiveness. speed.
- the key modules in the system are often redundantly configured so that when the module is not working properly, the corresponding redundancy module can take over its work and continue to provide application services.
- the module that works normally is called the Active module
- the redundant module is called the Standby module. Obviously these two names are based on the usage status of the module.
- the service processing is switched to the original standby module.
- the standby module is upgraded to the primary module, and the original primary module is stopped or downgraded to the standby module for maintenance or replacement.
- checkpoint Checkpoint
- the checkpoint service allows the process to back up the running data so that it can be restored to its last normal state when it recovers.
- the industry defines the Checkpointing mechanism for saving operational data. Each saved operational data is called a Checkpoint checkpoint.
- Checkpointing means a mechanism for saving running data by using a service during operation. Referring to Figure 1, the active module continuously records the work information to the checkpoint during operation. After the active/standby switchover, the standby module reads from the checkpoint. The current work record information, you can start working properly.
- the inventor of the present invention found in the research and practice of this method that there are usually many request messages sent to the main module for processing, and if the main module suddenly experiences a serious failure, then these Unprocessed messages will be lost; and, for messages that have already been processed, if the primary module has not completed the backup, serious problems will occur. If the backup has not been completed, the data will be backed up. If the backup is in progress, it will result in the backup. The backup is incomplete and affects the reliability of the data obtained by the standby module. In addition, because the backup data is stored in the checkpoint, it takes time for the standby module to read the backup data during the switchover. The service recovery delay is long and affects system performance.
- the method sends a request message to the message server and caches it in the message queue, waiting for the application module to obtain the message.
- the active module obtains the message from the message queue for processing, and the primary module processes the message and backs up the related data to the standby module. After the primary module fails, the standby module upgrades to the primary module and continues to obtain messages in the message queue for processing.
- the inventor of the present invention found in the research and practice of this method that the message server becomes a key point of system availability. If the message server is abnormal, the system cannot work normally, so it is necessary to design a redundant backup of the message server, which is equivalent to Transferring the availability of the system to the availability of the message server does not solve the availability problem fundamentally; and, the master module gets the message from the message queue, and if an exception occurs while the data backup is being processed or not completed, the message or the message will be caused. The resulting data changes are lost.
- the embodiment of the present invention provides a data backup method and an application processing system, which are used to solve the problem that the unprocessed message is lost or the data backup is incomplete when the primary module is in a sudden failure in operation.
- a data backup method comprising: marking an identifiable message to a received message; sending the marked message to the primary module and the standby module respectively; and processing, by the primary module, the received tagged message, and The processing result of the message and the tag binding of the corresponding message are sent to the standby module; the received tagged message is cached by the standby module, and after receiving the processing result sent by the active module and the bound tag, according to The processing result performs data backup, and the cached message corresponding to the tag is deleted according to the tag bound to the processing result.
- An application processing system includes at least one message distribution module, an active module, and a standby module; the message distribution module is configured to receive a message that needs to be processed; to identify a received message; and to mark the message And sent to the main module and the standby module respectively; the main module, The method is configured to process the received tagged message, and send the tagged binding result of the message and the corresponding message to the standby module; the standby module is configured to perform the received tagged message Cache, after receiving the processing result sent by the active module and the bound tag, performing data backup according to the processing result, and deleting the cached message corresponding to the tag according to the tag bound to the processing result.
- a computer program product comprising computer program code, which when executed by a computer, causes the computer to perform the steps of the foregoing data backup method.
- a computer readable storage medium storing computer program code, the computer program code causing the computer to execute the aforementioned data backup method when the computer program code is executed by a computer The steps in .
- the message is sent to the primary and backup modules respectively after being marked, and the standby module deletes the message corresponding to the corresponding tag in the cache after receiving the processing result of the primary module; If the backup module has obtained backup data, the backup data is complete. If the backup data has not been obtained, the message that has not received the processing result can be processed without causing the unprocessed message to be lost or backed up. The data is incomplete; and because the message distribution process does not save the message, it is stateless and easy to deploy redundantly without additional availability requirements.
- FIG. 1 is a schematic diagram of a conventional data backup method
- FIG. 2 is a schematic diagram of another existing data backup method
- FIG. 3 is a schematic flowchart of a data backup method according to an embodiment of the present invention.
- FIG. 4 is a schematic flowchart of a data backup method according to Embodiment 2 of the present invention.
- FIG. 5 is a schematic flowchart of a third data backup method according to an embodiment of the present invention.
- FIG. 6 is a schematic flowchart of a fourth data backup method according to an embodiment of the present invention.
- FIG. 7 is a schematic diagram showing the basic logical structure of an application processing system according to an embodiment of the present invention.
- FIG. 8 is a schematic diagram of a deployment manner of an application processing system according to an embodiment of the present invention.
- FIG. 9 is a schematic diagram of another deployment manner of an application processing system according to an embodiment of the present invention.
- Embodiment 1 A data backup method, referring to FIG. 3, includes the following steps:
- the logical unit that performs this operation can be called a message distribution module, and is used to receive messages that need to be processed sent by other modules.
- the so-called identifiable tag is used to distinguish the message, and any method that can identify the application module, such as numbering, time stamping, etc., can be used.
- the tags used need to be unique within a certain time range, so that the tags of the messages cached in the processing modules (primary and standby modules) are not duplicated, and the algorithm can be designed according to the needs of the actual system.
- an optional way is: use the number as a mark, the number is the combination of the start time of the message distribution module and the sequence number of the sequence arrangement.
- the marked messages are sent to the active module and the standby module respectively.
- the message distribution module performs the immediacy operation and does not need to save the message. Therefore, the message distribution module is stateless (that is, the data is not saved, and the current processing has no relationship with the previous data), so the redundancy can be very convenient. deploy. For example, two message distribution modules can be deployed. If one of them fails, use another one for message numbering and distribution. There is no need for data association between the primary and backup of the message distribution module.
- the received message is processed by the main module.
- This process can be performed according to the application function provided by the module, which is not limited in this embodiment.
- A3b the received tagged message is cached by the standby module.
- the message processing of the primary module and the message buffer of the standby module can be performed in parallel.
- the primary module sends the message processing result and the tag binding of the corresponding message to the standby module.
- the result of the message processing refers to the information related to the message processing, such as the data change or the generated result that occurs after the main module performs the message processing.
- the main The processing result of the message sent by the module is the data that needs the backup module to back up.
- the active module can perform a data backup after each message is processed.
- the batch backup can also be performed, that is, the processing result of the processing of one or more messages and the tag of the corresponding message are bound to the standby module.
- the master module can use the synchronous or asynchronous communication method to bind the tag and the processing result to the standby module at the same time. To further improve system performance, asynchronous communication methods can be selected.
- the standby module After receiving the processing result sent by the active module and the bound tag, the standby module performs data backup according to the processing result, and deletes the cached message corresponding to the tag according to the bound tag.
- the processing result sent by the active module is backup data, so the standby module can directly perform backup.
- the data change caused by the message corresponding to the bound mark has been backed up, so the standby module can be Remove the corresponding message from the cache.
- the standby module only needs to continue processing according to the cached message.
- Embodiment 2 A data backup method. Referring to FIG. 4, this embodiment increases the processing of sending a response message by the active module compared with the first embodiment, and is applicable to an application processing situation in which a response needs to be returned. Including the following steps:
- the marked message is sent to the primary module and the standby module respectively.
- the received message is processed by the main module.
- the received tagged message is cached by the standby module.
- the primary module sends the data that needs to be backed up by the standby module and the label binding of the corresponding message to the standby module.
- B5a After the main module confirms that the data to be backed up is sent to the standby module, the response message corresponding to the processed message is sent.
- the master module can confirm that the content has been sent to the standby module in different ways. For example, if the underlying reliable communication is used between the active module and the standby module, the primary module transmits successfully, and the standby module can be confirmed; for example, if the underlying communication between the primary module and the standby module is unreliable
- the acknowledgment mechanism at the communication level can also be used, that is, after receiving the content sent by the main module, the standby module returns the acknowledgment information to the main module, and the main module can confirm the receipt of the standby module, thereby transmitting the response.
- the message is addressed to the recipient of the response message (eg, the module that sent the request message to the message distribution module).
- the standby module After receiving the processing result sent by the active module and the bound tag, the standby module performs data backup according to the processing result, and deletes the cached message corresponding to the tag according to the bound tag.
- Embodiment 1 is applicable to a case where it is not necessary to respond to a message, and the present embodiment is applicable to a case where a response to a request message is required.
- Embodiment 3 A data backup method. Referring to FIG. 5, this embodiment increases the processing of sending a response message by the standby module compared with the first embodiment, and is applicable to an application processing situation in which a response needs to be returned. Including the following steps:
- the marked message is sent to the primary module and the standby module respectively.
- the received message is processed by the main module.
- the received tagged message is cached by the standby module.
- the primary module sends the processing result of the message and the tag binding of the corresponding message to the standby module.
- the processing result of the message sent by the active module includes a response message corresponding to the processed message, in addition to the data that needs to be backed up by the standby module.
- the standby module After receiving the response message sent by the active module, the standby module sends the response message.
- the response message is sent by the standby module, so that the primary module does not need to send a response message after confirming that the standby module has received, as in the second embodiment.
- step C6 After receiving the processing result sent by the active module and the bound tag, the standby module performs data backup according to the data that needs to be backed up in the processing result, and deletes the cache corresponding to the tag according to the bound tag. Message.
- This step and step C5 can be performed in parallel or sequentially.
- Embodiment 4 A data backup method, referring to FIG. 6, the difference between this embodiment and the third embodiment is that the backup data of the standby module is not directly generated from the primary module but is generated according to the original message and the response message. Including the following steps:
- the marked message is sent to the primary module and the standby module respectively.
- the received message is processed by the main module.
- the received tagged message is cached by the standby module.
- the primary module sends the processing result of the message and the label binding of the corresponding message to the standby module.
- the processing result of the message sent by the active module includes a response message corresponding to the processed message, and does not directly carry data that needs to be backed up by the standby module.
- the standby module After receiving the response message sent by the active module, the standby module sends the response message. D6. After receiving the response message and the binding flag sent by the active module, the standby module calculates data that needs to be backed up according to the response message, and performs data backup according to the calculated data, that is, changes internal state data; The cached message corresponding to the tag is deleted according to the bound tag.
- the response message sent by the primary module to the standby module is a confirmation message confirming that the user A activates the service B, and then the standby message is used.
- the module can calculate the data to be backed up according to the response message as the status data of the service B of the user A (the status is enabled), and perform data backup according to the modification, that is, the status data of the service B of the user A is modified. .
- step and step D5 may be performed in parallel or sequentially. Except for steps D4 and D6, the above steps can be performed by referring to the corresponding steps in the third embodiment.
- a person skilled in the art can understand that all or part of the steps of the foregoing embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium, and the type of the storage medium can be Includes: Read Only Memory (ROM: Read Only Memory). Random Access Memory (RAM), disk or optical disk.
- ROM Read Only Memory
- RAM Random Access Memory
- disk or optical disk optical disk.
- an application processing system mainly includes:
- the message distribution module 101 is configured to receive a message that needs to be processed; to identify the received message as an identifiable mark; and send the marked message to the primary module 102 and the standby module 103, respectively.
- the main module 102 is configured to process the received tagged message, and send the processing result of the message and the tag binding of the corresponding message to the standby module 103;
- the backup module 103 is configured to cache the received tagged message, and after receiving the processing result sent by the main module 102 and the bound tag, perform data backup according to the received processing result, and according to the bound
- the tag deletes the cached message corresponding to the tag.
- the active module or the standby module may be further configured to send a response message corresponding to the message processed by the active module.
- the specific data exchange and processing logic can be designed with reference to the foregoing method embodiments.
- the standby module may adopt the following structure, including:
- a cache unit configured to cache the received tagged message
- the processing unit is configured to obtain a response message sent by the active module and a bound tag, calculate data that needs to be backed up according to the response message, perform data backup according to the calculated data, and delete the cached in the cache unit according to the bound tag.
- the message corresponding to the tag is configured to obtain a response message sent by the active module and a bound tag, calculate data that needs to be backed up according to the response message, perform data backup according to the calculated data, and delete the cached in the cache unit according to the bound tag. The message corresponding to the tag.
- the message distribution module is a stateless module, its redundant deployment is very simple, and multiple settings can be used.
- the message distribution modules of each redundant deployment can be directly used.
- two message distribution modules can be deployed for alternate switching usage, which can be referred to as a message distribution master module and a message distribution standby module, respectively, depending on the enabled situation.
- One or any combination of the message distribution module, the main module, and the standby module in the application processing system of the embodiment of the present invention may be respectively deployed on the same or different computing nodes (Node, hereinafter abbreviated as N).
- N computing nodes
- the redundant deployment of the message distribution module can be as follows:
- two message distribution modules are deployed on different compute nodes (N3 and N4) than the primary module (deployed on N1) and the standby module (deployed on N2).
- the solid line connected to the message distribution module on N3 in FIG. 8 indicates the case when the module is the message distribution main module.
- the message distribution module on N4 is a message distribution standby module; the dotted line connected with the message distribution module on N4 indicates This module is used when the message is distributed to the main module.
- the message distribution module on N3 is a message distribution backup module.
- one of the active module and the message distribution module may be deployed on the same computing node (N1), and one of the standby module and the message distribution module may be deployed to another computing node (N2).
- the solid line connected to the message distribution module on N1 in FIG. 9 indicates that the module is a message distribution main module.
- the message distribution module on N2 is a message distribution backup module; and the solid line connected to the message distribution module on N2.
- the message distribution module on N1 is a message distribution standby module.
- the technical solution of the embodiment of the present invention can mark the message so that the standby module can know which messages are processed by the main module when receiving the processing result and the bound tag, and the standby module is upgraded mainly when the main use is abnormal.
- the backup module After the module is used, if the backup module has obtained backup data, the backup data is complete; if the backup data has not been obtained, the message in the cache (that is, the message that has not received the backup data) can be processed to solve the unprocessed The problem of missing messages or incomplete backup data.
- sending messages to the active and standby modules simultaneously enables message caching and processing messages to be performed in parallel, which improves system performance.
- the message distribution module does not need to save messages, and is easy to be redundant, thereby avoiding usability problems caused by a single point of failure of the message service. Or redundant complexity.
- Asynchronous communication can be used between the active and standby modules to further improve system performance.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
- Retry When Errors Occur (AREA)
Description
数据备份方法与应用处理系统
本申请要求于 2007 年 12 月 11 日提交中国专利局、 申请号为 200710198608.X, 发明名称为 "数据备份方法与应用处理系统" 的中国专利申 请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及数据备份技术领域, 具体涉及数据备份方法与应用处理系统。 背景技术
目前, 在很多关键应用中都要求处理系统具有非常高的可用性 (HA: Highly Available ), 例如电信系统、 银行系统和账单系统等, 这些系统需要在 任何时间都是可用的, 同时还要保证响应的速度。 为确保系统的高可用性, 往 往对系统中的关键模块进行冗余配置,使得当该模块不能正常工作的时候,对 应的冗余模块可以接替其工作继续提供应用服务。通常,将正常工作的模块称 为主用 (Active )模块, 将冗余模块称为备用 (Standby )模块, 显然这两个名 称是基于模块的使用状态而言的,在主用模块发生故障时, 业务处理切换到原 来的备用模块, 此时备用模块即升级为主用模块, 而原来的主用模块则停止运 行或降级为备用模块, 以便进行维修或更换等处理。
一般情况下主用模块的关键状态信息等数据需要及时备份到备用模块中, 以便备用模块在升级为主用模块的时候, 能够继续不间断工作。 目前, 主要有 以下两种方法来进行运行中的数据备份:
一、 检查点 (CKPT: Checkpoint )服务
检查点服务允许进程对运行数据进行备份,以便于故障恢复时可以恢复到 最后正常运行时的状态。业界定义了 Checkpointing机制进行运行数据的保存, 每次保存的运行数据称为 Checkpoint检查点。 Checkpointing即表示利用业务 运行时通过打点将运行数据保存起来的一种机制, 参考图 1 , 主用模块在运行 时不断将工作信息记录到检查点, 主备倒换后,备用模块从检查点读取当前的 工作记录信息, 即可开始正常工作。
本发明的发明人在对此方法的研究和实践过程中发现,通常会有很多请求 消息发送到主用模块中等待处理,如果主用模块突然发生严重故障, 那么这些
未处理消息将会丟失; 并且, 对于已经处理的消息, 若主用模块尚未完成备份 就出现严重问题, 在还未备份的情况下会造成数据无备份,在备份正在进行的 情况下则会导致备份不完整, 影响备用模块获取数据的可靠性; 此外, 由于备 份数据保存在检查点中 , 备用模块在倒换的时候读取备份数据需要花费时间 , 业务恢复时延比较长, 影响系统性能。
二、 消息队列技术
参考图 2, 该方法是将请求消息发送到消息服务器并緩存在消息队列中, 等待应用模块来获取消息。主用模块从消息队列中获取消息进行处理, 主用模 块处理消息后把相关数据备份到备用模块中。主用模块故障后,备用模块升级 为主用模块并继续获取消息队列中的消息进行处理。
本发明的发明人在对此方法的研究和实践过程中发现,消息服务器成为系 统可用性的关键点, 若消息服务器异常则系统也无法正常工作, 因此需要设计 消息服务器的冗余备份,这相当于将系统的可用性转移到消息服务器的可用性 上, 不能从根本上解决可用性问题; 并且, 主用模块从消息队列获取消息, 若 正在处理或尚未完成数据备份时发生异常,将造成该消息或者该消息引起的数 据变化丟失。
发明内容
本发明实施例提供数据备份方法和应用处理系统,用于解决主用模块在运 行中突发故障时未处理的消息丟失或数据备份不完整的问题。
一种数据备份方法, 包括: 对接收到的消息作可识别的标记; 将标记后的 消息分别发送给主用模块和备用模块;由主用模块对收到的标记后的消息进行 处理, 并且将对消息的处理结果和相应消息的标记绑定发送给备用模块; 由备 用模块对收到的标记后的消息进行緩存,在收到主用模块发送的处理结果和绑 定的标记后,根据所述处理结果进行数据备份, 并且根据与所述处理结果绑定 的标记删除緩存的与标记对应的消息。
一种应用处理系统, 包括至少一个消息分发模块、 主用模块、 备用模块; 所述消息分发模块, 用于接收需要处理的消息; 对接收到的消息作可识别的标 记;将标记后的消息分别发送给所述主用模块和所述备用模块;所述主用模块,
用于对收到的标记后的消息进行处理,并且将对消息的处理结果和相应消息的 标记绑定发送给所述备用模块; 所述备用模块, 用于对收到的标记后的消息进 行緩存,在收到所述主用模块发送的处理结果和绑定的标记后,根据所述处理 结果进行数据备份,并且根据与所述处理结果绑定的标记删除緩存的与标记对 应的消息。
以及, 一种计算机程序产品, 所述计算机程序产品包括计算机程序代码, 当所述计算机程序代码被一个计算机执行的时候,所述计算机程序代码可以使 得所述计算机执行前述数据备份方法中的步骤。
以及, 一种计算机可读存储介质, 所述计算机可读存储介质存储计算机程 序代码, 当所述计算机程序代码被一个计算机执行的时候, 所述计算机程序代 码可以使得所述计算机执行前述数据备份方法中的步骤。
本发明实施例的技术方案中, 消息在标记后被分别发送给主用和备用模 块,备用模块在收到主用模块的处理结果后才删除緩存中与相应标记对应的消 息; 在主用模块突然异常时, 备用模块若已获得备份数据, 则该备份数据是完 整的; 若还未获得备份数据, 可以对没有收到处理结果的消息继续进行处理, 不会造成未处理的消息丟失或备份数据不完整;并且由于消息分发过程并不保 存消息, 因此是无状态的,很容易进行冗余部署,不会带来额外的可用性要求。 附图说明
图 1是现有一种数据备份方法示意图;
图 2是现有另一种数据备份方法示意图;
图 3是本发明实施例一数据备份方法的流程示意图;
图 4是本发明实施例二数据备份方法的流程示意图;
图 5是本发明实施例三数据备份方法的流程示意图;
图 6是本发明实施例四数据备份方法的流程示意图;
图 7是本发明实施例的应用处理系统的基本逻辑结构示意图;
图 8是本发明实施例的应用处理系统的一种部署方式示意图;
图 9是本发明实施例的应用处理系统的另一种部署方式示意图。
具体实施方式
本发明实施例提供数据备份方法,消息在标记后被分别发送给主用和备用 模块,备用模块在收到主用模块的处理结果后才删除緩存中与相应标记对应的 消息。 本发明实施例还提供相应的应用处理系统。 以下分别进行详细说明。 实施例一、 一种数据备份方法, 参考图 3 , 包括如下步骤:
Al、 对接收到的消息作可识别的标记。
可将执行该操作的逻辑单元称为消息分发模块 ,用来接收其他模块发送过 来的需要处理的消息。 所称可识别的标记用于区分消息, 具体可釆用任何能够 令应用模块识别的方式, 例如编号、 加时间戳等。
由于需要实现区分的作用,所使用的标记在一定时间范围内需要保证唯一 性, 以使得处理模块(主用和备用模块)中緩存的消息的标记不重复, 可根据 实际系统的需要设计算法来保证标记的唯一性, 一种可选的方式是: 以编号作 为标记, 所称编号为消息分发模块的启动时间与顺序编排的序列号的组合。
A2、 将标记后的消息分别发送给主用模块和备用模块。
图 3中将发送给主用模块记为 A2a, 将发送给备用模块记为 A2b。
显然消息分发模块所执行的是即时性操作, 不需要保存消息, 因此消息分 发模块是无状态的 (即没有保存数据, 当前的处理过程和之前数据没有关系 ), 因此能够非常方便的进行冗余部署。 例如, 可部署两个消息分发模块, 若其中 之一发生故障, 则直接使用另一个进行消息编号和分发即可, 消息分发模块的 主用和备用之间无需数据关联。
A3a、 由主用模块对收到的标记后的消息进行处理。
此处理过程可按照该模块提供的应用功能执行, 本实施例中不作限定。 A3b、 由备用模块对收到的标记后的消息进行緩存。
由于标记后的消息被分别发送给主用模块和备用模块, 因此, 主用模块的 消息处理与备用模块的消息緩存可并行的执行。
A4、 由主用模块将对消息的处理结果和相应消息的标记绑定发送给备用 模块。
所称对消息处理的结果,指主用模块进行消息处理后发生的数据变化或生 成的结果等与消息处理相关的信息; 本实施例中, 以发生的数据变化为例, 主
用模块发送的对消息的处理结果为需要备用模块进行备份的数据。 主用模块可以在每处理完成一个消息后进行一次数据备份, 当然, 也可以 进行批备份, 即,将对一个以上消息的处理结果和相应消息的标记的列表绑定 发送给备用模块。
主用模块可釆用同步或异步通信方式将标记和处理结果绑定同时发送给 备用模块。 为进一步的提高系统性能, 具体可选择异步通信方式。
A5、 由备用模块在收到主用模块发送的处理结果和绑定的标记后, 根据 处理结果进行数据备份,并且根据所绑定的标记删除緩存的与该标记对应的消 息。
本实施例中, 主用模块发送的处理结果即为备份数据, 因此备用模块可直 接进行备份, 此时由所绑定的标记对应的消息引起的数据变化已被备份保存, 因此备用模块即可从緩存中删除相应的消息。当主用模块突发故障导致主备倒 换时, 备用模块只需根据所緩存的消息, 继续处理即可。
本发明实施例使得主用模块突然异常时,备用模块若已获得备份数据, 则 该备份数据是完整的; 若还未获得备份数据, 可以对没有收到处理结果的消息 继续进行处理, 不会造成未处理的消息丟失或备份数据不完整; 并且主备倒换 时,备用模块是从自身緩存的消息继续进行处理, 因此无需消耗额外的业务恢 复时间, 系统响应性能好。 实施例二、 一种数据备份方法, 参考图 4, 本实施例与实施例一相比增加 了主用模块发送响应消息的处理, 适用于需要返回响应的应用处理情况。 包括 如下步骤:
Bl、 对接收到的消息作可识别的标记。
B2、 将标记后的消息分别发送给主用模块和备用模块。
图 4中将发送给主用模块记为 B2a, 将发送给备用模块记为 B2b。
B3a、 由主用模块对收到的标记后的消息进行处理。
B3b、 由备用模块对收到的标记后的消息进行緩存。
B4、 由主用模块将需要备用模块进行备份的数据和相应消息的标记绑定 发送给备用模块。
B5a、 由主用模块在确认需要进行备份的数据发送到备用模块后, 发送与 所处理消息对应的响应消息。
基于模块间具体使用的通信模式,主用模块可以釆用不同的方式确认内容 已发送到备用模块。 例如, 若主用模块与备用模块之间釆用底层可靠通信, 则 主用模块发送成功, 即可确认备用模块收到; 再如, 若主用模块与备用模块之 间的底层通信是不可靠的,也可釆用在通信层面的确认机制, 即由备用模块在 收到主用模块发送的内容后, 向主用模块返回确认信息, 主用模块即可确认备 用模块收到, 从而发送响应消息给该响应消息的接收者(例如, 向消息分发模 块发送请求消息的模块 )。
B5b、 由备用模块在收到主用模块发送的处理结果和绑定的标记后, 根据 处理结果进行数据备份,并且根据所绑定的标记删除緩存的与该标记对应的消 息。
上述步骤中除步骤 B5a外, 均可参照实施例一中的相应步骤执行。 实施例 一可适用于无需对消息进行响应的情况,本实施例则适用于需要对请求消息进 行响应的情况。 实施例三、 一种数据备份方法, 参考图 5, 本实施例与实施例一相比增加 了备用模块发送响应消息的处理, 适用于需要返回响应的应用处理情况。 包括 如下步骤:
Cl、 对接收到的消息作可识别的标记。
C2、 将标记后的消息分别发送给主用模块和备用模块。
图 5中将发送给主用模块记为 C2a, 将发送给备用模块记为 C2b。
C3a、 由主用模块对收到的标记后的消息进行处理。
C3b、 由备用模块对收到的标记后的消息进行緩存。
C4、 由主用模块将对消息的处理结果和相应消息的标记绑定发送给备用 模块。
本实施例中,主用模块发送的对消息的处理结果除了包含需要备用模块进 行备份的数据以外, 还包含与所处理消息对应的响应消息。
C5、 由备用模块在收到主用模块发送的响应消息后, 发送该响应消息。
本实施例中由备用模块来发送响应消息, 即可无需像实施例二中一样, 由 主用模块在确认备用模块已收到后再发送响应消息。
C6、 由备用模块在收到主用模块发送的处理结果和绑定的标记后, 根据 处理结果中的需要进行备份的数据进行数据备份,并且根据所绑定的标记删除 緩存的与该标记对应的消息。 本步骤与步骤 C5可并行执行, 也可顺序执行。
上述步骤中除步骤 C4、 C5外, 均可参照实施例一中的相应步骤执行。 实施例四、 一种数据备份方法, 参考图 6, 本实施例与实施例三相比区别 之处在于,备用模块的备份数据不直接来自主用模块而是根据原消息和响应消 息生成。 包括如下步骤:
Dl、 对接收到的消息作可识别的标记。
D2、 将标记后的消息分别发送给主用模块和备用模块。
图 6中将发送给主用模块记为 D2a, 将发送给备用模块记为 D2b。
D3a、 由主用模块对收到的标记后的消息进行处理。
D3b、 由备用模块对收到的标记后的消息进行緩存。
D4、 由主用模块将对消息的处理结果和相应消息的标记绑定发送给备用 模块。
本实施例中,主用模块发送的对消息的处理结果包含与所处理消息对应的 响应消息, 而不直接携带需要备用模块进行备份的数据。
D5、 由备用模块在收到主用模块发送的响应消息后, 发送该响应消息。 D6、 由备用模块在收到主用模块发送的响应消息和绑定的标记后, 根据 响应消息计算出需要进行备份的数据,按照计算出的数据进行数据备份, 即改 变内部的状态数据; 并且根据所绑定的标记删除緩存的与该标记对应的消息。
例如, 在电信应用系统中, 若主用模块收到的消息为用户 A开通业务 B的 请求, 主用模块处理后发送给备用模块的响应消息为确认用户 A开通业务 B的 确认消息,则备用模块即可根据该响应消息计算出需要进行备份的数据为用户 A的业务 B的状态数据(状态为已开通), 并据此进行数据备份, 即修改用户 A 的业务 B的状态数据为已开通。
本步骤与步骤 D5可并行执行, 也可顺序执行。
上述步骤中除步骤 D4、 D6外, 均可参照实施例三中的相应步骤执行。 本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质的种类可以包括: 只读存储器 (ROM: Read Only Memory ). 随机存取存储器(RAM: Random Access Memory )、磁盘或光盘等。 下面对本发明实施例的应用处理系统进行详细说明。
参考图 7 , 本发明实施例的应用处理系统, 主要包括:
消息分发模块 101 , 用于接收需要处理的消息; 对接收到的消息作可识别 的标记; 将标记后的消息分别发送给主用模块 102和备用模块 103。
主用模块 102, 用于对收到的标记后的消息进行处理, 并且将对消息的处 理结果和相应消息的标记绑定发送给备用模块 103;
备用模块 103 , 用于对收到的标记后的消息进行緩存,在收到主用模块 102 发送的处理结果和绑定的标记后,根据收到的处理结果进行数据备份, 并且根 据绑定的标记删除緩存的与该标记对应的消息。
当然,对应于应用处理系统中需要返回响应消息的情形, 主用模块或备用 模块还可进一步用于,发送与主用模块所处理消息对应的响应消息。具体数据 交换和处理逻辑可参照前述方法实施例设计。
比如,若主用模块发送的对消息的处理结果包括与所处理消息对应的响应 消息; 则备用模块可釆用如下结构, 包括:
緩存单元, 用于对收到的标记后的消息进行緩存;
处理单元, 用于获取主用模块发送的响应消息和绑定的标记,根据响应消 息计算出需要进行备份的数据,按照计算出的数据进行数据备份; 根据绑定的 标记删除緩存单元中緩存的与该标记对应的消息。
本发明实施例应用处理系统中的消息分发模块可以有一个以上,以便于切 换使用。 由于消息分发模块是无状态模块, 因此, 其冗余部署非常简单, 多个 设置即可, 在切换时, 各个冗余部署的消息分发模块均可直接使用。 例如, 可 部署两个消息分发模块, 用于交替切换使用,根据启用情况可分别称为消息分 发主用模块和消息分发备用模块。
本发明实施例应用处理系统中的消息分发模块、主用模块、备用模块的其 中之一或任意组合可分别部署于相同或不同的计算节点 (Node, 以下简记为 N )。 考虑到运行环境例如硬件和通信故障等, 主用模块和备用模块宜各部署 在不同计算节点上; 消息分发模块的冗余部署则可选择如下两种方式:
①参考图 8, 将两个消息分发模块分别部署在与主用模块(部署于 N1 )和 备用模块(部署于 N2 )不同的计算节点上(N3和 N4 )。 图 8中与 N3上消息分发 模块连接的实线表示该模块为消息分发主用模块时的情形, 此时 N4上的消息 分发模块为消息分发备用模块; 与 N4上消息分发模块连接的虚线表示该模块 为消息分发主用模块时的情形, 此时 N3上的消息分发模块为消息分发备用模 块。
②参考图 9, 考虑到节省硬件成本, 可以将主用模块与消息分发模块之一 部署于同一计算节点(N1 ), 将备用模块与消息分发模块之一部署于另一计算 节点 (N2 )。 图 9中与 N1上消息分发模块连接的实线表示该模块为消息分发主 用模块时的情形, 此时 N2上的消息分发模块为消息分发备用模块; 与 N2上消 息分发模块连接的实线表示该模块为消息分发主用模块时的情形, 此时 N1上 的消息分发模块为消息分发备用模块。
本发明实施例的技术方案通过对消息进行标记使得备用模块在收到处理 结果和绑定的标记的时候能够获知主用模块处理了哪些消息,在主用突然异常 情况下, 备用模块升级为主用模块后, 备用模块若已获得备份数据, 则该备份 数据是完整的; 若还未获得备份数据, 可以对緩存中的消息(即没有收到备份 数据的消息)继续进行处理, 解决未处理消息丟失或备份数据不完整的问题。 并且,对主备模块同时发送消息使得消息緩存和处理消息能够并行进行,提高 了系统的性能; 同时, 消息分发模块无需保存消息, 容易做到冗余, 避免消息 服务单点故障造成的可用性问题或冗余的复杂度。主用和备用模块之间可釆用 异步通信方式, 能够进一步的提高系统性能。
以上对本发明实施例所提供的数据备份方法和应用处理系统进行了详细 施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于本领域
的一般技术人员,依据本发明的思想, 在具体实施方式及应用范围上均会有改 变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。
Claims
1、 一种数据备份方法, 其特征在于, 包括:
对接收到的消息作可识别的标记;
将标记后的消息分别发送给主用模块和备用模块;
由主用模块对收到的标记后的消息进行处理,并且将对消息的处理结果和 相应消息的标记绑定发送给备用模块;
由备用模块对收到的标记后的消息进行緩存,在收到主用模块发送的处理 结果和绑定的标记后,根据所述处理结果进行数据备份, 并且根据与所述处理 结果绑定的标记删除緩存的与标记对应的消息。
2、 根据权利要求 1所述的数据备份方法, 其特征在于, 所述对接收到的消 息作可识别的标记具体为: 对接收到的消息进行编号, 所述编号为启动接收的 时间与顺序编排的序列号的组合。
3、 根据权利要求 1所述的数据备份方法, 其特征在于, 所述主用模块将对 消息的处理结果和相应消息的标记绑定发送给备用模块具体为:主用模块将对 消息的处理结果和相应消息的标记绑定,釆用异步或同步通信方式发送给备用 模块。
4、 根据权利要求 1所述的数据备份方法, 其特征在于, 所述主用模块将对 消息的处理结果和相应消息的标记绑定发送给备用模块具体为:主用模块将对 一个或一个以上消息的处理结果和相对应消息的标记的列表绑定发送给备用 模块。
5、 根据权利要求 1 ~ 4任意一项所述的数据备份方法, 其特征在于: 所述 主用模块发送的对消息的处理结果包括需要备用模块进行备份的数据。
6、 根据权利要求 5所述的数据备份方法, 其特征在于, 还包括: 由主用模块在确认所述需要进行备份的数据发送到备用模块后,发送与所 处理消息对应的响应消息。
7、 根据权利要求 1 ~ 4任意一项所述的数据备份方法, 其特征在于: 所述 主用模块发送的对消息的处理结果包括需要备用模块进行备份的数据和与所 处理消息对应的响应消息;
所述数据备份方法还包括:
由备用模块在收到所述响应消息后, 发送所述响应消息。
8、 根据权利要求 1 ~ 4任意一项所述的数据备份方法, 其特征在于: 所述 主用模块发送的对消息的处理结果包括与所处理消息对应的响应消息;
所述由备用模块根据处理结果进行数据备份具体为:由备用模块根据收到 的响应消息计算出需要进行备份的数据, 按照计算出的数据进行数据备份; 所述数据备份方法还包括:
由备用模块在收到所述响应消息后, 发送所述响应消息。
9、 一种应用处理系统, 其特征在于, 包括至少一个消息分发模块、 主用 模块、 备用模块;
所述消息分发模块, 用于接收需要处理的消息; 对接收到的消息作可识别 的标记; 将标记后的消息分别发送给所述主用模块和所述备用模块;
所述主用模块, 用于对收到的标记后的消息进行处理, 并且将对消息的处 理结果和相应消息的标记绑定发送给所述备用模块;
所述备用模块, 用于对收到的标记后的消息进行緩存,在收到所述主用模 块发送的处理结果和绑定的标记后,根据所述处理结果进行数据备份, 并且根 据与所述处理结果绑定的标记删除緩存的与标记对应的消息。
10、 根据权利要求 9所述的应用处理系统, 其特征在于: 所述主用模块发 送的对消息的处理结果包括需要备用模块进行备份的数据;
所述主用模块还用于, 在确认所述需要进行备份的数据发送到备用模块 后, 发送与所处理消息对应的响应消息。
11、 根据权利要求 9所述的应用处理系统, 其特征在于: 所述主用模块发 送的对消息的处理结果包括与所处理消息对应的响应消息;
所述备用模块还用于, 在收到所述响应消息后, 发送所述响应消息。
12、 根据权利要求 9所述的应用处理系统, 其特征在于: 所述主用模块发 送的对消息的处理结果包括与所处理消息对应的响应消息;
所述备用模块包括:
緩存单元, 用于对收到的标记后的消息进行緩存;
处理单元, 用于获取所述主用模块发送的响应消息和绑定的标记,根据所 述响应消息计算出需要进行备份的数据,按照计算出的数据进行数据备份; 根 据所述绑定的标记删除緩存的与标记对应的消息。
13、 根据权利要求 9 ~ 12任意一项所述的应用处理系统, 其特征在于: 所述消息分发模块为两个, 分别为消息分发主用模块和消息分发备用模 块, 用于交替切换使用。
14、 根据权利要求 13所述的应用处理系统, 其特征在于:
所述消息分发模块、 主用模块、备用模块分别部署于不同的计算节点; 或 者,
所述主用模块与消息分发模块之一部署于同一计算节点 ,所述备用模块与 消息分发模块之一部署于另一计算节点。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710198608.XA CN100574220C (zh) | 2007-12-11 | 2007-12-11 | 数据备份方法与应用处理系统 |
CN200710198608.X | 2007-12-11 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2009074031A1 true WO2009074031A1 (fr) | 2009-06-18 |
Family
ID=39449084
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2008/072183 WO2009074031A1 (fr) | 2007-12-11 | 2008-08-28 | Procédé de sauvegarde de données et système de traitement d'application |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN100574220C (zh) |
WO (1) | WO2009074031A1 (zh) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100574220C (zh) * | 2007-12-11 | 2009-12-23 | 华为技术有限公司 | 数据备份方法与应用处理系统 |
KR102180474B1 (ko) * | 2013-11-20 | 2020-11-18 | 삼성전자주식회사 | 백업 정보를 디스플레이 하여 이미지 파일을 관리하는 장치 및 방법 |
CN105049258B (zh) * | 2015-08-14 | 2019-02-26 | 深圳市傲冠软件股份有限公司 | 网络容灾系统的数据传输方法 |
CN105591896A (zh) * | 2015-08-28 | 2016-05-18 | 杭州华三通信技术有限公司 | 报文转发方法及装置 |
CN105511310A (zh) * | 2015-11-30 | 2016-04-20 | 马鞍山市示范生产力促进中心有限公司 | 一种应用于轨道交通的计算机系统 |
CN109257404B (zh) * | 2017-07-14 | 2022-04-05 | 迈普通信技术股份有限公司 | 数据备份方法、装置及系统 |
CN109787835B (zh) * | 2019-01-30 | 2021-11-19 | 新华三技术有限公司 | 一种会话备份方法及装置 |
CN110764477A (zh) * | 2019-10-28 | 2020-02-07 | 无锡市经登自控阀门有限公司 | 信号丢失可自行脱管的执行器控制方法 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1812409A (zh) * | 2006-01-16 | 2006-08-02 | 杭州华为三康技术有限公司 | 一种实现主备状态同步的方法和系统 |
CN101038591A (zh) * | 2007-04-11 | 2007-09-19 | 华为技术有限公司 | 数据库同步方法及系统 |
US20070255758A1 (en) * | 2006-04-28 | 2007-11-01 | Ling Zheng | System and method for sampling based elimination of duplicate data |
CN101079742A (zh) * | 2007-07-03 | 2007-11-28 | 中兴通讯股份有限公司 | 容灾归属用户服务器间的数据同步方法及系统 |
CN101183990A (zh) * | 2007-12-11 | 2008-05-21 | 华为技术有限公司 | 数据备份方法与应用处理系统 |
-
2007
- 2007-12-11 CN CN200710198608.XA patent/CN100574220C/zh not_active Expired - Fee Related
-
2008
- 2008-08-28 WO PCT/CN2008/072183 patent/WO2009074031A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1812409A (zh) * | 2006-01-16 | 2006-08-02 | 杭州华为三康技术有限公司 | 一种实现主备状态同步的方法和系统 |
US20070255758A1 (en) * | 2006-04-28 | 2007-11-01 | Ling Zheng | System and method for sampling based elimination of duplicate data |
CN101038591A (zh) * | 2007-04-11 | 2007-09-19 | 华为技术有限公司 | 数据库同步方法及系统 |
CN101079742A (zh) * | 2007-07-03 | 2007-11-28 | 中兴通讯股份有限公司 | 容灾归属用户服务器间的数据同步方法及系统 |
CN101183990A (zh) * | 2007-12-11 | 2008-05-21 | 华为技术有限公司 | 数据备份方法与应用处理系统 |
Also Published As
Publication number | Publication date |
---|---|
CN100574220C (zh) | 2009-12-23 |
CN101183990A (zh) | 2008-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2009074031A1 (fr) | Procédé de sauvegarde de données et système de traitement d'application | |
JP4481498B2 (ja) | 複製サーバのためのプロトコル | |
JP4301849B2 (ja) | 情報処理方法及びその実施システム並びにその処理プログラム並びにディザスタリカバリ方法およびシステム並びにその処理を実施する記憶装置およびその制御処理方法 | |
EP2435916B1 (en) | Cache data processing using cache cluster with configurable modes | |
JP4355674B2 (ja) | リモートコピー方法及びストレージシステム | |
EP1250649B1 (en) | Crash recovery without complete remirror | |
US7260625B2 (en) | Data center system and method for controlling the same | |
US7865763B2 (en) | Data replication method | |
JP4341571B2 (ja) | 記憶装置システムおよびその制御方法、制御プログラム | |
JP5343436B2 (ja) | 情報管理システム | |
US20100268687A1 (en) | Node system, server switching method, server apparatus, and data takeover method | |
JP3877519B2 (ja) | システム回復方法およびその実施計算機システム並びにその処理プログラムを記録した記録媒体 | |
US7293197B2 (en) | Non-volatile memory with network fail-over | |
US20080046644A1 (en) | Method and System to Provide a Redundant Buffer Cache for Block Based Storage Servers | |
US8499133B2 (en) | Cache management for increasing performance of high-availability multi-core systems | |
WO2022033269A1 (zh) | 数据处理的方法、设备及系统 | |
JP5154843B2 (ja) | クラスタシステム、計算機、および障害回復方法 | |
WO2011103791A1 (zh) | 备份存储系统、备份系统及数据备份方法和恢复方法 | |
JP2006058960A (ja) | 冗長構成のサーバシステムにおける同期化方法及びシステム | |
JP4721057B2 (ja) | データ管理システム,データ管理方法及びデータ管理用プログラム | |
JP4452494B2 (ja) | 複数リモートストレージでのリモートコピー停止後のデータ同期化方式 | |
JP4131621B2 (ja) | 分散ミラードディスクシステム | |
JP3471913B2 (ja) | コンピュータシステム | |
JP4193754B2 (ja) | データ二重化方法とプログラム | |
JP2001290669A (ja) | フェールオーバ管理システム、フェールオーバ管理装置、方法、及びコンピュータ読み取り可能な記録媒体 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08800695 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 08800695 Country of ref document: EP Kind code of ref document: A1 |