CN112559246B - Data comparison method and device for hot standby smoothing stage of switch - Google Patents

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

Info

Publication number
CN112559246B
CN112559246B CN202011454270.1A CN202011454270A CN112559246B CN 112559246 B CN112559246 B CN 112559246B CN 202011454270 A CN202011454270 A CN 202011454270A CN 112559246 B CN112559246 B CN 112559246B
Authority
CN
China
Prior art keywords
data
switch
line card
mark
standby
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
CN202011454270.1A
Other languages
Chinese (zh)
Other versions
CN112559246A (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.)
Suzhou Centec Communications Co Ltd
Original Assignee
Suzhou Centec Communications 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 Suzhou Centec Communications Co Ltd filed Critical Suzhou Centec Communications 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

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)
  • Hardware Redundancy (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The invention discloses a data comparison method and a device in a hot standby 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 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 count marks of all the data on the standby switch to the line card and compares the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively; and according to the comparison result, adjusting the data in the line card and the data in the standby switch to be consistent. 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, thereby reducing the time of the smoothing stage and improving the overall performance of the equipment.

Description

Data comparison method and device for hot standby smoothing stage of switch
Technical Field
The present invention relates to a hot standby technology of a switch, and in particular, to a data comparison method and apparatus in a hot standby smoothing stage of a switch.
Background
In the hot standby function of the switch, there is a smoothing function, that is, when the main switch is off line, the standby switch takes over the responsibility of the main switch, and at this time, the upper layer data of the standby switch is compared with the line card data managed by the original main switch through a smoothing stage, so that redundant data is deleted, missing data is complemented, and incorrect data is corrected. Thus, when the standby switch is mainly lifted, the upper data and the lower data are consistent, and the stage is a smoothing 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 among the most important factors affecting the smoothing efficiency are: the number of times data is transferred between different processes. Therefore, generally, a plurality of data are encapsulated in a communication message to reduce the number of communication times. For some modules with small data storage structure units, such as routing, FDB (Forwarding DataBase ) and the like, the size of one data unit is typically about tens of bytes, and hundreds of data can be transferred by one communication, so this method is very 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 huge matching and action table entries, one data unit is often several kilobytes in size. For such a module, the number of data that can be carried by one communication is single digit, and the efficiency is not greatly improved.
As shown in fig. 1, the processing of the hot standby smoothing stage of the existing switch is to perform complete data comparison up and down, for example, 10 data of 32 bits of upper layer process data a are associated with lower layer process data B, and then all data of data a need to be transferred to the process where data B is located for comparison in the smoothing stage.
However, if the data a is large, such as an ACL (Access Control List ) module in a switch, the size of one data is often around several kilobytes, and the number of bytes of information that can be carried at a time by an inter-process communication is limited, and large bytes of data may only be transferred one at a time. Once more ACLs are configured, during the smoothing phase, a large amount of data is transferred and compared among processes, resulting in long smoothing time and affecting 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 standby smoothing stage of a switch.
In order to achieve the above purpose, the present invention proposes the following technical scheme: a data comparison method of a hot standby smoothing stage of a switch comprises the following steps:
s100, respectively backing up all data on a main switch to a standby switch and a line card, wherein each data in all the data is provided with an ID mark and a counting mark corresponding to the ID mark, and the counting marks of the main switch, the standby switch and the line card are synchronized;
s200, in a smoothing stage, the standby switch transmits the ID marks and the corresponding count marks of all the data on the standby switch to the line card and compares the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively;
and S300, according to the comparison result, adjusting the data in the line card and the data in the standby switch to be consistent.
Preferably, in S100, each time the master switch performs an operation on the ID tag, the corresponding count tag is incremented by 1, where the operation includes adding, deleting, and changing.
Preferably, in S100, the standby switch synchronizes the count marks corresponding to the same ID mark according to the ID mark and the count mark of the main switch, so that the count marks of the main switch and the standby switch are synchronized.
Preferably, in S100, the master switch carries a count tag of each data into the communication data with the line card, such that the line card and the count tag of 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, the line card has the same data as the ID mark and the counting mark of the standby switch, and the line card has the same data as the ID mark of the standby switch but the different counting mark.
Preferably, in S300, for an ID tag that is not transferred by the standby switch, the line card directly deletes the data corresponding to the ID tag.
Preferably, in S300, if there is data identical to the standby switch ID tag and the count tag in the line card, this data is indicated to be correct, and is not processed.
Preferably, in S300, for the data with the same ID tag as the standby switch and different count tag exists in the line card, the line card deletes the data locally, and then requests the standby switch to issue the correct data.
Preferably, the process of requesting the standby switch to issue the 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 transmits 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 phase 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 count marks of all the data on the standby switch to the line card in the smoothing stage and comparing the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively.
And the data adjustment 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 comparison module.
The beneficial effects of the invention are as follows: according to the invention, the counting mark is added to the process data, and the data is compared by replacing the data per se in the smoothing stage through the counting mark, so that the data to be compared can be well compressed to a certain extent, the information required to be transmitted between 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 chart of the method 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 schematic block diagram of the apparatus of the present invention.
Detailed Description
The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
The invention discloses a data comparison method and a device for a hot standby smoothing stage of a switch, which are mainly used in the fields of frame switches and switches supporting stacking functions.
Referring to fig. 2 to 5, the data comparison method in the hot standby smoothing stage of the switch disclosed by the invention comprises the following steps:
s100, all data on the main switch are respectively backed up to the standby switch and the line card, each data in all the data is provided with an ID mark and a counting mark corresponding to the ID mark, and the counting marks of the main switch, the standby switch and the line card are synchronized.
In particular, it should be explained that, firstly, each data in the switch software can be marked with a unique ID, which is a common means, and even if some data omits this ID mark because of the brevity of a key (key), the key thereof can be considered as an ID mark, and for complex data structures, the ID is often marked.
In switch software, most of the data structures, such as ACLs, are software-top processes that pass ACL information to the next process, so it can be considered that the data changes of the next process are all driven by the top process. The data is marked with ID to index the data when the data is added, deleted, changed, etc.
That is, each of all the data on the master switch of the present invention has a unique ID tag, e.g., data a has an ID of 1. Unlike available technology, the present invention adds one counting mark to each ID mark to record the number of times of adding, deleting, altering, etc. the ID mark has one counting mark added by 1. In this embodiment, the count flag of each data is set to 4 bytes, the ID flag is set to 8 bytes, i.e., 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 replace several kilobytes of data in the ACL with these 12 bytes of data for comparison.
As shown in fig. 2 and fig. 4, the master switch respectively copies all data on the master switch to the standby switch and the line card, and synchronizes counting marks of the master switch, the standby switch and the line card, for example, data a in the master switch is respectively copied to the standby switch to form data C, and the standby switch is backed up to the line card to form data B. 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 main switch, so that for the input of an instruction, the counting of the main switch and the standby switch on the same ID mark is consistent, for example, the counting mark corresponding to the data A in the main switch is consistent with the counting mark corresponding to the data C in the standby switch.
In addition, the data of each ID tag will carry the count tag in the communication data between each process, i.e. the following process (e.g. line card) can record the count of the current ID each time the data of the ID tag is received. Thus, as the system runs, there are three ID counts, specifically on the primary switch process, on the standby switch process, and on the line card process. Representing the existence state of the original data corresponding to the ID mark in three processes, and considering that the counts are consistent and the data is changed if the counts are inconsistent.
S200, in the smoothing stage, the standby switch transmits the ID marks and the corresponding count marks of all the data on the standby switch to the line card, and compares the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively.
Specifically, when the main exchanger stops working, the standby exchanger takes over the working, and at the moment, the smoothing stage of the heat backup of the exchanger is entered, and the data comparison is started up and down. Compared with the prior art, the invention only needs to communicate the ID mark and the counting mark corresponding to the ID mark to the following process, and the data volume is extremely small, and can carry hundreds of data in one communication, so that the comparison efficiency is greatly improved.
Specifically, as shown in fig. 2, 3 and 5, the standby switch transmits the ID marks and corresponding count marks of all the data on the standby switch to the line card, and after the line card receives all the ID marks and count marks, the received ID marks and count marks are respectively compared with the ID marks and count marks of all the data on the line card in a one-to-one correspondence manner. Such as comparing the ID tag and count tag of data C on the standby switch to the ID tag and count tag of data B on the line card one-to-one.
And S300, according to the comparison result, adjusting the data in the line card and the data in the standby switch to be consistent.
Specifically, the comparison result includes: the line card has an ID mark which is not transmitted by the standby switch, the line card has the same data as the ID mark and the counting mark of the standby switch, and the line card has the same data as the ID mark of the standby switch but the different 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, deleting the data corresponding to the ID mark directly.
The presence of the same data in the line card as the standby switch ID tag and the count tag indicates that the portion of the data is correct and is not processed.
And if the line card has the same data as the ID mark of the standby switch but different counting marks, the line card indicates that the data is wrong, the line card is deleted locally, and then the standby switch is requested to issue correct data.
The process of requesting the standby switch to issue the correct data specifically comprises the following steps:
the line card informs the standby switch of correct data;
and the standby switch compares the correct data with the local data, and transmits 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 entries issued by this increment are few, the data comparison efficiency is not affected.
Correspondingly, referring to fig. 6, the data comparing device in the hot standby smoothing stage of the switch disclosed by the 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 count marks of all the data on the standby switch to the line card in the smoothing stage and comparing the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively.
And the data adjustment 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 comparison module.
The working principles of the data synchronization module, the data comparison module and the data adjustment module may refer to the descriptions in the steps S100 to S300, respectively, and are not described herein.
The invention provides an effective and accurate information compression technology, which reduces data transmitted by comparison among processes, thereby improving comparison efficiency.
While the foregoing has been disclosed in the specification and drawings, it will be apparent to those skilled in the art that various substitutions and modifications may be made without departing from the spirit of the invention, and it is intended that the scope of the invention be limited not by the specific embodiments disclosed, but by the appended claims.

Claims (8)

1. A method for comparing data in a hot standby smoothing phase of a switch, the method comprising:
s100, respectively backing up all data on a main switch to a standby switch and a line card, wherein each data in all data is provided with an ID mark and a counting mark corresponding to the ID mark, and the counting marks of the main switch, the standby switch and the line card are synchronized, wherein the standby switch synchronizes the counting marks corresponding to the same ID mark according to the ID mark and the counting mark of the main switch, so that the counting marks of the main switch and the standby switch are synchronized;
s200, in a smoothing stage, the standby switch transmits the ID marks and the corresponding count marks of all the data on the standby switch to the line card and compares the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively;
s300, according to a comparison result, adjusting the data in the line card and the data in the standby switch to be consistent, wherein the comparison result comprises: the line card has an ID mark which is not transmitted by the standby switch, the line card has the same data as the ID mark and the counting mark of the standby switch, and the line card has the same data as the ID mark of the standby switch but the different counting mark.
2. The method for comparing data in a hot standby smoothing phase of a switch according to claim 1, wherein in S100, the master switch performs an operation on the ID tag each time, the corresponding count tag is incremented by 1, and the operation includes adding, deleting, and changing.
3. The method of claim 1, wherein in S100, the master switch carries a count tag of each data into the communication data with the line cards so that the line cards and the master switch synchronize the count tags.
4. The method for comparing data in a hot standby smoothing phase of a switch according to claim 1, wherein in S300, for an ID tag that is not transferred by a standby switch in a line card, the line card directly deletes the data corresponding to the ID tag.
5. The method of claim 1, wherein in S300, if there is data in the line card that is identical to the standby switch ID tag and the count tag, the data is indicated as correct, and the data is not processed.
6. The method for comparing data in a hot standby smoothing phase of a switch as claimed in claim 5, wherein in S300, for the data with the same ID tag as the standby switch but different count tag in the line card, the line card deletes the data locally and then requests the standby switch to issue the correct data.
7. The method for comparing data in a hot standby smoothing phase of a switch as claimed in claim 6, wherein the process of requesting the switch to issue the 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 transmits 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.
8. A data comparison device for a hot standby smoothing phase of a switch, comprising:
the data synchronization module is used for respectively backing up all data on the main switch to the standby switch and the line card, each data in all the data is provided with an ID mark and a counting mark corresponding to the ID mark, and synchronizing the counting marks of the main switch, the standby switch and the line card, wherein the standby switch synchronizes the counting marks corresponding to the same ID mark according to the ID mark and the counting mark of the main switch, so that the counting marks of the main switch and the standby switch are synchronized;
the data comparison module is used for transmitting the ID marks and the corresponding count marks of all the data on the standby switch to the line card in the smoothing stage and comparing the ID marks and the corresponding count marks with the ID marks and the count marks of all the data on the line card respectively;
the data adjustment 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 comparison module, and the comparison result comprises: the line card has an ID mark which is not transmitted by the standby switch, the line card has the same data as the ID mark and the counting mark of the standby switch, and the line card has the same data as the ID mark of the standby switch but the different counting mark.
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 CN112559246A (en) 2021-03-26
CN112559246B true 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 device for realizing different IP data packet repeating using strategic 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 device for realizing different IP data packet repeating using strategic 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
张玉峰 ; 孙知信 ; .基于热备份的主备倒换在高端路由器中的应用.计算机技术与发展.2010,(第03期),全文. *

Also Published As

Publication number Publication date
CN112559246A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US7428657B2 (en) Method for rolling back from snapshot with log
CN100388675C (en) A method for implementing foreground data configuration in network management system
CN100428177C (en) Method, system and program for data synchronization
CN100471134C (en) Method, device for upgrading telecommunication equipment and upgrading engine unit
EP1266309A2 (en) Method for optimization of synchronization between a client's database and a server database
CN103886091A (en) Database synchronization method based on record marks
CN101650744A (en) System and method for processing great data amount based on transport tablespace
WO2010028529A1 (en) A method and device for maintaining a changelog in data synchronization
CN104133715A (en) Ethernet power supply equipment firmware upgrade method and device
CN109977170A (en) The synchronous method and system of network data inside and outside a kind of government affairs
CN110099128B (en) Authentication data synchronization method and device
CN112559246B (en) Data comparison method and device for hot standby smoothing stage of switch
CN111563127B (en) Implementation method for synchronizing cloud face photo to face recognition device
CN100426875C (en) Main and spare internal memory data processing method
US7502899B2 (en) Write set boundary management in support of asynchronous update of secondary storage
CN105743669A (en) Data communication method and apparatus
JPH11312111A (en) Method for restoring data base and data base management system thereof
CN102364895B (en) Rapid object synchronization uploading method
CN103593369A (en) Inquiry and update method and processing system of HSS (home subscriber server) data
JPH04305751A (en) File transfer system
JP2507600B2 (en) Temporary update control method for drawing information
CN108959284B (en) Method and device for processing data in columnar database
JP4464872B2 (en) Computer system and computer control method
JPH10320256A (en) Data update control method and device for distributed database system
KR20000015088A (en) Apparatus and method for processing billing data between duplexed bmds in mobile communication switching system

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
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.

GR01 Patent grant
GR01 Patent grant