Data processing method and device based on multiple wide area network ports, equipment and medium

After receiving data packets on the target LAN port of the gateway device, dynamically determine the forwarding port, solving the problem of data confounding in multi-WAN environments, improving service stability and data processing reliability.

CN119906669AActive Publication Date: 2025-04-29SICHUAN TIANYI COMHEART TELECOM
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510407690.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-04-29
Estimated Expiration
2045-04-02

AI Technical Summary

Technical Problem

When existing gateway devices forward data in multi-WAN environments, the LAN side devices can only forward data through the default WAN, resulting in data confusion of different services, affecting service stability and reliability.

Method used

After receiving the pending data packets on the target LAN port, determine whether the port is bound to the WAN port. If it is not bound, it is forwarded through the default WAN port. If it is bound, it is forwarded through the bound WAN port, and dynamically determine the new default WAN port when the default WAN port is in a disconnected state.

Benefits of technology

It realizes that different service data are forwarded through different wide area network ports, avoiding data confusion, improving service stability, and improving data processing reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906669A_ABST
    Figure CN119906669A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device based on multiple wide area network ports, equipment and a medium, and relates to the technical field of network communication. In the application, firstly, after a to-be-processed data packet sent by a target terminal device is received through a target local area network port, whether the target local area network port is bound with a wide area network port is determined; secondly, if the target local area network port is not bound with the wide area network port, forwarding the to-be-processed data packet through a default wide area network port in the plurality of wide area network ports; and then, if the target local area network port is bound with the wide area network port, forwarding the to-be-processed data packet through the wide area network port bound with the target local area network port in the plurality of wide area network ports. Based on the content, the problem that in the prior art, the reliability of data processing is relatively low can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a data processing method and apparatus, device and medium based on multiple wide area network ports. Background Art

[0002] In recent years, with the promotion of computer network technology, operators have been increasing their support for multiple dual-stack services, such as PPPoE dial-up Internet access, VR services (IPoE non-session services), IPTV services, etc. However, the current gateway devices still have the following problems in data forwarding in a multi-WAN (wide area network) environment: LAN (local area network) side devices can usually only forward data through the default WAN, resulting in data from different services being mixed together, affecting service stability and making reliability relatively low. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a data processing method and apparatus, device and medium based on multiple WAN ports to improve the problem of relatively low reliability of data processing in the prior art.

[0004] To achieve the above objectives, this application adopts the following technical solutions: A data processing method based on multiple wide area network ports, comprising: After receiving a data packet to be processed sent by a target terminal device through a target LAN port, determining whether the target LAN port is bound to a WAN port; If the target LAN port is not bound to a WAN port, forwarding the to-be-processed data packet through a default WAN port among the multiple WAN ports; If the target LAN port is bound to a WAN port, the data packet to be processed is forwarded through the WAN port to which the target LAN port is bound among the multiple WAN ports.

[0005] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, before the step of forwarding the data packet to be processed through a default WAN port among multiple WAN ports if the target LAN port is not bound to a WAN port, the data processing method based on multiple WAN ports further includes: Monitoring the state of the default wide area network port to obtain port state information, wherein the port state information is used to reflect whether the default wide area network port is in a connected state or a disconnected state; If the port status information reflects that the default WAN port is in a disconnected state, a new default WAN port is determined from other WAN ports included in the multiple WAN ports except the default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0006] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, if the port status information reflects that the default WAN port is in a disconnected state, a new default WAN port is determined from other WAN ports other than the default WAN port included in the multiple WAN ports, so that the data packet to be processed can be forwarded through the new default WAN port, comprising: If the port status information reflects that the default WAN port is in a disconnected state, then determining each WAN port in a connected state from other WAN ports included in the plurality of WAN ports except the default WAN port, to obtain a plurality of candidate WAN ports; Based on the service priority and protocol stack status of each of the candidate WAN ports, a candidate WAN port is determined from the multiple candidate WAN ports, and the candidate WAN port is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0007] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, the step of determining a candidate WAN port from the multiple candidate WAN ports based on the service priority and protocol stack status of each of the candidate WAN ports, and determining the candidate WAN port as a new default WAN port, so that the data packet to be processed can be forwarded through the new default WAN port, includes: Based on the service priority of each of the candidate WAN ports, the multiple candidate WAN ports are traversed in sequence for the first time to form the candidate WAN ports currently traversed, wherein the traversal order is from the candidate WAN port with a higher service priority to the candidate WAN port with a lower service priority, and the service priority corresponding to the Ethernet dial-up Internet access service is higher than the service priority corresponding to the IP-based sessionless service, and the service priority corresponding to the IP-based sessionless service is higher than the service priority corresponding to other services, and the other services at least include an Internet Protocol television service; If the candidate WAN port currently traversed belongs to a dual-stack service and at least one protocol stack is in an available state, the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to the dual-stack service and each protocol stack is in an unavailable state, or the currently traversed candidate WAN port does not belong to the dual-stack service, the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed.

[0008] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, the step of determining a candidate WAN port from the multiple candidate WAN ports based on the service priority and protocol stack status of each of the candidate WAN ports, and determining the candidate WAN port as a new default WAN port, so that the data packet to be processed can be forwarded through the new default WAN port, further includes: If the first traversal fails to determine a new default WAN port, then based on the service priority of each of the candidate WAN ports, the plurality of candidate WAN ports are traversed in sequence for a second time to form a currently traversed candidate WAN port; If the candidate WAN port currently traversed belongs to the single stack service of IPv6 and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to an IPv6 single-stack service and the protocol stack is in an unavailable state, or does not belong to an IPv6 single-stack service, traverse the next candidate WAN port until a new default WAN port is determined or the last candidate WAN port is traversed; If the second traversal fails to determine a new default WAN port, then based on the service priority of each of the candidate WAN ports, the plurality of candidate WAN ports are sequentially traversed for a third time to form a currently traversed candidate WAN port; If the candidate WAN port currently traversed belongs to the single stack service of IPv4 and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to the IPv4 single stack service and the protocol stack is in an unavailable state, the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed.

[0009] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, if the target LAN port is bound to a WAN port, the step of forwarding the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports includes: If the target LAN port is bound to a WAN port, then based on a predetermined mapping relationship, determining the WAN port to which the target LAN port is bound from the multiple WAN ports; The data packet to be processed is forwarded through the wide area network port bound to the target local area network port.

[0010] In a preferred embodiment of the present application, in the above-mentioned data processing method based on multiple WAN ports, if the target LAN port is bound to a WAN port, the step of determining the WAN port bound to the target LAN port from the multiple WAN ports based on a predetermined mapping relationship includes: If the target LAN port is bound to a WAN port, then based on a predetermined first mapping relationship, according to the port number of the target LAN port, a target value of the corresponding target data structure field is mapped, and, based on a predetermined second mapping relationship, according to the target value, an identification value of the bound WAN port is mapped, wherein the target data structure field is used to mark the data packet to be processed in the kernel, and, for a downlink data packet from the WAN port to the LAN port, the identification value corresponding to the WAN port will be mapped to the target data structure field according to the second mapping relationship to mark the downlink data packet; Based on the identification value of the bound WAN port, the port number of the bound WAN port is determined, and based on the port number, the WAN port bound to the target LAN port is determined from the multiple WAN ports.

[0011] The present application also provides a data processing device based on multiple wide area network ports, comprising: A port binding status determination module, configured to determine whether the target LAN port is bound to a WAN port after receiving a to-be-processed data packet sent by a target terminal device through the target LAN port; A first forwarding processing module, configured to forward the data packet to be processed through a default WAN port among multiple WAN ports when the target LAN port is not bound to a WAN port; The second forwarding processing module is used to forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports when the target LAN port is bound to a WAN port.

[0012] On the basis of the above, the present application also provides a gateway device, including: Memory for storing computer programs; The processor connected to the memory is used to execute the computer program stored in the memory to implement the above-mentioned data processing method based on multiple wide area network ports.

[0013] On the basis of the above, the present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is run, each step of the above-mentioned data processing method based on multiple wide area network ports is executed.

[0014] The data processing method and device, equipment and medium based on multiple WAN ports provided by the present application, first, after receiving the data packet to be processed sent by the target terminal device through the target LAN port, determine whether the target LAN port is bound to a WAN port; secondly, if the target LAN port is not bound to a WAN port, forward the data packet to be processed through the default WAN port among the multiple WAN ports; then, if the target LAN port is bound to a WAN port, forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports. Based on the above content, on the basis of the default WAN port, since the data packet to be processed can also be forwarded through the WAN port bound to the target LAN port, different data packets can be forwarded through different WAN ports, so that the problem of data of different services being easily mixed together can be avoided to a certain extent, thereby ensuring business stability, and further improving the problem of relatively low reliability of data processing existing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings.

[0016] Figure 1 A structural block diagram of a gateway device provided in an embodiment of the present application.

[0017] Figure 2 A flowchart of a data processing method based on multiple WAN ports provided in an embodiment of the present application.

[0018] Figure 3 A block diagram of a data processing device based on multiple WAN ports provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0021] like Figure 1 As shown, an embodiment of the present application provides a gateway device, wherein the gateway device may include a memory, a processor, and a data processing device based on multiple WAN ports.

[0022] In detail, the memory and the processor are electrically connected directly or indirectly to achieve data transmission or interaction. For example, the memory and the processor can be electrically connected through one or more communication buses or signal lines. The data processing device based on multiple WAN ports includes at least one software function module stored in the memory in the form of software or firmware. The processor is used to execute an executable computer program stored in the memory, for example, the software function modules and computer programs included in the data processing device based on multiple WAN ports, so as to implement the data processing method based on multiple WAN ports provided in the embodiment of the present application.

[0023] Optionally, the memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.

[0024] Furthermore, the processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a system on chip (SoC), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0025] Understandably, Figure 1 The structure shown is for illustration only. The gateway device may also include Figure 1 More or fewer components as shown, or with Figure 1 The different configurations shown, for example, may also include a communication unit for exchanging information with other devices.

[0026] In addition, the above-mentioned gateway device can be a general gateway device or a government and enterprise gateway, and can be applied to scenarios such as PON and FTTR, without any specific restrictions.

[0027] Combination Figure 2 The embodiment of the present application also provides a data processing method based on multiple WAN ports that can be applied to the above-mentioned gateway device. Among them, the method steps defined in the process related to the data processing method based on multiple WAN ports can be implemented by the gateway device. Figure 2 The specific process shown is explained in detail.

[0028] Step S110, after receiving the to-be-processed data packet sent by the target terminal device through the target LAN port, determining whether the target LAN port is bound to a WAN port.

[0029] In an embodiment of the present application, the gateway device may determine whether the target LAN port is bound to a WAN port after receiving the data packet to be processed sent by the target terminal device through the target LAN port. Exemplarily, the data packet to be processed may refer to an uplink data packet.

[0030] Step S120: if the target LAN port is not bound to a WAN port, forwarding the to-be-processed data packet through a default WAN port among the multiple WAN ports.

[0031] In the embodiment of the present application, if the target LAN port is not bound to a WAN port, the gateway device may forward the data packet to be processed through a default WAN port among multiple WAN ports.

[0032] Step S130: if the target LAN port is bound to a WAN port, forwarding the to-be-processed data packet is performed through the WAN port to which the target LAN port is bound among the multiple WAN ports.

[0033] In the embodiment of the present application, if the target LAN port is bound to a WAN port, the gateway device can forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports. It should be noted that when binding, the binding can be performed according to the corresponding services, so that data of different services can be forwarded through different ports to avoid data mixing.

[0034] Based on the above content, on the basis of the default WAN port, since the data packets to be processed can also be forwarded through the WAN port bound to the target LAN port, different data packets can be forwarded through different WAN ports. In this way, the problem of data from different services being easily mixed together can be avoided to a certain extent, thereby ensuring business stability and improving the problem of relatively low reliability of data processing in the prior art.

[0035] It should be noted that for step S120, in order to ensure that the data packet to be processed can be reliably forwarded through the default WAN port, before executing the above step S120, the data processing method based on multiple WAN ports may also include step S101 and step S102, and the specific content of each step is described as follows.

[0036] Step S101, monitoring the status of the default WAN port to obtain port status information.

[0037] In an embodiment of the present application, the status of the default WAN port can be monitored to obtain port status information. The port status information is used to reflect whether the default WAN port is in a connected state (up) or a disconnected state (down). It is understandable that in some implementations, the status of all WAN ports can also be monitored.

[0038] Step S102, if the port status information reflects that the default WAN port is in a disconnected state, a new default WAN port is determined from other WAN ports included in the multiple WAN ports except the default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0039] In an embodiment of the present application, after obtaining the corresponding port status information, if the port status information reflects that the default WAN port is in a disconnected state, a new default WAN port is determined from other WAN ports other than the default WAN port included in the multiple WAN ports, so that the data packet to be processed can be forwarded and processed through the new default WAN port. It should be noted that the new default WAN port needs to process the connection state. In addition, if the port status information reflects that the default WAN port is in a connected state, the current default WAN port is maintained unchanged, and the above-mentioned step S120 is performed.

[0040] It is understandable that, in the above step S102, the specific method of determining the new default WAN port is not limited and can be selected according to actual needs.

[0041] For example, in an alternative implementation, a WAN port in a connected state may be arbitrarily selected from other WAN ports included in the plurality of WAN ports except the default WAN port as a new default WAN port.

[0042] For another example, in another alternative implementation, in order to ensure the reliability of the determined new default WAN port, the above step S102 may further include the following step S102a and step S102b, and the specific content of each step is described as follows.

[0043] Step S102a, if the port status information reflects that the default WAN port is in a disconnected state, then determine each WAN port in a connected state from other WAN ports included in the multiple WAN ports except the default WAN port to obtain multiple candidate WAN ports.

[0044] In an embodiment of the present application, if the port status information reflects that the default WAN port is in a disconnected state, then each WAN port in a connected state is determined from other WAN ports other than the default WAN port included in the multiple WAN ports to obtain multiple candidate WAN ports, that is, each WAN port in a connected state is screened out as a candidate.

[0045] Step S102b, based on the service priority and protocol stack status of each of the candidate WAN ports, determine a candidate WAN port from the multiple candidate WAN ports, and determine the candidate WAN port as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0046] In the embodiment of the present application, after the candidate WAN ports are screened out, a candidate WAN port can be determined from the multiple candidate WAN ports based on the service priority and protocol stack status of each of the candidate WAN ports, and the candidate WAN port can be determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port. In this way, it can be ensured that the service priority and protocol stack status of the screened new default WAN port can meet the application requirements, thereby improving its reliability.

[0047] It can be understood that in the above step S102b, in order to fully consider the impact of service priority and protocol stack status on data forwarding reliability, the above step S102b can further include the following steps b1, b2 and b3, and the specific content of each step is as follows.

[0048] Step b1, based on the service priority of each of the candidate WAN ports, traverse the plurality of candidate WAN ports in sequence for the first time to form the currently traversed candidate WAN ports.

[0049] In an embodiment of the present application, the plurality of candidate WAN ports may be traversed in sequence for the first time based on the service priority of each candidate WAN port to form the candidate WAN port currently traversed. The traversal order is from the candidate WAN port with a high service priority to the candidate WAN port with a low service priority, and the service priority corresponding to the Ethernet dial-up service (PPPoE) is higher than the service priority corresponding to the IP-based sessionless service (VR), and the service priority corresponding to the IP-based sessionless service is higher than the service priority corresponding to other services, and the other services at least include the Internet Protocol television service (IPTV).

[0050] Step b2: If the candidate WAN port currently traversed belongs to a dual-stack service and at least one protocol stack is in an available state, the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0051] In an embodiment of the present application, if the candidate WAN port currently traversed belongs to a dual-stack service (i.e., IPv4 and IPv6), and at least one protocol stack is in an available state (i.e., at least one of IPv4 and IPv6 is available and in an up state), the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port. For example, if the first candidate WAN port traversed belongs to a dual-stack service and at least one protocol stack is in an available state, the first candidate WAN port traversed is used as the new default WAN port.

[0052] Step b3, if the currently traversed candidate WAN port belongs to the dual-stack service and each protocol stack is in an unavailable state, or the currently traversed candidate WAN port does not belong to the dual-stack service, traverse the next candidate WAN port until a new default WAN port is determined or the last candidate WAN port is traversed.

[0053] In the embodiment of the present application, if the currently traversed candidate WAN port belongs to the dual-stack service and each protocol stack is in an unavailable state, or the currently traversed candidate WAN port does not belong to the dual-stack service, then the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed. For example, if the first traversed candidate WAN port does not belong to the dual-stack service or none of the protocol stacks are in an available state, and the second traversed candidate WAN port belongs to the dual-stack service and at least one protocol stack is in an available state, then the second traversed candidate WAN port is used as the new default WAN port.

[0054] It can be understood that in order to determine a reliable new default WAN port as much as possible, after the above-mentioned step b3, the above-mentioned step S102b can further include the following steps b4, b5, b6, b7, b8 and b9, and the specific contents of each step are as follows.

[0055] Step b4: if the first traversal fails to determine a new default WAN port, then based on the service priority of each candidate WAN port, the plurality of candidate WAN ports are traversed for a second time in sequence to form the currently traversed candidate WAN port.

[0056] In an embodiment of the present application, if the first traversal fails to determine a new default WAN port (i.e., each candidate WAN port does not satisfy the condition of "belonging to a dual-stack service and at least one protocol stack is in an available state"), then based on the service priority of each of the candidate WAN ports, the multiple candidate WAN ports are traversed in sequence for a second time to form the candidate WAN ports currently traversed, wherein the order of traversal is from the candidate WAN port with a high service priority to the candidate WAN port with a low service priority, which is the same as the order of the first traversal.

[0057] Step b5, if the currently traversed candidate WAN port belongs to the single stack service of IPv6 and the protocol stack is in an available state, the currently traversed candidate WAN port is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0058] In an embodiment of the present application, if the candidate WAN port currently traversed belongs to a single-stack service of IPv6, and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port. Exemplarily, if the first candidate WAN port traversed belongs to a single-stack service of IPv6, and the protocol stack is in an available state, the first candidate WAN port traversed is determined as a new default WAN port, that is, for single-stack services, available IPv6 is preferentially selected.

[0059] Step b6, if the currently traversed candidate WAN port belongs to an IPv6 single-stack service and the protocol stack is in an unavailable state, or does not belong to an IPv6 single-stack service, traverse the next candidate WAN port until a new default WAN port is determined or the last candidate WAN port is traversed.

[0060] In an embodiment of the present application, if the currently traversed candidate WAN port belongs to a single-stack service of IPv6, and the protocol stack is in an unavailable state, or does not belong to a single-stack service of IPv6, then the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed. Exemplarily, if the first traversed candidate WAN port belongs to a single-stack service of IPv6, and the protocol stack is in an unavailable state, or does not belong to a single-stack service of IPv6, then when the second traversed candidate WAN port belongs to a single-stack service of IPv6, and the protocol stack is in an available state, the second traversed candidate WAN port is determined as the new default WAN port, and so on, until a new default WAN port is determined or the last candidate WAN port is traversed.

[0061] Step b7: If the second traversal fails to determine a new default WAN port, then based on the service priority of each candidate WAN port, the plurality of candidate WAN ports are traversed for a third time in sequence to form the currently traversed candidate WAN port.

[0062] In an embodiment of the present application, if the second traversal fails to determine a new default WAN port (i.e., each back-end WAN port satisfies the condition of "being a single-stack service of IPv6, and the protocol stack is in an available state"), then based on the service priority of each of the candidate WAN ports, the multiple candidate WAN ports are traversed in sequence for a third time to form the candidate WAN ports currently traversed, wherein the order of traversal is from the candidate WAN port with a high service priority to the candidate WAN port with a low service priority, which is the same as the order of the first traversal and the second traversal.

[0063] Step b8, if the currently traversed candidate WAN port belongs to the IPv4 single stack service and the protocol stack is in an available state, the currently traversed candidate WAN port is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

[0064] In an embodiment of the present application, if the candidate WAN port currently traversed belongs to a single-stack service of IPv4 and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port. Exemplarily, if the first candidate WAN port traversed belongs to a single-stack service of IPv4 and the protocol stack is in an available state, the first candidate WAN port traversed is determined as a new default WAN port.

[0065] Step b9: If the currently traversed candidate WAN port belongs to the IPv4 single stack service and the protocol stack is in an unavailable state, traverse the next candidate WAN port until a new default WAN port is determined or the last candidate WAN port is traversed.

[0066] In an embodiment of the present application, if the candidate WAN port currently traversed belongs to the single stack business of IPv4, and the protocol stack belongs to the unavailable state, then traverse the next candidate WAN port, until a new default WAN port is determined or the last candidate WAN port is traversed. Exemplarily, if the first candidate WAN port traversed belongs to the single stack business of IPv4, and the protocol stack belongs to the unavailable state, then when the second candidate WAN port traversed belongs to the single stack business of IPv4, and the protocol stack belongs to the available state, the second candidate WAN port traversed is determined as the new default WAN port. So, and so on, until a new default WAN port is determined or the last candidate WAN port is traversed. That is to say, dual stack business is preferred, followed by the single stack business of IPv6, and finally the single stack business of IPv4 is selected. In the interior of the aforementioned three priorities, select according to the order of business priority from high to low.

[0067] It should be noted that after determining the new default WAN port, in order to ensure data forwarding based on the new default WAN port, the IPv6 prefix and DNS information corresponding to the new default WAN port can also be synchronized to the LAN port device (such as the target terminal device mentioned above).

[0068] It should be noted that for the above step S130, the specific implementation method of forwarding the to-be-processed data packet through the WAN port bound to the target LAN port among the multiple WAN ports is not limited and can be selected according to actual needs.

[0069] For example, in an alternative implementation, in order to accurately determine the WAN port to which the target LAN port is bound so as to increase the reliability of data forwarding processing and avoid the problem of different business data being mixed together, the above-mentioned step S130 may further include step S131 and step S132, and the specific contents of each step are as follows.

[0070] Step S131: if the target LAN port is bound to a WAN port, then based on a predetermined mapping relationship, determining the WAN port to which the target LAN port is bound from the multiple WAN ports.

[0071] In the embodiment of the present application, if the target LAN port is bound to a WAN port, the WAN port to which the target LAN port is bound is determined from the multiple WAN ports based on a predetermined mapping relationship. Thus, the bound WAN port can be reliably searched and determined through the mapping relationship.

[0072] Step S132, forwarding the data packet to be processed through the WAN port bound to the target LAN port.

[0073] In the embodiment of the present application, after the WAN port to which the target LAN port is bound is determined, the data packet to be processed can be forwarded through the WAN port to which the target LAN port is bound.

[0074] It can be understood that, in the above-mentioned step S131, the specific method of determining the WAN port bound to the target LAN port from the multiple WAN ports is not limited. For example, in an alternative implementation, in order to improve the efficiency of data forwarding, the above-mentioned step S131 can further include step S131a and step S131b. The specific content of each step is described as follows.

[0075] Step S131a, if the target LAN port is bound to a WAN port, based on a predetermined first mapping relationship, according to the port number of the target LAN port, a target value of the corresponding target data structure field is mapped, and, based on a predetermined second mapping relationship, according to the target value, an identification value of the bound WAN port is mapped.

[0076] In an embodiment of the present application, if the target LAN port is bound to a WAN port, then based on a predetermined first mapping relationship, according to the port number of the target LAN port, a target value of the corresponding target data structure field is mapped, and, based on a predetermined second mapping relationship, according to the target value, an identification value of the bound WAN port is mapped. Wherein, the target data structure field is used to mark the data packet to be processed in the kernel, and for a downlink data packet from the WAN port to the LAN port, the identification value corresponding to the WAN port will be mapped to the target data structure field according to the second mapping relationship to mark the downlink data packet. In other words, a mapping link of LAN port number-value of target data structure field-identification value of WAN port-port number of WAN port can be formed in advance, so that for an uplink data packet, the bound WAN port can be found from front to back according to the mapping link; for a downlink data packet, the bound WAN port can be found from back to front according to the mapping link.

[0077] Step S131b, based on the identification value of the bound WAN port, determining the port number of the bound WAN port, and, based on the port number, determining the WAN port bound to the target LAN port from the multiple WAN ports.

[0078] In the embodiment of the present application, the port number of the bound WAN port can be determined based on the identification value of the bound WAN port, and the WAN port bound to the target LAN port can be determined from the multiple WAN ports based on the port number, as described above. Based on the above mapping link, compared with the traditional routing query method, the amount of calculation can be reduced, and therefore, the efficiency of data forwarding can be improved to a certain extent.

[0079] It should also be noted that the device without a LAN port bound uses the IPv6 prefix of the default WAN port, while the device with a LAN port bound obtains the IPv6 prefix and DNS information of a specific WAN port according to the binding relationship. For example, the IPv6 prefix distribution configuration can be dynamically generated through the radvd process (Router Advertisement Daemon) and combined with the skbmask tag to achieve accurate matching and allocation of IPv6 addresses and DNS information of different WAN connections. Specifically, the radvd_policyid.conf file can be dynamically generated based on the policyid of the WAN connection. In other words, the policyid corresponding to the WAN connection (i.e. the identification value of the WAN port mentioned above) can be mapped to the kernel's skb->mark (i.e. the target data structure field mentioned above). Specifically, setsockopt(sock, SOL_SOCKET,SO_MARK,&mark, sizeof(mark)) is used to configure the radvd sock to carry the mark for forwarding (i.e. bind a mark value to the socket of the radvd process, and map the value to the skb->mark in the kernel. The mark value will be passed along with the flow of the data packet, allowing the kernel to determine which WAN connection the data packet should take based on the mark). In this way, the application layer can configure multiple wan information to the corresponding radvd for forwarding through the wan connection binding relationship, so as to realize the distribution of IPv6 prefix and DNS information, such as: radvd_policyid.conf file: interface br-lan { AdvSendAdvert on; prefix 2001:db8:1:: / 64 { AdvValidLifetime 86400; AdvPreferredLifetime 14400; AdvOnLink on; AdvAutonomous on; }; RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {}; }; Among them, interface br-lan: specifies the br-lan interface, which is usually a bridge interface that connects various devices on the intranet.

[0080] AdvSendAdvert on;: indicates that the sending of IPv6 routing advertisements is enabled.

[0081] prefix 2001:db8:1:: / 64: defines an IPv6 prefix and specifies the lifecycle of the prefix: AdvValidLifetime 86400;: The validity period of the prefix is ​​86400 seconds (24 hours).

[0082] AdvPreferredLifetime 14400;: The preferred lifetime of the prefix is ​​14400 seconds (4 hours).

[0083] AdvOnLink on;: indicates that the prefix is ​​directly reachable.

[0084] AdvAutonomous on;: indicates that the automatic configuration mode is turned on.

[0085] RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {};: Provides the DNS server address (such as the IPv6 address of Google DNS) to the client.

[0086] Combination Figure 3 The embodiment of the present application also provides a data processing device based on multiple WAN ports that can be applied to the above-mentioned gateway device. The data processing device based on multiple WAN ports can include a port binding status determination module, a first forwarding processing module and a second forwarding processing module.

[0087] The port binding status determination module is used to determine whether the target LAN port is bound to a WAN port after receiving a to-be-processed data packet sent by a target terminal device through the target LAN port. Figure 2 As shown in step S110, the relevant contents of the port binding status determination module can refer to the above description of step S110.

[0088] The first forwarding processing module is used to forward the data packet to be processed through a default WAN port among multiple WAN ports when the target LAN port is not bound to a WAN port. Figure 2 As shown in step S120, the relevant content of the first forwarding processing module can refer to the above description of step S120.

[0089] The second forwarding processing module is used to forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports when the target LAN port is bound to a WAN port. Figure 2 As shown in step S130, the relevant content of the second forwarding processing module can refer to the above description of step S130.

[0090] In an embodiment of the present application, corresponding to the above-mentioned data processing method based on multiple WAN ports applied to the gateway device, a computer-readable storage medium is also provided, in which a computer program is stored, and when the computer program is run, each step of the data processing method based on multiple WAN ports is executed.

[0091] Among them, the steps executed when the aforementioned computer program is running will not be described one by one here, and reference may be made to the above explanation of the data processing method based on multiple WAN ports.

[0092] In summary, the data processing method and device, equipment and medium based on multiple WAN ports provided by the present application, first, after receiving the data packet to be processed sent by the target terminal device through the target LAN port, determine whether the target LAN port is bound to a WAN port; secondly, if the target LAN port is not bound to a WAN port, forward the data packet to be processed through the default WAN port among the multiple WAN ports; then, if the target LAN port is bound to a WAN port, forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports. Based on the above content, on the basis of the default WAN port, since the data packet to be processed can also be forwarded through the WAN port bound to the target LAN port, different data packets can be forwarded through different WAN ports. In this way, the problem that data of different services are easily mixed together can be avoided to a certain extent, thereby ensuring business stability, and then improving the problem of relatively low reliability of data processing existing in the prior art.

[0093] In several embodiments provided in the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device and method embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0095] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code. It should be noted that in this article, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0096] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method based on multiple wide area network ports, characterized in that: include: After receiving a data packet to be processed sent by a target terminal device through a target LAN port, determining whether the target LAN port is bound to a WAN port; If the target LAN port is not bound to a WAN port, forwarding the data packet to be processed through a default WAN port among the multiple WAN ports; If the target LAN port is bound to a WAN port, the data packet to be processed is forwarded through the WAN port to which the target LAN port is bound among the multiple WAN ports.

2. The data processing method based on multiple WAN ports according to claim 1, characterized in that: Before the step of forwarding the data packet to be processed through a default WAN port among multiple WAN ports if the target LAN port is not bound to a WAN port, the data processing method based on multiple WAN ports also includes: Monitoring the state of the default wide area network port to obtain port state information, wherein the port state information is used to reflect whether the default wide area network port is in a connected state or a disconnected state; If the port status information reflects that the default WAN port is in a disconnected state, a new default WAN port is determined from other WAN ports included in the multiple WAN ports except the default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

3. The data processing method based on multiple WAN ports according to claim 2, characterized in that: If the port status information reflects that the default WAN port is in a disconnected state, the step of determining a new default WAN port from other WAN ports included in the multiple WAN ports except the default WAN port, so that the data packet to be processed can be forwarded through the new default WAN port includes: If the port status information reflects that the default WAN port is in a disconnected state, then determining each WAN port in a connected state from other WAN ports included in the plurality of WAN ports except the default WAN port, to obtain a plurality of candidate WAN ports; Based on the service priority and protocol stack status of each of the candidate WAN ports, a candidate WAN port is determined from the multiple candidate WAN ports, and the candidate WAN port is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port.

4. The data processing method based on multiple WAN ports according to claim 3 is characterized in that: The step of determining a candidate WAN port from the plurality of candidate WAN ports based on the service priority and protocol stack status of each of the candidate WAN ports, and determining the candidate WAN port as a new default WAN port so that the data packet to be processed can be forwarded through the new default WAN port includes: Based on the service priority of each of the candidate WAN ports, the multiple candidate WAN ports are traversed in sequence for the first time to form the candidate WAN ports currently traversed, wherein the traversal order is from the candidate WAN port with a higher service priority to the candidate WAN port with a lower service priority, and the service priority corresponding to the Ethernet dial-up Internet access service is higher than the service priority corresponding to the IP-based sessionless service, and the service priority corresponding to the IP-based sessionless service is higher than the service priority corresponding to other services, and the other services at least include an Internet Protocol television service; If the candidate WAN port currently traversed belongs to a dual-stack service and at least one protocol stack is in an available state, the candidate WAN port currently traversed is determined as a new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to the dual-stack service and each protocol stack is in an unavailable state, or the currently traversed candidate WAN port does not belong to the dual-stack service, the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed.

5. The data processing method based on multiple WAN ports according to claim 4, characterized in that: The step of determining a candidate WAN port from the plurality of candidate WAN ports based on the service priority and protocol stack status of each of the candidate WAN ports, and determining the candidate WAN port as a new default WAN port so that the data packet to be processed can be forwarded through the new default WAN port, further includes: If the first traversal fails to determine a new default WAN port, then based on the service priority of each of the candidate WAN ports, the plurality of candidate WAN ports are traversed in sequence for a second time to form a currently traversed candidate WAN port; If the candidate WAN port currently traversed belongs to the single stack service of IPv6 and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to an IPv6 single-stack service and the protocol stack is in an unavailable state, or does not belong to an IPv6 single-stack service, traverse the next candidate WAN port until a new default WAN port is determined or the last candidate WAN port is traversed; If the second traversal fails to determine a new default WAN port, then based on the service priority of each of the candidate WAN ports, the plurality of candidate WAN ports are sequentially traversed for a third time to form a currently traversed candidate WAN port; If the candidate WAN port currently traversed belongs to the single stack service of IPv4 and the protocol stack is in an available state, the candidate WAN port currently traversed is determined as the new default WAN port, so that the data packet to be processed can be forwarded and processed through the new default WAN port; If the currently traversed candidate WAN port belongs to the IPv4 single stack service and the protocol stack is in an unavailable state, the next candidate WAN port is traversed until a new default WAN port is determined or the last candidate WAN port is traversed.

6. The data processing method based on multiple WAN ports according to any one of claims 1 to 5, characterized in that: If the target LAN port is bound to a WAN port, the step of forwarding the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports comprises: If the target LAN port is bound to a WAN port, then based on a predetermined mapping relationship, determining the WAN port to which the target LAN port is bound from the multiple WAN ports; The data packet to be processed is forwarded through the wide area network port bound to the target local area network port.

7. The data processing method based on multiple WAN ports according to claim 6, characterized in that: If the target LAN port is bound to a WAN port, the step of determining the WAN port to which the target LAN port is bound from the multiple WAN ports based on a predetermined mapping relationship comprises: If the target LAN port is bound to a WAN port, then based on a predetermined first mapping relationship, according to the port number of the target LAN port, a target value of the corresponding target data structure field is mapped, and, based on a predetermined second mapping relationship, according to the target value, an identification value of the bound WAN port is mapped, wherein the target data structure field is used to mark the data packet to be processed in the kernel, and, for a downlink data packet from the WAN port to the LAN port, the identification value corresponding to the WAN port will be mapped to the target data structure field according to the second mapping relationship to mark the downlink data packet; Based on the identification value of the bound WAN port, the port number of the bound WAN port is determined, and based on the port number, the WAN port bound to the target LAN port is determined from the multiple WAN ports.

8. A data processing device based on multiple WAN ports, characterized in that: include: A port binding status determination module is used to determine whether the target LAN port is bound to a WAN port after receiving a to-be-processed data packet sent by a target terminal device through the target LAN port; A first forwarding processing module, configured to forward the data packet to be processed through a default WAN port among multiple WAN ports when the target LAN port is not bound to a WAN port; The second forwarding processing module is used to forward the data packet to be processed through the WAN port bound to the target LAN port among the multiple WAN ports when the target LAN port is bound to a WAN port.

9. A gateway device, characterized in that: include: Memory for storing computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the data processing method based on multiple wide area network ports as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is run, the data processing method based on multiple wide area network ports according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Local area network (LAN) and wide area network (WAN) service binding method and service binding system

    CN103166854A

  • Gateway device based on Linux inner core and communication method

    CN108616439A

  • Method, system and equipment for identifying camera device in room local area network

    CN111132120A

  • Method for gateway to distribute different Ipv6PD prefixes for lower device

    CN113660358A

  • Method and device for selecting main WAN port by CPE (Customer Premise Equipment) with multiple WAN ports

    CN116132333A