A method, device, and electronic device for distributing and sending drainage entries of distributed devices
By obtaining the number of business cards in distributed firewall devices and allocating traffic table entries, the problem of slow issuance of table entries during the equipment startup stage is solved, and fast and effective data traffic forwarding is achieved, improving equipment performance and stability.
Patent Information
- Application Number
- CN202111071089.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-09-13
AI Technical Summary
After the number of traffic entries increased, the issuance speed of existing distributed firewall devices became slower, resulting in too long traffic interruption time, affecting equipment performance and stability.
By obtaining the number of insertions of the business card and the number of business cards to be forwarded by data traffic, the comparison results are made to allocate traffic items, and notify the business card to forward data traffic after the issuance of the table item, reducing the number of issuances.
It effectively shortens the issuance time of traffic drainage table entries, improves the effectiveness and efficiency of data traffic forwarding, and enhances the robustness of equipment and the disaster recovery ability to resist emergencies.
Smart Images

Figure CN113986524B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a method, device, and electronic device for distributing and issuing flow entries of a distributed device. Background Art
[0002] In today's society where the Internet is developing rapidly, the world's demand for Internet traffic has increased explosively, and high-performance and highly reliable distributed firewalls have developed rapidly and grown day by day. Currently, a main architecture of a distributed firewall (hereinafter referred to as: device) includes: a main control board, a service processing board (hereinafter referred to as: service card), an interface card, and a switching network board. In this architecture, for the sake of performance and high reliability, the forward and reverse data packets of the same session traffic must be processed on the same service card. By default, the device evenly distributes the received data traffic to each service processing board based on the hash value of the source IP address + destination IP address on the interface card, so as to ensure that the forward and reverse data traffic of the same session will be processed on the same service board, which is called traffic diversion. However, since the distributed firewall is an application layer network device and needs to process various complex service traffic, for services such as NAT, IPSEC, and AFT, there are changes in the source IP address and destination IP address for the forward and reverse data traffic, and the traditional hash-based traffic diversion scheme cannot solve the traffic diversion for these traffic scenarios. For such scenarios, the device uses OpenFlow issued on the interface card along with the service configuration for traffic diversion.
[0003] With the increasing complexity of resource pool networking and school-enterprise industry networking, the configuration of services such as NAT is becoming increasingly large, resulting in a very large number of traffic diversion entries issued by the device up and down, causing the number of OpenFlow traffic diversion entries to reach 2,000 to 8,000. For the sake of high feasibility and code simplicity, each time the main control board processes and issues OpenFlow, it will not stop issuing due to the increase or decrease of service boards. Only after each flow table issuance is completed will the next flow table issuance be carried out. After the service cards are increased, all the OpenFlow traffic diversion entries are deleted, and then calculated according to the new number of service cards, and the OpenFlow flow table is issued again. Among them, the OpenFlow flow table refers to the traffic diversion rules issued by the device on the interface card in the distributed device. This rule matches certain characteristics in the traffic data packet and sends the data packet to the agreed service board. Moreover, for the hardware OpenFlow entries issued on the interface board, due to the characteristics of hardware resources, as the number of entries increases, the issuance speed becomes slower and slower. Therefore, this article provides a method for quickly issuing a large number of traffic diversion entries during the startup phase of a distributed device.
[0004] Therefore, the existing problem that the issuance speed becomes slower and slower due to the increase in the number of entries needs to be solved. Summary of the Invention
[0005] Based on this, it is necessary to provide a data traffic forwarding method, device, electronic device, and storage medium for the problem that the existing distribution speed becomes slower and slower due to the increase in the number of table entries.
[0006] In a first aspect, an embodiment of the present application provides a data traffic forwarding method, which is applied to a main control board in a distributed device. The distributed device includes the main control board and at least one service card. The method includes:
[0007] Obtain the inserted number of service cards and the number of service cards to be forwarded for data traffic;
[0008] Compare the inserted number of service cards with the number of service cards to be forwarded for data traffic to obtain a comparison result;
[0009] Allocate drainage table entries according to the comparison result and distribute the corresponding drainage table entries;
[0010] After determining that the distribution of the corresponding drainage table entries is completed, notify the service cards to be forwarded for data traffic to forward the data traffic.
[0011] In an implementation manner, the obtaining the inserted number of service cards includes:
[0012] After starting to monitor the first event of at least one service card, receive the first data reported by at least one service card related to the first event, where the first event is the insertion event of at least one service card;
[0013] At an interval of a first preset duration, judge and record the inserted number of service cards according to the first data.
[0014] In an implementation manner, the obtaining the number of service cards to be forwarded for data traffic includes:
[0015] After starting to monitor the data traffic forwarding event of at least one service card, receive the second data reported by at least one service card related to the second event, where the second event is the event that at least one service card forwards data traffic;
[0016] At an interval of a second preset duration, judge and record the number of service cards to be forwarded for data traffic according to the second data.
[0017] In an implementation manner, the allocating drainage table entries according to the comparison result and distributing the corresponding drainage table entries includes:
[0018] If the comparison result is that the number of inserted service cards is the same as the number of service cards for which data traffic forwarding is to be performed, then allocate the traffic forwarding entries according to a pre-configured traffic forwarding entry file, and issue the corresponding traffic forwarding entries.
[0019] In one implementation, the allocating the traffic forwarding entries according to the comparison result and issuing the corresponding traffic forwarding entries includes:
[0020] If the comparison result is that the number of inserted service cards is greater than the number of service cards for which data traffic forwarding is to be performed, then allocate the traffic forwarding entries according to the service cards for which data traffic forwarding is to be performed, and issue the corresponding traffic forwarding entries.
[0021] In one implementation, the allocating the traffic forwarding entries according to the comparison result and issuing the corresponding traffic forwarding entries includes:
[0022] If the comparison result is that the number of inserted service cards is less than the number of service cards for which data traffic forwarding is to be performed, then allocate the traffic forwarding entries according to the service cards for which data traffic forwarding is to be performed, and issue the corresponding traffic forwarding entries.
[0023] In one implementation, the method further includes:
[0024] Configuring a first preset duration range corresponding to the first preset duration, and / or,
[0025] Configuring a second preset duration range corresponding to the second preset duration.
[0026] In a second aspect, an embodiment of the present application provides a data traffic forwarding device, which is applied to a main control board in a distributed device. The distributed device includes the main control board and at least one service card. The device includes:
[0027] An obtaining module, configured to obtain the number of inserted service cards and the number of service cards for which data traffic forwarding is to be performed;
[0028] A comparing module, configured to compare the number of inserted service cards obtained by the obtaining module with the number of service cards for which data traffic forwarding is to be performed, to obtain a comparison result;
[0029] An allocating and issuing module, configured to allocate traffic forwarding entries according to the comparison result obtained by the comparing module, and issue the corresponding traffic forwarding entries;
[0030] A notifying module, configured to notify the service cards for which data traffic forwarding is to be performed to perform data traffic forwarding after determining that the corresponding traffic forwarding entries issued by the allocating and issuing module have been issued.
[0031] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor runs the computer program to implement the method steps as described above.
[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. The program is executed by a processor to implement the method steps as described above.
[0033] The technical solutions provided by the embodiments of the present application may include the following beneficial effects:
[0034] In the embodiment of the present application, the number of inserted service cards is obtained, and the number of service cards to be subjected to data traffic forwarding is obtained; the number of inserted service cards is compared with the number of service cards to be subjected to data traffic forwarding to obtain a comparison result; based on the comparison result, drainage table entries are allocated and the corresponding drainage table entries are sent down; and after it is determined that the sending of the corresponding drainage table entries is completed, the service cards to be subjected to data traffic forwarding are notified to perform data traffic forwarding. The data traffic forwarding method provided by the embodiment of the present application can shorten the number of times of sending down the drainage table entries to one time, thereby saving the time for sending down the drainage table entries; in addition, after it is determined that the sending of the drainage table entries is completed, the service cards to be subjected to data traffic forwarding are notified to perform data traffic forwarding, thereby effectively improving the effectiveness and forwarding efficiency of data traffic forwarding. It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0036] Figure 1 is a flowchart of a data traffic forwarding method applied to a distributed device in the prior art;
[0037] Figure 2 is a flowchart of a data traffic forwarding method provided by an embodiment of the present application;
[0038] Figure 3 is a flowchart of quickly sending down a large number of drainage table entries during the startup phase of a distributed device in a specific application scenario provided by an embodiment of the present application;
[0039] Figure 4 is a structural diagram of a data traffic forwarding device provided by an embodiment of the present application;
[0040] Figure 5 shows a schematic diagram of the connection structure of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0041] The following description and the drawings fully disclose specific implementation manners of the present invention, enabling those skilled in the art to practice them.
[0042] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0043] The optional embodiments of the present disclosure will be described in detail below with reference to the drawings.
[0044] As Figure 1 shown, it is a schematic flowchart of a data traffic forwarding method applied to a distributed device adopted by the prior art.
[0045] As Figure 1 shown, in the data traffic forwarding method applied to a distributed device adopted by the prior art, the mechanism of issuing Openflow drainage table entries (abbreviated as flow tables) causes the flow table issuing speed to be very slow during the device startup phase. In the worst theoretical case, for a device with 4 service cards that needs to issue 2000 flow tables, after restarting, due to the sequential startup of the service cards, about 2000 flow tables are issued 4 times and deleted 3 times. Experiments show that due to the short interval time between the startup completions of multiple service cards, the flow tables are issued 2 times and deleted 1 time, taking about 25 minutes in total. During this period, almost all service traffic will be interrupted. If there are n service cards in the device, when issuing the flow tables, it needs to be deleted n - 1 times and issued n times, and the time required will increase proportionally.
[0046] Therefore, in the technology for processing the issuance of a large number of drainage table entries during the startup phase of a distributed device as Figure 1 shown, the following problems exist:
[0047] Problem 1: The traffic interruption time is too long: After the device restarts, in a multi-board service board environment, due to the multiple issuances and deletions of the flow tables, the services relying on the flow tables are blocked and interrupted multiple times, seriously affecting the device's processing of service traffic during this phase.
[0048] Problem 2: Affecting device performance: During the startup process of a device in a multi-service board environment, since the global configuration of the device is constantly changing, the fast forwarding of the device cannot take effect in time. For a long time, the device can only forward data traffic slowly, and the CPUs of each service board are always overloaded, with great potential stability hazards.
[0049] As Figure 2As shown, it is a schematic flowchart of a data traffic forwarding method provided by an embodiment of the present application; as Figure 2 As shown, an embodiment of the present application provides a data traffic forwarding method, which is applied to a main control board in a distributed device. The distributed device includes a main control board and at least one service card, and specifically includes the following method steps:
[0050] S202: Obtain the number of inserted service cards and the number of service cards to which data traffic forwarding is to be performed.
[0051] In a possible implementation manner, obtaining the number of inserted service cards includes the following steps:
[0052] After starting to monitor the first event of at least one service card, receive the first data reported by at least one service card related to the first event, where the first event is the insertion event of at least one service card;
[0053] At an interval of a first preset duration, judge and record the number of inserted service cards according to the first data.
[0054] In the embodiment of the present application, the range of the first preset duration is within 0 to 120 seconds, and the generally adopted first preset duration is 30 seconds.
[0055] In a possible implementation manner, obtaining the number of service cards to which data traffic forwarding is to be performed includes the following steps:
[0056] After starting to monitor the data traffic forwarding event of at least one service card, receive the second data reported by at least one service card related to the second event, where the second event is the event of at least one service card forwarding data traffic;
[0057] At an interval of a second preset duration, judge and record the number of service cards to which data traffic forwarding is to be performed according to the second data.
[0058] In the embodiment of the present application, the range of the second preset duration is within 0 to 120 seconds, and the generally adopted second preset duration is 30 seconds.
[0059] In a possible implementation manner, the data traffic forwarding method provided by the embodiment of the present disclosure further includes the following steps:
[0060] Configure the first preset duration range corresponding to the first preset duration. For the description of the first preset duration range, refer to the foregoing, and details are not described herein again.
[0061] In a possible implementation manner, the data traffic forwarding method provided by the embodiment of the present disclosure further includes the following steps:
[0062] Configure a second preset duration range corresponding to the second preset duration. For the description of the second preset duration range, please refer to the foregoing and will not be elaborated here.
[0063] S204: Compare the number of inserted service cards with the number of service cards for which data traffic forwarding is to be performed to obtain a comparison result.
[0064] S206: Allocate drainage table entries according to the comparison result and send the corresponding drainage table entries.
[0065] In a possible implementation manner, allocating drainage table entries according to the comparison result and sending the corresponding drainage table entries includes the following steps:
[0066] If the comparison result is that the number of inserted service cards is the same as the number of service cards for which data traffic forwarding is to be performed, then allocate drainage table entries according to the pre-configured drainage table entry file and send the corresponding drainage table entries; in this way, the number of times of sending drainage table entries in the existing method can be shortened to one, thereby saving the drainage table entry sending duration; in addition, the phenomenon of long-term overload of distributed devices caused by the startup stage of a large number of drainage table entry devices is avoided, thereby ultimately improving the robustness of the distributed devices; in addition, the distributed device adopting the data traffic forwarding method of the embodiment of the present disclosure also has a disaster tolerance ability against emergencies.
[0067] In a possible implementation manner, allocating drainage table entries according to the comparison result and sending the corresponding drainage table entries includes the following steps:
[0068] If the comparison result is that the number of inserted service cards is greater than the number of service cards for which data traffic forwarding is to be performed, then allocate drainage table entries according to the service cards for which data traffic forwarding is to be performed and send the corresponding drainage table entries; in this way, the number of times of sending drainage table entries in the existing method can be shortened to one, thereby saving the drainage table entry sending duration; in addition, the phenomenon of long-term overload of distributed devices caused by the startup stage of a large number of drainage table entry devices is avoided, thereby ultimately improving the robustness of the distributed devices; in addition, the distributed device adopting the data traffic forwarding method of the embodiment of the present disclosure also has a disaster tolerance ability against emergencies.
[0069] In a possible implementation manner, allocating drainage table entries according to the comparison result and sending the corresponding drainage table entries includes the following steps:
[0070] If the comparison result is that the number of inserted service cards is less than the number of service cards for which data traffic forwarding is to be performed, then the diversion table entries are allocated according to the service cards for which data traffic forwarding is to be performed, and the corresponding diversion table entries are sent down; in this way, the number of times of sending down the diversion table entries adopted in the existing method can be shortened to one time, thereby saving the time for sending down the diversion table entries; in addition, the phenomenon that the distributed device is overloaded for a long time caused by a large number of diversion table entries during the startup phase of the device is avoided, thereby ultimately improving the robustness of the distributed device; in addition, the distributed device adopting the data traffic forwarding method of the embodiment of the present disclosure also has the disaster tolerance ability against emergencies.
[0071] S208: After determining that the corresponding diversion table entry sending is completed, notify the service card for which data traffic forwarding is to be performed to perform data traffic forwarding.
[0072] In the embodiment of the present application, only after determining that the diversion table entry sending is completed, the service card for which data traffic forwarding is to be performed is notified to perform data traffic forwarding. In this way, the problem of rapid forwarding failure existing in the process of sending down a large number of diversion table entries during the startup phase of the existing distributed device can be effectively solved, and the effectiveness and forwarding efficiency of data traffic forwarding are effectively improved.
[0073] As Figure 3 shown, it is a schematic flow chart of quickly sending down a large number of diversion table entries during the startup phase of the distributed device in the specific application scenario provided by the embodiment of the present application.
[0074] For the process of quickly sending down a large number of diversion table entries during the startup phase of the distributed device as Figure 3 shown, it includes a start phase, a confirmation phase, a verification and sending-down phase, and a data traffic forwarding phase, which are specifically described as follows:
[0075] (1) Start phase: Determine the number of service boards in the distributed device. In the distributed device, the main control board card first performs the wake-up process in the normal state. After the main control board is in the normal state, the service card is recognized through the main control card, and the service card starts the startup phase (i.e., the board card insertion event) to calculate the number a of service cards after the device starts this time. Since the start time interval of the service card startup is within seconds under normal circumstances, in order to cope with special situations, when listening to the subsequent insertion event of the service card, a 30s timeout mechanism is set to ensure, to the greatest extent possible, the accuracy of the number of service cards in the device being listened to. At this time, according to the fact that there are a board cards in the device, a temporary data file for flow table sending is preliminarily calculated and generated, where the format of the temporary data file can be a file with the opf_a.mdb format.
[0076] (2) Confirmation stage: Determine the number of service cards that have completed startup in the device. After the service card is recognized by the main control board, the CPU of the service card starts. The main control card continues to monitor the number of events of the CPU normal (service card startup completion event) of the service card to determine the number b of service cards that have completed startup in the device. Usually, the time interval for the CPU of the service card to complete startup in the same environment is within seconds. Considering that the startup of the front-inserted CPU is relatively complex, a 30s timeout mechanism is set to ensure the accuracy of the number of service cards that have completed startup monitored by the main control board in this device as much as possible.
[0077] In the embodiment of the present application, the number b of service cards that have completed startup is the number of service cards to which the foregoing data traffic forwarding is to be performed.
[0078] (3) Verification and distribution stage: Compare and confirm the number of service cards in the distributed device, and perform the distribution process of the drainage table entries. Compare the values of a and b and make corresponding selections. The two situations are as follows:
[0079] I: When a = b, at this time, directly use the allocated temporary file with the opf_a.mdb format to issue all the drainage table entries at one time.
[0080] II: When a ≠ b, at this time, based on b (the number of service cards that have completed startup), allocate the drainage table entries according to the number b of service cards, generate the opf_b.mdb temporary file, and issue all the drainage table entries at one time.
[0081] Here, it should be noted that:
[0082] a ≠ b is divided into two situations, one is a > b, and the other is a < b.
[0083] When a > b, at least one service card has not completed startup normally. Therefore, allocate the drainage table entries according to the actual number b of service boards, generate the opf_b.mdb temporary file, and issue all the drainage table entries at one time.
[0084] When a < b, because in an extremely small probability case, the time interval for any two service cards to complete startup exceeds the pre-set 30s, resulting in a < b at this time. Therefore, allocate the drainage table entries according to the actual number b of service boards, generate the opf_b.mdb temporary file, and issue all the drainage table entries at one time.
[0085] In the actual use of the distributed device, in the normal startup of the distributed device, it is all the first situation; and the second situation is a disaster tolerance measure adopted when the distributed device has an abnormality during the startup stage.
[0086] (4) Data traffic forwarding stage: Since processes such as calculating the distribution of traffic diversion entries and checking for duplicate traffic diversion entries are advanced before the business card starts up, the action of distributing traffic diversion entries can be set to be completed within 60 seconds. In this way, it can be ensured that only after it is determined that all traffic diversion entries have been distributed during the normal startup of the distributed device, each normally started business card in the distributed device begins to perform data traffic forwarding processing.
[0087] In the embodiment of the present application, the number of inserted business cards is obtained and the number of business cards to be subject to data traffic forwarding is obtained; the number of inserted business cards is compared with the number of business cards to be subject to data traffic forwarding to obtain a comparison result; traffic diversion entries are allocated according to the comparison result, and the corresponding traffic diversion entries are distributed; and after it is determined that the distribution of the corresponding traffic diversion entries ends, the business cards to be subject to data traffic forwarding are notified to perform data traffic forwarding. The data traffic forwarding method provided by the embodiment of the present application can shorten the number of times of distributing traffic diversion entries to one time, thereby saving the time for distributing traffic diversion entries; in addition, only after it is determined that the distribution of traffic diversion entries ends, the business cards to be subject to data traffic forwarding are notified to perform data traffic forwarding, thereby effectively improving the effectiveness and forwarding efficiency of data traffic forwarding.
[0088] The following is an embodiment of the data traffic forwarding device of the present application, which can be used to execute the embodiment of the data traffic forwarding method of the present application. For details not disclosed in the embodiment of the data traffic forwarding device of the present application, please refer to the embodiment of the data traffic forwarding method of the present application.
[0089] Please refer to Figure 4 , which shows a schematic structural diagram of a data traffic forwarding device provided by an exemplary embodiment of the present invention. The data traffic forwarding device can be implemented as all or a part of a terminal through software, hardware, or a combination of both. The data traffic forwarding device is applied to the main control board in a distributed device. The distributed device includes a main control board and at least one business card. The data traffic forwarding device includes an acquisition module 402, a comparison module 404, an allocation and distribution module 406, and a notification module 408.
[0090] Specifically, the acquisition module 402 is configured to obtain the number of inserted business cards and the number of business cards to be subject to data traffic forwarding;
[0091] The comparison module 404 is configured to compare the number of inserted business cards obtained by the acquisition module 402 with the number of business cards to be subject to data traffic forwarding to obtain a comparison result;
[0092] The allocation and distribution module 406 is configured to allocate traffic diversion entries according to the comparison result obtained by the comparison module 404 and distribute the corresponding traffic diversion entries;
[0093] A notification module 408, configured to notify a service card waiting for data traffic forwarding to forward data traffic after determining that the corresponding drainage table entry issued by the allocation and distribution module 406 has been issued.
[0094] Optionally, the obtaining module 402 is configured to:
[0095] After starting to monitor a first event of at least one service card, receive first data reported by the at least one service card and related to the first event, where the first event is an insertion event of the at least one service card;
[0096] At an interval of a first preset duration, determine and record the insertion quantity of the service card according to the first data.
[0097] Optionally, the obtaining module 402 is further configured to:
[0098] After starting to monitor a data traffic forwarding event of at least one service card, receive second data reported by the at least one service card and related to the second event, where the second event is an event of the at least one service card forwarding data traffic;
[0099] At an interval of a second preset duration, determine and record the quantity of the service cards waiting for data traffic forwarding according to the second data.
[0100] Optionally, the allocation and distribution module 406 is configured to:
[0101] If the comparison result obtained by the comparison module 404 is that the insertion quantity of the service card is the same as the quantity of the service cards waiting for data traffic forwarding, then allocate drainage table entries according to a pre-configured drainage table entry file and issue corresponding drainage table entries.
[0102] Optionally, the allocation and distribution module 406 is configured to:
[0103] If the comparison result obtained by the comparison module 404 is that the insertion quantity of the service card is greater than the quantity of the service cards waiting for data traffic forwarding, then allocate drainage table entries according to the service cards waiting for data traffic forwarding and issue corresponding drainage table entries.
[0104] Optionally, the allocation and distribution module 406 is configured to:
[0105] If the comparison result obtained by the comparison module 404 is that the insertion quantity of the service card is less than the quantity of the service cards waiting for data traffic forwarding, then allocate drainage table entries according to the service cards waiting for data traffic forwarding and issue corresponding drainage table entries.
[0106] Optionally, the device further includes:
[0107] A configuration module (at Figure 4not shown) for configuring a first preset duration range corresponding to a first preset duration, and / or for configuring a second preset duration range corresponding to a second preset duration.
[0108] It should be noted that when the data traffic forwarding device provided in the above embodiment executes the data traffic forwarding method, only the division of the above functional units is used for illustration. In actual applications, the above functions can be assigned to different functional units according to needs, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. In addition, the data traffic forwarding device provided in the above embodiment and the data traffic forwarding method embodiment belong to the same concept. For the implementation process, refer to the data traffic forwarding method embodiment, which will not be elaborated here.
[0109] In the embodiment of the present application, the acquisition module is used to acquire the insertion quantity of the service cards and the quantity of the service cards to be subjected to data traffic forwarding; the comparison module is used to compare the insertion quantity of the service cards acquired by the acquisition module with the quantity of the service cards to be subjected to data traffic forwarding to obtain a comparison result; the allocation and distribution module is used to allocate the drainage table entries according to the comparison result obtained by the comparison module and distribute the corresponding drainage table entries; and after it is determined that the distribution of the corresponding drainage table entries distributed by the allocation and distribution module is completed, the notification module notifies the service cards to be subjected to data traffic forwarding to perform data traffic forwarding. The data traffic forwarding method provided in the embodiment of the present application can shorten the number of times of distributing the drainage table entries to one time, thereby saving the existing duration of distributing the drainage table entries; in addition, after it is determined that the distribution of the drainage table entries is completed, the service cards to be subjected to data traffic forwarding are notified to perform data traffic forwarding, thereby effectively improving the effectiveness and forwarding efficiency of data traffic forwarding.
[0110] As Figure 5 shown, this embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor runs the computer program to implement the method steps as described above.
[0111] The embodiment of the present application provides a storage medium storing computer-readable instructions, on which a computer program is stored, and the program is executed by the processor to implement the method steps as described above.
[0112] Next, refer to Figure 5, which shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present application. The terminal device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0113] As Figure 5 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0114] Generally, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 5 the electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0115] Particularly, according to the embodiments of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above functions defined in the method of the embodiments of the present application are executed.
[0116] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0117] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0118] The computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The above programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can 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 it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0120] The units involved in the embodiments described in this application can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases.
[0121] The above disclosure is only for the preferred embodiments of this application, and of course it cannot be used to limit the scope of rights of this application. Therefore, equivalent changes made according to the claims of this application still fall within the scope covered by this application.
Claims
1. A data traffic forwarding method, characterized in that, Applied to the main control board in a distributed device, the distributed device includes the main control board and at least one service card, and the method includes: Obtain the insertion quantity of the service cards and the quantity of the service cards for which data traffic forwarding is to be performed. The insertion quantity of the service cards is determined based on the first data related to the first event reported by at least one service card. The first event is the insertion event of at least one service card. The quantity of the service cards for which data traffic forwarding is to be performed is determined based on the second data related to the second event reported by at least one service card. The second event is the event that at least one service card forwards data traffic; Compare the insertion quantity of the service cards with the quantity of the service cards for which data traffic forwarding is to be performed to obtain a comparison result; Allocate the drainage table entries according to the comparison result and issue the corresponding drainage table entries; After determining that the issuance of the corresponding drainage table entries is completed, notify the service cards for which data traffic forwarding is to be performed to forward the data traffic; The allocating the drainage table entries according to the comparison result and issuing the corresponding drainage table entries includes: By comparing the quantity of service cards after the device starts with the quantity of service cards that have completed startup, when the two are equal, issue all the drainage table entries at once using the allocated temporary file with the first preset format. When the two are not equal, allocate the drainage table entries according to the actual number of service boards to generate a temporary file with the second preset format and issue all the drainage table entries at once.
2. The method according to claim 1, characterized in that The obtaining the insertion quantity of the service cards includes: After starting to monitor the first event of at least one service card, receive the first data related to the first event reported by at least one service card. The first event is the insertion event of at least one service card; At an interval of the first preset duration, judge and record the insertion quantity of the service cards according to the first data.
3. The method according to claim 1, characterized in that, The obtaining the quantity of the service cards for which data traffic forwarding is to be performed includes: After starting to monitor the event of at least one service card forwarding data traffic, receive the second data related to the second event reported by at least one service card. The second event is the event that at least one service card forwards data traffic; At an interval of the second preset duration, judge and record the quantity of the service cards for which data traffic forwarding is to be performed according to the second data.
4. The method according to claim 1, wherein The allocating the drainage table entries according to the comparison result and issuing the corresponding drainage table entries includes: If the comparison result is that the insertion quantity of the service cards is the same as the quantity of the service cards for which data traffic forwarding is to be performed, then allocate the drainage table entries according to the pre-configured drainage table entry file and issue the corresponding drainage table entries.
5. The method according to claim 1, characterized in that The allocating the drainage table entries according to the comparison result and issuing the corresponding drainage table entries includes: If the comparison result is that the insertion quantity of the service cards is greater than the quantity of the service cards for which data traffic forwarding is to be performed, then allocate the drainage table entries according to the service cards for which data traffic forwarding is to be performed and issue the corresponding drainage table entries.
6. The method according to claim 1, wherein The allocating the drainage table entries according to the comparison result and issuing the corresponding drainage table entries includes: If the comparison result is that the inserted number of service cards is less than the number of service cards for which data traffic forwarding is to be performed, then allocate the drainage table entries according to the service cards for which data traffic forwarding is to be performed, and issue the corresponding drainage table entries.
7. The method according to claim 2, wherein The method further includes: Configure a first preset duration range corresponding to the first preset duration.
8. The method according to claim 3, characterized in that, The method further includes: Configure a second preset duration range corresponding to the second preset duration.
9. A data traffic forwarding device, characterized in that Applied to the main control board in a distributed device, the distributed device includes the main control board and at least one service card, and the device includes: An acquisition module, configured to acquire the inserted number of service cards and the number of service cards for which data traffic forwarding is to be performed. The inserted number of service cards is determined according to first data related to a first event reported by at least one service card. The first event is an insertion event of at least one service card. The number of service cards for which data traffic forwarding is to be performed is determined according to second data related to a second event reported by at least one service card. The second event is an event that at least one service card forwards data traffic; A comparison module, configured to compare the inserted number of service cards acquired by the acquisition module with the number of service cards for which data traffic forwarding is to be performed, to obtain a comparison result; An allocation and issuing module, configured to allocate drainage table entries according to the comparison result obtained by the comparison module, and issue the corresponding drainage table entries; A notification module, configured to notify the service cards for which data traffic forwarding is to be performed to perform data traffic forwarding after determining that the corresponding drainage table entries issued by the allocation and issuing module have been issued; The allocation and issuing module is further configured to: By comparing the number of service cards after the device starts with the number of service cards that have completed startup, when the two are equal, use the allocated temporary file with the first preset format to issue all drainage table entries at one time. When the two are not equal, allocate drainage table entries according to the actual number of service boards to generate a temporary file with the second preset format, and issue all drainage table entries at one time.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor runs the computer program to implement the method according to any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-8.
Citation Information
Patent Citations
Data processing method and apparatus for SDN Mobile Ad-Hoc Network
CN105959217A
Path evaluation method and device
CN108964958A