WO2017016196A1 - 同步数据方法、装置及*** - Google Patents
同步数据方法、装置及*** Download PDFInfo
- Publication number
- WO2017016196A1 WO2017016196A1 PCT/CN2016/070431 CN2016070431W WO2017016196A1 WO 2017016196 A1 WO2017016196 A1 WO 2017016196A1 CN 2016070431 W CN2016070431 W CN 2016070431W WO 2017016196 A1 WO2017016196 A1 WO 2017016196A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- control unit
- main control
- state
- standby
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000001360 synchronised effect Effects 0.000 claims abstract description 174
- 238000012545 processing Methods 0.000 claims abstract description 119
- 238000012790 confirmation Methods 0.000 claims description 64
- 230000004048 modification Effects 0.000 claims description 8
- 238000012986 modification Methods 0.000 claims description 8
- 230000002159 abnormal effect Effects 0.000 abstract description 9
- 238000012423 maintenance Methods 0.000 abstract description 6
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 13
- 238000011084 recovery Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 238000010977 unit operation Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
-
- 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/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/084—Configuration by using pre-existing information, e.g. using templates or copying from other elements
- H04L41/0846—Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
Definitions
- the present invention relates to the field of communications, and in particular to a method, device and system for synchronizing data.
- the Synchronous Digital Hierarchy (SDH) device In the Synchronous Digital Hierarchy (SDH) device, the Dense Wavelength Division Multiplexing (DWDM) device, the Packet Transport Network (PTN) device, and the network control protocol ( The Network Control Protocol (NCP) device and the Optical Transport Network (OTN) device have high real-time and reliability requirements for the services carried by the main control unit.
- the main control unit often has one or more standby main control units, that is, the synchronization of the configuration data includes two contents: data synchronization between the main control unit and the standby main control unit, and the synchronization is a copy and backup operation.
- the main control unit synchronizes with the data of the business processing unit, and this synchronization is an action of issuing and responding.
- the two data synchronizations are independently operated. Although the processing is simple, the effect is often poor. For example, when the main control unit sends data, if the main control unit fails, the data configuration of the main control is not synchronized successfully, and the standby main control unit does not have this data. The data is abnormal, causing the device to run abnormally, or even causing service interruption and failure to recover. These problems caused by data inconsistency are often very complicated and difficult to locate and eliminate, which will greatly increase the manpower and material resources of equipment maintenance and cause waste of resources.
- the present invention provides a method, apparatus and system for synchronizing data to at least solve the problem of abnormal faults caused by data out of synchronization in the related art.
- a data synchronization method including:
- the main control unit receives the application status data sent by the service processing unit, the main control unit modifies the application status data into unsynchronized status data, and the main control unit synchronizes the unsynchronized status data. Giving the business processing unit;
- the main control unit modifies the unsynchronized state data to be synchronizing state data, and the main control unit synchronizes the synchronizing state data to the standby main control unit;
- the primary control unit receives an acknowledgement message, the acknowledgement message includes a confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the
- the data in the synchronized state is the data in the synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing list yuan.
- the active main control unit receives an active/standby switching event, and sends the active/standby switching event to the service processing unit.
- the primary control unit receives a synchronization completion event sent by the service processing unit.
- the active main control unit receives an active/standby switching event, and sends the active/standby switching event to the service processing unit.
- the main control unit receives the synchronization state data, wherein the synchronization state data is the service processing unit. Modifying the unsynchronized state data or the application state data;
- the main control unit modifies the synchronization status data to unsynchronized status data, and the main control unit sends the unsynchronized status data to the standby main control unit;
- the primary control unit receives an acknowledgement message, the acknowledgement message includes a confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the
- the data of the unsynchronized state is data of the synchronized state
- the main control unit synchronizes the data of the synchronized state to the service processing unit.
- a data synchronization method including:
- the main control unit receives an online event of the standby main control unit, the main control unit modifies the unsynchronized status data to the synchronized state, and the main control unit sends the synchronizing status data to the standby Main control unit
- the primary control unit receives an acknowledgement message, the acknowledgement message includes a confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the
- the data in the synchronized state is the data in the synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the method includes:
- the active main control unit sends a synchronization completion event to the standby main control unit, and the standby main control unit deletes the local non-synchronized state data.
- a data synchronization apparatus including:
- the first receiving module is configured to receive, by the main control unit, application status data sent by the service processing unit, where the main control unit modifies the application status data into unsynchronized status data, and the main control unit
- the unsynchronized state data is synchronized to the service processing unit
- a first modifying module configured to: the primary control unit modifies the unsynchronized state data to be synchronized state data, and the primary MME synchronizes the synchronized state data to the standby MME;
- a first confirmation module configured to receive, by the primary control unit, an acknowledgement message, where the confirmation message includes a confirmation content that the standby control unit modifies the synchronized state data to the synchronized state data, the primary Synchronizing the synchronized state data to the service processing unit with a master unit.
- the first switching module is configured to receive the active/standby switching event by the active main control unit, and send the active/standby switching event to the service processing unit.
- the second receiving module is configured to receive, when the data states in the service processing unit are in a synchronized state, the primary control unit receives a synchronization completion event sent by the service processing unit.
- the second switching module is configured to receive the active/standby switching event by the active main control unit, and send the active/standby switching event to the service processing unit.
- a third receiving module configured to: when the service processing unit includes the unsynchronized state data or the application state data, the main control unit receives the synchronization state data, where the synchronization state is Data is that the service processing unit modifies the unsynchronized state data or the application state data;
- a second modification module configured to: the main control unit modifies the synchronization status data into unsynchronized status data, and the main control unit sends the unsynchronized status data to the standby main control unit;
- a second confirmation module configured to receive, by the main control unit, an acknowledgement message, where the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data to the synchronized state data, the main The data of the unsynchronized state is modified by the main control unit to be the data of the synchronized state, and the main control unit synchronizes the data of the synchronized state to the service processing unit.
- a data synchronization apparatus including:
- a third modification module configured to receive an online event of the standby main control unit, wherein the main control unit modifies the unsynchronized state data to the synchronization state, and the main control unit sends the ongoing Synchronizing status data to the standby master unit;
- a third confirmation module configured to receive, by the main control unit, an acknowledgement message, where the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data to the synchronized state data, the main The data of the synchronization state is modified by the main control unit to be synchronized data, and the main control unit synchronizes the data of the synchronized state to the service processing unit.
- the apparatus comprises:
- the primary control unit is configured to send a synchronization completion event to the standby main control unit, and the standby main control unit deletes the local non-synchronized state data.
- a data synchronization system including: an active main control unit, a standby main control unit, and a service processing unit;
- the main control unit receives application status data sent by the service processing unit, and the main control unit The application status data is modified to the unsynchronized status data, and the main control unit synchronizes the unsynchronized status data to the service processing unit;
- the main control unit modifies the unsynchronized state data to be synchronizing state data, and the main control unit synchronizes the synchronizing state data to the standby main control unit;
- the primary control unit receives an acknowledgement message, the acknowledgement message includes a confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the
- the data in the synchronized state is the data in the synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the main control unit receives the application status data sent by the service processing unit, and the main control unit modifies the application status data into unsynchronized status data, and the main control unit unsynchronizes the status data. Synchronizing to the service processing unit; the main control unit modifies the unsynchronized status data to the synchronization status data, and the main control unit synchronizes the synchronization status data to the standby main control unit; the main control unit Receiving a confirmation message, the confirmation message includes the confirmation content that the standby main control unit modifies the synchronization state data to the synchronization state data, and the main control unit modifies the data in the synchronization state to be the synchronized state data, where The main control unit synchronizes the synchronized state data to the service processing unit, solves the problem of abnormal failure caused by data non-synchronization, realizes consistency of data of each unit, and saves maintenance cost.
- FIG. 1 is a flow chart 1 of a data synchronization method according to an embodiment of the present invention.
- FIG. 2 is a second flowchart of a data synchronization method according to an embodiment of the present invention.
- FIG. 3 is a structural block diagram 1 of a data synchronization apparatus according to an embodiment of the present invention.
- FIG. 4 is a structural block diagram 2 of a data synchronization apparatus according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a normal data synchronization process according to a preferred embodiment of the present invention.
- FIG. 6 is a schematic diagram of an active/standby switching process according to a preferred embodiment of the present invention.
- FIG. 7 is a schematic diagram of an active/standby switchover process in a normal data synchronization process performed by an active/standby NCP according to a preferred embodiment of the present invention
- FIG. 8 is a schematic diagram of a flow of data batch synchronization by inserting a standby NCP according to a preferred embodiment of the present invention.
- FIG. 9 is a schematic diagram of an active/standby switchover process occurring during data synchronization between an active and standby device according to a preferred embodiment of the present invention.
- FIG. 1 is a flowchart 1 of a data synchronization method according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
- Step S102 the main control unit receives the application status data sent by the service processing unit, and the main control unit modifies the application status data into unsynchronized status data, and the main control unit synchronizes the unsynchronized status data to The business processing unit;
- Step S104 the main control unit modifies the unsynchronized state data into the synchronization state data, and the main control unit synchronizes the synchronization state data to the standby main control unit;
- Step S106 the main control unit receives an acknowledgement message, the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data, and the main control unit modifies the synchronization state.
- the data is data in a synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the main control unit receives the application status data sent by the service processing unit, and the main control unit modifies the application status data into unsynchronized status data, and the main control unit synchronizes the unsynchronized status data.
- Sending to the service processing unit the main control unit modifies the unsynchronized state data to the synchronization state data, and the main control unit synchronizes the synchronization state data to the standby main control unit, and the main control unit receives a confirmation message, the confirmation message includes the confirmation content that the standby main control unit modifies the synchronization state data to the synchronization state data, and the main control unit modifies the data of the synchronization state to be synchronized data, the main The main control unit synchronizes the synchronized state data to the service processing unit, solves the problem of abnormal fault caused by data unsynchronization, realizes consistency of data of each unit, and saves maintenance cost.
- the active main control unit receives the active/standby switchover event, and sends the active/standby switchover event to the service processing unit. If the data states in the service processing unit are all synchronized, the The active master unit receives the synchronization completion event sent by the service processing unit.
- the main control unit receives the active/standby switching event, and sends the active/standby switching event to the service processing unit, where the service processing unit includes the unsynchronized status data or the application status data.
- the main control unit receives the synchronization status data, wherein the synchronization status data is that the service processing unit modifies the unsynchronized status data or the application status data, and the main control unit synchronizes the status.
- the data is modified to the unsynchronized state data, and the main control unit sends the unsynchronized status data to the standby main control unit, and the main control unit receives the confirmation message, and the confirmation message includes the standby main control unit to be synchronizing
- the status data modifies the confirmation content of the synchronized state data
- the main control unit modifies the data of the unsynchronized state to be the data of the synchronized state
- the main control unit synchronizes the data of the synchronized state to the service processing unit. .
- FIG. 2 is a data synchronization method according to an embodiment of the present invention.
- Flowchart 2 as shown in Figure 2, the process includes the following steps:
- Step S202 the main control unit receives an online event of the standby main control unit, and the main control unit modifies the unsynchronized state data to the synchronization state, and the main control unit sends the synchronization status data to the standby main unit.
- Step S204 the main control unit receives an acknowledgement message, the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data to the synchronized state data, and the main control unit modifies the synchronization state.
- the data is data in a synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the main control unit receives the standby main control unit online event, the main control unit changes the unsynchronized status data to the synchronized state, and the main control unit sends the synchronous status data to the standby.
- a main control unit after the main control unit receives the confirmation that the standby main control unit modifies the synchronization status data to the synchronized status data, the main control unit modifies the data in the synchronization status to be synchronized Data, the main control unit synchronizes the synchronized state data to the service processing unit, solves the problem of abnormal failure caused by data non-synchronization, realizes consistency of data of each unit, and saves maintenance cost.
- the method includes: the primary control unit sends a synchronization completion event to the standby primary control unit, the standby The master unit deletes the local non-synchronized status data.
- a data synchronization device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
- the term “module” may implement a combination of software and/or hardware of a predetermined function.
- the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
- FIG. 3 is a structural block diagram 1 of a data synchronization apparatus according to an embodiment of the present invention. As shown in FIG. 3, the apparatus includes:
- the first receiving module 32 is configured to receive, by the main control unit, the application status data sent by the service processing unit, where the main control unit modifies the application status data to the unsynchronized status data, and the main control unit Synchronizing state data to the service processing unit;
- the first modifying module 34 is configured to modify, by the main control unit, the unsynchronized state data to be synchronizing state data, and the main controlling unit synchronizes the synchronizing state data to the standby main control unit;
- the first confirmation module 36 is configured to receive, by the main control unit, an acknowledgement message, where the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data to the synchronized state data, and the main control unit modifies The data in the synchronized state is data in a synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the device further includes: a first switching module, configured to: the primary control unit receives an active/standby switching event, and sends the active/standby switching event to the service processing unit;
- the second receiving module is configured to receive, when the data state in the service processing unit is the synchronized state, the primary control unit receives the synchronization completion event sent by the service processing unit.
- the device further includes: a second switching module, configured to: the primary control unit receives an active/standby switching event, and sends the active/standby switching event to the service processing unit;
- a third receiving module configured to receive, in the case that the service processing unit includes the unsynchronized state data or the application status data, the primary control unit receives the synchronization status data, where the synchronization status data is the service processing The unit modifies the unsynchronized status data or the application status data;
- a second modification module configured to: the main control unit modifies the synchronization status data to the unsynchronized status data, and the main control unit sends the unsynchronized status data to the standby main control unit;
- a second confirmation module configured to receive, by the main control unit, an acknowledgement message, where the confirmation message includes the confirmation content that the standby control unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the
- the data of the unsynchronized state is the data of the synchronized state
- the main control unit synchronizes the data of the synchronized state to the service processing unit.
- FIG. 4 is a structural block diagram 2 of a data synchronization apparatus according to an embodiment of the present invention. As shown in FIG. 4, the apparatus includes:
- the third modification module 42 is configured to receive an online event of the standby main control unit, wherein the main control unit modifies the unsynchronized state data to the synchronization state, and the main control unit sends the synchronization status. Data to the standby master unit;
- the third confirmation module 44 is configured to receive, by the main control unit, an acknowledgement message, where the confirmation message includes the confirmation content that the standby main control unit modifies the synchronized state data to the synchronized state data, and the main control unit modifies The data in the synchronized state is data in a synchronized state, and the master control unit synchronizes the data of the synchronized state to the service processing unit.
- the device further includes:
- the module is deleted, and the main control unit sends a synchronization completion event to the standby main control unit, and the standby main control unit deletes the local non-synchronized state data.
- a data synchronization system including: an active main control unit, a standby main control unit, and a service processing unit;
- the main control unit receives the application status data sent by the service processing unit, and the main control unit modifies the application status data into unsynchronized status data, and the main control unit synchronizes the unsynchronized status data to the Business processing unit;
- the master control unit modifies the unsynchronized state data to the synchronization state data, and the master control unit synchronizes the synchronization state data to the standby master unit;
- the master control unit receives an acknowledgement message, the acknowledgement message includes the confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the data in the synchronized state to be The data of the synchronization state, the main control unit synchronizes the data of the synchronized state to the service processing unit.
- the preferred embodiment provides a data synchronization mechanism for implementing an active main control unit, a standby main control unit, and a service processing list.
- Meta (could exist multiple) data consistency, wherein the main control unit, the standby main control unit, and the service processing unit and the main control unit, the standby main control unit, and the service processing unit in the above embodiments function and function The same, avoid a series of problems caused by data inconsistency.
- the method in the preferred embodiment divides the main control unit into three states: "active state”, “standby state”, “active/standby state”, and "data recovery state”.
- the “active state” means that only the main control unit has no standby main control unit; the “standby state” indicates that there are both the main control unit and the standby main control unit, and the unit is the standby main control unit; "It means that there are both the main control unit and the standby main control unit.
- This unit is the main control unit.
- the data recovery state passes the active/standby switchover, the main control unit and the service processing unit perform a transient state of data recovery. There is no case where there is only a standby master unit and no master master unit. Status negotiation can be performed between the master units in any way.
- the preferred embodiment divides the data to be synchronized into "application status”, "unsynchronized status”, “synchronizing status”, and “synchronized status”, "application status”, “unsynchronized status”, “data”
- the "synchronizing state” and the "synchronized state” are the same as the application state data in the above embodiment, the unsynchronized state data, the synchronizing state data, and the functions and functions of the synchronized state data.
- the data After receiving the application data event of the service processing unit, the data is set to the "unsynchronized state" and saved to the local service and sent to the service processing unit.
- the data sent to the service processing unit carries the status of "unsynchronized status".
- the data sent by the main control unit to the service processing unit can carry not only status information, but also other information, such as unique identification information of the data.
- the standby master unit is the master unit in the "standby state", and handles the following events:
- the main control unit is in the "data recovery state" steps:
- the service processing unit needs to process the service configuration and synchronize the service data to the main control unit as needed. How the service processing unit handles the service configuration is not within the scope of the present invention.
- the service processing unit only communicates with the active main control unit and does not communicate with the standby main control unit.
- the business processing unit handles the following events:
- each unit can perform active/standby switchover at any time. After the active/standby switchover, the new standby master control unit does not need to be restarted, and continuous active/standby switchover can be performed.
- the main control unit is an NCP and the service processing unit is a line card.
- NCP NCP
- the service processing unit is a line card.
- FIG. 5 is a schematic diagram of a normal data synchronization process according to a preferred embodiment of the present invention, as shown in FIG.
- step 1 the line card sends data 1 to the main NCP, and the data 1 is "application status" on the line card.
- Step 2 After receiving the data of the line card, the primary NCP saves to the local area and synchronizes to the line card, and the data 1 is “unsynchronized state” on the primary NCP.
- Step 3 After receiving the data of the primary NCP, the standby NCP saves it to the local area and sends a confirmation to the primary NCP.
- the data 1 is in the "synchronized state" on the standby NCP.
- Step 4 After receiving the confirmation of the standby NCP, the primary NCP modifies the local data to the “synchronized state” and sends it to the line card.
- Step 5 After receiving the data of the primary NCP, the line card modifies the local data to “synchronized state”.
- FIG. 6 is a schematic diagram of performing an active/standby switching process according to a preferred embodiment of the present invention, as shown in FIG. 6.
- Step 1 The master NCP receives the active/standby switchover event and modifies the board as the “standby state”.
- Step 2 The standby NCP receives the active/standby switchover event, and the board is modified to “data recovery state”, and then the active/standby switchover event is sent to the line card.
- Step 3 The line card receives the active/standby switchover event, and changes all the data of the “unsynchronized state” and the “application state” to the “synchronizing state”. In this scenario, all data is "synchronized” and a synchronization completion event is sent to the primary NCP.
- FIG. 7 is a preferred implementation in accordance with the present invention
- the master/slave NCP performs the active/standby switchover process during normal data synchronization, as shown in Figure 7.
- the line card has data 1 and data 2, data 1 is “synchronized state", and data 2 is "unsynchronized state”.
- the primary NCP has data 1 and data 2, data 1 is “synchronized state", and data 2 is "unsynchronized state”.
- the standby NCP has data 1, and the data 1 is "synchronized state”. When the primary NCP has not synchronized data 2 to the standby NCP, the active/standby switchover occurs.
- step 1 the primary NCP receives the active/standby switchover event and changes the board to the "standby state”.
- the standby NCP receives the active/standby switchover event and changes the board to the data recovery state to send the active/standby switchover event to the line card.
- Step 3 After receiving the active/standby switchover event, the line card changes the data 2 to “synchronizing state” and sends data 2 to the primary NCP.
- Step 4 The master NCP receives the data 2 of the line card, saves the data 2 to the local, sets the status to "unsynchronized state", and sends data 2 to the standby NCP.
- step 5 the standby NCP receives the data 2 of the primary NCP, changes the data 2 to the "synchronized state", and returns the data 2 to confirm.
- step 6 the main NCP receives the data 2 confirmation, and the data 2 is modified to the "synchronized state", and the data 2 is sent back to the line card.
- Step 7 The line card receives the main NCP data 2, and the data 2 is modified to the “synchronized state”, and the synchronization completion event is sent to the main NCP.
- step 8 the primary NCP receives the synchronization completion event and sends a synchronization completion event to the standby NCP.
- step IX the standby NCP receives the synchronization completion event and does nothing.
- FIG. 8 is a schematic diagram of a flow of data batch synchronization by inserting a standby NCP according to a preferred embodiment of the present invention, as shown in FIG. 8.
- Step 1 The primary NCP receives the standby NCP online event, sets the data 1 to the “synchronizing state”, and modifies the board to the “active/standby state” to synchronize data 1 with the standby NCP.
- the standby NCP receives the data 1 and saves it to the local state.
- the status is “synchronized state”, and the data is acknowledged to the primary NCP.
- step 3 the primary NCP receives the data 1 acknowledgment, and modifies the data 1 to the "synchronized state", and sends a synchronization completion event to the standby NCP and the primary NCP.
- Step 4 The standby NCP receives the synchronization completion event, and deletes all data that is not “synchronized state”. At this time, no data needs to be deleted.
- step 5 the line card receives the synchronization completion event, and the data 1 is modified to the “synchronized state”.
- FIG. 9 is a schematic diagram of an active/standby switchover process performed during data synchronization between the active and standby devices according to a preferred embodiment of the present invention, as shown in FIG. 9.
- the line card has data 1, the status is "synchronized state", data 2, the status is "unsynchronized state”; the main NCP has data 1, the status is "synchronized state”, the data 2 is "unsynchronized state”; the standby NCP There are data 1 and data 2, and the status is "synchronized state”.
- the master/slave switchover occurs when the standby NCP has not sent data 2 to the master NCP for confirmation.
- Step 1 The master NCP receives the active/standby switchover event and sets the board to the standby state.
- Step 2 The standby NCP receives the active/standby switchover event, and sets the board to the data recovery state to send the active/standby switchover event to the line card.
- Step 3 The line card receives the active/standby switchover event, and sets the data 2 to “synchronizing state” to send data 2 to the primary NCP.
- Step 4 The primary NCP receives the data 2, and the data 2 is modified to the "unsynchronized state", and the data 2 is synchronized to the standby NCP.
- step 5 the standby NCP receives the data 2, sets the data 2 to the "synchronized state", and sends a data 2 confirmation to the primary NCP.
- step 6 the master NCP receives the data 2 acknowledgment, and modifies the data 2 to the "synchronized state", and sends the data 2 to the line card.
- Step 7 The line card receives the data 2, and the data 2 is modified to the "synchronized state", and the synchronization completion is sent to the main NCP.
- step 8 the primary NCP receives the synchronization completion and sends a synchronization completion event to the standby NCP.
- Step 9 The standby NCP receives the synchronization completion event and does not process it.
- the preferred embodiment avoids abnormal faults caused by data synchronization through a double acknowledgement mechanism, and can fundamentally ensure that data of the master unit, the standby master unit, and the service processing unit (possibly multiple) are consistent at any time. State. This avoids a series of problems caused by data inconsistency.
- Embodiments of the present invention also provide a storage medium.
- the storage medium may be configured to store program code for performing the method steps of the above embodiment:
- the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
- ROM Read-Only Memory
- RAM Random Access Memory
- a mobile hard disk e.g., a hard disk
- magnetic memory e.g., a hard disk
- the processor executes the method of the above embodiment according to the stored program code in the storage medium.
- modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
- the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
- the invention is not limited to any specific combination of hardware and software.
- the main control unit receives the application status data sent by the service processing unit, and the main control unit modifies the application status data to the unsynchronized status data, and the main control unit
- the unit synchronizes the unsynchronized state data to the service processing unit;
- the master control unit modifies the unsynchronized state data to the synchronization state data, and the master control unit synchronizes the synchronization state data to the standby master unit
- the master control unit receives the confirmation message, the confirmation message includes the confirmation content that the standby master unit modifies the synchronized state data to the synchronized state data, and the master control unit modifies the data in the synchronization state to
- the main control unit synchronizes the data of the synchronized state to the service processing unit, solves the problem of abnormal fault caused by data unsynchronization, realizes consistency of data of each unit, and saves maintenance cost. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Hardware Redundancy (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种同步数据方法、装置及***,主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元;主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元,解决了数据不同步导致的异常故障的问题,实现了各单元数据的一致性,节约了维护成本。
Description
本发明涉及通信领域,具体而言,涉及一种同步数据方法、装置及***。
在同步数字体系(Synchronous Digital Hierarchy,简称为SDH)设备,密集型光波复用(Dense Wavelength Division Multiplexing,简称为DWDM)设备,分组传送网(Packet Transport Network,简称为PTN)设备,网络控制协议(Network Control Protocol,简称为NCP)设备,以及光传送网(Optical Transport Network,简称为OTN)设备中,由于其承载的业务具有非常高的实时性和可靠性要求,主控单元作为设备配置数据的数据中心,其配置数据的同步功能非常重要。主控单元往往存在一个或多个备用主控单元,也就是说,配置数据的同步,包括两个内容:主控单元与备用主控单元之间的数据同步,这个同步是复制、备份的动作;主控单元与业务处理单元的数据同步,这个同步是下发、应答的动作。
在相关技术中,这两个数据同步是独立运行的。这样虽然处理简单,但往往效果不佳,比如:当主控单元下发数据时,如果此时主控单元发生故障,主控的数据配置未同步成功,备用主控单元又没有这个数据,往往数据会出现异常,导致设备运行异常,甚至导致业务中断,无法恢复。而这些因为数据不一致导致的问题,往往非常复杂,难以定位和排除,会大大增加设备维护的人力、物力,造成资源浪费。
针对相关技术中,数据不同步导致的异常故障,目前尚未提出有效的解决方案。
发明内容
本发明提供了一种同步数据方法、装置及***,以至少解决相关技术中数据不同步导致的异常故障的问题。
根据本发明的一个实施例,提供了一种数据同步方法,包括:
主用主控单元接收业务处理单元发送的申请状态数据,所述主用主控单元将所述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;
所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到备用主控单元;
所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单
元。
在本发明的实施例中,所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;
在所述业务处理单元中的数据状态均是已同步状态的情况下,所述主用主控单元接收所述业务处理单元发送的同步完成事件。
在本发明的实施例中,所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;
在所述业务处理单元包括所述未同步状态数据或者所述申请状态数据的情况下,所述主用主控单元接收正在同步状态数据,其中,所述正在同步状态数据是所述业务处理单元将所述未同步状态数据或者所述申请状态数据修改的;
所述主用主控单元将所述正在同步状态数据修改为未同步状态数据,所述主用主控单元发送所述未同步状态数据给所述备用主控单元;
所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述未同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
根据本发明的另一个实施例,还提供了一种数据同步方法,包括:
主用主控单元接收备用主控单元的上线事件,所述主用主控单元将未同步状态数据修改为正在同步状态,所述主用主控单元发送所述正在同步状态数据到所述备用主控单元;
所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
在本发明的实施例中,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据之后,所述方法包括:
所述主用主控单元向所述备用主控单元发送同步完成事件,所述备用主控单元将本地不是已同步状态数据删除。
根据本发明的另一个实施例,还提供了一种数据同步装置,包括:
第一接收模块,设置为主用主控单元接收业务处理单元发送的申请状态数据,所述主用主控单元将所述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;
第一修改模块,设置为所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到备用主控单元;
第一确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
在本发明的实施例中,第一倒换模块,设置为所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;
第二接收模块,设置为在所述业务处理单元中的数据状态均是已同步状态的情况下,所述主用主控单元接收所述业务处理单元发送的同步完成事件。
在本发明的实施例中,第二倒换模块,设置为所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;
第三接收模块,设置为在所述业务处理单元包括所述未同步状态数据或者所述申请状态数据的情况下,所述主用主控单元接收正在同步状态数据,其中,所述正在同步状态数据是所述业务处理单元将所述未同步状态数据或者所述申请状态数据修改的;
第二修改模块,设置为所述主用主控单元将所述正在同步状态数据修改为未同步状态数据,所述主用主控单元发送所述未同步状态数据给所述备用主控单元;
第二确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述未同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
根据本发明的另一个实施例,还提供了一种数据同步装置,包括:
第三修改模块,设置为主用主控单元接收备用主控单元的上线事件,所述主用主控单元将未同步状态数据修改为正在同步状态,所述主用主控单元发送所述正在同步状态数据到所述备用主控单元;
第三确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
在本发明的实施例中,所述装置包括:
删除模块,设置为所述主用主控单元向所述备用主控单元发送同步完成事件,所述备用主控单元将本地不是已同步状态数据删除。
根据本发明的另一个实施例,还提供了一种数据同步***,包括:主用主控单元,备用主控单元,业务处理单元;
所述主用主控单元接收所述业务处理单元发送的申请状态数据,所述主用主控单元将所
述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;
所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到所述备用主控单元;
所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
通过本发明,采用主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元;该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元,解决了数据不同步导致的异常故障的问题,实现了各单元数据的一致性,节约了维护成本。
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种数据同步方法的流程图一;
图2是根据本发明实施例的一种数据同步方法的流程图二;
图3是根据本发明实施例的一种数据同步装置的结构框图一;
图4是根据本发明实施例的一种数据同步装置的结构框图二;
图5是根据本发明优选实施例的数据正常同步流程示意图;
图6是根据本发明优选实施例的进行主备倒换流程示意图;
图7是根据本发明优选实施例的主备NCP进行正常数据同步过程中进行主备倒换流程示意图;
图8是根据本发明优选实施例的插上备NCP进行数据批量同步流程示意图;
图9是根据本发明优选实施例的主备进行数据同步过程中发生主备倒换流程示意图。
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种数据同步方法,图1是根据本发明实施例的一种数据同步方法的流程图一,如图1所示,该流程包括如下步骤:
步骤S102,主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;
步骤S104,该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元;
步骤S106,该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
通过上述步骤,主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元,该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元,该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元,解决了数据不同步导致的异常故障的问题,实现了各单元数据的一致性,节约了维护成本。
在本实施例中,该主用主控单元收到主备倒换事件,向该业务处理单元发送该主备倒换事件,在该业务处理单元中的数据状态均是已同步状态的情况下,该主用主控单元接收该业务处理单元发送的同步完成事件。
在本实施例中,该主用主控单元收到主备倒换事件,向该业务处理单元发送该主备倒换事件,在该业务处理单元包括该未同步状态数据或者该申请状态数据的情况下,该主用主控单元接收正在同步状态数据,其中,该正在同步状态数据是该业务处理单元将该未同步状态数据或者该申请状态数据修改的,该主用主控单元将该正在同步状态数据修改为未同步状态数据,该主用主控单元发送该未同步状态数据给该备用主控单元,该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该未同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
在本实施例中提供了一种数据同步方法,图2是根据本发明实施例的一种数据同步方法
的流程图二,如图2所示,该流程包括如下步骤:
步骤S202,主用主控单元接收备用主控单元的上线事件,该主用主控单元将未同步状态数据修改为正在同步状态,该主用主控单元发送该正在同步状态数据到该备用主控单元;
步骤S204,该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
通过上述步骤,在主用主控单元接收备用主控单元上线事件,该主用主控单元将未同步状态数据修改为正在同步状态,该主用主控单元发送该正在同步状态数据到该备用主控单元,该主用主控单元接收该备用主控单元将该正在同步状态数据修改为已同步状态数据的确认后,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元,解决了数据不同步导致的异常故障的问题,实现了各单元数据的一致性,节约了维护成本。
在本实施例中,该主用主控单元修改该正在同步状态的数据为已同步状态的数据之后,该方法包括:该主用主控单元向该备用主控单元发送同步完成事件,该备用主控单元将本地不是已同步状态数据删除。
在本实施例中还提供了一种数据同步装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图3是根据本发明实施例的一种数据同步装置的结构框图一,如图3所示,该装置包括:
第一接收模块32,设置为主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;
第一修改模块34,设置为该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元;
第一确认模块36,设置为该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
在本实施例中,该装置还包括:第一倒换模块,设置为该主用主控单元收到主备倒换事件,向该业务处理单元发送该主备倒换事件;
第二接收模块,设置为在该业务处理单元中的数据状态均是已同步状态的情况下,该主用主控单元接收该业务处理单元发送的同步完成事件。
在本实施例中,该装置还包括:第二倒换模块,设置为该主用主控单元收到主备倒换事件,向该业务处理单元发送该主备倒换事件;
第三接收模块,设置为在该业务处理单元包括该未同步状态数据或者该申请状态数据的情况下,该主用主控单元接收正在同步状态数据,其中,该正在同步状态数据是该业务处理单元将该未同步状态数据或者该申请状态数据修改的;
第二修改模块,设置为该主用主控单元将该正在同步状态数据修改为未同步状态数据,该主用主控单元发送该未同步状态数据给该备用主控单元;
第二确认模块,设置为该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该未同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
图4是根据本发明实施例的一种数据同步装置的结构框图二,如图4所示,该装置包括:
第三修改模块42,设置为主用主控单元接收备用主控单元的上线事件,该主用主控单元将未同步状态数据修改为正在同步状态,该主用主控单元发送该正在同步状态数据到该备用主控单元;
第三确认模块44,设置为该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
在本实施例中,该装置还包括:
删除模块,设置为该主用主控单元向该备用主控单元发送同步完成事件,该备用主控单元将本地不是已同步状态数据删除。
在本发明的另一个实施例中,还提供了一种数据同步***,包括:主用主控单元,备用主控单元,业务处理单元;
该主用主控单元接收该业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;
该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到该备用主控单元;
该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元。
下面结合优选实施例和实施方式对本发明进行详细说明。
本优选实施例提供一种数据同步机制实现主用主控单元、备用主控单元以及业务处理单
元(可能存在多个)数据一致性,其中,主用主控单元、备用主控单元以及业务处理单元和上述实施例中的主用主控单元、备用主控单元以及业务处理单元功能和作用相同,避免因为数据不一致导致的一系列问题。
本优选实施例所述方法将主控单元分为“主用状态”、“备用状态”、“主备状态”以及“数据恢复状态”三种状态。其中“主用状态”表示只有主用主控单元,没有备用主控单元;“备用状态”表示同时有主用主控单元和备用主控单元,本单元是备用主控单元;“主备状态”表示同时有主用主控单元和备用主控单元,本单元是主用主控单元。“数据恢复状态”经过主备倒换后,主控单元和业务处理单元进行数据恢复的一种暂态。不存在只有备用主控单元,没有主用主控单元的情况。主控单元之间可以通过任何方式进行状态协商。
本优选实施例将所需同步的数据分为“申请状态”、“未同步状态”、“正在同步状态”以及“已同步状态”,该数据的“申请状态”、“未同步状态”、“正在同步状态”以及“已同步状态”与上述实施例中的申请状态数据,未同步状态数据,正在同步状态数据,已同步状态数据的功能和作用相同。
下面分别阐述主用主控单元、备用主控单元和业务处理单元的操作步骤。
一、主用主控单元操作步骤。
如果主用主控单元处于“主用状态”,针对如下事件的处理方法:
1.收到业务处理单元的申请数据事件,进行相应处理后,将数据设置为“未同步状态”,保存到本地并下发到业务处理单元。下发到业务处理单元的数据,携带的状态为“未同步状态”。主控单元下发到业务处理单元的数据不仅可以携带状态信息,还可以携带其它信息,比如数据的唯一标识信息。
2.收到备用主控单元在线事件,将本地保存的,并且是“未同步状态”的数据设置为“正在同步状态”,然后将本单元的状态设置为“主备状态”,开始同步数据到备用主控单元。
3.收到同步完成事件,不处理。
4.收到其它事件,记录异常日志。
如果主用主控单元处于“主备状态”,针对如下事件的处理方法:
1.收到业务处理单元的申请数据事件,查找本地数据,如果不存在此数据,对数据进行相应处理后,将数据设置为“未同步状态”,保存到本地并同步给备用主控单元;如果本地已经存在此数据,并且处于“已同步状态”,将数据携带本地状态下发到线卡;如果本地数据处于其它状态,不处理。
2.收到备用主控单元的数据确认事件,如果本地数据处于“正在同步状态”,将数据设置为“已同步状态”,并判断如果没有“正在同步状态”的数据,则向备用主控单元和业务处理单元发送同步完成事件;如果本地数据处于“未同步状态”,将数据设置为“已同步状态”,并下发给业务处理单元;如果本地数据处于其它状态,不做任何处理。
3.收到主备倒换事件,将本单元设置为“备用状态”。
4.收到备用主控单元离线事件,将所有数据设置为“未同步状态”,向业务处理单元发送同步清除事件,将本单元设置为“主用状态”。
5.收到其它事件,记录异常日志。
二、备用主控单元操作步骤。
备用主控单元是处于“备用状态”的主控单元,针对如下事件的处理方法:
1..收到主用主控单元发送的数据事件,将数据保存到本地,并设置数据为“已同步状态”,向主用主控单元发送数据确认事件。
2.收到主用主控单元发送的同步完成事件,将本地不是“已同步状态”的数据全部删除。
3.收到主备倒换事件,先将本地不是“已同步状态”的数据全部删除,向业务处理单元发送主备倒换事件,将本单元设置为“数据恢复状态”。
4.收到主用主控单元离线事件,将本地所有数据修改为“未同步状态”,向业务处理单元发送主备倒换事件,将本单元设置为“主用状态”。
5.收到其它事件,记录异常日志。
主控单元处于“数据恢复状态”的操作步骤:
1.收到业务处理单元的数据申请事件,如果本地已经存在该数据,将本地数据设置为“未同步状态”,向备用主控单元同步该数据;如果本地不存在该数据,将数据保存到本地,设置为“未同步状态”,向备用主控单元同步该数据。
2.收到备用主控单元的数据确认事件,将本地数据修改为“已同步状态”,向业务处理单元回送数据。
3.收到同步完成事件,删除本地不是“已同步状态”的数据,向备用主控单元发送同步完成时间,设置本板为“主备状态”。
4.收到其它事件,记录异常日志。
三、业务处理单元操作步骤。
业务处理单元需要处理业务配置,并根据需要将业务数据同步到主控单元,业务处理单元如何处理业务配置不属于本发明讨论范围。业务处理单元只和主用主控单元进行通信,不和备用主控单元进行通信。业务处理单元针对如下事件的处理方法:
1.收到业务配置事件,根据需要将业务数据发送到主用主控单元,并在本地将数据设置为“申请状态”。
2.收到主用主控单元下发的数据确认事件,如果本地数据处于“正在同步状态”,将本
地数据修改为“已同步状态”,并判断如果没有“正在同步状态”的数据,向主用主控单元发送同步完成事件;如果本地数据处于其它状态,将本地数据修改为“已同步状态”。
3.收到主用主控单元同步完成事件,将本地所有处于“未同步状态”的数据设置为“已同步状态”。
4.收到主备倒换事件,将处于“未同步状态”和“申请状态”的数据修改为“正在同步状态”,然后将“正在同步状态”的数据发送给新的主用主控单元;如果所有数据都处于“已同步状态”,则向主用主控单元发送同步完成事件。
5.收到同步清除事件,将所有处于“已同步状态”的数据设置为“未同步状态”。
6.收到其它事件,记录异常日志。
通过上述实施例,各单元可以在任何时刻进行主备倒换,主备倒换后,新的备用主控单元无需重启,可以进行连续的主备倒换。
在本发明的另外一个优选实施例中,主控单元是NCP,业务处理单元为线卡。下面针对一个主NCP,一个备NCP,一个线卡的典型情况做具体描述。
场景1,数据正常同步,图5是根据本发明优选实施例的数据正常同步流程示意图,如图5所示。
步骤一,线卡向主NCP发送数据1,数据1在线卡上是“申请状态”。
步骤二,主NCP收到线卡的数据后,保存到本地,并且同步到线卡,数据1在主NCP上是“未同步状态”。
步骤三,备NCP收到主NCP的数据后,保存到本地,并发送确认给主NCP,数据1在备NCP上是“已同步状态”。
步骤四,主NCP收到备NCP的确认后,修改本地数据为“已同步状态”,并发送给线卡。
步骤五,线卡收到主NCP的数据后,修改本地数据为“已同步状态”。
场景2,数据正常同步后,发生主备倒换场景,图6是根据本发明优选实施例的进行主备倒换流程示意图,如图6所示。
步骤一,主NCP收到主备倒换事件,修改本板为“备用状态”。
步骤二,备NCP收到主备倒换事件,修改本板为“数据恢复状态”,然后向线卡发送主备倒换事件。
步骤三,线卡收到主备倒换事件,将所有“未同步状态”和“申请状态”的数据修改为“正在同步状态”。在这种场景下所有数据都是“已同步状态”,向主NCP发送同步完成事件。
场景3,主备NCP进行正常数据同步过程中进行主备倒换。图7是根据本发明优选实施
例的主备NCP进行正常数据同步过程中进行主备倒换流程示意图,如图7所示。
线卡有数据1和数据2,数据1是“已同步状态”,数据2是“未同步状态”。主NCP有数据1和数据2,数据1是“已同步状态”,数据2是“未同步状态”。备NCP有数据1,数据1是“已同步状态”。主NCP还未向备NCP同步数据2时,发生主备倒换。
步骤一,主NCP收到主备倒换事件,并将本板修改为“备用状态”。
步骤二,备NCP收到主备倒换事件,将本板修改为“数据恢复状态”,向线卡发送主备倒换事件。
步骤三,线卡收到主备倒换事件后,将数据2修改为“正在同步状态”,向主NCP发送数据2。
步骤四,主NCP收到线卡的数据2,将数据2保存到本地,设置为“未同步状态”,并向备NCP发送数据2。
步骤五,备NCP收到主NCP的数据2,将数据2修改为“已同步状态”,并回送数据2确认。
步骤六,主NCP收到数据2确认,将数据2修改为“已同步状态”,向线卡回送数据2。
步骤七,线卡收到主NCP数据2,将数据2修改为“已同步状态”,向主NCP发送同步完成事件。
步骤八,主NCP收到同步完成事件,向备NCP发送同步完成事件。
步骤九,备NCP收到同步完成事件,不做任何处理。
至此,主NCP、备NCP、线卡三者的数据和状态达到一致。
场景4,插上备NCP后,主备进行数据批量同步。图8是根据本发明优选实施例的插上备NCP进行数据批量同步流程示意图,如图8所示。
线卡和主NCP都有数据1,状态是“未同步状态”。如果插上备NCP板,处理步骤如下:
步骤一,主NCP收到备NCP上线事件,将数据1设置为“正在同步状态”,将本板修改为“主备状态”,向备NCP同步数据1。
步骤二,备NCP收到数据1,保存到本地,状态为“已同步状态”,向主NCP回送数据1确认。
步骤三,主NCP收到数据1确认,将数据1修改为“已同步状态”,向备NCP和主NCP发送同步完成事件。
步骤四,备NCP收到同步完成事件,将所有非“已同步状态”的数据删除,此时无数据需要删除。
步骤五,线卡收到同步完成事件,将数据1修改为“已同步状态”。
至此,主NCP、备NCP、线卡三者的数据和状态达到一致。
场景五,主备进行数据同步过程中,发生主备倒换。图9是根据本发明优选实施例的主备进行数据同步过程中发生主备倒换流程示意图,如图9所示。
线卡有数据1,状态为“已同步状态”,数据2,状态为“未同步状态”;主NCP有数据1,状态为“已同步状态”,数据2为“未同步状态”;备NCP有数据1和数据2,状态为“已同步状态”。备NCP还未向主NCP发送数据2确认时,发生主备倒换。
步骤一,主NCP收到主备倒换事件,将本板设置为“备用状态”。
步骤二,备NCP收到主备倒换事件,将本板设置为“数据恢复状态”,向线卡发送主备倒换事件。
步骤三,线卡收到主备倒换事件,将数据2设置为“正在同步状态”,向主NCP发送数据2。
步骤四,主NCP收到数据2,将数据2修改为“未同步状态”,将数据2同步给备NCP。
步骤五,备NCP收到数据2,将数据2设置为“已同步状态”,向主NCP发送数据2确认。
步骤六,主NCP收到数据2确认,将数据2修改为“已同步状态”,向线卡发送数据2。
步骤七,线卡收到数据2,将数据2修改为“已同步状态”,向主NCP发送同步完成。
步骤八,主NCP收到同步完成,向备NCP发送同步完成事件。
步骤九,备NCP收到同步完成事件,不处理。
至此,主NCP、备NCP、线卡三者的数据和状态达到一致。
本优选实施例通过双确认机制,避免因为数据同步导致的异常故障,并且能够从根本上保证主控单元、备用主控单元以及业务处理单元(可能存在多个)的数据在任何时刻都是一致状态的。从而可以避免因为数据不一致导致的一系列问题。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行上述实施例的方法步骤的程序代码:
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述实施例的方法。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
基于本发明实施例提供的上述技术方案,采用主用主控单元接收业务处理单元发送的申请状态数据,该主用主控单元将该申请状态数据修改为未同步状态数据,该主用主控单元将该未同步状态数据同步给该业务处理单元;该主用主控单元将该未同步状态数据修改为正在同步状态数据,该主用主控单元同步该正在同步状态数据到备用主控单元;该主用主控单元接收确认消息,该确认消息包括该备用主控单元将该正在同步状态数据修改该已同步状态数据的确认内容,该主用主控单元修改该正在同步状态的数据为已同步状态的数据,该主用主控单元同步该已同步状态的数据到该业务处理单元,解决了数据不同步导致的异常故障的问题,实现了各单元数据的一致性,节约了维护成本。
Claims (11)
- 一种数据同步方法,包括:主用主控单元接收业务处理单元发送的申请状态数据,所述主用主控单元将所述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到备用主控单元;所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
- 根据权利要求1所述的方法,其中,还包括:所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;在所述业务处理单元中的数据状态均是已同步状态的情况下,所述主用主控单元接收所述业务处理单元发送的同步完成事件。
- 根据权利要求1所述的方法,其中,还包括:所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;在所述业务处理单元包括所述未同步状态数据或者所述申请状态数据的情况下,所述主用主控单元接收正在同步状态数据,其中,所述正在同步状态数据是所述业务处理单元将所述未同步状态数据或者所述申请状态数据修改的;所述主用主控单元将所述正在同步状态数据修改为未同步状态数据,所述主用主控单元发送所述未同步状态数据给所述备用主控单元;所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述未同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
- 一种数据同步方法,包括:主用主控单元接收备用主控单元的上线事件,所述主用主控单元将未同步状态数据修改为正在同步状态,所述主用主控单元发送所述正在同步状态数据到所述备用主控单元;所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述正在同 步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到业务处理单元。
- 根据权利要求1所述的方法,其中,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据之后,所述方法包括:所述主用主控单元向所述备用主控单元发送同步完成事件,所述备用主控单元将本地不是已同步状态数据删除。
- 一种数据同步装置,包括:第一接收模块,设置为主用主控单元接收业务处理单元发送的申请状态数据,所述主用主控单元将所述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;第一修改模块,设置为所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到备用主控单元;第一确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
- 根据权利要求6所述的装置,其中,还包括:第一倒换模块,设置为所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;第二接收模块,设置为在所述业务处理单元中的数据状态均是已同步状态的情况下,所述主用主控单元接收所述业务处理单元发送的同步完成事件。
- 根据权利要求6所述的装置,其中,还包括:第二倒换模块,设置为所述主用主控单元收到主备倒换事件,向所述业务处理单元发送所述主备倒换事件;第三接收模块,设置为在所述业务处理单元包括所述未同步状态数据或者所述申请状态数据的情况下,所述主用主控单元接收正在同步状态数据,其中,所述正在同步状态数据是所述业务处理单元将所述未同步状态数据或者所述申请状态数据修改的;第二修改模块,设置为所述主用主控单元将所述正在同步状态数据修改为未同步状态数据,所述主用主控单元发送所述未同步状态数据给所述备用主控单元;第二确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改所述未同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已 同步状态的数据到所述业务处理单元。
- 一种数据同步装置,包括:第三修改模块,设置为主用主控单元接收备用主控单元的上线事件,所述主用主控单元将未同步状态数据修改为正在同步状态,所述主用主控单元发送所述正在同步状态数据到所述备用主控单元;第三确认模块,设置为所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改所述已同步状态数据的确认内容,所述主用主控单元修改正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到业务处理单元。
- 根据权利要求9所述的装置,其中,所述装置包括:删除模块,设置为所述主用主控单元向所述备用主控单元发送同步完成事件,所述备用主控单元将本地不是已同步状态数据删除。
- 一种数据同步***,包括:主用主控单元,备用主控单元,业务处理单元;所述主用主控单元接收所述业务处理单元发送的申请状态数据,所述主用主控单元将所述申请状态数据修改为未同步状态数据,所述主用主控单元将所述未同步状态数据同步给所述业务处理单元;所述主用主控单元将所述未同步状态数据修改为正在同步状态数据,所述主用主控单元同步所述正在同步状态数据到所述备用主控单元;所述主用主控单元接收确认消息,所述确认消息包括所述备用主控单元将所述正在同步状态数据修改已同步状态数据的确认内容,所述主用主控单元修改所述正在同步状态的数据为已同步状态的数据,所述主用主控单元同步所述已同步状态的数据到所述业务处理单元。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510448471.3A CN106657168A (zh) | 2015-07-27 | 2015-07-27 | 同步数据方法、装置及*** |
CN201510448471.3 | 2015-07-27 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017016196A1 true WO2017016196A1 (zh) | 2017-02-02 |
Family
ID=57883985
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/070431 WO2017016196A1 (zh) | 2015-07-27 | 2016-01-07 | 同步数据方法、装置及*** |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106657168A (zh) |
WO (1) | WO2017016196A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112612654A (zh) * | 2021-01-08 | 2021-04-06 | 成都民航空管科技发展有限公司 | 空管自动化***多机主备切换方法及冗余服务*** |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113806143B (zh) * | 2018-05-11 | 2024-04-26 | 创新先进技术有限公司 | 一种异地容灾方法、***和电子设备 |
CN110224849A (zh) * | 2019-04-18 | 2019-09-10 | 广州市高科通信技术股份有限公司 | 一种防止ptn设备数据丢失的方法、***及存储介质 |
CN111654384A (zh) * | 2019-09-27 | 2020-09-11 | 中兴通讯股份有限公司 | 一种主备切换方法、bras设备及存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070300026A1 (en) * | 2006-06-23 | 2007-12-27 | Kwok-Yan Leung | Synchronous backup device and method used for storage device |
JP2008140289A (ja) * | 2006-12-05 | 2008-06-19 | Toshiba Corp | ストレージ装置 |
CN102075580A (zh) * | 2011-01-20 | 2011-05-25 | 迈普通信技术股份有限公司 | 分布式网络设备中同步数据的存储方法及*** |
CN103077242A (zh) * | 2013-01-11 | 2013-05-01 | 北京佳讯飞鸿电气股份有限公司 | 一种实现数据库服务器双机热备的方法 |
CN104253707A (zh) * | 2013-06-28 | 2014-12-31 | 上海斐讯数据通信技术有限公司 | 一种主备盘组播业务同步方法 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7039661B1 (en) * | 2003-12-29 | 2006-05-02 | Veritas Operating Corporation | Coordinated dirty block tracking |
EP1564656B1 (en) * | 2004-02-10 | 2006-09-13 | Research In Motion Limited | Apparatus and associated method for facilitating initiation of synchronization of database copies connected by way of a radio air interface |
CN101075861A (zh) * | 2007-06-28 | 2007-11-21 | 中兴通讯股份有限公司 | 一种实现主备板热备份和主备倒换的方法 |
CN102510408B (zh) * | 2011-11-30 | 2015-01-14 | 武汉烽火网络有限责任公司 | 实现tcp应用主备热倒换的方法 |
CN103188065B (zh) * | 2011-12-30 | 2016-08-17 | 北京新媒传信科技有限公司 | 一种业务服务中数据同步的方法和*** |
CN103902405B (zh) * | 2012-12-28 | 2017-02-08 | 杭州宏杉科技有限公司 | 一种准连续性数据复制方法及装置 |
-
2015
- 2015-07-27 CN CN201510448471.3A patent/CN106657168A/zh not_active Withdrawn
-
2016
- 2016-01-07 WO PCT/CN2016/070431 patent/WO2017016196A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070300026A1 (en) * | 2006-06-23 | 2007-12-27 | Kwok-Yan Leung | Synchronous backup device and method used for storage device |
JP2008140289A (ja) * | 2006-12-05 | 2008-06-19 | Toshiba Corp | ストレージ装置 |
CN102075580A (zh) * | 2011-01-20 | 2011-05-25 | 迈普通信技术股份有限公司 | 分布式网络设备中同步数据的存储方法及*** |
CN103077242A (zh) * | 2013-01-11 | 2013-05-01 | 北京佳讯飞鸿电气股份有限公司 | 一种实现数据库服务器双机热备的方法 |
CN104253707A (zh) * | 2013-06-28 | 2014-12-31 | 上海斐讯数据通信技术有限公司 | 一种主备盘组播业务同步方法 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112612654A (zh) * | 2021-01-08 | 2021-04-06 | 成都民航空管科技发展有限公司 | 空管自动化***多机主备切换方法及冗余服务*** |
CN112612654B (zh) * | 2021-01-08 | 2024-03-29 | 成都民航空管科技发展有限公司 | 空管自动化***多机主备切换方法及冗余服务*** |
Also Published As
Publication number | Publication date |
---|---|
CN106657168A (zh) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102098342B (zh) | 一种基于事务级的数据同步方法、装置及*** | |
CN103744809B (zh) | 基于vrrp的车辆信息管理***双机热备方法 | |
EP2144400B1 (en) | Distributed ethernet system and method for detecting fault based thereon | |
WO2018049983A1 (zh) | 数据同步方法、***、同步获取方法及装置 | |
CN110601903B (zh) | 一种基于消息队列中间件的数据处理方法及装置 | |
WO2017016196A1 (zh) | 同步数据方法、装置及*** | |
CN106656589B (zh) | 一种服务器双机热备份*** | |
WO2020224237A1 (zh) | 区块链共识的方法、装置、设备及存储介质 | |
DE102014204752A1 (de) | Fehlertolerantes taktnetzwerk | |
CN108228397A (zh) | 一种集群间跨机房同步的方法和装置 | |
WO2017162079A1 (zh) | 一种数据的同步方法和装置 | |
WO2021057438A1 (zh) | 主备切换方法、装置、bras设备及存储介质 | |
CN105591801B (zh) | 一种虚拟网络功能vnf故障处理方法及vnf管理设备 | |
CN105956207A (zh) | 一种基于binlog的可配置的mysql数据库实时同步方法 | |
CN113572561B (zh) | 用于时钟同步的方法、设备、通信***和介质 | |
WO2016101409A1 (zh) | 数据倒换的方法、设备及*** | |
CN113438111A (zh) | 基于Raft分布式恢复RabbitMQ网络分区的方法及应用 | |
JP5449229B2 (ja) | 呼救済システム及び呼救済方法 | |
CN108984346B (zh) | 一种生产数据容灾的方法、***及存储介质 | |
CN111083074A (zh) | 主备双ospf状态机的高可用性方法和*** | |
CN111460029A (zh) | 数据同步方法和装置 | |
CN114584459B (zh) | 一种实现容器云平台主备高可用的方法 | |
CN113890817A (zh) | 一种通信优化方法和装置 | |
WO2016177211A1 (zh) | 地址解析协议arp表项的同步方法及装置 | |
WO2012088960A1 (zh) | 一种数据容灾方法及*** |
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: 16829567 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: 16829567 Country of ref document: EP Kind code of ref document: A1 |