Terminal equipment communication method and device and electronic equipment

By generating a communication data distribution matrix for terminal devices, high-performance proxy devices are selected, the communication architecture of the IoT system is optimized, and the problems of high power consumption and network load of edge devices are solved, thereby improving stability and reliability.

CN121887848APending Publication Date: 2026-04-17LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2025-11-30
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In IoT systems, edge devices, due to hardware limitations, face high power consumption and network load when independently connecting to and maintaining heartbeats with MQTT servers. This also leads to significant server resource consumption and frequent disconnections and reconnections, affecting overall service stability.

Method used

By generating a communication data distribution matrix of terminal devices, first-level and second-level devices with high communication performance are selected and used as proxy devices to access the server. Other devices communicate with the server indirectly through the proxy devices, reducing the number of direct connections and optimizing the communication architecture.

Benefits of technology

It reduces server resource consumption, decreases terminal device power consumption and network load, reduces frequent disconnections and reconnections, and improves the overall service stability and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121887848A_ABST
    Figure CN121887848A_ABST
Patent Text Reader

Abstract

The invention provides a terminal equipment communication method and device and electronic equipment, and the method comprises the steps: responding to the access of multiple pieces of terminal equipment, and obtaining the communication data of the multiple pieces of terminal equipment; generating target information based on the communication data; the target information comprises a distribution matrix of a plurality of terminal devices; determining at least one first-level device and / or at least one second-level device from the plurality of terminal devices based on the target information; the first-level device serves as proxy access of the terminal device, and the second-level device serves as proxy access of the first-level device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and more particularly to a terminal device communication method, apparatus, and electronic device. Background Technology

[0002] In existing IoT systems, numerous edge devices need to independently establish connections and maintain heartbeats with MQTT (Message Queuing Telemetry Transport) servers. However, edge devices are limited by hardware, with relatively weak network and computing modules. Independently maintaining connections and heartbeats with MQTT servers increases power consumption and network load. Meanwhile, MQTT servers need to handle massive numbers of connections simultaneously, resulting in significant resource consumption and potential bottlenecks. When the number of edge devices is large or network fluctuations occur, frequent disconnections and reconnections can easily lead to overall service instability. Summary of the Invention

[0003] This application provides a terminal device communication method, apparatus, and electronic device.

[0004] One embodiment of this application provides a terminal device communication method, the method comprising: In response to multiple terminal devices accessing the system, the system obtains the communication data of the multiple terminal devices. Target information is generated based on the communication data; the target information includes a distribution matrix of the multiple terminal devices. Based on the target information, at least one primary device and / or at least one secondary device are determined from the plurality of terminal devices; the primary device acts as a proxy for the terminal device to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0005] After determining at least one primary device from the plurality of terminal devices based on the target information, the method further includes: Obtain communication data from at least one primary device; the communication data of each primary device includes the communication data of the terminal device accessing that primary device. The target information is updated based on the communication data.

[0006] After updating the target information based on the communication data, the method further includes: If the distribution matrix in the updated target information does not change within a preset time, at least one secondary device is determined from the at least one primary device based on the target information.

[0007] The target information further includes first communication information and second communication information, and the step of determining at least one primary device from the plurality of terminal devices based on the target information includes: From the plurality of terminal devices, at least one terminal device with the same second communication information is determined, wherein the second communication information characterizes the communication stability of the corresponding terminal device; The terminal device with the largest first communication information among the at least one terminal device is determined as the first-level device, and the first communication information represents the communication activity of the corresponding terminal device.

[0008] The target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: The primary devices are traversed from low to high according to their second communication information; If the first communication information of the current level device is greater than or equal to that of the previous level device, continue traversing. The previous level device is the level device traversed in the previous traversal. If the first communication information of the current level-one device is less than that of the previous level-one device, the previous level-one device is identified as the level-two device; After the traversal is completed, the at least one secondary device is obtained.

[0009] The target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: The primary devices are traversed from low to high according to their second communication information; If it is determined that there is a target primary device for the current primary device, the process is traversed to the target primary device. The target primary device is the primary device whose first communication information is the largest within the second communication information range and is higher than the first communication information of the current primary device. The second communication information range is determined based on the second communication information of the current primary device and a preset step size. If it is determined that there is no target primary device for the current primary device, the current primary device is designated as the secondary device; After the traversal is completed, the at least one secondary device is obtained.

[0010] The method further includes: In response to detecting a disconnection of the primary device, a first communication request is sent to at least one terminal device that has accessed the network through the primary device, so that the at least one terminal device disconnects its communication connection with the primary device and directly accesses the server. In response to detecting the disconnection of the secondary device, a second communication request is sent to at least one terminal device and at least one primary device that accessed the network through the secondary device, so that the at least one terminal device and the at least one primary device disconnect the communication connection with the second device and directly access the server.

[0011] The method further includes: Collect communication data between the terminal device or the primary device and the server; The target information is updated based on the communication data; Based on the updated target information, at least one primary device and / or at least one secondary device are determined from the plurality of terminal devices.

[0012] Another embodiment of this application provides a terminal device communication apparatus, the apparatus comprising: The acquisition module is used to respond to the access of multiple terminal devices and obtain the communication data of the multiple terminal devices; A calculation module is used to generate target information based on the communication data; the target information includes a distribution matrix of the multiple terminal devices; The processing module is configured to determine at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the target information; the primary device acts as a proxy for the terminal devices to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0013] This application also provides an electronic device, including: a communication interface and a processor, wherein the communication interface and the processor are electrically connected; The communication interface responds to multiple terminal devices accessing the system and obtains communication data from the multiple terminal devices. The processor generates target information based on the communication data; the target information includes a distribution matrix of the plurality of terminal devices; and determines at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the target information; the primary device acts as a proxy for the terminal devices to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0015] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0016] Figure 1 A flowchart of a terminal device communication method according to an embodiment of this application is shown; Figure 2 A flowchart of a terminal device communication method according to another embodiment of this application is shown; Figure 3 A flowchart of a terminal device communication method according to another embodiment of this application is shown; Figure 4A A schematic diagram of a distribution matrix according to an embodiment of this application is shown; Figure 4B A schematic diagram of a distribution matrix according to another embodiment of this application is shown; Figure 4C A schematic diagram of a distribution matrix according to another embodiment of this application is shown; Figure 5A A schematic diagram of a distribution matrix according to an embodiment of this application is shown; Figure 5B A schematic diagram of a distribution matrix according to another embodiment of this application is shown; Figure 6 A flowchart of a terminal device communication method according to another embodiment of this application is shown; Figure 7 A flowchart of a terminal device communication method according to another embodiment of this application is shown; Figure 8 A schematic diagram of the structure of a terminal device communication apparatus according to an embodiment of this application is shown; Figure 9 A schematic diagram of the composition structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0017] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] To reduce server resource consumption and minimize frequent disconnections and reconnections when there are many edge devices or network fluctuations, thereby improving overall service stability, one embodiment of this application provides a terminal device communication method, such as... Figure 1 As shown, the method includes: Step 101: Respond to the access of multiple terminal devices and obtain the communication data of the multiple terminal devices.

[0019] In the initial stage, multiple terminal devices do not connect to the server through any proxy device. Instead, they each establish a direct connection with the server independently and communicate or exchange data with the server based on this connection. During this initial stage, the server collects the communication data of each terminal device in real time.

[0020] In this embodiment, the communication data of the terminal device includes the number of valid data interactions between the terminal device and the server, the total number of heartbeats, and the number of connection establishments. In other embodiments, it may also include any other communication data.

[0021] Step 102: Generate target information based on the communication data; the target information includes the distribution matrix of the multiple terminal devices.

[0022] By hierarchically or clustering multiple terminal data based on communication data that characterizes different communication performance of terminal devices, corresponding target information can be generated.

[0023] For example, the ratio of the total number of heartbeats to the number of connection establishments can characterize the communication stability between the terminal device and the server. The number of effective data exchanges can characterize the communication activity between the terminal device and the server.

[0024] In addition to the distribution matrix of multiple terminal devices, the target information can also be the clustering results, hierarchical results, etc. of multiple terminal devices.

[0025] Step 103: Based on the target information, determine at least one primary device and / or at least one secondary device from the plurality of terminal devices; the primary device acts as a proxy for the terminal device to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0026] Based on the classification of multiple terminal devices according to their communication performance in the target information, at least one primary device with high communication performance is identified. These primary devices retain their connection with the server, while other terminal devices disconnect from the server and communicate with the server through these primary devices as proxies.

[0027] Alternatively, based on the classification of multiple terminal devices according to their communication performance in the target information, at least one primary device with high communication performance is identified. Then, based on the target information, at least one secondary device with high performance is identified from these primary devices. These secondary devices retain their connection with the server, while other terminal devices and primary devices disconnect from the server and communicate with the server through these secondary devices as proxies.

[0028] Alternatively, based on the classification of multiple terminal devices according to their communication performance in the target information, at least one primary device with high communication performance is identified. Then, based on the target information, at least one secondary device with high performance is identified from these primary devices. These secondary devices retain their connection with the server, while other terminal devices and primary devices disconnect from the server. Other terminal devices connect to the corresponding secondary devices through these primary devices as proxies, and primary devices communicate with the server through these secondary devices as proxies.

[0029] In the above scheme, by allowing terminal devices to connect directly to the server in the initial stage, communication data that characterizes the communication performance of the terminal devices is collected. Based on this communication data, which characterizes the different communication performance of the terminal devices, multiple terminal devices are then hierarchically or clustered to generate target information such as distribution matrices, clustering results, or hierarchical results. Subsequently, based on the target information, high-performance primary and / or secondary devices can be identified from the terminal devices. The primary devices retain their connection to the server, and other terminal devices communicate with the server through the primary devices. Alternatively, the secondary devices retain their connection to the server, and other terminal devices and primary devices communicate with the server through the secondary devices. Or, the secondary devices retain their connection to the server, and other terminal devices connect to the corresponding secondary devices through the primary devices, and the primary devices communicate with the server through the secondary devices. This effectively reduces the number of connections the server needs to handle simultaneously, lowers server resource consumption, avoids each terminal device independently maintaining its connection and heartbeat with the server, reduces terminal device power consumption and network load, and by filtering proxy devices based on communication performance and building a multi-level proxy communication architecture, it reduces frequent disconnections and reconnections when there are many edge devices or network fluctuations, significantly improving the overall service stability.

[0030] This application also provides a terminal device communication method in one example, such as Figure 2 As shown, after determining at least one primary device from the plurality of terminal devices based on the target information, the method further includes: Step 201: Obtain communication data of at least one primary device; the communication data of each primary device includes the communication data of the terminal device accessing that primary device.

[0031] After identifying multiple primary devices based on target information, other terminal devices that were not selected as primary devices disconnect from the server and establish a communication link with the corresponding primary device via UDP (multicast or unicast). Each primary device then acts as a proxy to forward data, enabling indirect communication with the server.

[0032] For ease of description, this stage will be referred to as the first proxy communication stage. In the first proxy communication stage, the server continuously collects communication data between the primary devices and the server, as well as communication data of the terminal devices accessed through each primary device. Each primary device summarizes the communication data of its subordinate terminal devices and reports it synchronously to the server, ensuring that the server obtains the communication data of all primary devices and all terminal devices.

[0033] Step 202: Update the target information based on the communication data.

[0034] The target information is updated based on the communication data collected from all primary devices and all terminal devices during this phase.

[0035] In the above scheme, after identifying multiple primary devices based on target information, other terminal devices not selected as primary devices disconnect their direct connection with the server and establish a communication link with the corresponding primary device via UDP. The primary device then forwards data to achieve indirect communication with the server. Compared to the initial stage where each terminal device communicates directly with the server independently, the communication method between the terminal devices and the server changes in the first proxy communication stage, resulting in significant changes in the corresponding communication data. Therefore, the server needs to continuously collect communication data from each primary device and the terminal devices accessing the server through the primary devices' aggregation and reporting. Based on the communication data collected from all primary devices and terminal devices in the first proxy communication stage, the target information is updated to ensure that the target information can characterize the actual communication scenario after the change in communication method, accurately reflect the communication performance of each primary device and terminal device, and provide an accurate data foundation for subsequent aggregation.

[0036] In one example of this application, a terminal device communication method is also provided. After updating the target information based on the communication data, the method further includes: If the distribution matrix in the updated target information does not change within a preset time, at least one secondary device is determined from the at least one primary device based on the target information.

[0037] During the first proxy communication phase, the distribution matrix in the target information needs to be monitored. Communication data is collected and the target information is updated. The updated target information is compared with the original target information. If the updated target information has changed compared with the original target information, communication data is collected and the target information is updated again until the updated target information has not changed compared with the original target information within a preset time. Then, at least one secondary device is determined from at least one primary device based on the latest target information.

[0038] In the above scheme, after transitioning to the first proxy communication stage in the initial phase, the communication methods of each terminal device change, causing the corresponding communication data to change as well. This leads to frequent changes in the target information in the early stages of the first proxy communication stage. By monitoring the distribution matrix of the target information in the first proxy communication stage, continuously collecting communication data and updating the target information, and comparing the updated target information with the original target information, if changes are found, the data collection and update operations continue until the updated target information remains unchanged within a preset time. That is, the communication links of each primary device and each terminal device in the first proxy communication stage reach a stable state. Based on this stable target information, at least one secondary device is determined from at least one primary device. This ensures that the selection criteria for secondary devices accurately reflect the actual communication performance and proxy carrying capacity of each primary device in the stable communication architecture, further optimizing the rationality of determining the multi-level proxy communication architecture and further improving the overall service stability.

[0039] This application also provides a terminal device communication method in one example, such as Figure 3 As shown, the target information further includes first communication information and second communication information. The step of determining at least one primary device from the plurality of terminal devices based on the target information includes: Step 301: Determine at least one terminal device from the plurality of terminal devices that has the same second communication information, wherein the second communication information characterizes the communication stability of the corresponding terminal device.

[0040] In this embodiment, the first communication information is the number of valid data interactions, and the second communication information is the ratio of the total number of heartbeats to the number of connection establishments. In other embodiments, the first communication information can be any other communication data that can characterize the communication activity of the corresponding terminal device, and the second communication information can be any other communication data that can characterize the communication stability of the corresponding terminal device.

[0041] First, classify all terminal devices according to the second communication information, and group terminal devices with the same second communication information together.

[0042] For example, such as Figure 4A As shown, the communication data between terminal devices A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, and A12 and the server are as follows: A1: [X: 1, Y: 1], A2: [X: 6, Y: 1], A3: [X: 8, Y: 1], A4: [X: 2, Y: 2], A5: [X: 5, Y: 2], A6: [X: 3, Y: 3], A7: [X: 4, Y: 3], A8: [X: 8, Y: 3], A9: [X: 3, Y: 4], A10: [X: 4, Y: 4], A11: [X: 5, Y: 4], A12: [X: 8, Y: 4]. Where X represents the first communication information and Y represents the second communication information. Based on the second communication information, these terminal devices are classified as follows: Terminal devices A1, A2, and A3, where all second communication information is 1, are grouped together. Terminal devices A4 and A5, where all second communication information is 2, are grouped together. Terminal devices A6, A7, and A8, where all second communication information is 3, are grouped together. Terminal devices A9, A10, A11, and A12, where all second communication information is 4, are grouped together. The result is as follows: Figure 4A The distribution matrix shown.

[0043] Step 302: Determine the terminal device with the largest first communication information among the at least one terminal device as the first-level device, where the first communication information represents the communication activity of the corresponding terminal device.

[0044] Among at least one terminal device with the same second communication information, the terminal device with the largest first communication information is identified as a first-level device.

[0045] Continuing from the above examples, such as Figure 4B As shown, for terminal devices A1, A2, and A3 where all second communication information is 1, terminal device A3 has the largest first communication information, so terminal device A3 is determined as a first-level device. For terminal devices A4 and A5 where all second communication information is 2, terminal device A5 has the largest first communication information, so terminal device A5 is determined as a first-level device. For terminal devices A6, A7, and A8 where all second communication information is 3, terminal device A8 has the largest first communication information, so terminal device A8 is determined as a first-level device. For terminal devices A9, A10, A11, and A12 where all second communication information is 4, terminal device A12 has the largest first communication information, so terminal device A12 is determined as a first-level device. Having determined the first-level devices A3, A5, A8, and A12, we obtain the following... Figure 4B The distribution matrix shown. According to... Figure 4BThe distribution matrix shown indicates that terminal devices A1 and A2 access the server through primary device A3 as proxy devices, terminal device A4 accesses the server through primary device A5 as proxy devices, terminal devices A6 and A7 access the server through primary device A8 as proxy devices, and terminal devices A9, A10, and A11 access the server through primary device A12 as proxy devices.

[0046] In the above scheme, all terminal devices are first classified according to a second communication information that characterizes their communication stability, grouping those with similar communication stability into one group. Then, the terminal device with the highest communication activity in each group is selected as the primary device, and the other terminal devices in that group connect to the server through this primary device as proxy devices. This achieves accurate grouping and proxy device selection based on the terminal device's own communication performance characteristics, ensuring that the primary device possesses matching communication stability and optimal communication activity to fulfill its proxy device role. This effectively reduces the number of direct connections the server needs to handle, significantly reducing server resource consumption. Simultaneously, it avoids each terminal device independently maintaining its connection and heartbeat with the server, reducing terminal device power consumption and network load, thereby reducing frequent disconnections and reconnections when there are many edge devices or network fluctuations, significantly improving overall service stability.

[0047] In one example of this application, a terminal device communication method is also provided, wherein the target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: Step 401: Traverse the primary devices from low to high according to their second communication information.

[0048] Step 402: If the first communication information of the current level device is greater than or equal to that of the previous level device, continue the traversal. The previous level device is the level device traversed in the previous traversal.

[0049] Step 403: If the first communication information of the current level-one device is less than that of the previous level-one device, the previous level-one device is identified as the level-two device.

[0050] Step 404: After the traversal is completed, the at least one secondary device is obtained.

[0051] For example, such as Figure 4BThe distribution matrix shown contains devices A3, A5, A8, and A12. The data is traversed from low to high according to the second communication information of the first devices. First, we reach device A3, which is the first device traversed and has no predecessor device; therefore, we continue traversing. Next, we reach device A5. The predecessor device of device A5 is device A3. The first communication information of device A3 is 8, and the first communication information of device A5 is 5. The first communication information of the predecessor device A3 is greater than that of device A5; therefore, device A3 is determined as the second device, and we continue traversing. Finally, we reach device A8. The predecessor device of device A8 is device A5. The first communication information of device A5 is 5, and the first communication information of device A8 is 8. The first communication information of device A8 is greater than that of its predecessor device A5; therefore, we continue traversing. Traversing to the first device A12, the preceding device of the first device A12 is the first device A8. The first communication information of the first device A8 is 8, and the first communication information of the first device A12 is 8. The first communication information of the preceding device A8 is equal to the first communication information of the first device A12. Since the first device has been traversed, the first device A12 is determined as the second device. After the traversal is completed, the second devices A3 and A12 are determined, resulting in the following... Figure 4C The distribution matrix is ​​shown. Based on... Figure 4C The distribution matrix shown indicates that terminal devices A1 and A2 are connected to the server via secondary device A3 as proxy devices, and primary devices A5 and A8 and terminal devices A4, A6, A7, A9, A10, and A11 are connected to the server via secondary device A12 as proxy devices.

[0052] In the above scheme, when determining at least one secondary device from at least one primary device, the primary devices are first traversed from low to high according to the second communication information representing their communication stability. During the traversal, if the first communication information of the current primary device is greater than or equal to that of the previous primary device, the traversal continues. If the first communication information of the current primary device is less than that of the previous primary device, the previous primary device is determined as a secondary device. After the traversal is completed, at least one secondary device is obtained. By selecting secondary devices based on the traversal order of communication stability combined with the comparison of communication activity, it is ensured that the selected secondary devices have both better communication stability and communication activity, and can stably carry out multi-level proxy forwarding tasks. This further simplifies the number of devices directly connected to the server, reduces server resource consumption and connection pressure, optimizes the hierarchical rationality of the multi-level proxy communication architecture, reduces communication loss and disconnection risk of terminal devices and proxy devices at all levels, and effectively improves the overall service stability and communication transmission efficiency.

[0053] In one example of this application, a terminal device communication method is also provided, wherein the target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: Step 501: Traverse the primary devices from low to high according to their second communication information.

[0054] Step 502: If it is determined that there is a target primary device for the current primary device, traverse to the target primary device. The target primary device is the primary device with the largest first communication information within the second communication information range and higher than the first communication information of the current primary device. The second communication information range is determined based on the second communication information of the current primary device and a preset step size.

[0055] Step 503: If it is determined that there is no target primary device for the current primary device, the current primary device is determined as the secondary device.

[0056] Step 504: After the traversal is completed, the at least one secondary device is obtained.

[0057] For example, such as Figure 5AThe distribution matrix shown contains devices A3, A5, A8, and A12. The preset step size is set to 2. The second communication information of device A5 is 2, that of device A8 is 3, and that of device A12 is 4. The system iterates through the devices according to their second communication information from low to high. First, it iterates to device A3. The second communication information of device A3 is 1, so the range of second communication information is 1-3. Within this range, devices A5 and A8 exist. The first communication information of device A3 is 8, while that of device A5 is 5 and that of device A8 is 7, all of which are less than the first communication information of device A3. Therefore, device A3 is identified as the second device, and the traversal continues. Traversing to the first device A5, the second communication information of the first device A5 is 2, so the range of the second communication information is 2-4. Within this range, there are the first devices A8 and A12. The first communication information of the first device A5 is 5, while the first communication information of the first device A8 is 7, and the first communication information of the first device A12 is 6. The first device A8 has the largest first communication information within this range, which is greater than the first communication information of the first device A5. Therefore, the first device A8 is determined as the target first device, and the traversal continues. Traversing to the first device A8, the second communication information of the first device A8 is 3, so the range of the second communication information is 3. Within this range, there is the first device A12. The first communication information of the first device A12 is less than the first communication information of the first device A8. Therefore, the first device A8 is determined as the second device, and the traversal continues. Traversing to the first device A12, since the first device A12 is the last first device, the first device A12 is determined as the second device. After the traversal is complete, the second devices A3, A8, and A12 are determined, and the following is obtained: Figure 5B The distribution matrix is ​​shown. Based on... Figure 5B The distribution matrix shown indicates that terminal devices A1 and A2 are connected to the server via secondary device A3 as proxy devices, primary device A5 and terminal devices A4, A6, and A7 are connected to the server via secondary device A8 as proxy devices, and terminal devices A9, A10, and A11 are connected to the server via secondary device A12 as proxy devices.

[0058] In the above scheme, when determining at least one secondary device from at least one primary device, the primary devices are first traversed from low to high according to the second communication information representing their communication stability. During the traversal, the range of the second communication information is determined based on the second communication information of the current primary device and a preset step size. If there is a target primary device within this range whose first communication information is higher than that of the current primary device, the traversal continues to that target primary device. If there is no corresponding target primary device, the current primary device is determined as a secondary device. After the traversal is completed, at least one secondary device is obtained. By combining the preset step size to limit the range of the second communication information and filtering target primary devices based on the comparison of communication activity, it is ensured that the selection of secondary devices not only adapts to the hierarchical distribution of communication stability but also accurately identifies devices with better communication activity. This further optimizes the selection of core proxy nodes in the multi-level proxy communication architecture, effectively reduces the number of direct connections on the server side, and reduces server resource consumption and connection pressure. At the same time, it improves the carrying stability and data forwarding efficiency of the proxy architecture, reduces the risk of disconnection caused by network fluctuations or changes in device load, and significantly enhances the overall service reliability.

[0059] This application also provides a terminal device communication method in one example, such as Figure 6 As shown, the method further includes: Step 601: In response to detecting the disconnection of the primary device, a first communication request is sent to at least one terminal device that accessed through the primary device, so that the at least one terminal device disconnects its communication connection with the primary device and directly accesses the server.

[0060] If a first-level device is detected to have lost its connection with the server, a first communication request is sent to all terminal devices that access the server through the first device, enabling these terminal devices to disconnect from the first device and access the server directly instead of through the first device.

[0061] For example, such as Figure 5A In the distribution matrix shown, there are first devices A3, A5, A8, and A12. At this time, the server detects that the connection between first device A8 and the server is broken, and sends a first communication request to terminal devices A6 and A7. After receiving the first communication request, terminal devices A6 and A7 disconnect from first device A8 and establish a direct connection with the server.

[0062] Step 602: In response to detecting the disconnection of the secondary device, a second communication request is sent to at least one terminal device and at least one primary device that accessed through the secondary device, so that the at least one terminal device and the at least one primary device disconnect the communication connection with the second device and directly access the server.

[0063] If a secondary device is detected to have lost connection with the server, a second communication request is sent to all primary devices and all terminal devices that access the server through the secondary device, enabling these primary devices and terminal devices to disconnect from the secondary device and access the server directly instead of through the secondary device.

[0064] For example, such as Figure 5B In the distribution matrix shown, there are second devices A3, A8, and A12. At this time, the server detects that the connection between the second device A8 and the server is broken, and sends a second communication request to the first device A5 and terminal devices A4, A6, and A7. Upon receiving the first communication request, the first device A5 and terminal devices A4, A6, and A7 disconnect from the second device A8 and establish a direct connection with the server.

[0065] In the above scheme, when a disconnection is detected between a primary device and the server, a first communication request is sent to the terminal devices that accessed through that primary device, causing these terminal devices to disconnect from the primary device and directly access the server. When a disconnection is detected between a secondary device and the server, a second communication request is sent to both the terminal devices that accessed through the secondary device and the primary device, causing these terminal devices and the primary device to disconnect from the secondary device and directly access the server. This scheme can control the connection switching of terminal devices and lower-level proxy devices when a disconnection failure occurs at any level of proxy device, avoiding situations where the corresponding terminal devices cannot communicate with the server due to proxy device failure. This effectively improves the fault tolerance and fault resistance of the multi-level proxy communication architecture, further enhancing the overall service stability.

[0066] This application also provides a terminal device communication method in one example, such as Figure 7 As shown, the method further includes: Step 701: Collect communication data between the terminal device or the primary device and the server.

[0067] After a terminal device or primary device disconnects from its proxy device and directly connects to the server, the server continuously collects communication data from these terminal devices or primary devices.

[0068] Step 702: Update the target information based on the communication data.

[0069] The target information is updated based on the continuously collected communication data from these terminal devices or primary devices.

[0070] Step 703: Based on the updated target information, determine at least one primary device and / or at least one secondary device from the plurality of terminal devices.

[0071] The primary and / or secondary equipment are redefined based on the updated target information.

[0072] In the above scheme, after a terminal device or primary device disconnects from its proxy device and directly connects to the server, the server continuously collects communication data from these terminal devices or primary devices. Based on this communication data, the server updates the target information and re-determines the primary and / or secondary devices based on the updated target information. This allows for timely adaptation to changes in the communication architecture after a proxy device failure, ensuring that the target information remains consistent with the actual communication status of each device. It also ensures that the re-determined proxy devices at each level meet the performance requirements of the current communication scenario, effectively maintaining the rationality and optimization of the multi-level proxy communication architecture and further improving the robustness of the overall service.

[0073] To implement the above-mentioned terminal device communication method, such as Figure 8 As shown, an example of this application provides a terminal device communication apparatus, including: The acquisition module 801 is used to respond to the access of multiple terminal devices and obtain the communication data of the multiple terminal devices. Calculation module 802 is used to generate target information based on the communication data; the target information includes a distribution matrix of the multiple terminal devices; The processing module 803 is used to determine at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the target information; the primary device acts as a proxy for the terminal device to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0074] The acquisition module 801 is further configured to acquire communication data of the at least one primary device; the communication data of each primary device includes communication data of the terminal device accessing the primary device. The calculation module 802 is also used to update the target information based on the communication data.

[0075] The processing module 803 is further configured to determine at least one secondary device from the at least one primary device based on the target information, provided that the distribution matrix in the updated target information has not changed within a preset time.

[0076] The calculation module 802 is further configured to determine at least one terminal device from the plurality of terminal devices that has the same second communication information, wherein the second communication information characterizes the communication stability of the corresponding terminal device; The calculation module 802 is further configured to determine the terminal device with the largest first communication information among the at least one terminal device as the first-level device, wherein the first communication information represents the communication activity of the corresponding terminal device.

[0077] The calculation module 802 is further configured to traverse the primary device from low to high according to its second communication information; The processing module 803 is further configured to continue traversing if the first communication information of the current level device is greater than or equal to that of the previous level device, wherein the previous level device is the level device traversed in the previous traversal. The processing module 803 is further configured to determine the previous level device as the second level device when the first communication information of the current level device is less than that of the previous level device. The processing module 803 is also used to obtain the at least one secondary device after the traversal is completed.

[0078] The calculation module 802 is further configured to traverse the primary device from low to high according to its second communication information; The processing module 803 is further configured to, when it is determined that there is a target primary device for the current primary device, traverse to the target primary device, wherein the target primary device is the primary device whose first communication information is the largest within the second communication information range and is higher than the first communication information of the current primary device, and the second communication information range is determined based on the second communication information of the current primary device and a preset step size; The processing module 803 is further configured to determine the current primary device as the secondary device when it is determined that there is no target primary device for the current primary device; The processing module 803 is also used to obtain the at least one secondary device after the traversal is completed.

[0079] The processing module 803 is further configured to, in response to detecting the disconnection of the primary device, send a first communication request to at least one terminal device that has accessed through the primary device, so that the at least one terminal device disconnects its communication connection with the primary device and directly accesses the server. The processing module 803 is further configured to, in response to detecting the disconnection of the secondary device, send a second communication request to at least one terminal device and at least one primary device that accessed through the secondary device, so that the at least one terminal device and the at least one primary device disconnect the communication connection with the second device and directly access the server.

[0080] The acquisition module 801 is also used to acquire communication data between the terminal device or the primary device and the server. The calculation module 802 is further configured to update the target information based on the communication data; The processing module 803 is further configured to determine at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the updated target information.

[0081] This application provides an example of an electronic device, Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0082] like Figure 9 As shown, the electronic device 900 includes a communication interface 901 and a processor 902, which are electrically connected. The communication interface 901 responds to multiple terminal devices accessing the system and obtains the communication data from the multiple terminal devices. The processor 902 generates target information based on the communication data; the target information includes a distribution matrix of the plurality of terminal devices; and determines at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the target information; the primary device acts as a proxy for the terminal devices to access the network, and the secondary device acts as a proxy for the primary device to access the network.

[0083] The communication interface 901 obtains communication data from at least one primary device; the communication data of each primary device includes communication data from the terminal device accessing that primary device. The processor 902 updates the target information based on the communication data.

[0084] Wherein, if the processor 902 determines that the distribution matrix in the updated target information has not changed within a preset time, it determines at least one secondary device from the at least one primary device based on the target information.

[0085] Specifically, the processor 902 determines at least one terminal device from the plurality of terminal devices that has the same second communication information, wherein the second communication information characterizes the communication stability of the corresponding terminal device; and determines the terminal device with the largest first communication information among the at least one terminal device as the first-level device, wherein the first communication information characterizes the communication activity of the corresponding terminal device.

[0086] The processor 902 traverses the primary devices from low to high according to their second communication information; if the first communication information of the current primary device is greater than or equal to that of the previous primary device, the traversal continues, and the previous primary device is the primary device traversed in the previous traversal; if the first communication information of the current primary device is less than that of the previous primary device, the previous primary device is determined as the secondary device; and after the traversal is completed, the at least one secondary device is obtained.

[0087] Specifically, the processor 902 traverses the primary devices according to their second communication information from low to high; if a target primary device is determined to exist for the current primary device, the traversal proceeds to the target primary device, where the target primary device is the primary device with the largest first communication information within the second communication information range that is higher than the first communication information of the current primary device, and the second communication information range is determined based on the second communication information of the current primary device and a preset step size; if a target primary device is determined not to exist for the current primary device, the current primary device is identified as the secondary device; and after the traversal is completed, the at least one secondary device is obtained.

[0088] Specifically, in response to detecting a disconnection of the primary device, the communication interface 901 sends a first communication request to at least one terminal device that accesses through the primary device, so that the at least one terminal device disconnects its communication connection with the primary device and directly accesses the server; and in response to detecting a disconnection of the secondary device, it sends a second communication request to at least one terminal device and at least one primary device that accesses through the secondary device, so that the at least one terminal device and the at least one primary device disconnect their communication connection with the secondary device and directly access the server.

[0089] The communication interface 901 collects communication data between the terminal device or the primary device and the server. The processor 902 updates the target information based on the communication data; and determines at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the updated target information.

[0090] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0091] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0092] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0093] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0094] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0095] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0096] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0097] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.

[0098] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure 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 this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A communication method for a terminal device, the method comprising: In response to multiple terminal devices accessing the system, the system obtains the communication data of the multiple terminal devices. Target information is generated based on the communication data; The target information includes the distribution matrix of the multiple terminal devices; Based on the target information, at least one primary device and / or at least one secondary device are determined from the plurality of terminal devices; the primary device acts as a proxy for the terminal device to access the network, and the secondary device acts as a proxy for the primary device to access the network.

2. The method according to claim 1, wherein after determining at least one primary device from the plurality of terminal devices based on the target information, the method further comprises: Obtain communication data from the at least one primary device; The communication data of each primary device includes the communication data of the terminal devices connected to that primary device; The target information is updated based on the communication data.

3. The method according to claim 2, wherein after updating the target information based on the communication data, the method further includes: If the distribution matrix in the updated target information does not change within a preset time, at least one secondary device is determined from the at least one primary device based on the target information.

4. The method according to claim 1, wherein the target information further includes first communication information and second communication information, and the step of determining at least one primary device from the plurality of terminal devices based on the target information includes: From the plurality of terminal devices, at least one terminal device with the same second communication information is determined, wherein the second communication information characterizes the communication stability of the corresponding terminal device; The terminal device with the largest first communication information among the at least one terminal device is determined as the first-level device, and the first communication information represents the communication activity of the corresponding terminal device.

5. The method according to claim 3, wherein the target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: The primary devices are traversed from low to high according to their second communication information; If the first communication information of the current level device is greater than or equal to that of the previous level device, continue traversing. The previous level device is the level device traversed in the previous traversal. If the first communication information of the current level-one device is less than that of the previous level-one device, the previous level-one device is identified as the level-two device; After the traversal is completed, the at least one secondary device is obtained.

6. The method according to claim 3, wherein the target information further includes first communication information and second communication information, and the step of determining at least one secondary device from the at least one primary device based on the target information includes: The primary devices are traversed from low to high according to their second communication information; If it is determined that there is a target primary device for the current primary device, the process is traversed to the target primary device. The target primary device is the primary device whose first communication information is the largest within the second communication information range and is higher than the first communication information of the current primary device. The second communication information range is determined based on the second communication information of the current primary device and a preset step size. If it is determined that there is no target primary device for the current primary device, the current primary device is designated as the secondary device; After the traversal is completed, the at least one secondary device is obtained.

7. The method according to claim 1, further comprising: In response to detecting a disconnection of the primary device, a first communication request is sent to at least one terminal device that has accessed the network through the primary device, so that the at least one terminal device disconnects its communication connection with the primary device and directly accesses the server. In response to detecting the disconnection of the secondary device, a second communication request is sent to at least one terminal device and at least one primary device that accessed the network through the secondary device, so that the at least one terminal device and the at least one primary device disconnect the communication connection with the second device and directly access the server.

8. The method according to claim 7, further comprising: Collect communication data between the terminal device or the primary device and the server; The target information is updated based on the communication data; Based on the updated target information, at least one primary device and / or at least one secondary device are determined from the plurality of terminal devices.

9. A terminal device communication apparatus, the apparatus comprising: The acquisition module is used to respond to the access of multiple terminal devices and obtain the communication data of the multiple terminal devices; The calculation module is used to generate target information based on the communication data; The target information includes the distribution matrix of the multiple terminal devices; The processing module is configured to determine at least one primary device and / or at least one secondary device from the plurality of terminal devices based on the target information; the primary device acts as a proxy for the terminal devices to access the network, and the secondary device acts as a proxy for the primary device to access the network.

10. An electronic device, comprising: A communication interface and a processor, wherein the communication interface and the processor are electrically connected; The communication interface responds to multiple terminal devices accessing the system and obtains communication data from the multiple terminal devices. The processor generates target information based on the communication data; The target information includes the distribution matrix of the multiple terminal devices; And based on the target information, at least one primary device and / or at least one secondary device are determined from the plurality of terminal devices; the primary device acts as a proxy for the terminal device to access the network, and the secondary device acts as a proxy for the primary device to access the network.