ONU gateway connection switching method and device of PON network, equipment and medium

By acquiring the signal quality of multiple ONU gateways in a WiFi Mesh network, establishing dual connections for parallel transmission, and dynamically adjusting traffic allocation, the problems of AP switching interruption and insufficient resource utilization in WiFi Mesh networks are solved. This achieves seamless switching with high bandwidth and low latency, improving user experience and network continuity.

CN121842783APending Publication Date: 2026-04-10SHENZHEN SKYWORTH DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing WiFi Mesh networks, terminal devices exhibit significant issues during AP switching, including interruptions, insufficient resource utilization, inadequate reliability, insufficient smooth traffic transition, inability to cope with rapid signal changes, unfriendly real-time applications, single point of failure risk, inconsistent terminal support, and inaccurate measurements. These problems make it difficult to meet the continuity requirements of high-bandwidth, low-latency applications.

Method used

By acquiring the signal quality of multiple ONU gateways within the communication range, a second gateway with a better signal quality than the currently connected ONU gateway is identified, and a dual connection is established while maintaining the first connection. Traffic data is transmitted in parallel through the dual connection, and the traffic allocation weight is dynamically adjusted until the first connection is disconnected, thus achieving seamless switching.

Benefits of technology

It effectively avoids service interruptions during the handover process, improves network continuity and user experience, with a handover interruption time of less than 5ms, a packet loss rate of less than 0.1%, latency jitter controlled within ±5ms, and a handover success rate of 99.9%. It is suitable for high-reliability scenarios such as industrial internet and telemedicine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121842783A_ABST
    Figure CN121842783A_ABST
Patent Text Reader

Abstract

The invention discloses an ONU gateway connection switching method, device and equipment of a PON network and a medium, the method is suitable for terminal equipment, and the method comprises the following steps: acquiring signal quality of a plurality of ONU gateways in a communication range, and determining a second ONU gateway of which the signal quality is superior to that of a currently connected first ONU gateway from the signal quality; establishing a second connection with the second ONU gateway, and keeping a first connection with the first ONU gateway; transmitting traffic data corresponding to the terminal device through the first connection and the second connection; and when the traffic data transmitted by the second connection meets the target traffic data distribution condition, disconnecting the first connection. According to the method, non-inductive switching is achieved through double-connection parallel transmission of flow data, service interruption in the switching process is effectively avoided, network continuity and user experience are improved, and the method can be applied to fiber to room (FTTR), enterprise-level fiber to room (FTTR-B) and broadband fusion terminal products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wireless communication, and in particular to a method, apparatus, device, and medium for switching ONU gateway connections in a PON network. Background Technology

[0002] WiFi Mesh networks are a mainstream solution for large-area WiFi coverage, forming a seamless coverage network through the collaborative work of multiple access points (APs). Mobile devices commonly roam between different APs, but traditional WiFi handover mechanisms present user experience issues. In traditional hard handover, the terminal first disconnects from the current AP and then reconnects to the new AP, a process that takes 100-300ms, resulting in noticeable network interruptions and impacting real-time application experience. The IEEE 802.11r standard introduced fast roaming, reducing the handover time to 30-50ms, but brief packet loss still occurs. In high-speed movement or rapidly changing signal scenarios, even a 50ms interruption can be perceived by the user. Mobile communication networks use the Make-Before-Break mechanism for smooth handover, but WiFi networks are difficult to port due to protocol and device capabilities limitations, and the fact that only a single connection is used during the handover moment cannot fully utilize the resources of two APs.

[0003] The existing WiFi switching and optimization technologies have the following drawbacks: First, interruptions are unavoidable; even the fastest 802.11r experiences 30-50ms interruptions, affecting real-time applications. Second, resource utilization is insufficient, as only one connection can be used during switching. Third, reliability is insufficient; failure to connect to a new AP prolongs the interruption time. Fourth, there is a lack of smooth traffic transition, easily causing congestion or packet loss. Fifth, they cannot cope with rapid signal changes, resulting in a worse experience in scenarios with fluctuating signals. Sixth, they are not friendly to real-time applications, which are sensitive to interruptions. Seventh, there is a risk of single point of failure; if a new AP fails, the old AP cannot be quickly restored. Eighth, terminal support varies, and older devices cannot enjoy fast switching. Ninth, they are limited by network protocols, making it difficult to break through WiFi standards. Tenth, measurements are inaccurate; RSSI-based switching decisions are easily interfered with. Therefore, the switching effect of terminal devices in existing WiFi Mesh networks during AP switching is significantly insufficient, making it difficult to meet the continuity requirements of high-bandwidth, low-latency applications. Summary of the Invention

[0004] This invention provides a method, apparatus, computer device, and storage medium for switching ONU gateway connections in a PON network, in order to solve the problem that the switching effect of terminal devices in existing WiFi Mesh networks is significantly insufficient when switching APs, making it difficult to meet the continuity requirements of high-bandwidth, low-latency applications.

[0005] A method for switching ONU gateway connections in a PON network, applicable to terminal devices, includes the following steps: acquiring the signal quality of multiple ONU gateways within the communication range, and determining a second ONU gateway whose signal quality is superior to that of a currently connected first ONU gateway; establishing a second connection with the second ONU gateway while maintaining a first connection with the first ONU gateway; transmitting traffic data corresponding to the terminal device through the first connection and the second connection; and disconnecting the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions.

[0006] An ONU gateway connection switching device for a PON network includes: an acquisition module for acquiring the signal quality of multiple ONU gateways within a communication range and determining a second ONU gateway whose signal quality is superior to that of a currently connected first ONU gateway; a connection establishment module for establishing a second connection with the second ONU gateway and maintaining a first connection with the first ONU gateway; a data transmission module for transmitting traffic data corresponding to the terminal device through the first connection and the second connection; and a connection disconnection module for disconnecting the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions.

[0007] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the ONU gateway connection switching method of the PON network described above.

[0008] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the ONU gateway connection switching method of the above-described PON network.

[0009] In the aforementioned technical solution for ONU gateway connection switching in a PON network, the method, applicable to terminal equipment, includes the following steps: acquiring the signal quality of multiple ONU gateways within the communication range, and identifying a second ONU gateway whose signal quality is superior to that of the currently connected first ONU gateway; establishing a second connection with the second ONU gateway while maintaining a first connection with the first ONU gateway; transmitting traffic data corresponding to the terminal equipment through the first and second connections; and disconnecting the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions. This method achieves seamless switching through parallel transmission via dual connections, effectively avoiding service interruptions during the switching process, improving network continuity and user experience, and can be applied to Fiber to the Room (FTTR), Fiber to the Room-Business (FTTR-B), and broadband converged terminal products. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart of an ONU gateway connection switching method in a PON network according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the principle of a PON network ONU gateway connection switching method in one embodiment of the present invention; Figure 3 This is a detailed flowchart of step S3 in the ONU gateway connection switching method of a PON network in one embodiment of the present invention; Figure 4 This is a schematic diagram of an ONU gateway connection switching device in a PON network according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] like Figure 1 As shown, a method for switching ONU gateway connections in a PON network is provided, applicable to terminal equipment, including the following steps: Step S1: Obtain the signal quality of multiple ONU gateways within the communication range, and determine the second ONU gateway whose signal quality is better than the currently connected first ONU gateway.

[0014] It should be noted that terminal devices include, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The first ONU gateway is the ONU gateway currently establishing a single communication connection with the terminal device; all traffic data from the terminal device is transmitted through this first connection. The second ONU gateway is the candidate gateway with the best signal quality within the communication range that meets the handover conditions.

[0015] In this embodiment, the PON network includes multiple distributed ONU gateways under the WIFI Mesh architecture. The ONU gateway includes an optical network unit and an integrated wireless access point (AP). The optical network unit performs photoelectric signal conversion and PON protocol processing, while the AP is responsible for transmitting and receiving wireless signals.

[0016] Combination Figure 2 The terminal device periodically scans and acquires the wireless signal strength and channel quality of multiple surrounding ONU gateways, obtaining signal strength, channel interference, and load status information for each ONU gateway. It then identifies a second ONU gateway with better signal quality than the currently connected first ONU gateway as a potential handover target. The signal quality assessment comprehensively considers Received Signal Strength Index (RSSI), Signal-to-Noise Ratio (SNR), and the current link's bit error rate.

[0017] Furthermore, before establishing a second connection between the terminal device and the second ONU gateway, it is necessary to evaluate whether the second ONU gateway meets the connection switching conditions. If the second ONU gateway meets the connection switching conditions, proceed to step S2 to establish a second connection between the terminal device and the second ONU gateway. If the second ONU gateway does not meet the connection switching conditions, return to step S1 to continue acquiring the signal quality of multiple ONU gateways within the communication range, and determine a new second ONU gateway whose signal quality is superior to the currently connected first ONU gateway.

[0018] In this embodiment, the connection switching conditions include a strength threshold that the difference between the signal strength of the second ONU gateway and the signal strength of the first ONU gateway must meet. This strength threshold can be dynamically adjusted according to the real-time traffic demand of the terminal device. If real-time traffic exists, the strength threshold is lowered; if normal traffic exists, the default strength threshold is maintained to prioritize connection stability. Furthermore, the connection switching conditions also consider the load status and stability of the second ONU gateway. If the load rate of the second ONU gateway exceeds a preset upper load limit and the load rate of the first ONU gateway is less than a preset lower load limit, switching will not be performed to avoid overloading due to the connection of a new device. Simultaneously, the signal stability variance of the second ONU gateway is detected. If the stability variance is greater than a stability threshold, it is determined to be unstable, and a delayed switching is performed.

[0019] For example, if the signal strength threshold is 5dBm, and real-time traffic exists, the threshold is lowered to 3dBm to ensure a stable connection even under high traffic conditions. The upper load limit is 0.8, and the lower load limit is 0.5. This means that if the load rate of the second ONU gateway exceeds 80% and the load rate of the first ONU gateway is less than 50%, a handover will not be triggered even if the signal quality of the second ONU gateway is better. The stability threshold is set to 2.5dBm². If the variance of the signal strength measured three consecutive times exceeds this value, the link jitter is considered severe, and a handover will not be performed.

[0020] Furthermore, frequent handover suppression is also required. By recording the last handover time of the terminal device in the previous handover, the time interval between the current time and the last handover time is calculated. If the time interval is less than the preset minimum handover interval, the current handover request is suppressed to avoid network instability caused by the terminal device frequently switching between multiple ONU gateways in a short period of time.

[0021] In other embodiments, the connection switching condition can also be combined with the duration of a strength threshold. This requires that the signal strength of the second ONU gateway be superior to that of the first ONU gateway, and the difference satisfying the strength threshold must continuously exceed a preset duration. Valid samples are filtered through a time window. Combining the strength threshold and duration conditions ensures the stability and reliability of the switching trigger. For example, with a preset duration of 3 seconds, the switching condition is only determined to be met if the signal strength difference of the second ONU gateway continuously exceeds the strength threshold for 3 seconds, preventing misjudgments caused by instantaneous signal fluctuations. Specifically, the signal strength within the last 10 seconds is recorded, and samples from the most recent preset duration (3 seconds) are extracted. The sample size must meet the requirement of a sampling rate (10Hz) and a sample size (≥30 samples). It is verified that all samples continuously satisfy the condition "Second ONU gateway signal strength - First ONU gateway signal strength ≥ strength threshold (5dBm)". Simultaneously, the minimum switching interval is set to 10 seconds to ensure sufficient buffer time between adjacent switching events, reducing the risk of network jitter. This mechanism effectively balances switching sensitivity and stability, improving the user experience.

[0022] In this application, a multi-dimensional evaluation mechanism is used to effectively avoid ping-pong handover and connection oscillations, ensuring that the terminal always accesses the optimal network node during movement, thereby guaranteeing the continuous experience of high-bandwidth, low-latency services.

[0023] Furthermore, before the terminal device establishes a second connection with the second ONU gateway, the process includes: initiating a connection switching authorization request to the main controller to ensure that the terminal device has the right to establish a second connection with the second ONU gateway. The main controller makes a comprehensive decision based on the global load status, link quality, and quality of service policies. If the authorization is approved, the terminal device is allowed to access the second ONU gateway; otherwise, the switching is rejected, and the current connection is maintained. This process ensures that the switching behavior conforms to the overall network scheduling strategy, avoids global congestion or resource conflicts caused by local optimization, and further enhances the stability and controllability of the network.

[0024] like Figure 2 As shown, the terminal device sends a connection switching authorization request to the main controller, which then sends a preparation notification to the second ONU gateway to accept the second connection. Upon receiving the preparation notification, the second ONU gateway reserves resources and sends a completion result to the main controller. After receiving the completion result, the main controller sends an authorization response to the terminal device to establish the second connection. Upon receiving the authorization response, the terminal device can immediately initiate the connection establishment process with the second ONU gateway. Simultaneously, the resource reservation status is maintained centrally by the main controller to ensure that the target gateway resources are not preempted or released during the switching window. This process, through pre-allocation of network resources, ensures that the target gateway has sufficient capacity and avoids service quality degradation due to sudden increases in access.

[0025] Step S2: Establish a second connection with the second ONU gateway, and maintain the first connection with the first ONU gateway.

[0026] It should be noted that, in order to ensure service continuity during the handover process, this invention adopts a dual-connection mechanism. While maintaining the first connection, a second connection is established through a second ONU gateway to achieve seamless access and provide redundancy for subsequent connection handover.

[0027] In this embodiment, when the terminal device determines that the second ONU gateway meets the connection switching conditions and is entitled to establish a second connection with the second ONU gateway, it initiates a dual connection mechanism. While maintaining the first connection between the terminal device and the first ONU gateway, it establishes a second connection between the terminal device and the second ONU gateway, thereby realizing data splitting and transmission and laying the foundation for subsequent connection switching.

[0028] Combination Figure 2The terminal device sends an association request to the second ONU gateway and marks the connection between the second access point and the terminal device as a second connection. Upon receiving the association request, the second ONU gateway accesses the terminal device and sends an association response confirming the successful establishment of the second connection. Simultaneously, the second ONU gateway assigns a virtual identifier to itself based on the real identifier of the first ONU gateway. After receiving the association response from the second ONU gateway, the terminal device enters dual-connection mode. The mapping relationship between the virtual and real identifiers is managed uniformly by the main controller to ensure correct routing and reassembly of data packets under the dual-connection path. Through the virtual identifier mechanism, the second ONU gateway can simulate the communication context of the terminal with the first ONU gateway, achieving session continuity.

[0029] To distinguish the traffic data between the first and second connections, a virtual identifier is used for the second ONU gateway. This virtual identifier is dynamically generated by the main controller and mapped to the real identifier of the first ONU gateway. For example, the identifier uses BSSID (Basic Service Set Identifier), which is a unique hardware identifier for the ONU gateway (AP) in the wireless network, typically corresponding to the AP's MAC address (formatted as 6 groups of hexadecimal numbers, such as 00:14:22:01:23:45). The last byte of the real identifier of the first ONU gateway {0x00, 0x11, 0x22, 0x33, 0x44, 0x55} is incremented by 1, while the remaining bytes are retained, forming the virtual identifier {0x00, 0x11, 0x22, 0x33, 0x44, 0x56} uniquely corresponding to the second ONU gateway, ensuring that the network layer address remains logically consistent during dual connections.

[0030] Meanwhile, a global sequence number is used across the two connections to ensure the uniqueness and orderliness of data packets transmitted between the two connections. The global sequence number is uniformly assigned by the main controller and increments with each data packet to avoid out-of-order or duplicate transmissions due to different paths between the two connections. When sending data, the terminal device splits the same data stream into two connections, each carrying the same sequence number. The receiving end reassembles the data based on the sequence number, ensuring the continuity and integrity of application layer data.

[0031] First, a mutex lock, threading.Lock, is used to ensure that continuously increasing global sequence numbers are generated in a multi-threaded environment. Then, a sequence header containing a global sequence number, a microsecond-level timestamp, and a data source identifier is added to each data packet. This allows the receiving end to deduplicate and reassemble data packets, providing a unified identifier for data packets transmitted in parallel through dual connections. This solves the problems of disordered and duplicate sequences in multi-path transmission, ensuring data integrity and transmission efficiency.

[0032] Step S3: Transmit traffic data corresponding to the terminal device through the first connection and the second connection.

[0033] It should be noted that traffic data includes multiple data packets, each carrying a global sequence number and a source connection identifier. In dual-connection parallel transmission, different transmission strategies are adopted according to different scenarios, allocating corresponding data packets for transmission to the first and second connections. Transmission strategies include full redundancy strategy, weighted allocation strategy, and priority-driven strategy. Under the full redundancy strategy, the same data packet is transmitted simultaneously through two connections; the weighted allocation strategy dynamically adjusts the traffic allocation weight based on the real-time connection quality of the two connections, distributing data packets proportionally to the two connections according to the traffic allocation weight; the priority-driven strategy classifies data packets according to service type, with high-priority data packets transmitted through the connection with the best quality, and low-priority data packets selected for transmission through the connection with the lowest load, in order to optimize resource utilization.

[0034] Among them, the full redundancy strategy allocates multiple data packets to the first and second connections for transmission at the same time. Each data packet is sent through both connections simultaneously. Although this method improves transmission reliability, it will double the bandwidth consumption. It is suitable for scenarios with extremely high data reliability requirements, such as real-time VoIP, video conferencing and other critical scenarios.

[0035] For the priority-driven strategy, high-priority data packets are preferentially transmitted through connections with low latency and low packet loss rate to ensure the quality of service for critical businesses; low-priority data packets are scheduled to connections with larger remaining capacity to avoid wasting valuable link resources. Intelligent traffic routing is achieved by dynamically monitoring the real-time status of two connections and combining this with business priority tags, improving overall transmission efficiency while ensuring user experience. This strategy is suitable for multi-service concurrent scenarios, such as simultaneous screen sharing and file downloading in online meetings, effectively isolating interference and ensuring smooth operation of core services.

[0036] For weighted allocation strategies, such as Figure 3 As shown, it includes the following sub-steps: Step S31: Evaluate the connection quality of the first connection and the second connection in real time to obtain the real-time connection quality.

[0037] In this embodiment, the real-time connection quality of the first and second connections is evaluated using multiple assessment metrics, including received signal strength score, latency score, packet loss rate score, throughput score, and stability score. The real-time connection quality (reflected by a connection quality score ranging from 0 to 100) is obtained by weighting these metrics. Specifically, the received signal strength score is converted from dBm to a score using the `rssi_to_score` function, with a weight of 0.3; latency is converted to a score using the `delay_to_score` function, with a weight of 0.25; the packet loss rate score is directly calculated using the formula (1 - packet loss rate) × 100, with a weight of 0.25; the throughput score is mapped to a score using the `throughput_to_score` function, with a weight of 0.15; and the stability score is calculated based on RSSI stability using the formula: stability score = 100 × (1 - stability value), with a weight of 0.05. The connection quality score is obtained by summing the weighted scores of each metric; a higher score indicates better connection quality.

[0038] Step S32: Update the traffic allocation weights for the first and second connections based on the real-time connection quality.

[0039] In this embodiment, the traffic allocation weights for the first connection and the second connection are a first allocation weight w1 and a second allocation weight w2, respectively, satisfying w1 + w2 = 1. The weights are dynamically adjusted based on the real-time connection quality scores of the two connections, specifically using the formulas: w1 = q1 / (q1 + q2), w2 = q2 / (q1 + q2), where q1 and q2 are the connection quality scores of the first connection and the second connection, respectively.

[0040] It should be noted that during the dual-path parallel phase, the first allocation weight corresponding to the first connection gradually decreases, while the second allocation weight corresponding to the second connection increases accordingly, ensuring that data packets are preferentially transmitted through the link with better quality.

[0041] In this embodiment, the corresponding allocation weights are smoothly migrated. Initially, 90% of data packets are handled by the first connection, and 10% are transmitted through the second connection. Subsequently, the traffic allocation weights are gradually adjusted. During the middle stage of the switchover, 50% of data packets are transmitted by the first connection, and 50% are handled by the second connection. Towards the end of the switchover, the first connection's allocation weight is reduced to 10%, and the second connection handles 90% of the data packets, achieving a smooth transition. The entire process avoids transmission interruptions or jitter caused by link switching, ensuring service continuity. Once the second connection is confirmed to be stable and its transmission quality meets service quality requirements, the main service flow is migrated to the second connection, and the first connection is downgraded to a backup path, thus achieving seamless switching. During this time, the status monitoring of the primary and backup links continues to ensure that if fluctuations occur in the second connection, the weights can be quickly re-weighted, and traffic can be switched back to the first connection.

[0042] Furthermore, when any connection quality score falls below a preset threshold (e.g., 30 points), the allocation weight for that connection will be forcibly reduced to the minimum guarantee level (e.g., 0.1) to avoid severe delays or interruptions in data transmission. The traffic allocation weight is updated every 200 milliseconds to ensure rapid response to network changes.

[0043] Furthermore, congestion detection is required for both the first and second connections to prevent congestion caused by dual-path transmission. The congestion status of the ONU gateway is determined based on four indicators: queue length (> length threshold), packet loss rate (>5%), retransmission rate (>10%), and latency (>50ms). Meeting two or more of these indicators indicates congestion. Once congestion is detected, a congestion control mechanism is immediately activated, dynamically reducing the traffic allocation weight of that path and guiding more data packets through non-congested links to alleviate network pressure. For example, if the first connection is congested, the first allocation weight is reduced to 30%, and the second allocation weight is correspondingly increased to 70%; if the second connection is congested, the second allocation weight is reduced to 30%, and the first connection weight is increased to 70%; if both paths are congested, an emergency rate reduction mechanism is activated, limiting the total transmission rate to 50% and evenly distributing traffic between the two paths to ensure priority transmission of critical business data.

[0044] In addition, the system records the reasons for each weight adjustment and the network status in real time, forming traceable log information to facilitate subsequent analysis and strategy optimization.

[0045] Step S33: Use traffic allocation weights to allocate corresponding data packets to the first and second connections.

[0046] In this embodiment, multiple data packets are dynamically distributed according to the updated first allocation weight w1 and second allocation weight w2 to ensure that data packets are transmitted through links with better quality whenever possible. Before transmission, each data packet makes a path decision based on its current allocation weight and is assigned to either the first or second connection using a scheduling algorithm that combines round-robin and weighted scheduling. When sudden changes in network state cause drastic fluctuations in connection quality scores, a smoothing factor is introduced to filter the weight changes and avoid jitter caused by frequent switching.

[0047] Furthermore, an ONU gateway is randomly selected to send data packets based on the weights. A random number in the range [0,1) is generated, and its magnitude is compared with the first allocated weight w1 of the first ONU gateway. If the random number is less than the first allocated weight w1, the corresponding data packet is sent to the first ONU gateway; otherwise, it is sent to the second ONU gateway. The random number generator is triggered with millisecond-level precision to ensure that each decision is independent and conforms to the current weight distribution.

[0048] It should be noted that during dual-path transmission, the same data packet may arrive at different ONU gateways via different paths, resulting in duplicate messages and affecting service processing. Furthermore, since the delays of the two ONU gateways may differ, data packets may arrive out of order. Therefore, it is necessary to deduplicate and reassemble the multiple data packets allocated to the first and second connections to ensure that each data packet is processed only once by the receiving end and delivered to the application layer in order.

[0049] First, multiple data packets allocated to the first and second connections are deduplicated and reassembled to obtain a data packet sequence. Then, according to the data packet sequence, the multiple data packets are sequentially sent to the first and second connections for transmission.

[0050] In this embodiment, to support deduplication and reassembly, additional information needs to be added to the data packets for marking. This additional information includes a global sequence number, timestamp, connection identifier, whether the packet was sent redundantly, original packet length, and checksum field. The global sequence number ensures that data packets can be reassembled in the order they were sent at the ONU gateway; the timestamp is used to detect latency anomalies and assist in packet loss judgment; the connection identifier records the physical links traversed by the data packet, providing a basis for path tracing; the redundancy marker indicates whether the packet was sent repeatedly, avoiding resource waste; and the original packet length and checksum ensure data integrity.

[0051] For the deduplication process, the sequence number is first extracted from the header of the data packet, and used as a unique identifier. Then, a fast deduplication check is performed using a Bloom filter to quickly determine if the global sequence number is likely duplicated. If a potential duplicate is detected, local records are queried, and if the duplicate is confirmed, the packet is discarded. For non-duplicate data packets, the Bloom filter and local records (including the global sequence number and timestamp) are updated, and the data packet is returned. In addition, expired records are periodically removed, removing old global sequence number records that have exceeded the set deduplication window time to free up system resources. This process combines probabilistic filtering (Bloom filter) with precise verification (dictionary lookup), ensuring both processing efficiency and accuracy. It is particularly suitable for ordered transmission scenarios such as TCP, effectively solving the problem of duplicate data caused by retransmissions.

[0052] For scenarios without a global sequence number (such as non-TCP traffic), timestamp deduplication can be used. The core logic is to first extract the source / destination IP, port, first 64 bytes of payload, and millisecond-level timestamp of the data packet, generate a unique identifier using a hash algorithm, and then perform deduplication checks. If the unique identifier already exists in the current identifier set, it is determined to be a duplicate data packet; otherwise, the unique identifier is added to the current identifier set and the data packet is retained. This method can effectively avoid the uploading of duplicate data packets caused by link switching during dual-path parallel switching in WiFi Mesh networks, ensuring the uniqueness and orderliness of application layer data, and achieving a low packet loss rate of less than 0.1%.

[0053] Furthermore, for the reassembly process, a receive buffer sorted by global sequence number needs to be maintained. This buffer is temporarily stored only when data packets have been deduplicated and the preceding packet is missing. Once the preceding packet arrives, continuous submission is triggered to ensure the application layer receives an ordered byte stream. Buffer management stores out-of-order data packets in a buffer dictionary (the key is the global sequence number, and the value includes the data packet and its arrival time). The next expected sequence number is marked to ensure in-order output. Starting from the next expected sequence number, consecutive data packets are popped from the buffer until the sequence is interrupted. A timeout handling mechanism is also included to force output and update the next expected sequence number for data packets that have exceeded the maximum waiting time (50 milliseconds) and have not been covered by a continuous sequence, thus avoiding overall blocking due to the loss of individual data packets. In dual-path parallel transmission scenarios, out-of-order data packets are restored to a continuous data stream through ordered reassembly and timeout fault tolerance. Combined with a deduplication mechanism (such as based on global sequence number or timestamp), the packet loss rate during handover can be reduced to below 0.1%, meeting the low-latency requirements of real-time applications (such as video calls and games).

[0054] Furthermore, it is necessary to measure the latency difference between the first and second ONU gateways to determine the timing compensation parameters in dual-connection transmission and ensure the orderly reassembly of data packets at the receiving end. The latency performance of the ONU gateway is evaluated by sending probe packets and calculating the round-trip time (RTT). Specifically, 10 probe packets (using ICMP or a dedicated protocol) are sent to the target ONU gateway, and the transmission time of each probe packet is recorded; a response is awaited from the ONU gateway, and if a timeout (1 second) occurs, the probe packet is ignored; if a response is received, the reception time is recorded and the RTT (in milliseconds) is calculated; the valid RTT values ​​are sorted, the maximum and minimum values ​​are removed (to avoid the influence of outliers), and the average of the remaining values ​​is returned as the final latency result. This latency difference can be used to dynamically adjust the scheduling order of dual-path data packets and compensate for inconsistencies in transmission latency between links.

[0055] The aforementioned latency difference measurement is an active measurement, which obtains latency data by injecting probe traffic, similar to the principle of the Ping command, but with the addition of a data filtering mechanism to improve accuracy. For further optimization, clock synchronization (such as the PTP protocol) or analysis of TCP ACK time difference (passive detection method) can be combined to obtain more comprehensive latency metrics.

[0056] In this embodiment, the weighted allocation strategy allocates traffic proportionally to the first and second connections based on their real-time connection quality (higher quality means a higher weight). This ensures that high-quality links carry more data traffic, while low-quality links retain the lowest weight to maintain link activity and prevent complete disconnection from incurring reconnection overhead. This approach better balances performance and bandwidth consumption, making it suitable for scenarios like ordinary web browsing and file downloads. Furthermore, a load balancing strategy dynamically allocates uplink and downlink traffic to avoid packet loss or sudden increases in latency during handover.

[0057] It should be noted that parallel communication with dual connections increases power consumption, thus requiring power optimization. Based on device status (charging / battery mode, traffic, battery level, etc.), the following optimization measures can be implemented: Dynamically adjust the scanning frequency, maintaining a high-frequency scan (1 second) during charging and reducing it to 5 seconds in battery mode to reduce energy consumption. Intelligent sleep mode: when traffic is low and there are no real-time applications, put the shadow connection (non-primary connection) into sleep mode. Transmission mode optimization: when the battery level is below 20%, disable redundant transmission and retain only the weighted allocation mode. Rapid decision-making: if the quality of the second ONU gateway is significantly better than that of the first ONU gateway, accelerate the switching to shorten the dual-path parallel time and reduce total power consumption. By combining these scenario-based strategies, the performance of the dual-path parallel network can be improved while keeping the increase in power consumption within an acceptable range (less than 10%).

[0058] Step S4: When the traffic data transmitted through the second connection meets the target traffic data allocation conditions, disconnect the first connection.

[0059] It should be noted that the target traffic data allocation condition refers to the second allocation weight allocated to the second connection reaching 100% after the dual-path parallel transmission phase, that is, the allocation weight of the first connection drops to 0%, completing the master-slave role switch.

[0060] Combination Figure 2When the traffic data transmitted by the terminal device to the second connection meets the target traffic data allocation conditions, all traffic data is carried by the second connection, and the original first connection enters a standby state, retaining a heartbeat signal to monitor link activity. At this time, the queue of data packets to be sent to the first ONU gateway is checked. If the queue of data packets to be sent is empty, a connection disconnection request is sent to the first ONU gateway to disconnect the connection between the terminal device and the first ONU gateway. The first ONU gateway sends a disconnection confirmation result to the terminal device. If the queue of data packets to be sent is not empty, the disconnection is temporarily suspended, and the remaining data packets continue to be forwarded until the data packet queue is cleared before the disconnection operation is performed to ensure uninterrupted service.

[0061] Meanwhile, actual testing revealed that the switching interruption time of the above method is less than 5ms, which is more than 10 times better than existing technologies, effectively ensuring the continuity of services with high real-time requirements; the packet loss rate is less than 0.1%, which is more than 30 times better than existing technologies; the latency jitter is controlled within ±5ms, which is more than 10 times better than existing technologies, significantly improving the user experience; the switching success rate reaches 99.9%, and the real-time application availability reaches 99%, which can effectively support the network requirements of high-reliability scenarios such as industrial internet and telemedicine, and significantly improve the user experience.

[0062] In summary, the above method acquires the signal quality of multiple ONU gateways within the communication range and identifies a second ONU gateway with a superior signal quality compared to the currently connected first ONU gateway. While maintaining the first connection with the first ONU gateway, a second connection is established with the second ONU gateway. In this dual-connection parallel state, traffic data is dynamically allocated between the two links according to a preset strategy, improving transmission efficiency and anti-interference capabilities. Simultaneously, the first allocation weight of the first connection is gradually reduced, and the second allocation weight of the second connection is correspondingly increased until the data transmission volume of the first connection is reduced to zero, ultimately releasing the first connection and completing a seamless handover. The entire handover process is completed within milliseconds, imperceptibly to the user. Through dynamic weight adjustment and link status monitoring, the packet loss and latency spikes problems inherent in traditional handover methods are effectively avoided.

[0063] It should be noted that the above embodiments mainly introduce the traffic allocation and master-slave switching mechanism in dual-path parallel transmission. This method is also applicable to multi-path connection scenarios and can be extended to the collaborative transmission of three or more ONU gateways. A unified scheduling module performs real-time evaluation of the signal quality, bandwidth utilization, and latency of each link, dynamically adjusting the traffic allocation weight of each link to achieve more refined load balancing and redundancy backup. The above method can also be implemented based on MPTCP (Multipath TCP), utilizing MPTCP's multi-substream characteristics to achieve multipathing at the transport layer. An L2 tunnel scheme can also be used, implementing dual-path transmission through tunneling technologies such as GRE / VXLAN. SDN centralized scheduling can also be used: the controller centrally decides on traffic allocation. Predictive switching can also be performed, using machine learning to predict user movement trajectories and establish connections in advance. 5G-based WiFi-Cellular aggregation can also be implemented to achieve dual WiFi and 5G connectivity. Optical wireless communication (LiFi) can also be used as a backup link during switching. Random linear network coding can also be used to improve reliability. However, considering performance, cost, compatibility, and deployment difficulty, the dual-path parallel connection scheme described in the above embodiments is optimal.

[0064] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0065] In one embodiment, an ONU gateway connection switching device for a PON network is provided, which corresponds one-to-one with the ONU gateway connection switching method for the PON network described in the above embodiments. For example... Figure 4 As shown, the ONU gateway connection switching device includes an acquisition module 101, a connection establishment module 102, a data transmission module 103, and a connection disconnection module 104. Detailed descriptions of each functional module are as follows: The acquisition module 101 is used to acquire the signal quality of multiple ONU gateways within the communication range, and determine the second ONU gateway whose signal quality is better than that of the currently connected first ONU gateway.

[0066] The connection establishment module 102 is used to establish a second connection with the second ONU gateway and maintain a first connection with the first ONU gateway.

[0067] The data transmission module 103 is used to transmit traffic data corresponding to the terminal device through the first connection and the second connection.

[0068] The connection disconnection module 104 is used to disconnect the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions.

[0069] Specific limitations regarding the ONU gateway connection switching device can be found in the above description of the ONU gateway connection switching method for PON networks, and will not be repeated here. Each module in the aforementioned ONU gateway connection switching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0070] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for switching the connection of an ONU gateway in a PON network.

[0071] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the ONU gateway connection switching method of the PON network described in the above embodiment, for example... Figure 1 S1-S4, as shown, will not be described again here to avoid repetition. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in this embodiment of the ONU gateway connection switching device for the PON network, for example... Figure 4 The functions of the acquisition module 101, connection establishment module 102, data transmission module 103, and connection disconnection module 104 shown are not described again here to avoid repetition.

[0072] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the ONU gateway connection switching method of the PON network described in the above embodiment, for example... Figure 1 S1-S4, as shown, will not be described again here to avoid repetition. Alternatively, when this computer program is executed by the processor, it implements the functions of each module / unit in this embodiment of the ONU gateway connection switching device for the PON network, for example... Figure 4The functions of the acquisition module 101, connection establishment module 102, data transmission module 103, and connection disconnection module 104 shown are not described again here to avoid repetition. The computer-readable storage medium can be non-volatile or volatile.

[0073] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0074] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0075] Therefore, this application discloses a method, apparatus, device, and medium for switching ONU gateway connections in a PON network. This method is applicable to terminal devices and includes the following steps: acquiring the signal quality of multiple ONU gateways within the communication range and identifying a second ONU gateway whose signal quality is superior to that of the currently connected first ONU gateway; establishing a second connection with the second ONU gateway while maintaining a first connection with the first ONU gateway; transmitting traffic data corresponding to the terminal device through the first and second connections; and disconnecting the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions. This method achieves seamless switching through parallel transmission via dual connections, effectively avoiding service interruptions during the switching process, improving network continuity and user experience. It can be applied to Fiber to the Room (FTTR), Fiber to the Room-Business (FTTR-B), and broadband converged terminal products.

[0076] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for switching ONU gateway connections in a PON network, applicable to terminal equipment, characterized in that, Including the following steps: Acquire the signal quality of multiple ONU gateways within the communication range, and determine the second ONU gateway whose signal quality is superior to the currently connected first ONU gateway; Establish a second connection with the second ONU gateway, while maintaining the first connection with the first ONU gateway; Traffic data corresponding to the terminal device is transmitted through the first connection and the second connection; When the traffic data transmitted through the second connection meets the target traffic data allocation conditions, the first connection is disconnected.

2. The ONU gateway connection switching method as described in claim 1, characterized in that, Before establishing a second connection with the second ONU gateway and maintaining a first connection with the first ONU gateway, the method further includes: Assess whether the second ONU gateway meets the connection switching conditions; If the second ONU gateway meets the connection switching conditions, then proceed with the step of establishing a second connection with the second ONU gateway; If the second ONU gateway does not meet the connection switching conditions, then return to the step of obtaining the signal quality of multiple ONU gateways within the communication range and determining the second ONU gateway whose signal quality is better than the currently connected first ONU gateway.

3. The ONU gateway connection switching method as described in claim 1, characterized in that, Before establishing a second connection with the second ONU gateway and maintaining a first connection with the first ONU gateway, the method further includes: Send a connection switching authorization request to the main controller to ensure that the terminal device has the right to establish the second connection with the second ONU gateway.

4. The ONU gateway connection switching method as described in claim 1, characterized in that, After establishing a second connection with the second ONU gateway and maintaining the first connection with the first ONU gateway, the process includes: A virtual identifier is assigned to the second ONU gateway based on the real identifier of the first ONU gateway.

5. The ONU gateway connection switching method as described in claim 1, characterized in that, The traffic data includes multiple data packets, and the transmission of traffic data corresponding to the terminal device through the first connection and the second connection includes: Different transmission strategies are adopted according to different scenarios to allocate corresponding data packets for transmission to the first connection and the second connection. The transmission strategies include a full redundancy strategy, a weighted allocation strategy, and a priority-driven strategy. The full redundancy strategy allocates the multiple data packets to the first connection and the second connection for transmission simultaneously. The weighted allocation strategy allocates the multiple data packets to the first connection and the second connection for transmission according to the traffic allocation weight. The priority-driven strategy classifies the multiple data packets, and transmits high-priority data packets through the connection with the best quality, while low-priority data packets are transmitted through the connection with the lowest load.

6. The ONU gateway connection switching method as described in claim 5, characterized in that, The step of allocating the plurality of data packets to the first connection and the second connection for transmission based on traffic allocation weights includes: The connection quality of the first connection and the second connection is evaluated in real time to obtain the real-time connection quality. Update the traffic allocation weights of the first connection and the second connection based on the real-time connection quality. Using the traffic allocation weights, corresponding data packets are allocated to the first connection and the second connection.

7. The ONU gateway connection switching method as described in claim 6, characterized in that, The step of allocating corresponding data packets to the first connection and the second connection using the traffic allocation weight includes: The multiple data packets allocated to the first connection and the second connection are deduplicated and reassembled to obtain a data packet sequence; According to the data packet sequence, the plurality of data packets are sequentially transmitted to the first connection and the second connection for transmission.

8. An ONU gateway connection switching device for a PON network, characterized in that, include: The acquisition module is used to acquire the signal quality of multiple ONU gateways within the communication range and determine the second ONU gateway whose signal quality is better than the currently connected first ONU gateway. A connection establishment module is used to establish a second connection with the second ONU gateway and maintain a first connection with the first ONU gateway; The data transmission module is used to transmit traffic data corresponding to the terminal device through the first connection and the second connection; The connection disconnection module is used to disconnect the first connection when the traffic data transmitted through the second connection meets the target traffic data allocation conditions.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the ONU gateway connection switching method of the PON network as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the ONU gateway connection switching method of the PON network as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Timestamp parallel access method, system and device based on fttr gateway and medium

    CN122247549A

  • Timestamp parallel access method, system and device based on fttr gateway and medium

    CN122247549B