Service switching method and system, electronic equipment and computer readable storage medium
By using loop-return messages to update the port status in the target forwarding table in traditional port fast switching technology, the problem of affecting the service switching speed of the central processor software is solved, and fast and packet-free service switching is achieved.
Patent Information
- Application Number
- CN202311777249.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
In traditional fast port switching technology, software processing of the central processor is easily affected, resulting in packet loss reaching seconds in the event of failure, affecting the rapid switching of services.
The target forwarding port of the service message to be forwarded is determined based on the local target forwarding table, and a loop return message is generated when the target forwarding port fails, and the port status in the target forwarding table is directly updated, so that the service message to be forwarded is forwarded to the alternate port.
The rate of service switching is improved, packet loss is avoided, and rapid service switching is achieved, and users cannot perceive business interruption.
Smart Images

Figure CN120200988A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to, but are not limited to, the field of communication technologies, and in particular, to a service switching method, system, electronic device, and computer-readable storage medium. Background Art
[0002] Nowadays, with the rapid development of the network, the demand for the integration of the three networks is becoming increasingly urgent. Operators attach great importance to the service convergence speed during network failures. When a failure occurs at any node, the service switching between adjacent nodes is less than 50 milliseconds, and the end-to-end service convergence is less than 1 second, which has gradually become the threshold index of the bearer network. In the traditional port fast switching technology, it is necessary to sense the port failure through the physical layer, report the interruption to the central processing unit, and then the central processing unit will trigger the service switching, and the switching time is also in milliseconds. However, in this process, it involves the software processing of the central processing unit, and the processing of port failures is easily affected. When the central processing unit is busy, the packet loss will reach the second level, which is not conducive to the rapid switching of services. Summary of the Invention
[0003] The following is an overview of the subject matter described in detail in this article. This overview is not intended to limit the scope of protection of the claims.
[0004] The embodiments of the present application provide a service switching method, system, electronic device, and computer-readable storage medium, which can improve the service switching rate and prevent packet loss.
[0005] In a first aspect, the embodiments of the present application provide a service switching method, and the method includes:
[0006] Determine a target forwarding port for a service packet to be forwarded based on a local target forwarding table;
[0007] Send the service packet to be forwarded through the target forwarding port;
[0008] In the case where the target forwarding port fails, generate a loopback packet based on the service packet to be forwarded and the target forwarding port;
[0009] According to the loopback packet, set the port state corresponding to the target forwarding port to a failure state in the target forwarding table, so that the service packet to be forwarded is forwarded to a standby port.
[0010] In a second aspect, the embodiments of the present application provide a service switching system, and the service switching system includes a forwarding module and a port module, and the forwarding module is data-connected to the port module;
[0011] The forwarding module is configured to determine a target forwarding port for a service packet to be forwarded based on a local target forwarding table;
[0012] The port module is used to send the service packet to be forwarded through the target forwarding port; in the case of a failure of the target forwarding port, a loopback packet is generated based on the service packet to be forwarded and the target forwarding port, so that the forwarding module sets the port status corresponding to the target forwarding port to the failure state in the target forwarding table according to the loopback packet, and the service packet to be forwarded is forwarded to the standby port.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0014] At least one processor;
[0015] At least one memory for storing at least one program;
[0016] When at least one of the programs is executed by at least one of the processors, the service switching method described above is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for executing the service switching method described above.
[0018] Embodiments of the present application include: during the service switching process, first determine the target forwarding port of the service packet to be forwarded based on the local target forwarding table; then send the service packet to be forwarded through the target forwarding port; in the case of a failure of the target forwarding port, a loopback packet is generated based on the service packet to be forwarded and the target forwarding port; finally, according to the loopback packet, the port status corresponding to the target forwarding port is set to the failure state in the target forwarding table, so that the service packet to be forwarded is forwarded to the standby port. According to the technical solution provided by the embodiment of the present application, when the target forwarding port fails, a loopback packet is directly generated according to the service packet to be forwarded to update the port status corresponding to the target forwarding port, without uploading relevant information to the central processing unit as usual, thereby improving the service switching rate and preventing packet loss well. Description of the Drawings
[0019] The drawings are used to provide a further understanding of the technical solution of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation to the technical solution of the present application.
[0020] Figure 1 It is a schematic diagram of the system architecture for executing the service switching method provided by an embodiment of the present application;
[0021] Figure 2 It is a flowchart of the service switching method provided by an embodiment of the present application;
[0022] Figure 3 is a specific flowchart for determining a target forwarding port provided by an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of the design of an FRR policy table entry provided by an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of the design of an ECMP policy table entry provided by an embodiment of the present application;
[0025] Figure 6 is a specific flowchart for generating a loopback message provided by an embodiment of the present application;
[0026] Figure 7 is a specific flowchart for rewriting a target forwarding port provided by an embodiment of the present application;
[0027] Figure 8 is a flowchart of a service switching method provided by another embodiment of the present application;
[0028] Figure 9 is a specific flowchart for determining a target forwarding port provided by another embodiment of the present application;
[0029] Figure 10 is a flowchart of a service switching method provided by another embodiment of the present application;
[0030] Figure 11 is a specific flowchart for rewriting a target forwarding port provided by another embodiment of the present application;
[0031] Figure 12 is a schematic diagram of data interaction of a service switching method provided by an embodiment of the present application;
[0032] Figure 13 is a schematic diagram of data interaction of a service switching method provided by another embodiment of the present application;
[0033] Figure 14 is a schematic diagram of the architecture of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0034] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] It should be noted that although functional modules are divided in the schematic diagram of the device and the logical sequence is shown in the flowchart, in some cases, the steps shown or described can be executed in a different module division from that in the device or a different order from that in the flowchart. Terms such as "first" and "second" in the description of the specification, claims, and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.
[0036] In the description of this application, the meaning of "several" is one or more, the meaning of "multiple" is two or more, understandings such as "greater than", "less than", and "exceeding" do not include the present number, and understandings such as "above", "below", and "within" include the present number. If there is a description of "first" and "second", it is only for the purpose of distinguishing technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.
[0037] In the description of this application, unless otherwise clearly defined, words such as "set", "install", and "connect" should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in this application in combination with the specific content of the technical solution.
[0038] The embodiments of this application provide a service switching method, system, electronic device, and computer-readable storage medium. During the service switching process, first, based on the local target forwarding table, determine the target forwarding port of the service packet to be forwarded; then send the service packet to be forwarded through the target forwarding port; in the case of a failure of the target forwarding port, a loopback packet will be generated based on the service packet to be forwarded and the target forwarding port; finally, according to the loopback packet, set the port status corresponding to the target forwarding port to the failure state in the target forwarding table, so that the service packet to be forwarded is forwarded to the standby port. According to the technical solution provided by the embodiments of this application, when the target forwarding port fails, a loopback packet is directly generated based on the service packet to be forwarded to update the port status corresponding to the target forwarding port, without the need to upload relevant information to the central processing unit as usual, thereby improving the service switching rate and well preventing packet loss.
[0039] The following further elaborates on the embodiments of this application in conjunction with the drawings.
[0040] As Figure 1 shown, it is a schematic diagram of the system architecture for implementing the service switching method provided by an embodiment of the first aspect of this application. In Figure 1 the example, the system architecture includes at least one forwarding module 100 and at least one port module 200, where the forwarding module 100 and the port module 200 can be data-connected by wire or wirelessly; each forwarding module 100 can be connected to multiple port modules 200.
[0041] In some embodiments of the present application, the forwarding module 100 may include a forwarding table 110 and a packet processing unit 120; wherein, the forwarding table 110 contains routing forwarding information and port information; the packet processing unit 120 can analyze and process service packets to determine that the service packets are specifically forwarded according to a certain piece of forwarding information and port information in the forwarding table 110. The port module 200 may include multiple service forwarding ports, and each service forwarding port can forward the service packets sent by the forwarding module 100. In the case of a failure of a corresponding service forwarding port, the port module 200 can set the corresponding service forwarding port as faulty, and then perform a loopback process on the service packets received by this port to inform the forwarding module 100 that this port has failed, thereby triggering service switching processing.
[0042] It should be noted that both the forwarding module 100 and the port module 200 are located on the forwarding plane, so subsequent service forwarding and service switching do not need to pass through the central processor of the upper control plane, which enables the service switching to be more direct and fast, improves the efficiency of service switching, effectively prevents packet loss, and users cannot perceive service interruption, bringing a better user experience.
[0043] In some embodiments of the present application, the forwarding module 100 may specifically be a Network Processor (NP), and the port module 200 may specifically be a Field Programmable Gate Array (FPGA). The above two may also be other programmable chips, which are not limited herein. The forwarding table 110 may be a Fast Reroute (FRR) policy table or an Equal-Cost Multiple Path (ECMP) policy table.
[0044] The system architecture and application scenarios described in the embodiments of the present application are to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0045] Those skilled in the art can understand that Figure 1 the system architecture shown does not constitute a limitation to the embodiments of the present application, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0046] Based on the structure of the above system architecture, various embodiments of the service switching method of the present application are proposed.
[0047] As Figure 2 shown, Figure 2 is a flowchart of a service switching method provided by an embodiment of the present application. The method includes but is not limited to step S100, step S200, step S300, and step S400.
[0048] Step S100, determine the target forwarding port of the service packet to be forwarded based on the local target forwarding table;
[0049] Step S200, send the service packet to be forwarded through the target forwarding port;
[0050] Step S300, in the case of a failure of the target forwarding port, generate a loopback packet based on the service packet to be forwarded and the target forwarding port;
[0051] Step S400, according to the loopback packet, set the port status corresponding to the target forwarding port in the target forwarding table to the failure state, so that the service packet to be forwarded is forwarded to the standby port.
[0052] In the embodiments of the present application, during the process of service switching, first determine the target forwarding port of the service packet to be forwarded based on the local target forwarding table; then send the service packet to be forwarded through the target forwarding port; in the case of a failure of the target forwarding port, a loopback packet will be generated based on the service packet to be forwarded and the target forwarding port; finally, according to the loopback packet, set the port status corresponding to the target forwarding port in the target forwarding table to the failure state, so that the service packet to be forwarded is forwarded to the standby port. According to the technical solution provided by the embodiments of the present application, when the target forwarding port fails, a loopback packet is directly generated according to the service packet to be forwarded to update the port status corresponding to the target forwarding port, without uploading relevant information to the central processing unit as usual, thereby improving the service switching rate, well preventing packet loss, and users not perceiving service interruption, bringing a good user experience to users.
[0053] It should be noted that the service packet to be forwarded can be the service packet received by the forwarding module; when the forwarding module receives the packet to be forwarded, it will analyze and view it according to the internal target forwarding table to determine through which forwarding port the received service packet to be forwarded is specifically forwarded; after determining the target forwarding port in the target forwarding table, the service to be forwarded can be packet-forwarded through the target forwarding port. Among them, the service packet to be forwarded can be a data block, and the packet to be forwarded contains the complete data information to be sent, and its length can be inconsistent, with no limit and variable length.
[0054] It should be noted that when the target forwarding port fails, it means that the target forwarding port cannot forward data normally. In such a case, service switching will be triggered so that the service packets to be forwarded can be forwarded through another forwarding port to meet the packet forwarding requirements.
[0055] It can be understood that when the target forwarding port fails, the port module can directly generate a loopback packet based on the service packet to be forwarded and the target forwarding port to notify the forwarding module that the target forwarding port has failed, thereby triggering the update process of the status of the corresponding target forwarding port in the target forwarding table of the forwarding module, enabling subsequent service packets to be forwarded through the standby port; through the above technical solution, during the service switching process, the intervention of the central processor of the control plane is avoided, the flexibility of the programmable device is fully utilized, and service switching is achieved by relying on packet loopback, with almost zero packet loss and microsecond-level switching achieved.
[0056] It should be noted that by using the loopback packet to change the status of the corresponding forwarding port in the target forwarding table and update the table entry information, it is not necessary to go through the central processor, enabling the service packets to be forwarded to be quickly switched and forwarded from the standby port through the updated forwarding table, effectively preventing packet loss.
[0057] It should be noted that after determining the target forwarding port of the service packet to be forwarded, it is necessary to check and confirm the port status of the target forwarding port; when the target forwarding port is in a normal state, the service packet to be forwarded can be forwarded through this target forwarding port; when the target forwarding port is in an abnormal state, the packet will be directly forwarded through another standby port according to the preset data forwarding protection mechanism.
[0058] As Figure 3 shown, the above step S100 may include but is not limited to step S110, step S120, and step S130.
[0059] Step S110, perform a search process on the service packet to be forwarded to obtain a first table index;
[0060] Step S120, determine the target forwarding table according to the first table index;
[0061] Step S130, determine the target forwarding port of the service packet to be forwarded from the target forwarding table.
[0062] In some embodiments of the present application, in the process of determining the target forwarding port of the service packet to be forwarded based on the local target forwarding table, first, the service packet to be forwarded is searched to obtain the first table index; then, the target forwarding table can be determined according to the obtained first table index; finally, the target forwarding port of the service packet to be forwarded is determined from the target forwarding table. Through the above-mentioned target forwarding port determination scheme, the determination process of the target forwarding port corresponding to the service packet to be forwarded can be made more accurate.
[0063] It should be noted that in the process of searching the service packet to be forwarded, it can be based on the packet processing unit of the forwarding module; in the process of analyzing the service packet to be forwarded by using the packet processing unit, the first table index can be obtained; the first table index is used to represent the pointer to the forwarding table based on which the service packet to be forwarded is forwarded; according to the first table index, the target forwarding table can be determined from multiple forwarding tables of the forwarding module; finally, the target forwarding port of the service packet to be forwarded can be determined according to the target forwarding table.
[0064] As Figure 4 and Figure 5 shown, in some specific embodiments of the present application, the target forwarding table may include an FRR policy table and an ECMP policy table; among them, the FRR policy table may include a port status table, a primary path information table, and a backup path information table; the ECMP policy table may include multiple link member information tables and multiple port status tables, where the link member information tables and the port status tables are in one-to-one correspondence. Exemplarily, the service packet to be forwarded is searched to obtain the first table index, then the link member information table in the ECMP policy table is determined according to the first table index, and finally the target forwarding port is determined from the port status table corresponding to the link member information table.
[0065] As Figure 6 shown, the above step S300 may include but is not limited to step S310.
[0066] Step S310, add a packet header to the service packet to be forwarded to obtain a loopback packet, where the packet header carries a failure port number corresponding to the target forwarding port.
[0067] In some embodiments of the present application, in the process of generating a loopback packet according to the service packet to be forwarded and the target forwarding port, only by adding a packet header to the service packet to be forwarded, the loopback packet can be obtained; through the above packet generation method, the generation method of the loopback packet is made more simple and fast. Among them, the added packet header carries a failure port number corresponding to the target forwarding port, and by confirming the failure port number in the packet header, the target forwarding port that has failed can be quickly determined from the target forwarding table.
[0068] In some embodiments of the present application, by way of example, the forwarding module sends a service packet to be forwarded to the second port of the port module; when the second port fails, the port module immediately adds a header to the received service packet to be forwarded, where the failed port number carried in the header is the second port number; further, when the forwarding module receives the loopback packet, it can quickly determine from the header of the loopback packet that the port number of the previously sent target forwarding port is the second port number, and then quickly update the port status of the corresponding port in the target forwarding table, so that subsequent service packets to be forwarded can quickly perform service switching according to the updated target forwarding table, and forward the service packets to be forwarded to the standby port.
[0069] As Figure 7 shown, the header further carries a second table index, and the above step S400 may include but is not limited to step S410, step S420, and step S430.
[0070] Step S410, determine the target forwarding table according to the second table index;
[0071] Step S420, determine the target forwarding port from the target forwarding table according to the failed port number;
[0072] Step S430, set the port status corresponding to the target forwarding port in the target forwarding table to the failed status.
[0073] In some embodiments of the present application, in the process of switching the port status corresponding to the target forwarding port to the failed status according to the loopback packet, first determine the target forwarding table according to the second table index carried in the header, then determine the target forwarding port from the target forwarding table according to the failed port number; finally, set the port status corresponding to the target forwarding port in the target forwarding table to the failed status. Just by carrying the failed port number in the header of the loopback service packet, the port status of the corresponding forwarding port in the target forwarding table can be quickly updated, making the entire process of determining the failed port and rewriting the status simpler and faster.
[0074] It should be noted that each port in the target forwarding table corresponds to a port number. Therefore, when determining the target forwarding table using the second table index, the corresponding target forwarding port can be quickly determined from the target forwarding table according to the failed port number, thereby improving the efficiency of updating and rewriting the port status and preparing for subsequent service switching.
[0075] As Figure 8 shown, after performing the above step S400, the service switching method may further include but is not limited to step S510 and step S520.
[0076] Step S510: Receive a new service message to be forwarded.
[0077] Step S520: When the target forwarding port corresponding to the new service message to be forwarded is in a faulty state, forward the new service message to be forwarded according to a preset service switching strategy.
[0078] In some embodiments of the present application, after setting the port state corresponding to the target forwarding port to the faulty state in the target forwarding table, when the target forwarding port corresponding to the received new service message to be forwarded is in a faulty state, the new service message to be forwarded can be forwarded from the standby port according to the preset service switching strategy, so as to achieve fast service switching, effectively prevent packet loss, and improve the efficiency of service switching.
[0079] Exemplarily, taking the FRR service as an example, previously, the service was forwarded using the forwarding port with port number two; after this forwarding port fails, the port state of the forwarding port in the corresponding target forwarding table is updated to the faulty state; when a new service message to be forwarded is received subsequently, after table lookup processing, it is found that the forwarding port of the service message to be forwarded is also the forwarding port with port number two; however, currently, the port state of this forwarding port is in a faulty state, so according to the FRR service switching strategy, the new service message to be forwarded can be switched to the standby path, and the corresponding standby port is determined from the standby path for service forwarding.
[0080] In some embodiments of the present application, when the target forwarding port has local failure and / or remote failure and / or signal loss, it can be determined that the target forwarding port has failed and cannot normally forward data messages. Among them, both local failure and remote failure are a kind of error sequence; when the receiving end receives a local failure, it means that the local link has not been properly established; when the receiving end receives a remote failure, it means that the peer end has not been properly established; local failure and remote failure are a link interaction mechanism that enables the docking link to establish a link through the failure sequence. Signal loss means that the receiving end of the communication system cannot receive the signal transmitted by the transmitting end.
[0081] As Figure 9 shown, the target forwarding table includes path information and port status information corresponding to the path information. The above step S130 may include but is not limited to steps S131 and S132.
[0082] Step S131: Determine the primary path information from the path information in the target forwarding table.
[0083] Step S132: Determine the target forwarding port of the service message to be forwarded according to the port status information corresponding to the primary path information.
[0084] In some embodiments of the present application, in the process of determining the target forwarding port of the service packet to be forwarded from the target forwarding table, first determine the primary path information from the path information of the target forwarding table; then, according to the port status information corresponding to the primary path information, the target forwarding port of the service packet to be forwarded can be determined, making the determination process of the target forwarding port more accurate.
[0085] Exemplarily, after determining the target forwarding table, the primary path information can be first determined from the multiple path information of the target forwarding table; then, select the forwarding port with the port status being normal from the port status information corresponding to the primary path information as the target forwarding port.
[0086] As Figure 10 shown, after step S300 above, it may include but is not limited to step S610.
[0087] Step S610, perform broadcast processing on the loopback packet through a preset switching network, so that each network node of the preset forwarding plane receives the loopback packet.
[0088] In some embodiments of the present application, there are multiple network nodes in the forwarding plane, and each network node includes a forwarding module and a port module. Each network node conducts data interaction through the switching network; after the forwarding module of one of the network nodes receives the loopback packet, it can broadcast the received loopback packet to all network nodes in the forwarding plane through the switching network, so that the forwarding modules of each network node can update the port status of the corresponding target forwarding table according to the loopback packet, making preparations for subsequent service packet forwarding.
[0089] As Figure 11 shown, step S430 above may include but is not limited to step S431 and step S432.
[0090] Step S431, determine the faulty port number as the write table key value;
[0091] Step S432, rewrite the port status of the corresponding target forwarding port in the target forwarding table to the faulty state according to the write table key value.
[0092] In some embodiments of the present application, in the process of setting the port status corresponding to the target forwarding port in the target forwarding table to the faulty state, first determine the faulty port number as the write table key value; then rewrite the port status of the corresponding target forwarding port in the target forwarding table to the faulty state according to the write table key value. Determining the faulty port number as the write table key value facilitates port search and determination processing for the target forwarding table.
[0093] To more clearly illustrate the service switching method provided by the embodiments of the present invention, the following uses specific examples for illustration.
[0094] As Figure 12 shown, a data interaction schematic diagram of a service switching method is provided; among them, the system is a centralized system. Taking the FRR service as an example, the main path port is port 2. The implementation steps are as follows: The packet passes through the packet processing unit, and the FRR table index is found through service lookup (such as routing table / mac table, etc.). The FRR forwarding table is found using the FRR index. According to the content of the port status table, it is found that the status of the main path port is up, so the packet is sent to port 2 of the FPGA; during the process of forwarding the packet, when a fault occurs in port 2, when the FPGA detects a local fault (LF), a remote fault (RF) or a loss of signal (LOS) in port 2, the received packet is looped back to the network processor for processing, and at the same time, an FPGA header is added to the front of the packet header, which carries the port number (port 2); the network processor receives the packet, and the microcode extracts the port table index from the FPGA header in the looped-back packet and performs the fast cut write table processing flow. Using the port number in the FPGA header as the write table key value, the port status table is written, and the status of port 2 is set to down; for services such as FRR / ECMP, the forwarding plane looks up the table and responds to the port down, and performs the switching process. In an ideal situation, after the first packet sets the port status to down, the second packet will sense that the status of port 2 is down, so it will switch to the backup path for forwarding. Since this solution fully realizes the fast writing of the port table by means of the forwarding chip and is triggered by the packet, the time from the port reporting down to the port status table being set is in the microsecond level. In an ideal situation, the second packet has detected that the port has reported down when looking up the table and takes the backup link, almost achieving no packet loss. Among them, the packet in this embodiment is the packet to be forwarded, the target forwarding table is the FRR policy table, the forwarding module is the network processor, and the port module is the FPGA.
[0095] As Figure 13 shown, a data interaction schematic diagram of another service switching method is provided; among them, the system is a distributed system. Forwarding from port 1 of line card 1 to port 2 of line card 2, on the basis of the processing flow of the Figure 12 centralized system, after the microcode of line card 2 receives the looped-back packet, it broadcasts it to all line cards through the internal switching network. Other line cards receive the broadcast packet, extract the global port number from it and write the corresponding port status table, so line card 1 can quickly update the status of the port status table, so the traffic coming in from line card 1 can achieve almost zero packet loss.
[0096] Through the above technical solution, by utilizing a flexible forwarding entry design, giving full play to the programmability of the network processor / FPGA, after transforming the service packet when the physical layer reports DOWN, modifying the entry through microcode, and performing fast switching processing on the forwarding plane; since this technology involves chip design and forwarding plane processing, it avoids the participation of the central processor in the control plane, and the packet loss processing time is extremely short, almost achieving zero packet loss, greatly optimizing the service handover performance, and users will not perceive service interruption.
[0097] In addition, as Figure 1 shown, an embodiment of the present application further provides a service handover system, which includes a forwarding module 100 and a port module 200, and the forwarding module 100 is data-connected to the port module 200;
[0098] Among them, the forwarding module 100 is used to determine the target forwarding port of the service packet to be forwarded based on the local target forwarding table;
[0099] Among them, the port module 200 is used to send the service packet to be forwarded through the target forwarding port; in the case of a failure of the target forwarding port, a loopback packet is generated based on the service packet to be forwarded and the target forwarding port, so that the forwarding module 100 sets the port status corresponding to the target forwarding port to the failure status in the target forwarding table according to the loopback packet, and forwards the service packet to be forwarded to the standby port.
[0100] It should be noted that the service handover system in the embodiment of the present application and the above service handover method are based on the same inventive concept, so these embodiments have the same implementation principle and technical effects, which will not be elaborated here.
[0101] In addition, as Figure 14 shown, an embodiment of the present application further provides an electronic device 700, which includes:
[0102] A memory 720, a processor 710, and a computer program stored on the memory 720 and executable on the processor 710.
[0103] The processor 710 and the memory 720 can be connected through a bus or other means.
[0104] It should be noted that the electronic device 700 in this embodiment and the service handover method in the above embodiment belong to the same inventive concept, so these embodiments have the same implementation principle and technical effects, which will not be elaborated here.
[0105] The non-transitory software program and instructions required to implement the service handover method in the above embodiment are stored in the memory 720, and when executed by the processor 710, they execute the service handover method in the above embodiment. For example, execute the above description ofFigure 2 the method steps S100 to S400 in Figure 3 the method steps S110 to S130 in Figure 6 the method step S310 in Figure 7 the method steps S410 to S430 in Figure 8 the method steps S510 to S520 in Figure 9 the method steps S131 to S132 in Figure 10 the method step S610 in Figure 11 and the method steps S431 to S432 in
[0106] In addition, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor 710, for example, executed by a processor 710 in the above-described embodiment of the electronic device 700, the above-mentioned processor 710 can be caused to execute the service switching method in the above embodiment. For example, execute the Figure 2 the method steps S100 to S400 in Figure 3 the method steps S110 to S130 in Figure 6 the method step S310 in Figure 7 the method steps S410 to S430 in Figure 8 the method steps S510 to S520 in Figure 9 the method steps S131 to S132 in Figure 10 the method step S610 in Figure 11 and the method steps S431 to S432 in
[0107] Those of ordinary skill in the art will understand that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and their appropriate combinations. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or can be implemented as hardware, or can be implemented as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVDs) or other optical disk storage, magnetic cassettes, tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that a communication medium typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.
[0108] The above is a specific description of the preferred embodiment of the present application, but the present application is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A service switching method, the method comprising: Determining a target forwarding port for a service message to be forwarded based on a local target forwarding table; Sending the service message to be forwarded through the target forwarding port; When the target forwarding port fails, generating a loopback message based on the service message to be forwarded and the target forwarding port; According to the loopback message, setting the port status corresponding to the target forwarding port in the target forwarding table to a fault status, so that the service message to be forwarded is forwarded to a standby port.
2. The service switching method according to claim 1, wherein The determining a target forwarding port for a service message to be forwarded based on a local target forwarding table includes: Performing a lookup process on the service message to be forwarded to obtain a first table index; Determining the target forwarding table according to the first table index; Determining the target forwarding port of the service message to be forwarded from the target forwarding table.
3. The service switching method according to claim 1, wherein The generating a loopback message based on the service message to be forwarded and the target forwarding port includes: Adding a message header to the service message to be forwarded to obtain the loopback message, wherein the message header carries a fault port number corresponding to the target forwarding port.
4. The service switching method according to claim 3, wherein The message header further carries a second table index, and according to the loopback message, setting the port status corresponding to the target forwarding port in the target forwarding table to a fault status includes: Determining the target forwarding table according to the second table index; Determining the target forwarding port from the target forwarding table according to the fault port number; Setting the port status corresponding to the target forwarding port in the target forwarding table to the fault status.
5. The service switching method according to claim 1, wherein After setting the port status corresponding to the target forwarding port in the target forwarding table to a fault status, the service switching method further includes: Receiving a new service message to be forwarded; When the target forwarding port corresponding to the new service message to be forwarded is in the fault status, performing a forwarding process on the new service message to be forwarded according to a preset service switching policy.
6. The service switching method according to claim 1, wherein The failure of the target forwarding port includes at least one of the following situations: local failure; remote failure; signal loss.
7. The service switching method according to claim 2, wherein The target forwarding table includes path information and port status information corresponding to the path information. The determining the target forwarding port of the service message to be forwarded from the target forwarding table includes: Determining main path information from the path information of the target forwarding table; Determining the target forwarding port of the service message to be forwarded according to the port status information corresponding to the main path information.
8. The service switching method according to claim 1, wherein After generating the loopback message based on the service message to be forwarded and the target forwarding port, the service switching method further includes: Performing a broadcast process on the loopback message through a preset switching network, so that each network node of a preset forwarding plane receives the loopback message.
9. The service switching method according to claim 4, wherein The setting the port status corresponding to the target forwarding port in the target forwarding table to the fault status includes: Determining the fault port number as a write table key value; Rewriting the port status of the corresponding target forwarding port in the target forwarding table to the fault status according to the write table key value.
10. A service switching system, characterized in that, The service switching system includes a forwarding module and a port module, and the forwarding module is connected to the port module for data connection; The forwarding module is configured to determine a target forwarding port of a service packet to be forwarded based on a local target forwarding table; The port module is configured to send the service packet to be forwarded through the target forwarding port; In the case where the target forwarding port fails, a loopback packet is generated based on the service packet to be forwarded and the target forwarding port, so that the forwarding module sets the port status corresponding to the target forwarding port to a fault status in the target forwarding table according to the loopback packet, and causes the service packet to be forwarded to a standby port.
11. An electronic device, characterized in that, Comprising: At least one processor; At least one memory for storing at least one program; When at least one of the at least one program is executed by at least one of the at least one processor, the service switching method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the service switching method according to any one of claims 1 to 9.