Equipment wakeup and P2P (Peer-to-Peer) connection system and method based on dynamic selection
By decoupling the device end from the wake-up server cluster and combining a dynamic selection strategy for resource and service location servers, the problems of low scalability and low resource utilization in IoT device P2P wake-up systems are solved, achieving efficient and stable device wake-up and P2P connection.
Patent Information
- Application Number
- CN202511851230.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-01-06
AI Technical Summary
Existing P2P wake-up systems for IoT devices suffer from limited scalability, low resource utilization, performance interference, high wake-up latency, and a lack of server selection strategies, resulting in overall low system efficiency.
It adopts an architecture that decouples the device and the wake-up server cluster. By providing a dynamic selection strategy through resource and service location servers, it achieves efficient connection between the device and the wake-up server and direct establishment of P2P channels. It independently manages wake-up and P2P services and optimizes server selection.
The system achieves high scalability, flexibility, high resource utilization, low latency, and high reliability, improving the success rate of device wake-up and system stability.
Smart Images

Figure CN121284084A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of Internet of Things (IoT) communication and other technologies, and in particular to a device wake-up and P2P connection system and method based on dynamic selection. Background Technology
[0002] With the continuous development of IoT technology, modern smart cameras have gradually broken free from the constraints of traditional wired power supply, shifting towards more flexible and diversified energy solutions. These devices typically integrate battery packs, solar panels, or wireless charging modules to achieve self-sufficiency and are equipped with an intelligent power management system. This system enables full-function operation during periods of high activity, while automatically switching to deep sleep mode during periods of inactivity or low load (typically reducing power consumption by 80%–90%). This dynamic dual-mode switching mechanism ensures 24 / 7 uninterrupted monitoring while significantly improving battery life after a single charge. In low-power mode, the device's main control program enters a sleep state, retaining only the 4G communication module. It maintains communication with a remote keep-alive / wake-up server via a persistent TCP connection, providing a channel for subsequent remote command wake-up. This feature makes these cameras particularly suitable for applications lacking stable power supply, such as outdoor security and temporary deployment.
[0003] Currently, there is a P2P-based remote wake-up system, which mainly consists of four modules: an APP client, a P2P server, a wake-up / keep-alive server, and a device. The P2P server and the wake-up / keep-alive server are forcibly deployed on the same physical server, forming a one-to-one binding relationship. Only a limited number of such servers (e.g., three) are configured for a single number segment (usually corresponding to a product series or region). The device maintains a long TCP connection with one of the wake-up servers via a 4G module, sending heartbeat packets every minute to stay online. When the APP needs to connect to the device, the process is as follows: 1) The APP initiates a connection request to all P2P servers; 2) After receiving the request, the P2P server notifies the wake-up server on the same physical machine it is bound to; 3) The wake-up server sends a wake-up command to the target device through the existing long TCP connection; 4) After being woken up, the device actively connects to the P2P server, and finally, with the assistance of the P2P server, completes a hole-punching connection with the APP. However, this existing technology has many substantial technical problems.
[0004] First, the existing technology is tightly coupled, limiting its scalability. The physical binding of the P2P server and the wake-up server results in a rigid system architecture. Any scaling up or down operation on the P2P server or wake-up server must be performed in pairs, and independent scaling is not possible. This model becomes extremely cumbersome when serving devices with different number ranges or types, hindering flexible business development.
[0005] Second, the existing technology suffers from low resource utilization and waste. The number of devices managed by the P2P server (mainly UDP short connections) is usually disproportionate to the number of devices managed by the wake-up server (TCP long connections). Forced binding can lead to one server resource being exhausted while another server resource still has a large amount of idle resources, making it impossible to achieve elastic scheduling and maximize utilization of resources, resulting in significant waste of server resources.
[0006] Third, the existing technology suffers from performance bottlenecks and mutual interference. P2P service (UDP) and wake-up keep-alive service (TCP) are two completely different network I / O models with different requirements and consumption methods for system resources (such as socket handles, ports, CPU, and memory). Deploying them on the same physical machine will lead to competition for underlying resources, causing mutual performance interference, thereby limiting the maximum number of device connections that a single server can support.
[0007] Fourth, the existing technology suffers from functional dependencies and excessively long transmission chains. The wake-up function relies entirely on the P2P server for message triggering. This not only increases the processing load on the P2P server, making it a performance bottleneck, but also lengthens the transmission path of the wake-up command (APP->P2P->wake-up->device), increasing wake-up latency and overall failure rate. The functional expansion of the wake-up service is also limited by the P2P server.
[0008] Fifth, the existing technology lacks a server selection strategy and does not provide an effective mechanism for waking up and selecting servers. The initial server that the device connects to is usually random or fixed, and it cannot make intelligent and optimized selections based on the real-time status of the server (such as load, bandwidth, and geographical location). This may result in some servers being overloaded while others are idle, leading to low overall system efficiency.
[0009] In summary, existing technologies suffer from several technical problems, including tight system coupling, limited scalability, low resource utilization, mutual performance interference, increased wake-up latency and overall failure rate, inability to make intelligent and optimized selections based on the real-time status of the server, and low overall system efficiency. Summary of the Invention
[0010] To address the shortcomings of the existing technologies, this invention provides a system and method for device wake-up and P2P connection based on dynamic selection, so as to achieve high scalability and flexibility, high resource utilization, high performance and stability, low latency and high reliability, intelligent optimization and load balancing.
[0011] In a first aspect, the present invention provides a device wake-up and P2P connection system based on dynamic selection, comprising: On the device side, it is configured to establish a persistent network connection with one of the wake-up servers in the wake-up server cluster and conduct periodic heartbeat communication before going to sleep. The APP client is configured to provide users with an operation interface so that users can initiate device wake-up requests and P2P connection requests; A P2P server cluster, comprising several P2P servers, is used to establish a P2P channel between the APP client and the device according to the P2P connection request. The wake-up server cluster is physically and logically decoupled from the P2P server cluster, and includes several wake-up servers for managing the keep-alive long connections of all devices on the device side and processing the device wake-up requests. The resource and service location server, as an independent service center, is used to maintain and manage the status information of the wake-up server cluster, and to provide the device with a list of the current optimal wake-up server addresses, providing the device with a dynamic basis for wake-up server selection.
[0012] Secondly, the present invention provides a method for device wake-up and P2P connection based on dynamic selection. This method is applied to a system including a device, an APP client, a decoupled P2P server cluster and wake-up server cluster, and a resource and service location server. The method includes: Dynamic connection step: Based on the cluster status information obtained from the resource and service location server, the device establishes and maintains a keep-alive long connection with one of the wake-up servers in the wake-up server cluster through a dynamic selection strategy. Direct wake-up step: When the APP client needs to connect to the device, the APP client initiates the wake-up process by directly sending a wake-up request to the wake-up server cluster; Connection establishment steps: After the device is woken up, it establishes a P2P connection with the APP client with the assistance of the P2P server cluster.
[0013] Compared with the prior art, the beneficial effects of this invention are as follows: This invention provides a system and method for device wake-up and P2P connection based on dynamic selection. The method is applied to a system including a device, an app client, a decoupled P2P server cluster and wake-up server cluster, and a resource and service location server. The method includes: a dynamic connection step: the device establishes and maintains a keep-alive long connection with one of the wake-up servers in the wake-up server cluster based on cluster status information obtained from the resource and service location server, using a dynamic selection strategy; a direct wake-up step: when the app client needs to connect to the device, the app client initiates the wake-up process by directly sending a wake-up request to the wake-up server cluster; and a connection establishment step: after the device is woken up, it establishes a P2P connection with the app client with the assistance of the P2P server cluster. This invention can achieve high scalability and flexibility, high resource utilization, high performance and stability, low latency and high reliability, intelligent optimization and load balancing. Attached Figure Description
[0014] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. Some specific embodiments of the invention will be described in detail below with reference to the accompanying drawings in an exemplary and non-limiting manner. The same reference numerals in the drawings designate the same or similar parts or components. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic diagram of an architecture of a device wake-up and P2P connection system based on dynamic selection according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for dynamically selected device wake-up and P2P connection based on an embodiment of the present invention. Detailed Implementation
[0015] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0016] Example 1 See Figures 1-2 This embodiment provides a device wake-up and P2P connection system based on dynamic selection, the system comprising: On the device side, it is configured to establish a persistent network connection with one of the wake-up servers in the wake-up server cluster and conduct periodic heartbeat communication before going to sleep. The APP client is configured to provide users with an operation interface so that users can initiate device wake-up requests and P2P connection requests; A P2P server cluster, comprising several P2P servers, is used to establish a P2P channel between the APP client and the device according to the P2P connection request. The wake-up server cluster is physically and logically decoupled from the P2P server cluster, and includes several wake-up servers for managing the keep-alive long connections of all devices on the device side and processing the device wake-up requests. The resource and service location server, as an independent service center, is used to maintain and manage the status information of the wake-up server cluster, and to provide the device with a list of the current optimal wake-up server addresses, providing the device with a dynamic basis for wake-up server selection.
[0017] In this embodiment, the wake-up server cluster and the P2P server cluster are physically and logically decoupled. This solves the problems of rigid system architecture, limited scalability, low resource utilization, and performance interference caused by the physical binding of P2P servers and wake-up servers. It enables independent deployment, management, and elastic scaling of P2P services and wake-up services, improving the overall scalability, flexibility, and resource utilization of the system. Furthermore, the resource and service location server, as an independent service center, maintains and manages the status information of the wake-up server cluster and provides the device with a list of currently optimal wake-up server addresses. This addresses the lack of server selection strategies and the inability to make intelligent and optimized selections based on the real-time status of servers. It achieves centralized, status-aware intelligent management of the wake-up server cluster, providing a decision-making basis for optimal selection at the device level.
[0018] Preferably, after the device starts up or wakes up, it selects a wake-up server from the list of wake-up server addresses provided by the resource and service location server according to a preset dynamic selection strategy, and establishes a long TCP connection between the device and the selected wake-up server. In this embodiment, after the device starts up or wakes up, it selects a wake-up server from the list of wake-up server addresses provided by the resource and service location server according to a preset dynamic selection strategy, and establishes a long TCP connection between the device and the selected wake-up server. This can solve the problem that the initial connection to a server is usually random or fixed, which may lead to some servers being overloaded while others are idle. It enables intelligent and refined control of the device's connection behavior, avoids uneven connection load, and improves the efficiency of a single connection and the overall stability of the system.
[0019] Preferably, when selecting a wake-up server from the list of wake-up server addresses provided by the resource and service location server according to a preset dynamic selection strategy, the process includes: querying the resource and service location server to obtain a list of currently optimal wake-up servers; and selecting a wake-up server from the list of currently optimal wake-up servers obtained through the query according to the preset dynamic selection strategy. In this embodiment, querying the resource and service location server to obtain a list of currently optimal wake-up servers, and then selecting a wake-up server from the list of currently optimal wake-up servers obtained through the query according to the preset dynamic selection strategy, can solve the problem of the lack of real-time, global server selection on the device side, ensuring that the device can make the optimal connection decision based on the latest cluster status, thereby reducing latency and improving connection success rate.
[0020] Preferably, the dynamic selection strategy calculates weights and ranks the selection based on one or more of the following factors: the server's real-time load, the server's network bandwidth capacity and current bandwidth utilization, the network latency between the server and the device, and the server's geographical location. In this embodiment, the dynamic selection strategy calculates weights and ranks the selection based on one or more of the following factors: the server's real-time load, the server's network bandwidth capacity and current bandwidth utilization, the network latency between the server and the device, and the server's geographical location. This can adapt to complex network environments and server states, making the selection strategy more specific and multidimensional. By comprehensively considering computational performance, network performance, and location relationships, it ensures that the selected server is optimal in terms of load, latency, and stability, thereby achieving efficient load balancing and low-latency communication.
[0021] Preferably, the dynamic selection strategy is executed by the device or the resource and service location server; the real-time load of the server includes CPU and memory utilization; and the network latency between the server and the device is obtained through TCP long connection latency measurement. In this embodiment, the dynamic selection strategy is executed by the device or the resource and service location server, which enables flexibility in strategy execution. It can utilize the distributed computing capabilities of the device or the global computing capabilities of the resource and service location server to adapt to different application scenarios and system architecture requirements. The real-time load of the server, including CPU and memory utilization, and the network latency between the server and the device, obtained through TCP long connection latency measurement, enable the clarification and quantification of key selection factors, making the dynamic selection strategy operable and implementable, and ensuring the accuracy and effectiveness of the selection results.
[0022] Example 2 See Figures 1-2This embodiment provides a method for device wake-up and P2P connection based on dynamic selection. The method is applied to a system including a device, an APP client, a decoupled P2P server cluster and wake-up server cluster, and a resource and service location server. The method includes: Dynamic connection step: Based on the cluster status information obtained from the resource and service location server, the device establishes and maintains a keep-alive long connection with one of the wake-up servers in the wake-up server cluster through a dynamic selection strategy. Direct wake-up step: When the APP client needs to connect to the device, the APP client initiates the wake-up process by directly sending a wake-up request to the wake-up server cluster; Connection establishment steps: After the device is woken up, it establishes a P2P connection with the APP client with the assistance of the P2P server cluster.
[0023] In this embodiment, the device establishes and maintains a keep-alive long connection with a wake-up server based on the cluster status information obtained from the resource and service location server through a dynamic selection strategy. This solves the problems of uneven load and low connection efficiency caused by the lack of server selection strategies, realizing intelligent and optimized connection between the device and the wake-up server, achieving load balancing at the system entry point, and laying the foundation for low-latency wake-up. When the APP client needs to connect to the device, the APP client initiates the wake-up process by directly sending a wake-up request to the wake-up server cluster. This solves the problem of the wake-up function relying entirely on P2P servers for message triggering, resulting in a long link (APP->P2P->wake-up->device), leading to high wake-up latency and high failure rate. It simplifies and disintermediates the wake-up path, reduces wake-up latency, and improves wake-up success rate and system reliability. By setting the P2P server cluster and the wake-up server cluster to be decoupled from each other and applying them to the method flow of this embodiment, the fundamental problem of rigid architecture, poor scalability, low resource utilization and mutual performance interference caused by the physical binding of P2P and wake-up servers can be solved. The entire method flow of this embodiment is built on a highly scalable and resource-optimizable flexible architecture, ensuring the high performance and stability of the method itself.
[0024] Preferably, in the dynamic connection step, the device performs the following: querying the resource and service location server for the current optimal wake-up server list; selecting a target wake-up server from the list based on one or more factors according to the dynamic selection strategy, including: the server's real-time load, the server's network bandwidth capacity and current bandwidth utilization, the network latency between the server and the device, and the server's geographical location; establishing a TCP long connection with the selected target wake-up server, and periodically sending heartbeat data to maintain the connection.
[0025] In this embodiment, the dynamic connection step includes querying the list from the RSL server, selecting based on multiple factors (load, bandwidth, latency, location), and establishing a TCP long connection with heartbeat keep-alive. This can achieve the operability and accuracy of the dynamic selection strategy, ensuring that each long connection establishment is the optimal solution under the current network and server conditions, while reliably maintaining the availability of the wake-up channel through the heartbeat mechanism.
[0026] Preferably, in the direct wake-up step, the APP client sends a wake-up request to any server in the wake-up server cluster, and the wake-up request contains the unique device identifier of the target device.
[0027] In this embodiment, the APP client sends a wake-up request to any server in the wake-up server cluster, and the request contains a unique device identifier. This can solve the path dependency and single point of failure problems caused by the APP initiating a request through a specific P2P server, realize the arbitrary and stateless nature of the wake-up request entry point, and make the APP's wake-up behavior no longer dependent on the state of a specific backend server, greatly improving the system's fault tolerance and access flexibility.
[0028] Preferably, the wake-up process includes: the wake-up server receiving the wake-up request checks whether the device corresponding to the unique identifier of the device has a keep-alive long connection with it; if so, the wake-up server directly sends a wake-up command to the device through the keep-alive long connection; if not, the wake-up server forwards the wake-up request to the correct wake-up server that has a keep-alive long connection with the target device through the forwarding mechanism within the wake-up server cluster.
[0029] In this embodiment, the wake-up process includes checking the connection relationship and forwarding the request through the internal forwarding mechanism of the cluster. This can solve the problem that when the request randomly sent by the APP is not received by the server connected to the target device, the request may be dropped, resulting in wake-up failure. This enables the wake-up server cluster to provide services to the outside world as a whole. The internal forwarding mechanism ensures that any received wake-up request can be accurately delivered to the correct server where the target device is located, thereby improving the robustness and success rate of the wake-up service.
[0030] Preferably, in the connection establishment step, after the device is woken up, it actively connects to the P2P server cluster and logs in; the APP client initiates a P2P connection request for the device to the P2P server cluster; with the assistance of the P2P server cluster, a direct P2P channel is established between the APP client and the device.
[0031] In this embodiment, the connection establishment step includes the device actively logging into the P2P server cluster and initiating a P2P connection request with the APP client. With the assistance of the P2P server cluster, a direct P2P channel is established, which can solve the problem of how to establish a P2P connection efficiently and reliably. It achieves a perfect connection and separation of responsibilities between the wake-up function and the P2P connection function after decoupling, ensuring that after the device is successfully woken up, it can quickly and stably switch to the direct communication stage with the APP, completing the complete process from low-power standby to full-function service.
[0032] It should be noted that the above embodiments are merely preferred embodiments of the present invention, and the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention, and the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A device wake-up and P2P connection system based on dynamic selection, characterized in that, The method comprises the following steps: The device end is configured to establish a persistent network connection with a wake-up server in a wake-up server cluster and perform periodic heartbeat communication before hibernation; The APP client is configured to provide an operation interface for a user to initiate a device wake-up request and a P2P connection request; The P2P server cluster comprises a plurality of P2P servers, which are used to establish a P2P channel between the APP client and the device end according to the P2P connection request; The wake-up server cluster is physically and logically decoupled from the P2P server cluster, comprises a plurality of wake-up servers, and is used to manage the keep-alive long connection of all devices of the device end and process the device wake-up request; The resource and service location server is used as an independent service center to maintain and manage the state information of the wake-up server cluster and provide the device end with a current optimal wake-up server address list, thereby providing the device end with a dynamic wake-up server selection basis.
2. The system of claim 1, wherein, The method comprises the following steps: After the device end is started or woken up, a wake-up server is selected from the wake-up server address list provided by the resource and service location server according to a preset dynamic selection strategy, and a TCP long connection is established between the device end and the selected wake-up server.
3. The system of claim 2, wherein, When a wake-up server is selected from the wake-up server address list provided by the resource and service location server according to a preset dynamic selection strategy, the following steps are included: querying the resource and service location server to obtain a current optimal wake-up server list; and selecting a wake-up server from the current optimal wake-up server list obtained by querying according to a preset dynamic selection strategy.
4. The system of claim 2, wherein, The dynamic selection strategy calculates weights and performs sorting selection based on one or more factors, such as the real-time load of the server, the network bandwidth capability and current bandwidth utilization of the server, the network delay between the server and the device, and the geographical regional position of the server.
5. The system of claim 4, wherein, The dynamic selection strategy is executed by the device end or the resource and service location server; the real-time load of the server includes CPU and memory usage; and the network delay between the server and the device is obtained by measuring the time consumption of the TCP long connection.
6. A method for device wake-up and P2P connection based on dynamic selection, the method comprising: The method is applied to a system comprising a device end, an APP client, a P2P server cluster and a wake-up server cluster which are decoupled from each other, and a resource and service location server, and the method comprises the following steps: A dynamic connection step: the device end establishes and maintains a keep-alive long connection with a wake-up server in the wake-up server cluster based on the cluster state information obtained from the resource and service location server by using a dynamic selection strategy; A direct wake-up step: when the APP client needs to connect the device end, the APP client initiates a wake-up process by directly sending a wake-up request to the wake-up server cluster; A connection establishment step: after the device end is woken up, the device end establishes a P2P connection with the APP client with the assistance of the P2P server cluster.
7. The method of claim 6, wherein, In the dynamic connection step, the device end performs: querying the resource and service location server for a list of currently optimal wake-up servers, selecting a target wake-up server from the list based on one or more factors according to the dynamic selection strategy, the factors including: real-time load of the server, network bandwidth capability and current bandwidth utilization of the server, network delay between the server and the device, geographical regional position of the server; establishing a TCP long connection with the selected target wake-up server, and periodically sending heartbeat data to maintain the connection.
8. The method of claim 6, wherein, In the direct wake-up step, the APP client sends a wake-up request to any server in the wake-up server cluster, and the sent wake-up request contains a device unique identifier of the target device end.
9. The method of claim 8, wherein, The wake-up process includes: the wake-up server receiving the wake-up request checks whether the device end corresponding to the device unique identifier has a keep-alive long connection with it; if yes, the wake-up server directly issues a wake-up instruction to the device end through the keep-alive long connection; if not, the wake-up server forwards the wake-up request to the correct wake-up server that has a keep-alive long connection with the target device end through a forwarding mechanism inside the wake-up server cluster.
10. The method of claim 6, wherein, In the connection establishment step, after the device end is woken up, it actively connects to the P2P server cluster and logs in; the APP client initiates a P2P connection request for the device end to the P2P server cluster; and under the assistance of the P2P server cluster, a direct P2P channel is established between the APP client and the device end.
Citation Information
Patent Citations
Remote wakening system and method based on P2P
CN107659414A
Monitoring equipment awakening method and device
CN116546078A
Forwarding server selection method of hybrid network architecture, electronic equipment and computer readable storage medium
CN120602493A
Connection management system, connection management method, and management server
US20080034099A1
Dynamic Selection of Server States
US20110016339A1