CN114020529A - Backup method and device of flow table data, network equipment and storage medium - Google Patents

Backup method and device of flow table data, network equipment and storage medium Download PDF

Info

Publication number
CN114020529A
CN114020529A CN202111272140.0A CN202111272140A CN114020529A CN 114020529 A CN114020529 A CN 114020529A CN 202111272140 A CN202111272140 A CN 202111272140A CN 114020529 A CN114020529 A CN 114020529A
Authority
CN
China
Prior art keywords
backup
target
data
core
backup data
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.)
Pending
Application number
CN202111272140.0A
Other languages
Chinese (zh)
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.)
Eversec Beijing Technology Co Ltd
Original Assignee
Eversec Beijing Technology 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 Eversec Beijing Technology Co Ltd filed Critical Eversec Beijing Technology Co Ltd
Priority to CN202111272140.0A priority Critical patent/CN114020529A/en
Publication of CN114020529A publication Critical patent/CN114020529A/en
Pending legal-status Critical Current

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
    • 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/1448Management of the data involved in backup or backup restore

Abstract

The embodiment of the invention discloses a backup method and a device of flow table data, wherein the method comprises the following steps: in response to the fact that the newly added flow table data exists in the target forwarding core, sending the backup data of the newly added flow table data to the matched target memory space through the target forwarding core; sending the backup data in the target memory space to a matched target message queue; reading the backup data in the target message queue through the target backup core, and serializing the backup data; and sending the serialized backup data to the standby network equipment through the target backup core. The technical scheme provided by the embodiment of the invention realizes the separation of the data forwarding task and the flow table backup task on the forwarding core, greatly reduces the data processing pressure of the forwarding core, improves the data forwarding efficiency of the forwarding core, and simultaneously improves the synchronization efficiency of the flow table data by executing serialization and backup data transmission through the backup core.

Description

Backup method and device of flow table data, network equipment and storage medium
Technical Field
The embodiment of the invention relates to a network transmission technology, in particular to a method and a device for backing up flow table data, network equipment and a storage medium.
Background
For a network device operating in an existing network, when the network device fails, another device is required to quickly take over current network traffic, and therefore, the active/standby disaster recovery function becomes an indispensable component of the network device.
When the host fails, the standby machine is changed into the host to take over the current traffic so as to ensure the continuity of the traffic in the current network, and if the new host can take over the current traffic quickly after the switching, the flow table data on the old host is relied on so as to ensure the high-speed forwarding of the traffic.
In the prior art, most virtualized network devices are multi-core network devices, and in a multi-core environment, backup of flow table data is usually performed by each processor core to perform own backup data transmission, that is, each processor core performs backup of flow table data while processing flow forwarding, but such a flow table backup manner greatly affects data forwarding performance of the processor core and cannot ensure synchronization efficiency of backup data.
Disclosure of Invention
The embodiment of the invention provides a method and a device for backing up flow table data, network equipment and a storage medium, which are used for realizing the backup of the flow table data of the network equipment.
In a first aspect, an embodiment of the present invention provides a method for backing up flow table data, including:
in response to the fact that newly added flow table data exist in a target forwarding core, sending backup data of the newly added flow table data to a matched target memory space through the target forwarding core;
sending the backup data in the target memory space to a matched target message queue;
reading the backup data in the target message queue through a target backup core, and serializing the backup data;
and sending the serialized backup data to a standby network device through the target backup core.
In a second aspect, an embodiment of the present invention provides a backup apparatus for flow table data, including:
the memory space storage module is used for responding to the fact that newly-increased flow table data exist in a target forwarding core, and sending backup data of the newly-increased flow table data to a matched target memory space through the target forwarding core;
the message queue storage module is used for sending the backup data in the target memory space to a matched target message queue;
the serialization execution module is used for reading the backup data in the target message queue through a target backup core and serializing the backup data;
and the backup data sending module is used for sending the serialized backup data to the standby network equipment through the target backup core.
In a third aspect, an embodiment of the present invention further provides a network device, where the network device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the backup method of the flow table data according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, implement the method for backing up flow table data according to any embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, the backup data of the newly added flow table data is sent to the matched target memory space through the target forwarding core, the backup data in the target memory space is sent to the matched target message queue, the backup data in the target message queue is read through the target backup core, the backup data is serialized, and the serialized backup data is sent to the standby network equipment, so that the separation of the data forwarding task and the flow table backup task on the forwarding core is realized, the data processing pressure of the forwarding core is greatly reduced, the data forwarding efficiency of the forwarding core is improved, and meanwhile, the synchronization efficiency of the flow table data is also improved by executing serialization and backup data sending through the backup core.
Drawings
Fig. 1 is a flowchart of a method for backing up flow table data according to an embodiment of the present invention;
fig. 2 is a flowchart of a backup method of flow table data according to a second embodiment of the present invention;
fig. 3 is a block diagram of a backup apparatus for stream table data according to a third embodiment of the present invention;
fig. 4 is a block diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for backing up flow table data according to an embodiment of the present invention, where this embodiment is applicable to a network device serving as a host to back up flow table data to a standby device, and the method may be executed by a device for backing up flow table data according to an embodiment of the present invention, where the device may be implemented by software and/or hardware and integrated on a network device, and typically may be integrated in a network device such as a switch, a router, or a server, and the method specifically includes the following steps:
s110, responding to the fact that newly added flow table data exist in the target forwarding core, and sending the backup data of the newly added flow table data to the matched target memory space through the target forwarding core.
The flow table, namely the flow statistical table, is a set of policy table entries for the data flow and is responsible for searching and forwarding the data packet; the flow table includes a Header field (Header Fields) for packet matching, a counter (Counters) for counting the number of matched packets, and Actions (Actions) for showing the processing manner of the matched packets; because the network traffic carried by the network device, that is, the network data forwarded by the network device, exists in the form of a data packet, a piece of traffic statistic data recorded in the flow table represents parameter information of one data packet; the parameter information specifically comprises a flow type, a speed limit configuration, a protocol result and an effectiveness verification result; a traffic type, that is, a data type of the traffic data packet, for example, a TCP (Transmission Control Protocol) handshake message; rate limit configuration, i.e. the transmission rate requirement of the traffic data packet; the Protocol result, i.e. the type of Protocol used by the traffic packet, e.g. STP (Spanning Tree Protocol); the validity verification result is a result identification of the flow data packet after validity verification; optionally, in the embodiment of the present invention, the parameter type of the flow statistics data in the flow table is not specifically limited.
The network device in the embodiment of the present invention includes at least two computing engines (i.e., cores), where the cores may be from one Central Processing Unit (CPU) or from different CPUs, that is, the network device may include one or more multi-core CPUs, or multiple single-core CPUs, or both a single-core CPU and a multi-core CPU; the forwarding cores are kernels used for forwarding data, and each forwarding core is provided with an independent flow table and is used for recording parameter information of network data forwarded by the forwarding core; the backup core does not execute the data forwarding task; optionally, in the embodiment of the present invention, the number of central processors and the number of cores of the network device are not specifically limited.
The memory space is a backup data storage space allocated for the forwarding core, the newly added flow table data comprises the updated flow record in the existing flow table and the flow record in the newly added flow table, and when the newly added flow table data is detected to exist in the flow table of the target forwarding core, the backup data (namely the copy data) of the newly added flow table data is sent to the matched target memory space through the target forwarding core, so that the backup data is stored through the target memory space.
Optionally, in this embodiment of the present invention, before detecting that there is newly added flow table data in the target forwarding core, the method further includes: configuring a forwarding core and a backup core of the network equipment according to the historical flow record of the network equipment; wherein the network device comprises at least one forwarding core and at least one backup core, and the backup core is matched with the at least one forwarding core. Configuring one or more cores into forwarding cores according to the historical traffic records of the network equipment and the data processing capacity of each core, so as to meet the forwarding requirements of the network traffic through the forwarding cores; meanwhile, one or more cores are configured as backup cores according to the data processing capacity of each forwarding core, each backup core is associated and matched with one or more forwarding cores, and when the data forwarding requirement of the network equipment is met, the backup cores execute serialization processing and sending of backup data, so that the data processing pressure of the forwarding cores is reduced, and the data forwarding efficiency of the forwarding cores is improved.
Optionally, in this embodiment of the present invention, the sending, by the target forwarding core, the backup data of the newly added flow table data to the matched target memory space specifically includes: judging whether the target memory space meets the storage requirement of the backup data; if the target memory space meets the storage requirement of the backup data, the backup data of the newly added flow table data is sent to the matched target memory space through the target forwarding core; and if the target memory space does not meet the storage requirement of the backup data, performing capacity expansion on the target memory space, and sending the backup data of the newly added flow table data to the capacity-expanded target memory space through the target forwarding core.
Specifically, since each piece of backup data includes the same parameter information item, an individual storage space of the same size, for example, 16 bytes, may be configured for each piece of backup data; meanwhile, a fixed number (for example, 1024) of individual storage spaces may be configured for each forwarding core, or different numbers of individual storage spaces may be configured according to different network flows carried by each forwarding core; if the target memory space comprises at least one unoccupied individual storage space, the target memory space is indicated to meet the storage requirement of the backup data, and the backup data can be directly stored; if the individual storage spaces of the target memory space are occupied, performing capacity expansion processing on the target memory space, for example, reapplying the fixed number (i.e., 1024) of individual storage spaces to meet the storage requirement of the backup data.
And S120, sending the backup data in the target memory space to a matched target message queue.
The message queue is a linear table, and one end of the message queue is used for inputting backup data, namely the backup data is written in the memory space, and the other end of the message queue is used for outputting the backup data, namely the backup data is read by the backup core.
Optionally, in this embodiment of the present invention, before detecting that there is newly added flow table data in the target forwarding core, the method further includes: in response to the acquisition of an equipment starting instruction, configuring a memory space and a message queue for a forwarding core of the network equipment; the forwarding cores are matched with the memory spaces one by one, and the forwarding cores are matched with the message queues one by one. In the starting stage of the network equipment, a memory space is allocated to each forwarding core in advance, a corresponding message queue is initialized, the forwarding cores are prevented from executing application of the memory space in the data forwarding stage, the message queue is prevented from being created, and the data processing pressure of the forwarding cores in the data forwarding stage is further reduced.
Optionally, in the embodiment of the present invention, the memory space includes a Cache storage space; and/or the message queue operates based on producer and consumer modes; wherein the forwarding core is a producer of the message queue and the backup core is a consumer of the message queue. The Cache memory (namely a Cache memory) has the characteristic of high read-write speed, and compared with the condition that a central processing unit needs to wait for a longer time period when accessing data from a memory, the central processing unit can directly call the data in the Cache memory, so that the access waiting time is greatly reduced, and the data processing efficiency is improved; the producer and consumer model solves the problem of strong coupling between a producer (namely a forwarding core) and a consumer (namely a backup core) through an intermediate container (namely a message queue), the producer and the consumer do not directly communicate with each other, the forwarding core does not need to wait for backup core processing after transmitting backup data, the backup data is directly put into the message queue, the backup core does not need to wait for the backup data transmission of the producer, the backup data is directly obtained from the message queue, and the data processing capacity of the forwarding core and the backup core is balanced.
S130, reading the backup data in the target message queue through the target backup core, and serializing the backup data.
Serialization (Serialization) is the process of converting backup data from storage form to transmission form so that the backup network device receives the local backup flow table; compared with the prior art, the serialization of the backup data is executed by the forwarding core, in the embodiment of the invention, the serialization processing of the backup data is completed by the target backup core, so that the data processing pressure of the forwarding core is further reduced; optionally, in the embodiment of the present invention, a processing manner of serialization is not particularly limited.
Optionally, in this embodiment of the present invention, the reading, by the target backup core, the backup data in the target message queue and serializing the backup data includes: reading the backup data in the target message queue according to a preset reading period through a target backup core, and serializing the backup data; and/or the sending the serialized backup data to a standby network device through the target backup core comprises: and sending the serialized backup data to standby network equipment through the target backup core according to a preset sending period and an accumulated threshold value to be sent.
Specifically, a first timer may be set for each backup core, and the timing interval may be set to 10ms, that is, a read notification is sent to the target backup core every 10 ms; the target backup core obtains the reading notice according to the preset reading period (namely 10ms), and reads the backup data in the message queue in a polling mode; in order to ensure timeliness of flow table data backup, a second timer can be further set for each backup core, and the timing interval can be set to be 100ms, namely, a notification is sent to the backup core every 100 ms; the backup core transmits the serialized backup data in a delayed manner according to the preset transmission period (namely 100 ms); meanwhile, in order to avoid data backlog, an accumulated threshold to be sent, for example, 1024 data, is set according to the data volume limit value of single sending, and when the number of the acquired backup data reaches the accumulated threshold to be sent, the backup data is also sent in batch; by setting the preset sending period and the cumulative threshold value to be sent, the calling times of the data sending interface are reduced, and the resource occupation of the network equipment is reduced.
S140, sending the serialized backup data to a standby network device through the target backup core.
Optionally, in this embodiment of the present invention, after sending the serialized backup data to the standby network device through the target backup core, the method includes: judging whether the residual space of the target memory space is greater than or equal to a preset storage threshold value or not; if the residual space of the target memory space is larger than or equal to a preset storage threshold value, deleting the backup data, and moving the storage space occupied by the backup data out of the target memory space; and if the residual space of the target memory space is smaller than a preset storage threshold value, deleting the backup data, and adding the storage space occupied by the backup data into the target memory space. Specifically, if the remaining space of the target memory space is large, that is, greater than or equal to the preset storage threshold, after deleting the sent backup data, directly releasing the storage space occupied by the backup data, that is, returning the storage space occupied by the backup data to the memory; and if the residual space of the target memory space is smaller, namely smaller than a preset storage threshold value, returning the storage space occupied by the backup data to the target memory space after deleting the sent backup data.
According to the technical scheme provided by the embodiment of the invention, the backup data of the newly added flow table data is sent to the matched target memory space through the target forwarding core, the backup data in the target memory space is sent to the matched target message queue, the backup data in the target message queue is read through the target backup core, the backup data is serialized, and the serialized backup data is sent to the standby network equipment, so that the separation of the data forwarding task and the flow table backup task on the forwarding core is realized, the data processing pressure of the forwarding core is greatly reduced, the data forwarding efficiency of the forwarding core is improved, and meanwhile, the synchronization efficiency of the flow table data is also improved by executing serialization and backup data sending through the backup core.
Example two
Fig. 2 is a flowchart of a backup method for flow table data according to a second embodiment of the present invention, which is embodied on the basis of the foregoing technical solution, and specifically, the method includes the following steps:
s201, configuring a forwarding core and a backup core of a network device according to a historical flow record of the network device; s202 is performed.
S202, in response to the obtained device starting instruction, executing init initialization of the network device; s203 is performed.
In the embodiment of the invention, the network equipment carries the Linux system, and when the network equipment is started, the initialization of the init process under the Linux system is executed.
S203, configuring a memory space for a forwarding core of the network equipment, and initializing a message queue; s204 is performed.
S204, detecting that newly added flow table data exists in the target forwarding core; s205 is performed.
S205, judging whether the target memory space meets the storage requirement of the backup data of the newly added flow table data; if yes, go to S207; if not, go to S206.
S206, capacity increasing is carried out on the target memory space; s207 is performed.
S207, sending the backup data of the newly added flow table data to a target memory space through a target forwarding core; s208 is performed.
S208, sending the backup data in the target memory space to a matched target message queue; s209 is performed.
S209, sending a reading notice to the target backup core through the first timer; s210 is performed.
S210, polling a target message queue through a target backup core to acquire backup data; s211 is executed.
S211, performing serialization processing on the backup data, and putting the backup data into a waiting queue; s212 is performed.
S212, judging whether the waiting queue meets the sending condition; if yes, go to S213; if not, go to step S204.
Specifically, whether a sending notification sent by the second timer is acquired or not and whether the number of backup data in the waiting queue is greater than or equal to a cumulative threshold to be sent or not are judged.
S213, sending the backup data in the waiting queue to the standby network equipment; s213 is performed.
S214, judging whether the residual space of the target memory space is larger than or equal to a preset storage threshold value or not; if yes, go to S215; if not, go to S216.
S215, deleting the backup data in the target memory space, and moving the storage space occupied by the backup data out of the target memory space.
S216, deleting the backup data in the target memory space, and adding the storage space occupied by the backup data into the memory space management pool.
And the memory space management pool is used for managing the storage space released by deleting the backup data, and when the capacity increase application of the memory space is obtained, the memory space management pool is used for allocating the storage space for each memory space.
According to the technical scheme provided by the embodiment of the invention, the forwarding core and the backup core of the network equipment are configured, the memory space and the initialized message queue are configured for the forwarding core in advance, the forwarding core is prevented from executing the application of the memory space in the data forwarding stage and the establishment of the message queue, the separation of the data forwarding task on the forwarding core and the flow table backup task is realized, the data forwarding efficiency of the forwarding core is improved, meanwhile, the backup data in the target message queue is read through the target backup core, the backup data is serialized, and the serialized backup data is sent to the standby network equipment, so that the serialization and the backup data sending executed through the backup core are realized, and the synchronization efficiency of the flow table data is improved.
EXAMPLE III
Fig. 3 is a block diagram of a backup apparatus for stream table data according to a third embodiment of the present invention, where the apparatus specifically includes: a memory space storage module 310, a message queue storage module 320, a serialization execution module 330, and a backup data transmission module 340.
The memory space storage module 310 is configured to, in response to detecting that newly added flow table data exists in the target forwarding core, send backup data of the newly added flow table data to a matched target memory space through the target forwarding core;
a message queue storage module 320, configured to send the backup data in the target memory space to a matched target message queue;
a serialization execution module 330, configured to read the backup data in the target message queue through a target backup core, and serialize the backup data;
the backup data sending module 340 is configured to send the serialized backup data to a standby network device through the target backup core.
According to the technical scheme provided by the embodiment of the invention, the backup data of the newly added flow table data is sent to the matched target memory space through the target forwarding core, the backup data in the target memory space is sent to the matched target message queue, the backup data in the target message queue is read through the target backup core, the backup data is serialized, and the serialized backup data is sent to the standby network equipment, so that the separation of the data forwarding task and the flow table backup task on the forwarding core is realized, the data processing pressure of the forwarding core is greatly reduced, the data forwarding efficiency of the forwarding core is improved, and meanwhile, the synchronization efficiency of the flow table data is also improved by executing serialization and backup data sending through the backup core.
Optionally, on the basis of the above technical solution, the backup device for the flow table data further includes:
the core configuration execution module is used for configuring a forwarding core and a backup core of the network equipment according to the historical flow record of the network equipment; wherein the network device comprises at least one forwarding core and at least one backup core, and the backup core is matched with the at least one forwarding core.
Optionally, on the basis of the above technical solution, the backup device for the flow table data further includes:
the memory space configuration module is used for configuring a memory space and a message queue for a forwarding core of the network equipment in response to the obtained equipment starting instruction; the forwarding cores are matched with the memory spaces one by one, and the forwarding cores are matched with the message queues one by one.
Optionally, on the basis of the above technical solution, the memory space includes a Cache storage space; and/or the message queue operates based on producer and consumer modes; wherein the forwarding core is a producer of the message queue and the backup core is a consumer of the message queue.
Optionally, on the basis of the foregoing technical solution, the memory space storage module 310 specifically includes:
the storage requirement judging unit is used for judging whether the target memory space meets the storage requirement of the backup data or not;
the first memory space storage unit is used for sending the backup data of the newly added flow table data to the matched target memory space through the target forwarding core if the target memory space meets the storage requirement of the backup data;
and the second memory space storage unit is used for increasing the capacity of the target memory space if the target memory space does not meet the storage requirement of the backup data, and sending the backup data of the newly added flow table data to the target memory space after the capacity is increased through the target forwarding core.
Optionally, on the basis of the foregoing technical solution, the serialization execution module 330 is specifically configured to read, by the target backup core, the backup data in the target message queue according to a preset read cycle, and serialize the backup data.
Optionally, on the basis of the above technical solution, the backup data sending module 340 is specifically configured to send the serialized backup data to the standby network device through the target backup core according to a preset sending period and an accumulated threshold to be sent.
Optionally, on the basis of the above technical solution, the backup device for the flow table data further includes:
a preset storage threshold value judging module, configured to judge whether a remaining space of the target memory space is greater than or equal to a preset storage threshold value;
the first storage space releasing module is used for deleting the backup data and moving the storage space occupied by the backup data out of the target memory space if the residual space of the target memory space is larger than or equal to a preset storage threshold;
and the second storage space releasing module is used for deleting the backup data and adding the storage space occupied by the backup data into the target memory space if the residual space of the target memory space is smaller than a preset storage threshold.
The device can execute the backup method of the flow table data provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technique not described in detail in this embodiment, reference may be made to a backup method of the flow table data provided in any embodiment of the present invention.
Example four
Fig. 4 is a schematic structural diagram of a network device according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary network device 12 suitable for use in implementing embodiments of the present invention. The network device 12 shown in fig. 4 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 4, the network device 12 is in the form of a general purpose computer device. The components of network device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples various system components including the memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Network device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by network device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Network device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Network device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the network device 12, and/or with any devices (e.g., network card, modem, etc.) that enable the network device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, network device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, the network adapter 20 communicates with the other modules of the network device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with network device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the memory 28, for example, implementing a backup method of flow table data provided by an embodiment of the present invention. Namely: in response to the fact that newly added flow table data exist in a target forwarding core, sending backup data of the newly added flow table data to a matched target memory space through the target forwarding core; sending the backup data in the target memory space to a matched target message queue; reading the backup data in the target message queue through a target backup core, and serializing the backup data; and sending the serialized backup data to a standby network device through the target backup core.
EXAMPLE five
Fifth, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for backing up flow table data according to any embodiment of the present invention; the method comprises the following steps:
in response to the fact that newly added flow table data exist in a target forwarding core, sending backup data of the newly added flow table data to a matched target memory space through the target forwarding core;
sending the backup data in the target memory space to a matched target message queue;
reading the backup data in the target message queue through a target backup core, and serializing the backup data;
and sending the serialized backup data to a standby network device through the target backup core.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A backup method of flow table data is applied to a network device, and comprises the following steps:
in response to the fact that newly added flow table data exist in a target forwarding core, sending backup data of the newly added flow table data to a matched target memory space through the target forwarding core;
sending the backup data in the target memory space to a matched target message queue;
reading the backup data in the target message queue through a target backup core, and serializing the backup data;
and sending the serialized backup data to a standby network device through the target backup core.
2. The method of claim 1, before detecting that there is new flow table data in the target forwarding core, further comprising:
configuring a forwarding core and a backup core of the network equipment according to the historical flow record of the network equipment; wherein the network device comprises at least one forwarding core and at least one backup core, and the backup core is matched with the at least one forwarding core.
3. The method according to claim 1 or 2, before detecting that there is new flow table data in the target forwarding core, further comprising:
in response to the acquisition of an equipment starting instruction, configuring a memory space and a message queue for a forwarding core of the network equipment; the forwarding cores are matched with the memory spaces one by one, and the forwarding cores are matched with the message queues one by one.
4. The method of claim 3, wherein the memory space comprises a Cache storage space;
and/or the message queue operates based on producer and consumer modes;
wherein the forwarding core is a producer of the message queue and the backup core is a consumer of the message queue.
5. The method according to claim 1, wherein the sending, by the target forwarding core, the backup data of the newly added flow table data to the matched target memory space specifically includes:
judging whether the target memory space meets the storage requirement of the backup data;
if the target memory space meets the storage requirement of the backup data, the backup data of the newly added flow table data is sent to the matched target memory space through the target forwarding core;
and if the target memory space does not meet the storage requirement of the backup data, performing capacity expansion on the target memory space, and sending the backup data of the newly added flow table data to the capacity-expanded target memory space through the target forwarding core.
6. The method of claim 1, wherein reading and serializing, by a target backup core, the backup data in the target message queue comprises:
reading the backup data in the target message queue according to a preset reading period through a target backup core, and serializing the backup data;
and/or the sending the serialized backup data to a standby network device through the target backup core comprises:
and sending the serialized backup data to standby network equipment through the target backup core according to a preset sending period and an accumulated threshold value to be sent.
7. The method of claim 5, wherein after sending the serialized backup data to a standby network device through the target backup core, the method comprises:
judging whether the residual space of the target memory space is greater than or equal to a preset storage threshold value or not;
if the residual space of the target memory space is larger than or equal to a preset storage threshold value, deleting the backup data, and moving the storage space occupied by the backup data out of the target memory space;
and if the residual space of the target memory space is smaller than a preset storage threshold value, deleting the backup data, and adding the storage space occupied by the backup data into the target memory space.
8. A backup apparatus of flow table data, applied to a network device, comprising:
the memory space storage module is used for responding to the fact that newly-increased flow table data exist in a target forwarding core, and sending backup data of the newly-increased flow table data to a matched target memory space through the target forwarding core;
the message queue storage module is used for sending the backup data in the target memory space to a matched target message queue;
the serialization execution module is used for reading the backup data in the target message queue through a target backup core and serializing the backup data;
and the backup data sending module is used for sending the serialized backup data to the standby network equipment through the target backup core.
9. A network device, characterized in that the network device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of backup of flow table data of any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the method of backup of flow table data according to any one of claims 1 to 7 when executed by a computer processor.
CN202111272140.0A 2021-10-29 2021-10-29 Backup method and device of flow table data, network equipment and storage medium Pending CN114020529A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111272140.0A CN114020529A (en) 2021-10-29 2021-10-29 Backup method and device of flow table data, network equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111272140.0A CN114020529A (en) 2021-10-29 2021-10-29 Backup method and device of flow table data, network equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114020529A true CN114020529A (en) 2022-02-08

Family

ID=80058928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111272140.0A Pending CN114020529A (en) 2021-10-29 2021-10-29 Backup method and device of flow table data, network equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114020529A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001998A (en) * 2022-04-26 2022-09-02 北京贝壳时代网络科技有限公司 Disaster recovery method and device for message service
CN116170385A (en) * 2023-04-21 2023-05-26 四川汉科计算机信息技术有限公司 Gateway information forwarding system, method, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001998A (en) * 2022-04-26 2022-09-02 北京贝壳时代网络科技有限公司 Disaster recovery method and device for message service
CN115001998B (en) * 2022-04-26 2024-02-23 北京贝壳时代网络科技有限公司 Disaster recovery method and device for message service
CN116170385A (en) * 2023-04-21 2023-05-26 四川汉科计算机信息技术有限公司 Gateway information forwarding system, method, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10521393B2 (en) Remote direct memory access (RDMA) high performance producer-consumer message processing
CN114020529A (en) Backup method and device of flow table data, network equipment and storage medium
CN112650558B (en) Data processing method and device, readable medium and electronic equipment
EP3633494A1 (en) Graceful out-of-band power control of remotely-managed computer systems
CN111737022A (en) Interface calling method, system, equipment and medium based on micro-service
WO2012164419A1 (en) Facilitating routing by selectively aggregating contiguous data units
US20240106754A1 (en) Load Balancing Method for Multi-Thread Forwarding and Related Apparatus
CN114691595B (en) Multi-core circuit, data exchange method, electronic device, and storage medium
CN110515749B (en) Method, device, server and storage medium for queue scheduling of information transmission
US8055817B2 (en) Efficient handling of queued-direct I/O requests and completions
CN111913861A (en) Performance test method, device, equipment and medium of Internet of things system
US20140280674A1 (en) Low-latency packet receive method for networking devices
CN111679892A (en) Distributed transaction processing method, device, equipment and medium
CN113691466A (en) Data transmission method, intelligent network card, computing device and storage medium
KR20140135020A (en) Low Latency Framework System
CN116633879A (en) Data packet receiving method, device, equipment and storage medium
CN115495406A (en) Message transmission method, device, equipment and storage medium based on PCIe
US8762615B2 (en) Dequeue operation using mask vector to manage input/output interruptions
CN115237716A (en) Event recording and statistical method and device for operating system
WO2021254162A1 (en) Data sending method and apparatus, storage medium, and electronic device
CN116601616A (en) Data processing device, method and related equipment
CN114518833A (en) Method, electronic device and computer program product for storage management
CN106484536B (en) IO scheduling method, device and equipment
CN111835686A (en) Data compression method, data decompression method, data compression device, data decompression device, electronic equipment and storage medium
CN116841773B (en) Data interaction method and device, electronic equipment and storage medium

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