Communication channel retention method, endpoint, device, medium, and program product

By sending heartbeat packets and setting hop count limits on the device side, the aging time of the smart gateway firewall is dynamically updated, solving the problem of high resource consumption in existing technologies, achieving stable and reliable communication channel maintenance, and improving network communication quality.

CN123145296APending Publication Date: 2026-11-20CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510648324.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In network communication with a device-server architecture, maintaining a communication connection in existing technologies requires a lot of resources. In particular, when establishing a connection via the TCP protocol, the server needs to consume a lot of processing and bandwidth resources, or when using the UDP protocol, a lot of heartbeat data needs to be processed, increasing the number of concurrent connections that the server can handle.

Method used

A communication channel maintenance method is adopted, in which the heartbeat interval is less than the firewall aging time. Heartbeat packets are sent and a hop count limit is set to ensure that the heartbeat packets are transmitted to the smart gateway to dynamically update the firewall aging time. At the same time, they are dropped at intermediate routing nodes to reduce the server's concurrent data processing requirements.

Benefits of technology

It effectively maintains the active state of the communication channel, ensures the stability and reliability of communication between the end side and the server, reduces communication failures caused by connection interruptions, and improves network communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123145296A_ABST
    Figure CN123145296A_ABST
Patent Text Reader

Abstract

The application provides a communication channel maintaining method, an end side, a device, a medium and a program product. The method comprises the following steps: sending a heartbeat packet to a server according to a heartbeat interval time; the heartbeat interval time is less than a firewall aging time; the heartbeat packet is provided with a corresponding hop limit value, the hop limit value is greater than or equal to the hop number of the end side to a smart gateway, and is less than the hop number of the end side to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet; and after the heartbeat packet is discarded, heartbeat exception feedback sent by a routing node discarding the heartbeat packet is received. The communication channel maintaining method provided by the application not only ensures that the firewall aging time can be dynamically updated when the heartbeat packet is transmitted to the smart gateway, but also ensures that the heartbeat packet will not be transmitted to the server and will be discarded at the intermediate routing node, so that the concurrent data processing demand of the server can be greatly reduced, and the active state of the communication channel is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of personal and home business technology, and in particular to a communication channel maintenance method, end-side device, medium, and program product. Background Technology

[0002] In device-server network communication, a data transmission channel is established between the client and server based on a communication protocol. By initiating communication from the client and using a heartbeat mechanism to maintain the connection with the server, a bidirectional communication mechanism can be achieved.

[0003] Transmission Control Protocol (TCP) is a stateful, long-connection protocol. TCP establishes a connection between the client and server, requiring the server to consume significant processing and bandwidth resources to maintain the connection. User Datagram Protocol (UDP) is a stateless protocol. UDP establishes a connection between the client and server, but after the client sends a request to the server, it requires numerous heartbeats to update the aging time and maintain the communication channel's availability. The server needs to process a large amount of heartbeat data, greatly increasing the number of concurrent connections it can handle. Summary of the Invention

[0004] This invention provides a communication channel maintenance method, end-side device, medium, and program product to solve the problem that maintaining a communication connection requires a large amount of resources in the prior art.

[0005] In a first aspect, the present invention provides a communication channel maintenance method, comprising: A heartbeat packet is sent to the server according to the heartbeat interval; the heartbeat interval is less than the firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value is greater than or equal to the number of hops from the end to the smart gateway, and less than the number of hops from the end to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet. After the heartbeat packet is dropped, receive the heartbeat anomaly feedback sent by the routing node that dropped the heartbeat packet.

[0006] In one embodiment, the hop count limit value is determined in the following manner: Based on the smart gateway egress address pool, match the number of hops from the endpoint to the smart gateway; Based on the link forwarding data of the home broadband devices in the district / county where the endpoint is located, determine the range of hops from the endpoint to the server; Based on the actual access environment, and considering the hop count from the endpoint to the smart gateway and the hop count range from the endpoint to the server, hop count statistics are performed from the endpoint or the smart gateway to determine the hop count from the endpoint to the server. Based on the hop count setting requirements, determine the hop count limit value for the heartbeat packets sent by the endpoint; the hop count setting requirements are that the hop count limit value must be greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server.

[0007] In one embodiment, the firewall aging time is dynamically updated in the following manner: The response timeout time between devices in the home and the smart gateway based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) is periodically counted. The firewall aging time of the smart gateway is dynamically updated based on the response timeout.

[0008] In one embodiment, the communication channel maintenance method further includes: If downlink data sent by the server is detected, the downlink data is processed, and the processed response data is sent to the server according to the latest valid connection state information; the latest valid connection state information is obtained by updating the firewall aging time through the smart gateway after the smart gateway receives the downlink data.

[0009] In one embodiment, before sending the heartbeat packet, the method further includes: Based on the local IPv6 address and device information, a registration request is generated and sent to the server; After the server parses and stores the IPv6 address and device information in the registration request, it receives a registration success message sent by the server.

[0010] In one embodiment, after receiving the registration success message and before sending the heartbeat packet, the method further includes: The number of intermediate hops from the endpoint to the server is detected by sending response data to the server. The number of intermediate hops from the endpoint to the smart gateway is detected by sending response data to the smart gateway. The number of intermediate hops from the endpoint to the server and the number of intermediate hops from the endpoint to the smart gateway are stored locally.

[0011] In one embodiment, the communication between the client and the server is based on the UDP protocol for data transmission.

[0012] Secondly, the present invention also provides an end side, comprising: A heartbeat packet sending module is used to send heartbeat packets to the server according to the heartbeat interval time; the heartbeat interval time is less than the firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value is greater than or equal to the number of hops from the end side to the smart gateway, and less than the number of hops from the end side to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet; The heartbeat anomaly feedback receiving module is used to receive heartbeat anomaly feedback sent by the routing node that dropped the heartbeat packet after the heartbeat packet is dropped.

[0013] Thirdly, the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the communication channel maintenance methods described above.

[0014] Fourthly, the present invention also provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the communication channel maintenance methods described above.

[0015] Fifthly, the present invention also provides a computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein the computer program, when executed by the processor, implements the steps of any of the communication channel maintenance methods described above.

[0016] The communication channel maintenance method, end-side device, medium, and program products provided by this invention send heartbeat packets to the server at heartbeat intervals shorter than the firewall aging time. The hop count limit set for the heartbeat packets is between the hop count from the end-side device to the smart gateway and the hop count from the end-side device to the server. This not only ensures that the smart gateway can dynamically update the firewall aging time when the heartbeat packets are transmitted to the smart gateway, but also ensures that the heartbeat packets are not transmitted to the server and are discarded at intermediate routing nodes. This greatly reduces the server's concurrent data processing requirements, maintains the active state of the communication channel, ensures the stability and reliability of communication between the end-side device and the server, reduces communication failures caused by connection interruptions, and improves the overall network communication quality. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the communication channel maintenance method provided by the present invention.

[0019] Figure 2 This is a schematic diagram of the public IP address of the SNAT shared smart gateway provided by the present invention.

[0020] Figure 3 This is a schematic diagram of home network device access provided by the present invention.

[0021] Figure 4 This is a schematic diagram of the initialization process provided by the present invention.

[0022] Figure 5 This is a schematic diagram of the data interaction process provided by the present invention.

[0023] Figure 6 This is a schematic diagram of the structural interaction on the end side provided by the present invention.

[0024] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this 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 this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0026] The terms "first," "second," etc., used in this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein.

[0027] The following is combined with Figures 1-7 This invention describes the communication channel maintenance method, end-side device, medium, and program products provided by the present invention.

[0028] Combination Figure 1 , Figure 1This is a flowchart illustrating the communication channel maintenance method provided by the present invention.

[0029] like Figure 1 As shown, the communication channel maintenance method includes the following steps: Step 101: Send heartbeat packets to the server according to the heartbeat interval; Step 102: After the heartbeat packet is dropped, receive the heartbeat anomaly feedback sent by the routing node that dropped the heartbeat packet.

[0030] Specifically, in the early stages of operation of the end-side (i.e., end-side devices, such as smart home devices), the address allocation of the device side is unknown. It is necessary to first send device information and address information to the server through polling to register.

[0031] In home networks, smart gateways support assigning IPv6 global unicast addresses to downstream addresses on the device side. Using these addresses eliminates the need for Network Address Translation (NAT), meaning they don't occupy the egress port. NAT is a technology used to use private addresses on a local network, switching to global Internet Protocol (IP) addresses when connecting to the internet. Because the number of public IPv4 addresses is limited, NAT is needed to map the source IP address and port when a local IPv4 address accesses the internet, enabling the reuse of public IP addresses and facilitating communication with the server. For example... Figure 2 As shown, Figure 2 This is a schematic diagram of the public IP address of the SNAT-shared smart gateway provided by this invention. When home devices connect to a home network, each device has its own internal IP address (source IP) and port number (source PORT). Through Source Network Address Translation (SNAT), a type of NAT, the home device's internal source IP address and source PORT are translated into the smart gateway's public IP address (router IP) and a mapped port number (mapped PORT). Then, the smart gateway's public IP address and mapped port number are used as the source IP and source PORT to access the target server on the public network (target IP and target PORT), thereby enabling access to public network services. To ensure that home devices receive response data packets, the router / smart gateway temporarily adds this mapping relationship to the NAT table, allowing for the possibility of reusing this channel for service communication.

[0032] In addition, IPv4 addresses are used as alternative communication addresses to address scenarios where home broadband networks do not support global unicast IPv6.

[0033] This example proposes an information interaction mechanism between intranet devices and servers based on air heartbeat. However, in some scenarios, there are situations where routers do not support the allocation of IPv6 addresses. Therefore, multiple interaction methods are combined to ensure the stable operation of the method.

[0034] The smart gateway enables the IPv6 session firewall by default, which can effectively reduce the vulnerability exposure of devices after obtaining IPv6 global unicast addresses, but it also reduces the ways in which IPv6 addresses can be used to some extent.

[0035] After receiving the device and address information sent by the server, the server verifies whether the terminal side has obtained the IPv6 global unicast address and whether the smart gateway has enabled the IPv6 session firewall.

[0036] If the endpoint can obtain an IPv6 address, and that address is a global unicast address, the device communicates with the server through that address, refreshing the smart gateway firewall aging time via air heartbeat. It should be noted that the global unicast address assigned on the endpoint can be directly selected, but it is not directly accessible from the server. Refreshing the smart gateway aging time via air heartbeat maintains a specific channel.

[0037] When the endpoint cannot unicast IPv6 addresses globally, it uses IPv4 internal network addresses in conjunction with air heartbeats to maintain the communication channel. This method requires the use of public network address port resources and serves as an emergency measure, but it puts less pressure on the server-side equipment.

[0038] The server opens specific interfaces to handle business needs such as reconnection, re-online status, and online verification on the client side.

[0039] After successful verification, the terminal information is stored, and the registration success information is fed back to the terminal to inform it that registration has been completed and the initialization process is completed. The device can communicate with the server through this address and refresh the smart gateway aging time through air heartbeat.

[0040] In network communication systems, to maintain the stability and effectiveness of the connection between the client and the server, the client needs to send heartbeat packets to the server regularly according to a pre-set heartbeat interval. This heartbeat interval must be less than the firewall aging time of the smart gateway. For different home network environments, a "virtual" heartbeat can be implemented by setting a hop count limit. The hop count limit must be greater than or equal to the number of hops from the client to the smart gateway, and less than the number of hops from the client to the server; that is, the hop count limit must be between the number of hops from the client to the smart gateway and the server.

[0041] If the endpoint can use an IPv6 global unicast address for communication, a "hollow" heartbeat can be implemented by setting the Hop Limit value. The Hop Limit value, or hop count limit, is a field in the IPv6 packet header used to limit the maximum number of hops a packet can traverse in the network. If the endpoint cannot use an IPv6 global unicast address for communication, an IPv4 address is used as an alternative. A "hollow" heartbeat can be implemented by setting the TTL value. The TTL value, or Time to Live value, is a field in the IPv4 packet header used to limit the maximum number of hops a packet can traverse in the network. Throughout the heartbeat packet's forwarding path from source to destination, each routing node decrements the Hop Limit / TTL value by 1 before forwarding the heartbeat packet. If the Hop Limit / TTL value decreases to 0 before the heartbeat packet reaches the destination IP, the routing node will discard the received heartbeat packet with Hop Limit / TTL=0 and send an Internet Control Message Protocol (ICMP) message to the sender (i.e., the end side) to report the reason for the heartbeat abnormality or dropping.

[0042] Because the hop limit setting for heartbeat packets must be greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server, heartbeat packets sent from the endpoint can at least be routed to the smart gateway, but cannot be routed to the server. When a heartbeat packet is routed to the smart gateway, the smart gateway dynamically updates the firewall aging time and then continues to forward the heartbeat packet to subsequent routing nodes until the Hop Limit / TTL value reaches 0. At this point, the heartbeat packet is discarded by the current routing node, which then sends an ICMP packet to the endpoint to report the reason for the heartbeat anomaly or being dropped.

[0043] In one embodiment, theoretically, it takes 15 hops for the client and server to communicate with each other, that is, 15 hops from the client to the server. The client sends a heartbeat packet with a Hop Limit / TTL of 5 (5 hops to forward to the smart gateway; IPv6 only needs to update to the home broadband smart gateway, and IPv4 needs to update to the NAT table of the Broadband Remote Access Server (BRAS) egress route) at an interval of t seconds (t is less than the firewall aging time). The aging time statistics of the egress route device are updated. Since the heartbeat data cannot be delivered to the server, it will be discarded at the intermediate point, which can greatly reduce the server's concurrent data processing requirements.

[0044] In home scenarios, communication using IPv6 global unicast addresses does not require NAT address translation on the end side. It is controlled solely by the data flow aging time of the firewall on the egress side (smart gateway). This configuration program has the authority to adjust and supports hot-swapping. By dynamically adjusting the firewall aging time of the smart gateway, a long-term communication channel (with the source IP and port being consistent with the destination IP and port) can be maintained without resource consumption.

[0045] Communication using IPv6 global unicast addresses fully leverages the routing advantages of IPv6 global unicast addresses, eliminating the need for NAT mechanisms and reducing port usage on routing nodes. The smart gateway's protocol aging time is controllable and can be configured according to the network environment. Combined with an "air" heartbeat mechanism, the server side does not need to process heartbeat data, and the heartbeat interval is much longer than existing solutions (24-hour aging time has been tested and verified to be feasible). In addition, the IPv6 address header has programmable parts, which makes it more scalable in protocol identification and path selection, thus improving the quality assurance of the solution.

[0046] For situations where smart gateways or routers do not support IPv6 address allocation, a similar solution can be implemented using IPv4 LAN addresses. However, since IPv4 needs to meet NAT aging time limits and is limited by the principle of minimization (i.e., the minimum NAT aging time on the link), configuring the firewall aging time of the smart gateway cannot increase the time window of the communication channel. However, by combining the "air" heartbeat mechanism, the communication channel can still be maintained for a long time.

[0047] Furthermore, the communication process between the client and the server is based on the UDP protocol for data transmission. UDP is a stateless protocol, requiring no state maintenance and enabling stateless bidirectional communication. Compared to TCP, UDP offers advantages in terms of simple and efficient interaction. The client only needs to send an initial registration data packet and reset the firewall aging time via heartbeat packets to access the communication channel (source IP, port, destination IP, port). This lightweight UDP-based communication protocol supports all UDP-based application-layer IoT protocols, such as Coap and Lwm2m, and supports both OSGi and native client SDK integration.

[0048] The communication channel maintenance method provided by this invention sends heartbeat packets to the server at intervals shorter than the firewall aging time, with the hop count limit set for the heartbeat packets falling between the hop count from the endpoint to the smart gateway and the hop count from the endpoint to the server. This not only ensures that the smart gateway can dynamically update the firewall aging time when the heartbeat packets are transmitted to the smart gateway, but also ensures that the heartbeat packets are not transmitted to the server and are discarded at intermediate routing nodes. This greatly reduces the server's concurrent data processing requirements, maintains the active state of the communication channel, ensures the stability and reliability of communication between the endpoint and the server, reduces communication failures caused by connection interruptions, and improves the overall network communication quality.

[0049] In some embodiments, the hop count limit value is determined in the following manner: Based on the smart gateway egress address pool, match the number of hops from the endpoint to the smart gateway; Based on the link forwarding data of the home broadband devices in the district / county where the endpoint is located, determine the range of hops from the endpoint to the server; Based on the actual access environment, and considering the hop count from the endpoint to the smart gateway and the hop count range from the endpoint to the server, hop count statistics are performed from the endpoint or the smart gateway to determine the hop count from the endpoint to the server. Based on the hop count setting requirements, determine the hop count limit value for the heartbeat packets sent by the endpoint; the hop count setting requirements are that the hop count limit value must be greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server.

[0050] Specifically, in the network architecture, the smart gateway, as a key node connecting the endpoint to the external network, contains important network information in its egress address pool. By collecting data from the smart gateway's egress address pool, the network path between the endpoint and the smart gateway can be analyzed. Since the network topology from the endpoint to the smart gateway is relatively stable, this hop count data is also relatively fixed.

[0051] In practice, professional network monitoring tools can be used to monitor and collect data from the smart gateway's egress address pool in real time. By analyzing the IP address allocation and data packet flow in the address pool, combined with the network topology diagram, the number of routing nodes (hop count) traversed by the endpoint to reach the smart gateway can be accurately determined.

[0052] In home broadband network environments, the IPv6 prefix address pool is relatively fixed, which makes communication links exhibit certain regularities. For home broadband devices in various districts and counties, their link forwarding data can be collected in advance. Specifically, data collection nodes can be deployed in the home broadband networks of each district and county to record and analyze information such as the forwarding path of data packets and the routing nodes they pass through. Through long-term data accumulation and statistical analysis, the approximate range of hop counts from the endpoint to the server can be obtained.

[0053] The actual access environment is complex and variable. Different endpoints, network topologies, and network loads can all affect the actual number of hops from the endpoint to the server. Therefore, it is necessary to combine the previously obtained hop counts from the endpoint to the smart gateway and the hop count range from the endpoint to the server, and to perform hop count statistics from either the endpoint or the smart gateway to calculate the actual number of hops from the endpoint to the server.

[0054] Based on the above calculation results, namely the number of hops from the end-side to the smart gateway and the number of hops from the end-side to the server, the Hop Limit / TTL value of the end-side "air" heartbeat packet is set to a value between the number of hops from the end-side to the smart gateway and the server, thereby achieving seamless communication channel maintenance.

[0055] In one embodiment, to better update the Hop Limit / TTL value of heartbeat packets and achieve the purpose of updating the aging time of the egress gateway, it is necessary to calculate the number of hops from the end side to the server. For IPv6 addresses, it is only necessary to route to the smart gateway, and the hop count information can be preset according to the link patterns of devices in districts and counties. For IPv4 addresses, it is necessary to collect the BARS egress address, or it can be pre-statistically counted by latitude such as districts and counties, but the hop count is relatively variable and needs to be calculated in combination with the existing network environment. The principle is similar to traceroute, calculating the total hop count t. Since the home broadband network is located at the network boundary rather than the center, the TTL value can be set to t / 2.

[0056] This invention sets the hop count limit for heartbeat packets to be between the hop count from the endpoint to the smart gateway and the hop count from the endpoint to the server. This not only ensures that the smart gateway can dynamically update the firewall aging time when the heartbeat packet is transmitted to the smart gateway, but also ensures that the heartbeat packet will not be transmitted to the server and will be discarded at intermediate routing nodes. This can greatly reduce the server's concurrent data processing requirements and maintain the active state of the communication channel.

[0057] In some embodiments, the firewall aging time is dynamically updated in the following manner: The response timeout time between devices in the home and the smart gateway based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) is periodically counted. The firewall aging time of the smart gateway is dynamically updated based on the response timeout.

[0058] Specifically, for end-to-end communication using IPv4, which is stateless data exchange, the effective communication time is limited by the aging time of routing devices. Since there are multiple routing devices between the endpoint and the service side, it requires traversing multiple NATs. Adjusting the communication aging time would necessitate modifying the configuration of all routing devices in the link, which is extremely difficult. Therefore, communication using IPv6 global unicast addresses does not require NAT; only the data flow aging time of the egress firewall (smart gateway) is controlled. This configuration program has the authority to adjust and supports hot-swapping. By dynamically adjusting the aging time of the smart gateway firewall, a long-term communication channel can be maintained without resource consumption.

[0059] Combination Figure 3 , Figure 3 This is a schematic diagram illustrating home network device access provided by the present invention. In a home broadband network, when end-side device 1 and end-side device 2 access the network via IPv4, NAT mapping relationships involving routing nodes such as routers, smart gateways, and BRAS are involved. Unlike IPv4, end-side device 3 uses a public IPv6 address and has no NAT restrictions; therefore, when accessing the network, it is affected by firewalls on the router and smart gateway sides.

[0060] After verification, the timeout time when the aging time of the smart gateway firewall is adjusted and no heartbeat packets are sent is shown in Table 1.

[0061] Table 1

[0062] In one embodiment, ` / proc / net / nf_contrack` is a connection tracking file. `nf_conntrack` is used to record network connection tracking information. When a connection reaches its aging time, the corresponding connection tracking information is reclaimed. The connection tracking file includes fifteen columns: the first column is the network layer protocol name; the second column is the network layer protocol number; the third column is the transport layer protocol name; the fourth column is the transport layer protocol number; the fifth column is the number of seconds that are invalid when no subsequent packets arrive, i.e., the aging time; the sixth column is not present for all protocols, such as TCP, and will show the connection state; the seventh to fourteenth columns are the IP addresses and ports of the communicating parties; the fifteenth column is an identifier: `[ASSURED]`: traffic has been seen in both directions (i.e., request and response); `[UNREPLIED]`: traffic has not been seen in the response direction. If the connection tracking cache overflows, these connections are deleted first.

[0063] Therefore, the response timeout time between devices in the home and the smart gateway based on IPv4 or IPv6 can be periodically counted, and then the firewall aging time of the smart gateway can be dynamically updated based on the response timeout time.

[0064] This invention, through configuring the firewall aging time of the smart gateway and expanding the channel interval, reduces the frequency of heartbeat packets processed by the smart gateway even in the presence of an empty heartbeat.

[0065] This document describes a low-power communication mechanism based on IPv6 addresses. The following examples focus on the initialization and data interaction processes of end-side communication under IPv6 addresses. Figures 4-5 , Figure 4 This is a schematic diagram of the initialization process provided by the present invention. Figure 5 This is a schematic diagram of the data interaction process provided by the present invention. Figure 4 and Figure 5 In a network system, each component includes endpoints, smart gateways, BRAS, specific routing nodes, and servers. These components each play different roles and collaborate with each other to form a complete network architecture.

[0066] The device accesses the network through a smart gateway. The smart gateway provides network connectivity for the device, enabling data interaction between the device and the external network, and also allows for the management and configuration of the device.

[0067] Network traffic generated on the endpoint may reach the BRAS after passing through devices such as smart gateways. The BRAS is responsible for authenticating, authorizing, and billing endpoint users, while forwarding the endpoint traffic to the core network.

[0068] Data packets on the endpoint need to be forwarded through specific routing nodes in order to reach the target server or other network devices. The specific routing node determines the forwarding path of the data packet based on the routing table information.

[0069] The client side is typically the user of the service provided by the server. The client device sends a request to the server, and the server provides the corresponding data or service according to the request.

[0070] In some embodiments, before sending the heartbeat packet, the method further includes: Based on the local IPv6 address and device information, a registration request is generated and sent to the server; After the server parses and stores the IPv6 address and device information in the registration request, it receives a registration success message sent by the server.

[0071] Specifically, such as Figure 4In home broadband networks that support global unicast IPv6, the device first obtains its own IPv6 address. Then, it combines this information with device model, identity document (ID), MAC address, port information, and other device details to generate a registration request and sends it to the server. This step marks the beginning of the entire initialization process, where the device actively initiates communication with the smart gateway.

[0072] When a registration request is routed to the smart gateway, the smart gateway continues to forward the registration request to the next node and starts session timing, which is used to track server response time.

[0073] When a registration request is routed to the server, the server parses the received request and records the client's IPv6 address and port information. It also stores the device ID, port information, and IPv6 address to identify the client device and reuses this IPv6 address and port information. After storing the information locally, the server sends a registration success message to the client.

[0074] During the timing process, the smart gateway continuously checks whether the timeout is less than the firewall aging time. If the session timeout is less than the firewall aging time, it means that the session and related operations are still within the valid time range, and the information can continue to be transmitted. When the downlink data sent by the server arrives at the smart gateway, the smart gateway updates the firewall aging time and forwards the downlink data to the endpoint so that the endpoint can receive the registration success information sent by the server.

[0075] Furthermore, after receiving the registration success message but before sending the heartbeat packet, the process also includes: The number of intermediate hops from the endpoint to the server is detected by sending response data to the server. The number of intermediate hops from the endpoint to the smart gateway is detected by sending response data to the smart gateway. The number of intermediate hops from the endpoint to the server and the number of intermediate hops from the endpoint to the smart gateway are stored locally.

[0076] Specifically, after establishing a communication channel between the client and the server, the client first sends response data to the server to detect the number of intermediate hops from the client to the server. This hop count information can be obtained by transmitting the response data over the network. Then, the server sends a response operation to the client, which may be an acknowledgment of the detection process or other related operations.

[0077] Furthermore, the endpoint sends response data to the smart gateway to detect the number of intermediate hops from the endpoint to the smart gateway. The relevant hop count information can be obtained by transmitting response data over the network.

[0078] Furthermore, the number of intermediate hops detected from the endpoint to the server and the number of intermediate hops from the endpoint to the smart gateway are stored locally.

[0079] The embodiments of the present invention first realize the effective registration of the end device in the network, and understand the network topology between the end device and the server, which helps to optimize network connection and improve communication stability. Then, the intermediate hop count from the end device to the server and the smart gateway is detected and stored to prepare for subsequent heartbeat packets.

[0080] In some embodiments, after completing the registration task on the client side, the client side starts two threads: one thread is responsible for the aforementioned "air" heartbeat mechanism, and the other thread is responsible for implementing the data interaction process with the server. Therefore, the communication channel maintenance method further includes: If downlink data sent by the server is detected, the downlink data is processed, and the processed response data is sent to the server according to the latest valid connection state information; the latest valid connection state information is obtained by updating the firewall aging time through the smart gateway after the smart gateway receives the downlink data.

[0081] Specifically, such as Figure 5 As shown, the client first obtains its own IPv6 address and constructs an identity parameter, namely the device ID, as an identifier for subsequent communication. Then, the client opens the corresponding port and begins listening for requests from the server. If no server request is received, it continues to listen.

[0082] Furthermore, when the smart gateway detects downlink data from the server, it updates the firewall aging time to obtain the latest valid connection state information, and then transmits data based on the updated and latest valid connection state information.

[0083] Once the downlink data is routed to the endpoint, the endpoint also listens for the downlink data sent by the server through a port, processes the downlink data, generates response data, and then sends the response data to the server. After the server receives the response data from the endpoint, one information synchronization process is complete.

[0084] Synchronously, the endpoint sends heartbeat packets to the server at regular intervals. When a heartbeat packet is routed to the smart gateway, the smart gateway updates its firewall aging time and continues to forward the heartbeat packet until it reaches a specific routing node. Since the set Hop Limit value is 0, the heartbeat packet is discarded, and an ICMP packet is sent to the endpoint. The server can then communicate with the endpoint using its IPv6 address and port information.

[0085] This invention, through monitoring downlink data sent by the server, utilizes a smart gateway to update the firewall aging time after receiving downlink data to obtain the latest valid connection status information. It then processes the downlink data and sends the processed response data back to the server based on this information, effectively ensuring the stability and reliability of the communication channel. This enables the endpoint to respond to server commands promptly and accurately, achieving efficient bidirectional data transmission.

[0086] In summary, this example solution is a communication method that combines a special heartbeat mechanism and uses a specific path method to reset the communication aging time. In a home setting, combined with the promotion of IPv6 on the public network, it can efficiently realize bidirectional communication between internal network devices and public network services.

[0087] The end-side provided by the present invention will be described below. The end-side described below can be referred to in correspondence with the communication channel maintenance method described above.

[0088] Combination Figure 6 , Figure 6 This is a schematic diagram of the end-side structure provided by the present invention.

[0089] like Figure 6 As shown, the end side includes: The heartbeat packet sending module 610 is used to send heartbeat packets to the server according to the heartbeat interval time; the heartbeat interval time is less than the firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value is greater than or equal to the number of hops from the end side to the smart gateway, and less than the number of hops from the end side to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet.

[0090] The heartbeat anomaly feedback receiving module 620 is used to receive heartbeat anomaly feedback sent by the routing node that discarded the heartbeat packet after the heartbeat packet is discarded.

[0091] The endpoint provided by this invention sends heartbeat packets to the server at intervals shorter than the firewall aging time, with the hop count limit set between the endpoint's connection to the smart gateway and the endpoint's connection to the server. This not only ensures that the smart gateway can dynamically update the firewall aging time when the heartbeat packet is transmitted to the smart gateway, but also ensures that the heartbeat packet will not be transmitted to the server and will be discarded at intermediate routing nodes. This greatly reduces the server's concurrent data processing requirements, maintains the active state of the communication channel, ensures the stability and reliability of communication between the endpoint and the server, reduces communication failures caused by connection interruptions, and improves the overall network communication quality.

[0092] Furthermore, the end side is also used for: Based on the smart gateway egress address pool, match the number of hops from the endpoint to the smart gateway; Based on the link forwarding data of the home broadband devices in the district / county where the endpoint is located, determine the range of hops from the endpoint to the server; Based on the actual access environment, and considering the hop count from the endpoint to the smart gateway and the hop count range from the endpoint to the server, hop count statistics are performed from the endpoint or the smart gateway to determine the hop count from the endpoint to the server. Based on the hop count setting requirements, determine the hop count limit value for the heartbeat packets sent by the endpoint; the hop count setting requirements are that the hop count limit value must be greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server.

[0093] Furthermore, the end side is also used for: The response timeout time between devices in the home and the smart gateway based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) is periodically counted. The firewall aging time of the smart gateway is dynamically updated based on the response timeout.

[0094] Furthermore, the end side is also used for: If downlink data sent by the server is detected, the downlink data is processed, and the processed response data is sent to the server according to the latest valid connection state information; the latest valid connection state information is obtained by updating the firewall aging time through the smart gateway after the smart gateway receives the downlink data.

[0095] Furthermore, the end side is also used for: Based on the local IPv6 address and device information, a registration request is generated and sent to the server; After the server parses and stores the IPv6 address and device information in the registration request, it receives a registration success message sent by the server.

[0096] Furthermore, the end side is also used for: The number of intermediate hops from the endpoint to the server is detected by sending response data to the server. The number of intermediate hops from the endpoint to the smart gateway is detected by sending response data to the smart gateway. The number of intermediate hops from the endpoint to the server and the number of intermediate hops from the endpoint to the smart gateway are stored locally.

[0097] It should be noted that the terminal provided by the present invention can execute the communication channel maintenance method described in any of the above embodiments during specific operation, which will not be elaborated in this embodiment.

[0098] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a communication channel maintenance method, which includes: sending a heartbeat packet to the server according to a heartbeat interval; the heartbeat interval is less than the firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value being greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet; and after the heartbeat packet is discarded, receiving heartbeat anomaly feedback sent by the routing node that discarded the heartbeat packet.

[0099] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0100] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the communication channel maintenance method provided in the above embodiments, the method comprising: sending a heartbeat packet to a server according to a heartbeat interval; the heartbeat interval being less than a firewall aging time; the heartbeat packet being set with a corresponding hop count limit value, the hop count limit value being greater than or equal to the number of hops from the endpoint to the smart gateway and less than the number of hops from the endpoint to the server; the firewall aging time being dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet; and after the heartbeat packet is discarded, receiving a heartbeat anomaly feedback sent by the routing node that discarded the heartbeat packet.

[0101] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the communication channel maintenance method provided in the above embodiments. The method includes: sending a heartbeat packet to a server according to a heartbeat interval; the heartbeat interval is less than a firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value being greater than or equal to the number of hops from the endpoint to the smart gateway and less than the number of hops from the endpoint to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet; and after the heartbeat packet is discarded, receiving a heartbeat anomaly feedback sent by the routing node that discarded the heartbeat packet.

[0102] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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; and these 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.

Claims

1. A communication channel preservation method, characterized in that, Applied to the end side, the communication channel maintenance method includes: A heartbeat packet is sent to the server according to the heartbeat interval; the heartbeat interval is less than the firewall aging time; the heartbeat packet is set with a corresponding hop count limit value, the hop count limit value is greater than or equal to the number of hops from the end to the smart gateway, and less than the number of hops from the end to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet. After the heartbeat packet is dropped, receive the heartbeat anomaly feedback sent by the routing node that dropped the heartbeat packet.

2. The communication channel maintenance method according to claim 1, characterized in that, The hop count limit value is determined in the following way: Based on the smart gateway egress address pool, match the number of hops from the endpoint to the smart gateway; Based on the link forwarding data of the home broadband devices in the district / county where the endpoint is located, determine the range of hops from the endpoint to the server; Based on the actual access environment, and considering the hop count from the endpoint to the smart gateway and the hop count range from the endpoint to the server, hop count statistics are performed from the endpoint or the smart gateway to determine the hop count from the endpoint to the server. Based on the hop count setting requirements, determine the hop count limit value for the heartbeat packets sent by the terminal side; The hop count setting requirement is that the hop count limit value must be greater than or equal to the hop count from the endpoint to the smart gateway, and less than the hop count from the endpoint to the server.

3. The communication channel maintenance method according to claim 1, characterized in that, The firewall aging time is dynamically updated in the following way: The response timeout time between devices in the home and the smart gateway based on Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) is periodically counted. The firewall aging time of the smart gateway is dynamically updated based on the response timeout.

4. The communication channel maintenance method according to claim 1, characterized in that, The communication channel maintenance method further includes: If downlink data sent by the server is detected, the downlink data is processed, and the processed response data is sent to the server according to the latest valid connection state information; the latest valid connection state information is obtained by updating the firewall aging time through the smart gateway after the smart gateway receives the downlink data.

5. The communication channel maintenance method according to claim 1, characterized in that, Before sending the heartbeat packet, it also includes: Based on the local IPv6 address and device information, a registration request is generated and sent to the server; After the server parses and stores the IPv6 address and device information in the registration request, it receives a registration success message sent by the server.

6. The communication channel maintenance method according to claim 5, characterized in that, After receiving the registration success message, but before sending the heartbeat packet, it also includes: The number of intermediate hops from the endpoint to the server is detected by sending response data to the server. The number of intermediate hops from the endpoint to the smart gateway is detected by sending response data to the smart gateway. The number of intermediate hops from the endpoint to the server and the number of intermediate hops from the endpoint to the smart gateway are stored locally.

7. The communication channel maintenance method according to any one of claims 1-6, characterized in that, The communication between the client and the server is based on the UDP protocol for data transmission.

8. An end face, characterized in that, include: The heartbeat packet sending module is used to send heartbeat packets to the server according to the heartbeat interval. The heartbeat interval is less than the firewall aging time; The heartbeat packet is set with a corresponding hop count limit value, which is greater than or equal to the number of hops from the endpoint to the smart gateway, and less than the number of hops from the endpoint to the server; the firewall aging time is dynamically updated by the smart gateway after the smart gateway receives the heartbeat packet. The heartbeat anomaly feedback receiving module is used to receive heartbeat anomaly feedback sent by the routing node that dropped the heartbeat packet after the heartbeat packet is dropped.

9. An electronic 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 steps of the communication channel maintenance method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, wherein a computer program is stored on the non-transitory computer-readable storage medium, characterized in that, When the computer program is executed by a processor, it implements the steps of the communication channel maintenance method as described in any one of claims 1 to 7.

11. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the communication channel maintenance method as described in any one of claims 1 to 7.