CN112559246A - Data comparison method and device for hot backup smoothing stage of switch - Google Patents

Data comparison method and device for hot backup smoothing stage of switch Download PDF

Info

Publication number
CN112559246A
CN112559246A CN202011454270.1A CN202011454270A CN112559246A CN 112559246 A CN112559246 A CN 112559246A CN 202011454270 A CN202011454270 A CN 202011454270A CN 112559246 A CN112559246 A CN 112559246A
Authority
CN
China
Prior art keywords
data
switch
line card
marks
mark
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.)
Granted
Application number
CN202011454270.1A
Other languages
Chinese (zh)
Other versions
CN112559246B (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.)
Centec Networks Suzhou Co Ltd
Original Assignee
Centec Networks Suzhou Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Centec Networks Suzhou Co Ltd filed Critical Centec Networks Suzhou Co Ltd
Priority to CN202011454270.1A priority Critical patent/CN112559246B/en
Publication of CN112559246A publication Critical patent/CN112559246A/en
Application granted granted Critical
Publication of CN112559246B publication Critical patent/CN112559246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a data comparison method and a device for a hot backup smoothing stage of a switch, wherein the method comprises the steps of respectively backing up all data on a main switch to a standby switch and a line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card; in the smoothing stage, the standby switch transmits the ID marks and the corresponding counting marks of all data on the standby switch to the line card and compares the ID marks and the counting marks with the ID marks and the counting marks of all data on the line card respectively; and according to the comparison result, adjusting the data in the line card to be consistent with the data in the standby switch. The invention compresses the data to be compared, so that the information to be transmitted between the processes in the main and standby smoothing stages is greatly reduced, the time of the smoothing stage is reduced, and the overall performance of the equipment is improved.

Description

Data comparison method and device for hot backup smoothing stage of switch
Technical Field
The present invention relates to a switch hot backup technology, and in particular, to a data comparison method and apparatus in a switch hot backup smoothing stage.
Background
In the hot standby function of the switch, a smoothing function is provided, that is, when the main switch is taken off line, the standby switch takes over the responsibility of the main switch, and at the moment, through a smoothing stage, the upper layer data of the standby switch is compared with the line card data managed by the original main switch, and redundant data is deleted, the leaked data is supplemented, and incorrect data is corrected. Therefore, when the standby switch is promoted to be the main switch, the data are consistent up and down, and the stage is a smooth stage.
In the switch, there are many modules, but the smoothing stage is experienced by each module, so the smoothing efficiency of each module must be guaranteed, and the most important factors affecting the smoothing efficiency are: the number of times data is passed between different processes. Generally, multiple data packets are encapsulated in a communication message to reduce the number of communications. For some modules with small data storage structure units, such as routing modules, FDB (Forwarding DataBase) modules, and the like, the size of one data unit is generally about tens of bytes, and hundreds of data can be transmitted through one-time communication, so that the method is effective. However, each module has the characteristics of each module, and this method is not applicable to all modules, such as ACL modules, and because of the large matching and action table entries, a data unit is often several kilobytes in size. For such a module, the number of data which can be carried by one-time communication is single-digit, and the efficiency is not greatly improved.
As shown in fig. 1, the processing of the hot backup smoothing stage of the existing switch is to perform complete data comparison from top to bottom, for example, 10 pieces of 32-bit data of the upper process data a are associated with the lower process data B, so that all data of the data a need to be transferred to the process where the data B is located in the smoothing stage for comparison.
However, if the data a is large, for example, an Access Control List (ACL) module in a switch, the size of one data is often about several kilobytes, the number of bytes of a message that can be carried in one inter-process communication is limited, and the large-byte data may only be transferred one or two at a time. Once more ACLs are configured, a large amount of data is transferred and compared between processes in the smoothing stage, which results in a long smoothing time and affects the smoothing efficiency of other modules.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a data comparison method and device for a hot backup smoothing stage of a switch.
In order to achieve the purpose, the invention provides the following technical scheme: a data comparison method for a switch hot backup smoothing stage comprises the following steps:
s100, respectively backing up all data on a main switch to a standby switch and a line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card;
s200, in the smoothing stage, the standby switch transmits the ID marks and the corresponding counting marks of all data on the standby switch to a line card and compares the ID marks and the counting marks with the ID marks and the counting marks of all data on the line card respectively;
s300, according to the comparison result, the data in the line card and the data in the standby switch are adjusted to be consistent.
Preferably, in S100, the master switch adds 1 to the corresponding count tag every time the ID tag is operated, where the operation includes addition, deletion, and modification.
Preferably, in S100, the standby switch synchronizes the counting marks corresponding to the same ID mark according to the ID mark and the counting mark of the master switch, so that the counting marks of the master switch and the standby switch are synchronized.
Preferably, in S100, the master switch carries the count tag of each data to the communication data with the line card, so that the count tags of the line card and the master switch are synchronized.
Preferably, in S300, the comparison result includes: the line card has an ID mark which is not transmitted by the standby switch, has the same data with the ID mark and the counting mark of the standby switch, and has the same data with the ID mark of the standby switch but different data with the counting mark.
Preferably, in S300, for an ID tag that is not transmitted by the standby switch exists in the line card, the line card directly deletes the data corresponding to the ID tag.
Preferably, in S300, if data identical to the standby switch ID tag and the count tag exists in the line card, this part of data is correct, and is not processed.
Preferably, in S300, for data with the same ID tag but different count tag as the standby switch ID tag, the line card locally deletes the data and requests the standby switch to send correct data.
Preferably, the process of requesting the standby switch to issue correct data includes:
the line card informs the standby switch of correct data;
and the standby switch compares the correct data with the local data and sends the data except the correct data to the line card, so that the data in the line card and the data in the standby switch are adjusted to be consistent.
The invention also discloses another technical scheme: a data comparison apparatus for a hot-standby smoothing stage of a switch, comprising:
and the data synchronization module is used for respectively backing up all data on the main switch to the standby switch and the line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card.
And the data comparison module is used for transmitting the ID marks and the corresponding counting marks of all the data on the standby switch to the line card in a smoothing stage and respectively comparing the ID marks and the counting marks with the ID marks and the counting marks of all the data on the line card.
And the data adjusting module is used for adjusting the data in the line card and the data in the standby switch to be consistent according to the comparison result of the data comparing module.
The invention has the beneficial effects that: the invention adds a counting mark to the process data, and the data comparison is carried out in the smoothing stage by replacing the data per se with the counting mark, so that the data required to be compared can be well compressed to a certain extent, the information required to be transmitted between the processes in the main and standby smoothing stages is greatly reduced, the time of the smoothing stage is reduced, and the overall performance of the equipment is improved.
Drawings
FIG. 1 is a schematic diagram of a prior art data comparison;
FIG. 2 is a schematic diagram of the data comparison of the present invention;
FIG. 3 is a schematic flow diagram of the process of the present invention;
FIG. 4 is a schematic diagram of step S100 of the present invention;
FIG. 5 is a schematic diagram of step S200 of the present invention;
fig. 6 is a block schematic diagram of the apparatus of the present invention.
Detailed Description
The technical solution of the embodiment of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention.
The invention discloses a data comparison method and device for a hot backup smoothing stage of a switch, which are mainly used in the field of frame switches and switches supporting stacking functions.
Referring to fig. 2 to 5, a method for comparing data in a hot backup smoothing stage of an exchange disclosed in the present invention includes the following steps:
s100, respectively backing up all data on the main switch to the standby switch and the line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card.
Specifically, it should be explained that, firstly, each data in the switch software can be marked with a unique ID, which is a common means, even if some data omit the ID mark because of the simplicity of the key (key), the key can be regarded as an ID mark for this reason, and for a complex data structure, the ID is often marked.
In the switch software, most data structures, such as ACLs, are that the process above the software transmits ACL information to the process below, so that the data change of the process below can be considered to be driven by the process above. When data is added, deleted, changed and the like, the data is indexed with an ID mark.
That is, each of all data on the master switch of the present invention has a unique ID tag, e.g., the ID of data a is 1. Different from the prior art, the invention adds a counting mark to each ID mark for recording the times of operations such as addition, deletion, modification and the like of the ID mark, and the corresponding counting mark is added with 1 every time the ID mark is operated. In this embodiment, the count flag of each data is set to 4 bytes, and the ID flag is set to 8 bytes, that is, the count flag and the ID flag of each data are 12 bytes in total, and the smoothing stage of the present invention is to use the 12 bytes of data to replace several kilobytes of data in the ACL for comparison.
As shown in fig. 2 and 4, the main switch backs up all data thereon to the standby switch and the line card, and synchronizes the counting marks of the main switch, the standby switch and the line card, for example, data a in the main switch is backed up to the standby switch to form data C, and data B is backed up to the line card. Specifically, after the standby switch is on line, the counting marks corresponding to the same ID mark are synchronized according to the ID mark and the counting mark of the master switch, so that for the input of an instruction, the counts of the same ID mark by the master switch and the standby switch are consistent, for example, the counting mark corresponding to the data a in the master switch is consistent with the counting mark corresponding to the data C in the standby switch.
In addition, the data of each ID tag carries a count tag in each inter-process communication data, that is, the next process (e.g., line card) can record the current ID count after receiving the data change of the ID tag. Thus, as the system operates, there will be three ID counts, specifically on the master switch process, on the standby switch process, and on the line card process. The data storage device respectively represents the existing states of the original data corresponding to the ID marks in the three processes, the counts are consistent, the data are considered to be consistent, and the data are considered to be changed if the counts are inconsistent.
S200, in the smoothing stage, the standby switch transmits the ID marks and the corresponding counting marks of all data on the standby switch to the line card and compares the ID marks and the counting marks with the ID marks and the counting marks of all data on the line card respectively.
Specifically, when the main switch stops working, the standby switch takes over the working, and at this time, a smoothing stage of the hot backup of the switch is entered, and data comparison performed up and down is started. Compared with the prior art, the invention only needs to communicate and compare the ID mark and the counting mark corresponding to the ID mark to the next process, and because the data volume is extremely small, hundreds of ID marks can be carried in one communication, thereby greatly improving the comparison efficiency.
Specifically, as shown in fig. 2, fig. 3, and fig. 5, the standby switch transmits the ID tags and the corresponding count tags of all data on the standby switch to the line card, and after the line card receives all the ID tags and the count tags, the received ID tags and the count tags are respectively compared with the ID tags and the count tags of all data on the line card in a one-to-one correspondence manner. For example, the ID tag and the count tag of the data C on the standby switch are compared with the ID tag and the count tag of the data B on the line card one by one.
S300, according to the comparison result, the data in the line card and the data in the standby switch are adjusted to be consistent.
Specifically, the comparison result includes: the line card has an ID mark which is not transmitted by the standby switch, has the same data with the ID mark and the counting mark of the standby switch, and has the same data with the ID mark of the standby switch but different data with the counting mark.
For the comparison result, the processing procedure corresponding to the line card includes:
and if the ID mark which is not transmitted by the standby switch exists in the line card and the data corresponding to the ID mark in the line card is redundant data, directly deleting the data corresponding to the ID mark.
If the data identical to the ID mark and the counting mark of the standby switch exists in the line card, the data is correct, and the data is not processed.
If data which is the same as the ID mark of the standby switch but has a different counting mark exists in the line card, the data is indicated to be wrong, and the data is locally deleted first and then the standby switch is requested to send correct data.
The process of requesting the standby switch to issue correct data specifically includes:
the line card informs the standby switch of correct data;
and the standby switch compares the correct data with the local data and sends the data except the correct data to the line card, so that the data in the line card and the data in the standby switch are adjusted to be consistent. Since the data items issued by the increment are few, the data comparison efficiency is not influenced.
Correspondingly, referring to fig. 6, the data comparison apparatus for the hot backup smoothing stage of the switch disclosed in the present invention includes:
and the data synchronization module is used for respectively backing up all data on the main switch to the standby switch and the line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card.
And the data comparison module is used for transmitting the ID marks and the corresponding counting marks of all the data on the standby switch to the line card in a smoothing stage and respectively comparing the ID marks and the counting marks with the ID marks and the counting marks of all the data on the line card.
And the data adjusting module is used for adjusting the data in the line card and the data in the standby switch to be consistent according to the comparison result of the data comparing module.
The working principles of the data synchronization module, the data comparison module and the data adjustment module may refer to the descriptions in steps S100 to S300, which are not repeated herein.
The invention provides an effective and accurate information compression technology, which reduces data transmitted by comparison among processes, thereby improving comparison efficiency.
Therefore, the scope of the present invention should not be limited to the disclosure of the embodiments, but includes various alternatives and modifications without departing from the scope of the present invention, which is defined by the claims of the present patent application.

Claims (10)

1. A data comparison method for a switch hot backup smoothing stage is characterized by comprising the following steps:
s100, respectively backing up all data on a main switch to a standby switch and a line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card;
s200, in the smoothing stage, the standby switch transmits the ID marks and the corresponding counting marks of all data on the standby switch to a line card and compares the ID marks and the counting marks with the ID marks and the counting marks of all data on the line card respectively;
s300, according to the comparison result, the data in the line card and the data in the standby switch are adjusted to be consistent.
2. The method as claimed in claim 1, wherein in S100, the master switch adds 1 to the corresponding count tag every time the ID tag is operated, and the operation includes adding, deleting and modifying.
3. The method according to claim 1, wherein in S100, the standby switch synchronizes the counting marks corresponding to the same ID mark according to the ID mark and the counting mark of the primary switch, so that the counting marks of the primary switch and the standby switch are synchronized.
4. The method according to claim 1, wherein in S100, the main switch carries a count tag of each data to the communication data of the line card, so that the count tags of the line card and the main switch are synchronized.
5. The method according to claim 1, wherein in S300, the comparison result includes: the line card has an ID mark which is not transmitted by the standby switch, has the same data with the ID mark and the counting mark of the standby switch, and has the same data with the ID mark of the standby switch but different data with the counting mark.
6. The method according to claim 5, wherein in step S300, for an ID tag that is not transmitted by the standby switch and exists in the line card, the line card directly deletes the data corresponding to the ID tag.
7. The method as claimed in claim 5, wherein in step S300, if there is data in the line card that is the same as the spare switch ID flag and the count flag, this part of data is correct, and then the data is not processed.
8. The method according to claim 7, wherein in step S300, for data with the same ID tag but different count tag as the backup switch ID tag, the line card locally deletes the data and requests the backup switch to send correct data.
9. The method as claimed in claim 8, wherein the step of requesting the standby switch to issue correct data comprises:
the line card informs the standby switch of correct data;
and the standby switch compares the correct data with the local data and sends the data except the correct data to the line card, so that the data in the line card and the data in the standby switch are adjusted to be consistent.
10. A data comparison apparatus in a hot standby smoothing stage of a switch, comprising:
and the data synchronization module is used for respectively backing up all data on the main switch to the standby switch and the line card, setting an ID mark and a counting mark corresponding to the ID mark for each data in all the data, and synchronizing the counting marks of the main switch, the standby switch and the line card.
And the data comparison module is used for transmitting the ID marks and the corresponding counting marks of all the data on the standby switch to the line card in a smoothing stage and respectively comparing the ID marks and the counting marks with the ID marks and the counting marks of all the data on the line card.
And the data adjusting module is used for adjusting the data in the line card and the data in the standby switch to be consistent according to the comparison result of the data comparing module.
CN202011454270.1A 2020-12-10 2020-12-10 Data comparison method and device for hot standby smoothing stage of switch Active CN112559246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011454270.1A CN112559246B (en) 2020-12-10 2020-12-10 Data comparison method and device for hot standby smoothing stage of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011454270.1A CN112559246B (en) 2020-12-10 2020-12-10 Data comparison method and device for hot standby smoothing stage of switch

Publications (2)

Publication Number Publication Date
CN112559246A true CN112559246A (en) 2021-03-26
CN112559246B CN112559246B (en) 2024-02-27

Family

ID=75061739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011454270.1A Active CN112559246B (en) 2020-12-10 2020-12-10 Data comparison method and device for hot standby smoothing stage of switch

Country Status (1)

Country Link
CN (1) CN112559246B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1321004A (en) * 2000-04-25 2001-11-07 华为技术有限公司 Method and equipment for swapping active with standby switches
CN1392711A (en) * 2001-06-14 2003-01-22 日本电气株式会社 Network monitoring system, data quatity counting method and systimatic program thereof
CN1612562A (en) * 2003-10-28 2005-05-04 武汉烽火网络有限责任公司 Method and apparatus for implementing different internet protocol data packet forwarding using policy flow
CN1622483A (en) * 2003-11-27 2005-06-01 华为技术有限公司 A method for implementing software hot-backup of main and reserve machines
JP2007300634A (en) * 2006-05-05 2007-11-15 Kofukin Seimitsu Kogyo (Shenzhen) Yugenkoshi Network device and its time synchronization method
CN106789157A (en) * 2016-11-11 2017-05-31 武汉烽火网络有限责任公司 The hardware resource management method of pile system and stacked switch
CN112039863A (en) * 2020-08-25 2020-12-04 烽火通信科技股份有限公司 Method and equipment for backup and smoothing of TCP stream in TCP hot standby architecture

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1321004A (en) * 2000-04-25 2001-11-07 华为技术有限公司 Method and equipment for swapping active with standby switches
CN1392711A (en) * 2001-06-14 2003-01-22 日本电气株式会社 Network monitoring system, data quatity counting method and systimatic program thereof
CN1612562A (en) * 2003-10-28 2005-05-04 武汉烽火网络有限责任公司 Method and apparatus for implementing different internet protocol data packet forwarding using policy flow
CN1622483A (en) * 2003-11-27 2005-06-01 华为技术有限公司 A method for implementing software hot-backup of main and reserve machines
JP2007300634A (en) * 2006-05-05 2007-11-15 Kofukin Seimitsu Kogyo (Shenzhen) Yugenkoshi Network device and its time synchronization method
CN106789157A (en) * 2016-11-11 2017-05-31 武汉烽火网络有限责任公司 The hardware resource management method of pile system and stacked switch
CN112039863A (en) * 2020-08-25 2020-12-04 烽火通信科技股份有限公司 Method and equipment for backup and smoothing of TCP stream in TCP hot standby architecture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张玉峰;孙知信;: "基于热备份的主备倒换在高端路由器中的应用", 计算机技术与发展, no. 03, 10 March 2010 (2010-03-10) *

Also Published As

Publication number Publication date
CN112559246B (en) 2024-02-27

Similar Documents

Publication Publication Date Title
US5390335A (en) Method for modifying system configuration data sets in a telecommunications switching system
US7428657B2 (en) Method for rolling back from snapshot with log
CN100471134C (en) Method, device for upgrading telecommunication equipment and upgrading engine unit
US20050083862A1 (en) Data migration method, system and node
EP1266309A2 (en) Method for optimization of synchronization between a client's database and a server database
US7035392B2 (en) Unique repository server in an operations and maintenance center for a telecommunications system
EP1853002A1 (en) Method of network management system interface negotiation and apparatus thereof
EP1577776B1 (en) Method and apparatus for data synchronization in a distributed data base system
WO2010131482A1 (en) Database device, database matching system, and database matching method
JPS5851339A (en) Control information control system
CN112559246A (en) Data comparison method and device for hot backup smoothing stage of switch
US5931955A (en) Method and generic automatic database recovery
CN100490343C (en) A method and device for realizing switching between main and backup units in communication equipment
CN108282371B (en) Network element service configuration method and system
JPH0879370A (en) Operation system for exchange
CN102014008A (en) Data disaster-tolerant method and system
JPH05244653A (en) Common data base duplex system for mobile communication system
CN103593369B (en) Inquiry and update method and processing system of HSS (home subscriber server) data
JPH06119182A (en) Information communication network system with down-load control function
US7106724B2 (en) System and method for querying and recovering circuit group state in a switched network
JPH11312111A (en) Method for restoring data base and data base management system thereof
CN110012109A (en) Method for establishing engineering information capable of realizing high accuracy
KR100328667B1 (en) Backup Method For Subscriber Information Of HLR System
EP2485510A1 (en) System and method for implementing concentrated access of business operations support system
CN101141209B (en) SDH network element data recovery system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 215101 unit 13 / 16, 4th floor, building B, No. 5, Xinghan street, Suzhou Industrial Park, Jiangsu Province

Applicant after: Suzhou Shengke Communication Co.,Ltd.

Address before: Unit 13 / 16, 4th floor, building B, No.5 Xinghan street, Suzhou Industrial Park, 215000 Jiangsu Province

Applicant before: CENTEC NETWORKS (SUZHOU) Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant