CN111897681A - Message forwarding method and device, computing equipment and storage medium - Google Patents
Message forwarding method and device, computing equipment and storage medium Download PDFInfo
- Publication number
- CN111897681A CN111897681A CN202010674345.0A CN202010674345A CN111897681A CN 111897681 A CN111897681 A CN 111897681A CN 202010674345 A CN202010674345 A CN 202010674345A CN 111897681 A CN111897681 A CN 111897681A
- Authority
- CN
- China
- Prior art keywords
- message
- forwarding
- memory area
- shared
- flow
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 376
- 230000008569 process Effects 0.000 claims abstract description 337
- 238000012544 monitoring process Methods 0.000 claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 32
- 230000002159 abnormal effect Effects 0.000 claims abstract description 27
- 230000004044 response Effects 0.000 claims description 16
- 230000007246 mechanism Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002265 prevention Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/202—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
- G06F11/2023—Failover techniques
- G06F11/2028—Failover techniques eliminating a faulty processor or activating a spare
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a message forwarding method, a message forwarding device, a computing device and a storage medium, which are used for solving the technical problem of low reliability of a flow forwarding process in the prior art, and the method comprises the following steps: and forwarding the message in the shared message memory area through the flow forwarding process, monitoring the state of the flow forwarding process in real time in the process of forwarding the message in the shared message memory area through the standby process, determining a CPU (central processing unit) used when the flow forwarding process forwards the message after monitoring that the state of the flow forwarding process is abnormal, and forwarding the message in the shared message memory area by using the determined CPU. Compared with the prior art, after the state of the flow forwarding process is abnormal, the standby process forwards the message in the shared message memory area by using the CPU used when the flow forwarding process forwards the message, so that the forwarding of the message is not interrupted, and the reliability of the flow forwarding can be improved.
Description
Technical Field
The present invention relates to the field of network security technologies, and in particular, to a method and an apparatus for forwarding a packet, a computing device, and a storage medium.
Background
Generally, in a network, some key routing nodes often deploy security protection products, such as an intrusion prevention system, a firewall, and the like, and these security protection devices are generally applied to a client network in a serial connection manner, so as to not only play a role of intrusion prevention, but also ensure normal forwarding of a packet. If the program responsible for message forwarding is abnormal, and exits or is stuck, the network fault of message forwarding interruption can be directly caused, and the user with higher network use requirement can be seriously damaged by difficult estimation. At present, various safety protection products are complex in service, complex in variety and large in service category difference, so that the problem of abnormal forwarding programs of the safety protection products is solved one by one difficultly, and the effect is low.
However, in the prior art, as shown in fig. 1, when the traffic forwarding program 10 exits abnormally or is stuck, the monitoring program of the program is responsible for restarting the traffic forwarding program, so that although forwarding of a message can be resumed, during the restart of the traffic forwarding program 10, traffic forwarding service time is interrupted, which causes a network failure, resulting in low traffic forwarding reliability.
Disclosure of Invention
The invention provides a message forwarding method, a message forwarding device, a computing device and a storage medium, which are used for solving the problem of low reliability of a flow forwarding process.
In a first aspect, an embodiment of the present invention provides a packet forwarding method, including:
forwarding the message in the shared message memory area through a flow forwarding process;
monitoring the state of the flow forwarding process in real time through a standby process, wherein the shared message memory area is created by the standby process, and both the standby process and the flow forwarding process can access the shared message memory area;
after monitoring that the state of the flow forwarding process is abnormal through the standby process, determining a Central Processing Unit (CPU) used when the flow forwarding process forwards a message;
and forwarding the message in the shared message memory area by using the CPU through the standby process.
In one possible implementation, the traffic forwarding process is monitored for status anomalies by:
receiving a condition semaphore sent by a monitoring mechanism for monitoring a traffic forwarding process through the standby process; or
And determining that the flow forwarding process does not forward the message in the shared message memory area within a preset time length through the standby process.
In a possible implementation manner, the determining, by the standby process, a CPU used by the traffic forwarding process to forward a packet includes:
receiving a registration message sent by the flow forwarding process after the flow forwarding process is started through the standby process;
and determining the CPU through the standby process according to the CPU identification carried in the registration message.
In a possible implementation manner, before forwarding the packet in the shared packet memory through the traffic forwarding process, the method further includes:
creating the shared message memory area through the standby process;
determining a CPU (central processing unit) used by the forwarding process for forwarding the message through the standby process;
forwarding the message in the shared message memory area by using the CPU through the standby process;
after receiving the registration message sent by the flow forwarding process through the standby process, stopping sending the message;
sending a registration response message for triggering the flow forwarding process to forward the message in the shared message memory area to the flow forwarding process through the standby process;
the forwarding of the message in the shared message memory area through the traffic forwarding process includes:
and after receiving the registration response message through a flow forwarding process, forwarding the message in the shared message memory area.
In a second aspect, an embodiment of the present invention provides a packet forwarding apparatus, including:
the first forwarding module is used for forwarding the message in the shared message memory area through a flow forwarding process;
a monitoring module, configured to monitor a state of the traffic forwarding process in real time through a standby process, where the shared packet memory area is created by the standby process, and both the standby process and the traffic forwarding process may access the shared packet memory area;
the processing module is used for determining a CPU (central processing unit) used when the flow forwarding process forwards the message after monitoring that the state of the flow forwarding process is abnormal through the standby process;
and the second forwarding module is used for forwarding the message in the shared message memory area by using the CPU through the standby process.
In a possible implementation manner, the processing module is specifically configured to monitor a state exception of the traffic forwarding process by:
receiving a condition semaphore sent by a monitoring mechanism for monitoring a traffic forwarding process through the standby process; or
And determining that the flow forwarding process does not forward the message in the shared message memory area within a preset time length through the standby process.
In a possible implementation manner, the processing module is specifically configured to:
receiving a registration message sent by the flow forwarding process after the flow forwarding process is started through the standby process;
and determining the CPU through the standby process according to the CPU identification carried in the registration message.
In one possible implementation, the processing module is further configured to:
before the message in the shared message memory is forwarded through the flow forwarding process, the shared message memory area is established through the standby process;
determining a CPU (central processing unit) used by the forwarding process for forwarding the message through the standby process;
forwarding the message in the shared message memory area by using the CPU through the standby process;
after receiving the registration message sent by the flow forwarding process through the standby process, stopping sending the message;
sending a registration response message for triggering the flow forwarding process to forward the message in the shared message memory area to the flow forwarding process through the standby process;
and after receiving the registration response message through a flow forwarding process, forwarding the message in the shared message memory area.
In a third aspect, an embodiment of the present invention further provides a computing device, including:
a memory and a processor;
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the message forwarding method in any one of the first aspect according to the obtained program instruction.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are configured to enable a computer to execute any message forwarding method in the embodiment of the present application.
The embodiment of the invention provides a message forwarding method, a message forwarding device, a computing device and a storage medium, wherein a message in a shared message memory area is forwarded through a flow forwarding process, the state of the flow forwarding process is monitored in real time in the process of forwarding the message in the shared message memory area through a standby process, after the abnormal state of the flow forwarding process is monitored, a CPU used when the flow forwarding process forwards the message is determined, and the determined CPU is used for forwarding the message in the shared message memory area. Compared with the prior art, after the state of the flow forwarding process is abnormal, the standby process forwards the message in the shared message memory area by using the CPU used when the flow forwarding process message is forwarded, so that the forwarding of the message is not interrupted, and the reliability of message forwarding can be improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
Fig. 1 is a schematic diagram of a structure of a packet forwarding process provided in the background art;
fig. 2 is a schematic diagram of a message forwarding method provided in an embodiment of the present invention;
fig. 3 is a schematic flow chart of a method for forwarding a packet according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for determining a process to be used when forwarding a packet according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of an interaction method for forwarding a packet by a bypass process and a traffic forwarding process according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a method for completing packet forwarding according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
As described in the background art, in the related art, when the traffic forwarding process exits abnormally or is stuck, the monitoring program in kyoto is responsible for restarting the traffic forwarding process, and there is a network failure fault, which cannot meet the requirement of the user for high reliability of the network. Based on the application, a message forwarding method is provided to solve the technical problem.
The message is a data unit exchanged and transmitted in the network, i.e. a data block to be sent by the station at one time.
The following describes a message forwarding method, an apparatus, a computing device, and a storage medium provided by the present invention in more detail with reference to the accompanying drawings and embodiments.
The method comprises the following main ideas that a shared message memory area is established by a standby process (hereinafter referred to as a bypass process), a flow forwarding process forwards messages in the shared message memory area, the bypass process monitors the flow forwarding process, and after the abnormality of the flow forwarding process is monitored, a CPU used when the flow forwarding process forwards the messages is used for forwarding the messages in the shared message memory area.
Fig. 2 is a schematic diagram of a packet forwarding method according to an embodiment of the present invention. In fig. 2, both the traffic forwarding process and the bypass process may forward the message in the shared message memory area, the solid line represents that the traffic forwarding process forwards the message in the shared message memory area, and the dotted line represents that the bypass process forwards the message in the shared message memory area.
The following describes the message forwarding method in detail.
As shown in fig. 3, a method for forwarding a packet according to an embodiment of the present invention includes:
s301, the message in the shared message memory area is forwarded through the flow forwarding process.
And S302, monitoring the state of the flow forwarding process in real time through a standby process, wherein the shared message memory area is created by the standby process, and both the standby process and the flow forwarding process can access the shared message memory area.
And S303, after monitoring that the state of the flow forwarding process is abnormal through the standby process, determining a CPU (central processing unit) used when the flow forwarding process forwards the message.
S304, the standby process uses the CPU to forward the message in the shared message memory area.
In the embodiment of the invention, the message in the shared message memory area is forwarded through the flow forwarding process, the state of the flow forwarding process is monitored in real time in the process of forwarding the message in the shared message memory area through the flow forwarding process through the standby process, after the abnormal state of the flow forwarding process is monitored, the CPU used when the flow forwarding process forwards the message is determined, and the determined CPU is used for forwarding the message in the shared message memory area. Compared with the prior art, after the state of the flow forwarding process is abnormal, the standby process forwards the message in the shared message memory area by using the CPU used when the flow forwarding process forwards the message, so that the forwarding of the message is not interrupted, and the reliability of message forwarding can be improved.
When the message is forwarded in the embodiment of the invention, the shared message memory area is created by the bypass process, and firstly, the bypass process is started to create the shared message memory area and initialize the shared message memory area. And starting to forward the message after a series of initialization operations are carried out.
It should be noted that after the bypass process creates the shared message memory area and before forwarding the message, the CPU used by the traffic forwarding process when forwarding the message may be determined by reading the configuration file of the CPU used by the traffic forwarding process when forwarding the message, and the CPU is used to forward the message.
When the bypass process forwards the message, the CPU used when the flow forwarding process forwards the message is used for forwarding, so that the CPU resource is not occupied additionally, and the CPU resource can be saved.
In addition, the shared message memory area is created by the bypass process, so that the shared message memory area can be normally used when the state of the flow forwarding process is abnormal.
In the process of forwarding the message in the shared message memory area by the bypass process, the traffic forwarding process is started, and a registration message is sent to the bypass process through a registration mechanism, where the registration message carries a CPU identifier, such as a CPU ID (Identity Document, identification number), of a CPU used when the traffic forwarding process forwards the message.
After the flow forwarding process is started, the shared message memory area created by the standby process needs to be determined, and when the forwarding message is switched to the flow forwarding process from the bypass process, the flow forwarding process forwards the message in the determined shared message memory area.
After the flow forwarding process is started, a registration message can be sent to the bypass process, and the registration message is used for triggering the bypass process to stop forwarding the message. After receiving the registration message, the bypass process stops forwarding the message in the shared message memory area, and after the packet receiving and sending queue finishes processing the remaining message, the bypass process can send a registration response message to the traffic forwarding process, wherein the registration response message is used for triggering the traffic forwarding process to forward the message.
Correspondingly, after receiving the registration response message, the flow forwarding process takes over the network card to receive and transmit the packet queue immediately and starts to forward the message.
It should be noted that, when the forwarding of the packet is switched from the bypass process to the traffic forwarding process, the time can reach the ms level due to the switching between the software, so that the reliability of the packet forwarding can be improved.
In the process of forwarding the message by the flow forwarding process, the bypass process can monitor the state of the flow forwarding process in real time, and if the abnormal state of the flow forwarding process is monitored, a CPU used when the flow forwarding process forwards the message is determined, and the CPU is used for forwarding the message in the shared message memory area.
It should be noted that, after the traffic forwarding process state is recovered to normal from abnormal, the CPU used in forwarding the packet may be different from the CPU used in forwarding the packet last time, and therefore, when the traffic forwarding process state is abnormal next time, the bypass process needs to determine the CPU used in forwarding the packet by the traffic forwarding process once again.
In an embodiment, the bypass process may monitor the state of the traffic forwarding process by using a netlink connector ns mechanism, and when the state of the traffic forwarding process is abnormal, the netlink connector ns mechanism sends a condition semaphore to the bypass process.
The registration message sent by the traffic forwarding process to the bypass process may carry a CPU identifier of a CPU used by the traffic forwarding process when forwarding traffic, and after receiving the conditional semaphore, the bypass process binds the corresponding CPU to continue forwarding the message according to the CPU identifier of the registration message.
In another embodiment, the bypass process may further determine that the traffic forwarding process does not forward the packet in the shared packet memory area within a preset time length, so as to determine that the state of the traffic forwarding process is abnormal.
Because the switching from the flow forwarding process to the bypass process is the switching between the software, the switching time can reach ms level, and the flow forwarding process and the bypass process share the message memory area, so that the message is not lost at the moment of switching, and the message forwarding reliability can be improved.
In addition, the bypass process can detect other abnormal forwarding states of the traffic forwarding process, such as deadlock, deadlock and the like, by checking the head and tail registers of the network card packet receiving queue, and at the moment, the traffic forwarding process can be manually quitted and switched to the bypass process until the traffic forwarding process is recovered to be normal again.
In a possible implementation manner, after the state of the traffic forwarding process is recovered to normal from an exception, the shared message memory area created by the standby process needs to be determined, and when the forwarding message is switched from the bypass process to the traffic forwarding process, the traffic forwarding process forwards the message in the determined shared message memory area.
For ease of understanding, specific examples are set forth below.
Example 1:
fig. 4 is a schematic flow chart of a method for determining a process used when forwarding a packet according to an embodiment of the present invention.
S401, the first internet access receives a message;
s402, judging whether the state of the traffic forwarding process is normal or not by the bypass process, if so, executing S403, and otherwise, executing S405;
s403, the flow forwarding process receives a message sent by the first network port;
s404, the flow forwarding process sends a message to a second network port;
s405, the bypass process receives a message sent by the first internet access;
s406, the bypass process sends a message to the second internet access;
s407, the second network port sends the message.
Example 2:
as shown in fig. 5, a schematic flow chart of an interaction method for forwarding a packet by a bypass process and a traffic forwarding process according to an embodiment of the present invention is provided.
S501, sending socket registration to an abnormal monitoring thread in a bypass process by a receiving and sending thread in a flow forwarding process;
the socket registration carries a CPU ID, a queue ID 0, and a CPU list of a CPU used when the traffic forwarding process forwards the packet.
S502, an exception monitoring thread in the bypass process sets bypass stopping for a transceiving thread in the bypass process;
s503, stopping message forwarding by a receiving and sending thread in the bypass process;
s504, a bypass stheld is set to an exception monitoring thread in the bypass process by a transceiving thread in the bypass process;
s505, the exception monitoring thread in the bypass process sends a socket response ok to the transceiving thread in the traffic forwarding process;
s506, a receiving and sending thread in the flow forwarding process starts to forward the message;
s501 to S506 are examples of the steps of the service process starting the switch, and the service process quit the switch will be described below.
S507, exiting a receiving and sending thread in the flow forwarding process;
s508, the netlink in the exception monitoring thread in the bypass process detects that the transceiving thread exits, and the corresponding transceiving thread is determined according to the pid of the transceiving thread;
s509, an exception monitoring thread in the bypass process sends pthread _ cond _ signal to a transceiving thread in the bypass process;
s510, restarting message forwarding by a receiving and sending thread in the bypass process;
the following explains another abnormal switching.
S511, locking a receiving and sending thread in the flow forwarding process;
s512, an abnormity monitoring thread in the bypass process detects that a network card register is abnormal;
the network card register is abnormal, such as RDH ═ RDT, MISSED increase.
S513, kill corresponds to business process.
The invention monitors the state of the flow forwarding process in real time by operating a stable bypass process, when the flow forwarding process is upgraded or abnormal, the bypass process automatically obtains the message forwarding control right to ensure the normal forwarding of the network flow, and when the flow forwarding process is recovered to be normal, the bypass process automatically returns the message forwarding control right and continues to monitor the state of the flow forwarding process.
Referring to fig. 6, a message forwarding apparatus includes: a first forwarding module 601, a monitoring module 602, a processing module 603, and a second forwarding module 604.
A first forwarding module 601, configured to forward a packet in the shared packet memory through a traffic forwarding process;
a monitoring module 602, configured to monitor a state of the traffic forwarding process in real time through a standby process, where the shared packet memory area is created by the standby process, and both the standby process and the traffic forwarding process can access the shared packet memory area;
a processing module 603, configured to determine, after monitoring that the state of the traffic forwarding process is abnormal through the standby process, a CPU used when the traffic forwarding process forwards a packet;
a second forwarding module 604, configured to forward the packet in the shared packet memory area through the standby process by using the CPU.
Optionally, the processing module 603 is specifically configured to monitor a state exception of the traffic forwarding process in the following manner:
receiving a condition semaphore sent by a monitoring mechanism for monitoring a traffic forwarding process through the standby process; or
And determining that the flow forwarding process does not forward the message in the shared message memory area within a preset time length through the standby process.
Optionally, the processing module 603 is specifically configured to:
receiving a registration message sent by the flow forwarding process after the flow forwarding process is started through the standby process;
and determining the CPU through the standby process according to the CPU identification carried in the registration message.
Optionally, the processing module 603 is further configured to:
before the message in the shared message memory is forwarded through the flow forwarding process, the shared message memory area is established through the standby process;
determining a CPU (central processing unit) used by the forwarding process for forwarding the message through the standby process;
forwarding the message in the shared message memory area by using the CPU through the standby process;
after receiving the registration message sent by the flow forwarding process through the standby process, stopping sending the message;
sending a registration response message for triggering the flow forwarding process to forward the message in the shared message memory area to the flow forwarding process through the standby process;
and after receiving the registration response message through a flow forwarding process, forwarding the message in the shared message memory area.
As shown in fig. 7, a complete method for forwarding a packet according to an embodiment of the present invention includes:
s701, starting a bypass process;
s702, the bypass process creates a shared message memory area and initializes the shared message memory area;
s703, reading a configuration file of a CPU (Central processing Unit) used when the message is forwarded by the traffic forwarding process by the bypass process, and determining the CPUID;
s704, determining the CPU by the bypass process according to the CPU ID;
s705, the bypass process forwards the message in the shared message memory area by using the determined CPU;
s706, starting a flow forwarding process;
s707, the flow forwarding process sends a registration message carrying the CPU ID to the bypass process through a registration mechanism;
s708, the bypass process receives the registration message;
s709, stopping forwarding the message in the shared message memory area by the bypass process;
s710, after the packet to be received and transmitted queue finishes processing the residual messages, the bypass process sends a registration response message to the flow forwarding process;
s711, the flow forwarding process receives the registration response message;
s712, the flow forwarding process forwards the message in the shared message memory area;
s713, the bypass process monitors the state of the flow forwarding process by utilizing a netlink connector ns mechanism;
s714, a netlink connector ns mechanism monitors that the state of the flow forwarding process is abnormal;
s715, sending a conditional semaphore to the bypass process by a netlink connector ns mechanism;
s716, the bypass process receives the conditional semaphore;
s717, the bypass process binds the corresponding CPU according to the CPU ID in the received registration message;
s718, the bypass process uses the bound CPU to forward the message in the shared message memory area.
In some possible implementations, a computing device according to the present application may include at least one processor, and at least one memory. Wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the message forwarding method according to various exemplary embodiments of the present application described above in the present specification. For example, the processor may perform S301-S304 as shown in FIG. 3.
A computing device 80 according to this embodiment of the present application is described below with reference to fig. 8. The computing device 80 shown in fig. 8 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the application.
As shown in fig. 8, computing device 80 is embodied in the form of a general purpose computing apparatus. Components of computing device 80 may include, but are not limited to: the at least one processor 801, the at least one memory 802, and a bus 803 that couples various system components including the memory 802 and the processor 801.
The memory 802 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)8021 and/or cache memory 8022, and may further include Read Only Memory (ROM) 8023.
In some possible embodiments, the aspects of the message forwarding method provided in the present application may also be implemented in the form of a program product including a computer program for causing a computer device to perform the steps in the message forwarding method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device, for example, the computer device may perform S301-S304 as shown in fig. 3.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A 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 readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
The program product for parameter processing of the embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include a computer program, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a 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 readable signal medium may include a propagated data signal with a readable computer program embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a 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.
A computer program embodied on a 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 programs for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer program may execute entirely on the target object computing device, partly on the target object apparatus, as a stand-alone software package, partly on the target object computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the target object computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having a computer-usable computer program embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (10)
1. A message forwarding method is characterized by comprising the following steps:
forwarding the message in the shared message memory area through a flow forwarding process;
monitoring the state of the flow forwarding process in real time through a standby process, wherein the shared message memory area is created by the standby process, and both the standby process and the flow forwarding process can access the shared message memory area;
after monitoring that the state of the flow forwarding process is abnormal through the standby process, determining a Central Processing Unit (CPU) used when the flow forwarding process forwards a message;
and forwarding the message in the shared message memory area by using the CPU through the standby process.
2. The method of claim 1, wherein the traffic forwarding process is monitored for status anomalies by:
receiving a condition semaphore sent by a monitoring mechanism for monitoring a traffic forwarding process through the standby process; or
And determining that the flow forwarding process does not forward the message in the shared message memory area within a preset time length through the standby process.
3. The method according to claim 1, wherein the determining, by the standby process, the CPU used by the traffic forwarding process to forward the packet comprises:
receiving a registration message sent by the flow forwarding process after the flow forwarding process is started through the standby process;
and determining the CPU through the standby process according to the CPU identification carried in the registration message.
4. The method according to any one of claims 1 to 3, wherein before forwarding the message in the shared message memory through the traffic forwarding process, the method further comprises:
creating the shared message memory area through the standby process;
determining a CPU (central processing unit) used by the forwarding process for forwarding the message through the standby process;
forwarding the message in the shared message memory area by using the CPU through the standby process;
after receiving the registration message sent by the flow forwarding process through the standby process, stopping sending the message;
sending a registration response message for triggering the flow forwarding process to forward the message in the shared message memory area to the flow forwarding process through the standby process;
the forwarding of the message in the shared message memory area through the traffic forwarding process includes:
and after receiving the registration response message through a flow forwarding process, forwarding the message in the shared message memory area.
5. A message forwarding apparatus, comprising:
the first forwarding module is used for forwarding the message in the shared message memory area through a flow forwarding process;
a monitoring module, configured to monitor a state of the traffic forwarding process in real time through a standby process, where the shared packet memory area is created by the standby process, and both the standby process and the traffic forwarding process may access the shared packet memory area;
the processing module is used for determining a Central Processing Unit (CPU) used when the flow forwarding process forwards the message after monitoring the abnormal state of the flow forwarding process through the standby process;
and the second forwarding module is used for forwarding the message in the shared message memory area by using the CPU through the standby process.
6. The apparatus according to claim 5, wherein the processing module is specifically configured to monitor the traffic forwarding process for a status anomaly by:
receiving a condition semaphore sent by a monitoring mechanism for monitoring a traffic forwarding process through the standby process; or
And determining that the flow forwarding process does not forward the message in the shared message memory area within a preset time length through the standby process.
7. The apparatus of claim 5, wherein the processing module is specifically configured to:
receiving a registration message sent by the flow forwarding process after the flow forwarding process is started through the standby process;
and determining the CPU through the standby process according to the CPU identification carried in the registration message.
8. The apparatus of any one of claims 5 to 7, wherein the processing module is further configured to:
before the message in the shared message memory is forwarded through the flow forwarding process, the shared message memory area is established through the standby process;
determining a CPU (central processing unit) used by the forwarding process for forwarding the message through the standby process;
forwarding the message in the shared message memory area by using the CPU through the standby process;
after receiving the registration message sent by the flow forwarding process through the standby process, stopping sending the message;
sending a registration response message for triggering the flow forwarding process to forward the message in the shared message memory area to the flow forwarding process through the standby process;
and after receiving the registration response message through a flow forwarding process, forwarding the message in the shared message memory area.
9. A computing device, comprising: a memory and a processor;
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the method of any one of claims 1 to 4 in accordance with the program instructions obtained.
10. A computer storage medium storing computer-executable instructions for performing the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010674345.0A CN111897681B (en) | 2020-07-14 | 2020-07-14 | Message forwarding method, device, computing equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010674345.0A CN111897681B (en) | 2020-07-14 | 2020-07-14 | Message forwarding method, device, computing equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111897681A true CN111897681A (en) | 2020-11-06 |
CN111897681B CN111897681B (en) | 2024-07-26 |
Family
ID=73192637
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010674345.0A Active CN111897681B (en) | 2020-07-14 | 2020-07-14 | Message forwarding method, device, computing equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111897681B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114422192A (en) * | 2021-12-23 | 2022-04-29 | 武汉思普崚技术有限公司 | Abnormal slow flow detection method and device for network security equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030145250A1 (en) * | 2002-01-29 | 2003-07-31 | Wen-Long Chin | Dynamic built-in self-skip method used for shared memory fault recovery |
CN102971723A (en) * | 2011-06-28 | 2013-03-13 | 华为技术有限公司 | Distributed multi-process communication method and device |
CN110071880A (en) * | 2018-01-24 | 2019-07-30 | 北京金山云网络技术有限公司 | Message forwarding method, retransmission unit, server and storage medium |
CN111131060A (en) * | 2019-12-23 | 2020-05-08 | 瑞斯康达科技发展股份有限公司 | Burst message processing method and device, electronic equipment and computer storage medium |
-
2020
- 2020-07-14 CN CN202010674345.0A patent/CN111897681B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030145250A1 (en) * | 2002-01-29 | 2003-07-31 | Wen-Long Chin | Dynamic built-in self-skip method used for shared memory fault recovery |
CN102971723A (en) * | 2011-06-28 | 2013-03-13 | 华为技术有限公司 | Distributed multi-process communication method and device |
CN110071880A (en) * | 2018-01-24 | 2019-07-30 | 北京金山云网络技术有限公司 | Message forwarding method, retransmission unit, server and storage medium |
WO2019144777A1 (en) * | 2018-01-24 | 2019-08-01 | 北京金山云网络技术有限公司 | Packet forwarding method and apparatus, server, and storage medium |
CN111131060A (en) * | 2019-12-23 | 2020-05-08 | 瑞斯康达科技发展股份有限公司 | Burst message processing method and device, electronic equipment and computer storage medium |
Non-Patent Citations (1)
Title |
---|
徐梦琼;陈临强;: "基于SPB的实时备份技术", 电子科技, no. 04, pages 31 - 33 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114422192A (en) * | 2021-12-23 | 2022-04-29 | 武汉思普崚技术有限公司 | Abnormal slow flow detection method and device for network security equipment |
CN114422192B (en) * | 2021-12-23 | 2024-03-29 | 武汉思普崚技术有限公司 | Abnormal slow flow detection method and device for network security equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111897681B (en) | 2024-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112866004B (en) | Control plane equipment switching method and device and transfer control separation system | |
US8332506B2 (en) | Network monitor program executed in a computer of cluster system, information processing method and computer | |
US10318335B1 (en) | Self-managed virtual networks and services | |
EP2637102B1 (en) | Cluster system with network node failover | |
US7953016B2 (en) | Method and system for telecommunication apparatus fast fault notification | |
JPWO2019049433A1 (en) | Cluster system, cluster system control method, server device, control method, and program | |
CN110768840A (en) | Control method, device, equipment and storage medium of communication equipment | |
CN104283780A (en) | Method and device for establishing data transmission route | |
US20140298076A1 (en) | Processing apparatus, recording medium storing processing program, and processing method | |
JP4964666B2 (en) | Computer, program and method for switching redundant communication paths | |
CN111897681B (en) | Message forwarding method, device, computing equipment and storage medium | |
US8370897B1 (en) | Configurable redundant security device failover | |
JP2007233586A (en) | Duplex controller and duplex control method | |
CN112217718A (en) | Service processing method, device, equipment and storage medium | |
US10491544B2 (en) | Consistency control of a logical path passing through a relay device | |
US11954509B2 (en) | Service continuation system and service continuation method between active and standby virtual servers | |
JP2016206898A (en) | Information processing device, fault detection method, and computer program | |
JP4863984B2 (en) | Monitoring processing program, method and apparatus | |
US10122588B2 (en) | Ring network uplink designation | |
KR20150059697A (en) | Method and System for detecting network failure in Software Defined Network | |
WO2024051258A1 (en) | Event processing method, apparatus and system | |
CN114500157B (en) | Redundancy implementation system based on CAN gateway, electronic device and computer readable storage medium | |
US11150980B2 (en) | Node device, recovery operation control method, and non-transitory computer readable medium storing recovery operation control program | |
KR101843395B1 (en) | Apparatus and method for preventing a failure of the inline device | |
JP6784939B2 (en) | Network equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |