CN102075315B - Data synchronization method and device among forwarding boards - Google Patents

Data synchronization method and device among forwarding boards Download PDF

Info

Publication number
CN102075315B
CN102075315B CN201010557626.4A CN201010557626A CN102075315B CN 102075315 B CN102075315 B CN 102075315B CN 201010557626 A CN201010557626 A CN 201010557626A CN 102075315 B CN102075315 B CN 102075315B
Authority
CN
China
Prior art keywords
service data
data
linked list
forwarding board
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201010557626.4A
Other languages
Chinese (zh)
Other versions
CN102075315A (en
Inventor
何松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201010557626.4A priority Critical patent/CN102075315B/en
Publication of CN102075315A publication Critical patent/CN102075315A/en
Application granted granted Critical
Publication of CN102075315B publication Critical patent/CN102075315B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the communication field and discloses a data synchronization method and a device for forwarding boards, and is used for improving the execution efficiency of a data synchronization flow and lowering the communication overhead among the boards. The method comprises the following steps: a main forwarding board stores relevant information of business data in the form of a business data linked list, then sequentially reads the information saved in the business data linked list by linked list nodes so as to obtain the corresponding business data when designated time is reached, and finally sends the business data to a standby forwarding board for data synchronization. In the invention, the business data linked list has high access efficiency, thus ensuring real-time business data synchronization between the main forwarding board and the standby forwarding board, and further ensuring smooth business transition and improving the business reliability of communication equipment in the case of switchover between the main forwarding board and the standby forwarding board.

Description

Data synchronization method and device between forwarding boards
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for synchronizing data between forwarding boards.
Background
In large communication devices, important forwarding boards are often set as primary forwarding for reliability reasons
The board and the standby forwarding board are two boards, namely the forwarding board is the hardware where the module with the transceiving function is located. Services based on various communication protocols are usually operated in communication equipment, and dynamic data is generated when the services are performed, for example, a dynamic multicast member table is generated when a multicast Service is operated, a Mac learning table is generated when a Virtual Private Lan Service (VPLS) of MPLS (multi Protocol Label Switching) is operated, and the like. In order to ensure that the service flow is not interrupted or interrupted for a very short time (for example, the interruption time is less than 10ms) as far as possible when the switching occurs between the main forwarding board and the standby forwarding board, the dynamic data synchronization needs to be periodically performed between the main forwarding board and the standby forwarding board, so that the standby forwarding board can obtain the dynamic data generated by the main forwarding board in the service operation process in time, and therefore, the smooth transition of the service flow is effectively ensured when the switching occurs between the forwarding boards.
In the prior art, data used in a forwarding board is usually stored in a database table form, and data stored in a database table is used, so that access is time-consuming, and only all data can be synchronized when synchronization operation is performed each time, which further reduces the execution efficiency of a data synchronization process, and particularly when the communication bandwidth between forwarding boards is small or/and the data amount required to be synchronized is too large, the defect is more obvious, and the execution of a forwarding board switching process is also influenced when the communication bandwidth is too large, so that the service reliability of communication equipment is reduced.
Disclosure of Invention
The embodiment of the invention provides a data synchronization method and device between forwarding boards, which are used for reducing communication overhead between the forwarding boards in a data synchronization process and improving execution efficiency of the data synchronization process.
The embodiment of the invention provides the following specific technical scheme:
a data synchronization method between forwarding boards includes:
the method for generating the service data linked list by the main forwarding board based on the service data generated in the service process comprises the following steps: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data;
the main forwarding board sequentially sends the service data corresponding to each link table node in the at least one service data link table to the standby forwarding board for data synchronization at a designated time, and the method specifically includes: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; and sending the obtained service data and the global sequence number to a standby forwarding board.
An apparatus for implementing data synchronization between forwarding boards, comprising:
a generating unit, configured to generate at least one service data linked list based on service data generated in a service flow, where each linked list node in the at least one service data linked list corresponds to one piece of service data, and the generating unit generates a corresponding service data linked list based on any type of service, including: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data;
the communication unit is configured to sequentially send the service data corresponding to each link table node in the at least one service data link table to another forwarding board for data synchronization at a designated time, and specifically includes: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; and sending the obtained service data and the global sequence number to another forwarding board.
An apparatus for implementing data synchronization between forwarding boards, comprising:
the business module is used for generating business data in a business process;
a primary forwarding board, configured to generate at least one service data linked list based on service data generated in a service flow, where each linked list node in the at least one service data linked list corresponds to one piece of service data, and the primary forwarding board generates the corresponding service data linked list based on any type of service, including: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data; and at the appointed time, sequentially sending the service data corresponding to each linked list node in the at least one service data linked list to the standby forwarding board for data synchronization, specifically comprising: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; sending the obtained service data and the global sequence number to a standby forwarding board;
and the standby forwarding board is used for receiving the service data sent by the main forwarding board so as to realize data synchronization.
In the embodiment of the invention, the main forwarding board stores the relevant information of the service data in the form of the service data linked list, and when the appointed time is reached, the information stored by each linked list node in the service data linked list is sequentially read to obtain the corresponding service data, and the corresponding service data is sent to the standby forwarding board for data synchronization. Because the access efficiency of the service data linked list is very high, the execution efficiency of the data synchronization process is effectively improved, and the communication overhead between boards is reduced. Therefore, real-time synchronization of service data is ensured between the main forwarding board and the standby forwarding board, and further, smooth transition of services (namely, service interruption time is as short as possible) is ensured when the main forwarding board and the standby forwarding board are switched, and the service reliability of the communication equipment is improved.
Drawings
Fig. 1A is a functional structure diagram of a communication device according to an embodiment of the present invention;
fig. 1B is a schematic diagram illustrating a connection between a forwarding board and a service module according to an embodiment of the present invention;
FIG. 2 is a functional structure diagram of a forwarding board according to an embodiment of the present invention;
FIG. 3 is a flow chart of data synchronization between forwarding boards according to an embodiment of the present invention;
fig. 4 is a schematic diagram of data synchronization performed between forwarding boards according to an embodiment of the present invention.
Detailed Description
In view of the above, in the embodiment of the present invention, a main forwarding board in a communication device generates at least one service data linked list based on service data dynamically generated in a service flow, where each linked list node in the service data linked list corresponds to one piece of service data, and then the main forwarding board sequentially sends the service data corresponding to each linked list node in the service data linked list to a standby forwarding board at a preset time to perform data synchronization.
Referring to fig. 1A, in the embodiment of the present invention, a communication device includes a plurality of service modules, a main forwarding board, and a standby forwarding board; wherein,
the business module is used for processing the business process and generating dynamic business data of various business types;
the main forwarding board is used for generating at least one business data linked list based on business data generated in a business process, wherein each linked list node in the at least one business data linked list corresponds to one piece of business data, and the business data corresponding to each linked list node in the at least one business data linked list are sequentially sent to the standby forwarding board for data synchronization at a designated time;
and the standby forwarding board is used for receiving the service data sent by the main forwarding board so as to realize data synchronization.
Preferably, the main forwarding board and the standby forwarding board may be forwarding boards with the same structure, and are respectively corresponding to the service modules, and when the main forwarding board and the standby forwarding board are switched, the service modules are also switched, so that a callback interface is provided between the main forwarding board or the standby forwarding board and the corresponding service module.
Referring to fig. 1B, in this embodiment, an interface for acquiring data and an interface for setting data are provided between the forwarding board and any corresponding service module, where the interface is a data interface for acquiring data and a data interface for setting data are provided between the forwarding board and any corresponding service module
Acquiring a data interface, and reading new service data from a service module when the forwarding board is used as a main forwarding board;
and setting a data interface, and when the forwarding board is used as a standby forwarding board, setting a corresponding service module according to the synchronous data received from the main forwarding board.
Referring to fig. 2, in the embodiment of the present invention, the forwarding board includes a generating unit 20 and a communication unit 21, wherein,
a generating unit 20, configured to generate at least one service data linked list based on service data generated in a service flow, where each linked list node in the at least one service data linked list corresponds to one piece of service data;
and a communication unit 21, configured to sequentially send the service data corresponding to each link table node in the at least one service data link table to another forwarding board for data synchronization at a designated time.
Referring to fig. 3, in the embodiment of the present invention, a method for implementing data synchronization between a main forwarding board and a standby forwarding board includes:
step 300: the main forwarding board generates at least one service data linked list based on service data generated in the service process, wherein each linked list node in the at least one service data linked list corresponds to one service data.
As shown in fig. 1A, in a normal situation, one service module in a communication device is responsible for processing one type of service flow, in the service flow processing process, each service module generates dynamic service data of a corresponding type, and a main forwarding board respectively establishes corresponding service data linked lists for different types of services, for example:
service 1: service data chain table 1
Service 2: service data chain table 2
……
Taking a service module as an example, each time new service data is generated, the primary forwarding board generates a new linked list node in the corresponding service data linked list based on the newly generated service data, for example:
chain table 1: link list node 1- > link list node 2- > link list node 3- > link list node 4 … …
The information recorded in each linked list node 1 at least includes the data index of the service data corresponding to the linked list node and the global serial number of the linked list node, and further, may also include the data type of the service data and the operation type of the service data (e.g., add/modify/delete operation), and so on. The global sequence number refers to a unified numbering among the service data linked lists, for example:
service data linked list 1: link list node 1- > link list node 2- > link list node 3- > link list node 4 … …
Service data linked list 2: link list node 7- > link list node 8- > link list node 9- > link list node 10 … …
……
Taking the linked list node 1 as an example, after the linked list node 1 is generated, if the corresponding service data is changed and the service data corresponding to the linked list node 1 is not sent to the standby forwarding board for data synchronization, the global serial number of the linked list node 1 is updated, for example, the linked list node 1 is updated to be the linked list node 11.
Step 310: and the main forwarding board sequentially sends the obtained service data corresponding to each linked list node in at least one service data linked list to the standby forwarding board for data synchronization at a designated time.
In practical applications, the designated time may be a preset periodic transmission time, or a time when the standby forwarding board is powered on, where the periodic transmission time may be monitored by using a timer. Further, according to the difference of the processing performance of the main forwarding board, if more than two service data linked lists exist, the service data linked lists can be transmitted in parallel or in series.
With service data linked list 1: the linked list node 1- > linked list node 2- > linked list node 3- > linked list node 4 is taken as an example, the primary forwarding board reads a linked list head node, that is, the linked list node 1, acquires service data (hereinafter referred to as service data 1) corresponding to the linked list node 1 from a corresponding service module through the data acquisition interface according to a data index recorded in the linked list node 1, and sends the service data 1 and the global serial number 1 (which may also include a data type, a data operation type, and the like) of the linked list node 1 to the standby forwarding board. After receiving the service data 1 and the global sequence number 1 sent by the main forwarding board, the standby forwarding board configures the corresponding service module through a data interface according to the service data 1, and returns a response message to the main forwarding board after the configuration is completed, wherein the global sequence number 1 is carried in the response message. After receiving the global sequence 1 returned by the standby forwarding board, the main forwarding board compares the global sequence number 1 returned by the standby forwarding board with the locally transmitted global sequence number 1, determines that the global sequence number 1 and the locally transmitted global sequence number are the same, determines that the data synchronization operation of the service data 1 is successful, and deletes the linked list node 1. If the main forwarding board does not receive the response message returned by the standby forwarding board, or the response message returned by the standby forwarding board does not carry the global serial number 1, the main forwarding board does not delete the linked list node 1, and continues to read the next linked list node 2 for data synchronization operation. Therefore, when the data synchronization operation is triggered again next time, the reading can still be started from the linked list node 1 at the head node of the linked list, so that the omission of the synchronized data is effectively prevented.
Of course, in the above embodiment, the primary forwarding board may also mark each link list node to distinguish a link list node with successful data synchronization, a link list node without data synchronization, a link list node with failed data synchronization, and the like, and the deletion of the link list node with successful synchronization is only a preferred embodiment, and is not limited thereto.
After the data synchronization operation is performed on the linked list node 1, the primary forwarding board reads the head node of the next linked list, namely the linked list node 2, and repeats the steps to perform the data synchronization operation on the service data 2 corresponding to the linked list node 2. By analogy, the primary forwarding board sequentially reads the linked list node 1, the linked list node 2, the linked list node 3 and the linked list node 4, so that data synchronization operation on the service data corresponding to each linked list node is realized.
Based on the above embodiments, referring to fig. 4, when the primary forwarding board sends the service data and other related information (hereinafter referred to as synchronization data) to the standby forwarding board for synchronization operation, the method includes:
if an interface capable of direct communication exists between the main forwarding board and the standby forwarding board, the main forwarding board directly sends the synchronous data to the standby forwarding board. Before sending, if the board position information (i.e., the physical position, such as a card slot) of the standby forwarding board is not stored on the main forwarding board, the main forwarding board may obtain the board position information of the standby forwarding board from the main control board.
If no interface capable of direct communication exists between the main forwarding board and the standby forwarding board, the main forwarding board sends the synchronous data to the main control board, the main control board sends the synchronous data to the standby forwarding board, and the response message returned by the standby forwarding board is forwarded to the main control board.
Referring to fig. 4, to implement the second scenario, a board position conversion interface is required to be arranged on the main control board, when the main control board receives the synchronous data sent by the main forwarding board, board position information of both the main forwarding board and the standby forwarding board is required to be recorded in a message header carrying the synchronous data, and when the main control board receives a response message returned by the standby forwarding board, the response message is sent to the main forwarding board according to the board position information of the main forwarding board in the response message header.
In summary, in the embodiment of the present invention, the primary forwarding board stores the related information of the service data in the form of the service data linked list, and when the specified time is reached, the primary forwarding board sequentially reads the information stored by each linked list node in the service data linked list to obtain the corresponding service data, and sends the corresponding service data to the standby forwarding board for data synchronization. Because the access efficiency of the service data linked list is very high, the execution efficiency of the data synchronization process is effectively improved, and the communication overhead between boards is reduced. Therefore, real-time synchronization of service data is ensured between the main forwarding board and the standby forwarding board, and further, smooth transition of services (namely, service interruption time is as short as possible) is ensured when the main forwarding board and the standby forwarding board are switched, and the service reliability of the communication equipment is improved.
Furthermore, the main forwarding board deletes the linked list node corresponding to the successfully synchronized service data from the service linked list, so that the object of each synchronization operation is only the service data which is not subjected to the synchronization operation, and the repeated operation is avoided, thereby avoiding the system resource consumption caused by the repeated synchronization operation of all the service data, further effectively improving the execution efficiency of the data synchronization process and reducing the communication overhead between boards.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A method for synchronizing data between forwarding boards, comprising:
the method for generating the service data linked list by the main forwarding board based on the service data generated in the service process comprises the following steps: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data;
the main forwarding board sequentially sends the service data corresponding to each link table node in the at least one service data link table to the standby forwarding board for data synchronization at a designated time, and the method specifically includes: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; and sending the obtained service data and the global sequence number to a standby forwarding board.
2. The method according to claim 1, wherein after the primary forwarding board sends the service data corresponding to any one of the link list nodes to the standby forwarding board, if the global sequence number returned by the standby forwarding board is received, the global sequence number returned by the standby forwarding board is compared with the global sequence number sent by the primary forwarding board, and when the global sequence number returned by the standby forwarding board is determined to be consistent with the global sequence number sent by the primary forwarding board, the link list node is deleted.
3. The method as claimed in claim 1 or 2, wherein when the primary forwarding board sequentially sends the service data corresponding to each link table node in the at least one service data link table to the standby forwarding board for data synchronization, the method comprises:
directly sending the service data corresponding to each chain table result in the at least one service data chain table to a standby forwarding board for data synchronization; or,
and sending the service data corresponding to each chain table result in the at least one service data chain table to a main control board, and forwarding the service data to a standby forwarding board by the main control board.
4. The method of claim 3, wherein the designating an opportunity comprises: a preset forwarding period, or the standby forwarding board is powered on.
5. An apparatus for implementing data synchronization between forwarding boards, comprising:
a generating unit, configured to generate at least one service data linked list based on service data generated in a service flow, where each linked list node in the at least one service data linked list corresponds to one piece of service data, and the generating unit generates a corresponding service data linked list based on any type of service, including: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data;
the communication unit is configured to sequentially send the service data corresponding to each link table node in the at least one service data link table to another forwarding board for data synchronization at a designated time, and specifically includes: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; and sending the obtained service data and the global sequence number to another forwarding board.
6. The apparatus according to claim 5, wherein after the primary forwarding board sends the service data corresponding to any one of the link list nodes to another forwarding board, if a global sequence number returned by another forwarding board is received, the global sequence number returned by another forwarding board is compared with the global sequence number sent by the apparatus, and when the global sequence number returned by another forwarding board is determined to be consistent with the global sequence number sent by the apparatus, the link list node is deleted.
7. An apparatus for implementing data synchronization between forwarding boards, comprising:
the business module is used for generating business data in a business process;
a primary forwarding board, configured to generate at least one service data linked list based on service data generated in a service flow, where each linked list node in the at least one service data linked list corresponds to one piece of service data, and the primary forwarding board generates a corresponding service data linked list based on any type of service, including: generating a linked list node every time new service data is generated in a service flow, wherein the linked list node at least records a data index and a global serial number of the service data; and at the appointed time, sequentially sending the service data corresponding to each linked list node in the at least one service data linked list to the standby forwarding board for data synchronization, specifically comprising: reading the data index and the global serial number recorded by the linked list node; acquiring corresponding service data according to the data index; sending the obtained service data and the global sequence number to a standby forwarding board;
and the standby forwarding board is used for receiving the service data sent by the main forwarding board so as to realize data synchronization.
CN201010557626.4A 2010-11-24 2010-11-24 Data synchronization method and device among forwarding boards Active CN102075315B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010557626.4A CN102075315B (en) 2010-11-24 2010-11-24 Data synchronization method and device among forwarding boards

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010557626.4A CN102075315B (en) 2010-11-24 2010-11-24 Data synchronization method and device among forwarding boards

Publications (2)

Publication Number Publication Date
CN102075315A CN102075315A (en) 2011-05-25
CN102075315B true CN102075315B (en) 2014-08-13

Family

ID=44033670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010557626.4A Active CN102075315B (en) 2010-11-24 2010-11-24 Data synchronization method and device among forwarding boards

Country Status (1)

Country Link
CN (1) CN102075315B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103199978A (en) * 2013-03-25 2013-07-10 天脉聚源(北京)传媒科技有限公司 Method and device for log synchronization
CN105323289B (en) * 2014-08-01 2019-02-05 上海博达数据通信有限公司 One kind being based on distributed method of data synchronization

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728701A (en) * 2004-07-30 2006-02-01 国家数字交换系统工程技术研究中心 Method for treating protocol stack of route through one process
CN101127052A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 Sequential chained list node quick searching method and device
CN101197657A (en) * 2007-11-12 2008-06-11 中兴通讯股份有限公司 Data synchronization method of distributed system single panel

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728701A (en) * 2004-07-30 2006-02-01 国家数字交换系统工程技术研究中心 Method for treating protocol stack of route through one process
CN101127052A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 Sequential chained list node quick searching method and device
CN101197657A (en) * 2007-11-12 2008-06-11 中兴通讯股份有限公司 Data synchronization method of distributed system single panel

Also Published As

Publication number Publication date
CN102075315A (en) 2011-05-25

Similar Documents

Publication Publication Date Title
CN101820435B (en) Synchronization method and device for MAC (Media Access Control) address table information of distributed network processing system
CN100555948C (en) A kind of switching equipment of in the stack exchanger system, being coupled of being used for
CN108173691B (en) Cross-device aggregation method and device
US9264327B2 (en) Communication network management system, method and program, and management computer
CN101110820B (en) Method and switchboard for processing spanning tree protocol message
JP6555445B1 (en) Time synchronization system, time master, management master, and time synchronization method
CN109639512B (en) Hot backup method of VTS multi-sensor information comprehensive processing system
WO2017162079A1 (en) Data synchronization method and apparatus
CN110232053B (en) Log processing method, related equipment and system
CN105554175A (en) ARP backup method in PW (Pseudo-wires) redundancy scene
WO2017008641A1 (en) Method of switching redundancy port and device utilizing same
JP5266705B2 (en) Communications system
CN103631652A (en) Method and system for achieving virtual machine migration
CN112202678A (en) MAC address synchronization method, system, device and medium
CN103152266B (en) The synchronous method of a kind of LA Management Room, the network equipment and system
CN102075315B (en) Data synchronization method and device among forwarding boards
CN1941927B (en) Data distribution to nodes of a telecommunication network
US9641268B2 (en) Method, system and device for synchronizing clocks
CN103580845B (en) A kind of clock synchronizing method based on virtual switch cluster and device
CN106941450B (en) Route synchronization method, equipment and communication system
CN102946332B (en) A kind of reverse path forwarding check method and apparatus
KR101192896B1 (en) Distributed synchronization method and apparatus for fault tolerance
CN102404215B (en) Synchronization method for filtering database table forms, device and network equipment
CN101615998A (en) A kind of method and system and access switch of in Ethernet, realizing clock synchronization
CN111064622B (en) Network device, synchronization apparatus, and information transmission method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant