Message interaction methods, devices, electronic devices and storage media

CN122579197APending Publication Date: 2026-08-14APUTURE IMAGING IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,由于网络环境的复杂性,当该代理节点与终端断开连接后,终端往往需要重新扫描代理节点,并与新的代理节点重新建立连接,导致业务控制长时间中断,使得消息交互效率较低

Benefits of technology

[0016] This embodiment of the application determines a first proxy node for sending messages from the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and each proxy node has a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node. The first message is sent to the corresponding target network node in the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool. Thus, by pre-creating a proxy node connection pool for the terminal in the mesh network based on at least one proxy node that has established a connection with the terminal and the proxy sessions created for the proxy nodes, a first proxy node for sending messages can be selected from the proxy node connection pool, and messages can be sent through the proxy session corresponding to the first proxy node. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the proxy node connection pool, achieving rapid switching and activation of the proxy node. This allows for rapid response to message interaction needs based on the new first proxy node, avoiding the problem of prolonged service control interruption due to rescanning and reconnection after the proxy node is disconnected from the terminal, effectively improving the message interaction efficiency in the mesh network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122579197A_ABST
    Figure CN122579197A_ABST
Patent Text Reader

Abstract

This application discloses a message interaction method, apparatus, electronic device, and storage medium. It involves determining a first proxy node for sending messages from a proxy node connection pool corresponding to a terminal in a target mesh network. The proxy node connection pool includes at least one proxy node connected to the terminal, and each proxy node has a corresponding proxy session. The method involves obtaining a first message to be sent by the terminal through the first proxy node; sending the first message to the corresponding target network node in the target mesh network through the proxy session corresponding to the first proxy node; and selecting a new first proxy node from the proxy node connection pool if an abnormal event is detected in the first proxy node. Therefore, by using a proxy node connection pool corresponding to the terminal in the mesh network, rapid switching and activation of proxy nodes can be achieved when the currently used proxy node becomes abnormal, effectively improving the message interaction efficiency in the mesh network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a message interaction method, apparatus, electronic device, and storage medium. Background Technology

[0002] When a terminal connects to a network such as a mesh network, it typically connects to a proxy node and sends and receives messages specific to that terminal through the proxy node. However, due to the complexity of the network environment, when the proxy node disconnects from the terminal, the terminal often needs to rescan for proxy nodes and re-establish a connection with a new proxy node, resulting in a prolonged interruption of service control and low message exchange efficiency. Summary of the Invention

[0003] This application provides a message interaction method, apparatus, electronic device, and storage medium, which can quickly switch and activate proxy nodes when the proxy node currently used by the terminal malfunctions, effectively improving the message interaction efficiency in the mesh network.

[0004] This application provides a message interaction method applied to a terminal, including: In the proxy node connection pool corresponding to the target mesh network, a first proxy node for sending messages is determined. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node; The first message is sent to the target network node in the target mesh network through the proxy session corresponding to the first proxy node; If an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool.

[0005] Accordingly, embodiments of this application also provide a message interaction device, applied to a terminal, comprising: The determining unit is used to determine a first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The acquisition unit is used to acquire the first message that the terminal needs to send through the first proxy node; The sending unit is used to send the first message to the target network node in the target mesh network through the proxy session corresponding to the first proxy node; The switching unit is used to select a new first proxy node from the proxy node connection pool when an abnormal event of the proxy node corresponding to the first proxy node is detected.

[0006] In one embodiment, the determining unit is configured to: Obtain the communication quality association parameters of each proxy node in the proxy node connection pool corresponding to the terminal in the target mesh network. The communication quality association parameters include at least one of broadcast signal strength and historical packet loss rate. Based on the communication quality correlation parameters, calculate the communication quality score corresponding to each of the agent nodes; The first proxy node is determined from the proxy node connection pool based on the communication quality score.

[0007] In one embodiment, a determining unit is configured to: Upon receiving a message sending request for the first message, the terminal determines a first proxy node from the proxy node connection pool corresponding to the target mesh network for sending the first message. The message interaction device is also used for: The first message is sent to the target network node in the target mesh network through the proxy session corresponding to the new first proxy node.

[0008] In one embodiment, the process of determining the first proxy node for sending the first message from the proxy node connection pool corresponding to the target mesh network by the terminal is specifically used for: Obtain the topological feature information of each proxy node in the proxy node connection pool relative to the target network node in the target mesh network, wherein the target network node is the network node that receives the first message; Based on the topology feature information, a first proxy node for sending the first message is selected from the proxy node connection pool; The topology feature information includes at least one of the topology distance between the proxy node and the target network node, and the estimated number of hops from the proxy node to the target network node.

[0009] In one embodiment, the message interaction device is further configured to: When the terminal accesses the target mesh network, the system scans the connectable proxy nodes in the target mesh network according to a preset first number of proxy nodes, and establishes connections with the proxy nodes. Create a corresponding proxy session for the proxy node after the connection is established, and assign a corresponding session identifier to the proxy session; Based on the session identifier, the proxy node is added to the proxy node connection pool.

[0010] In one embodiment, the message interaction device is further configured to: If the number of proxy nodes in the proxy node connection pool is less than the preset second number of proxy nodes, the terminal is triggered to scan for a third connectable proxy node in the target mesh network. Establish a connection with the third proxy node, create a corresponding proxy session for the third proxy node after the connection is established, and assign a session identifier to the proxy session corresponding to the third proxy node; Based on the session identifier corresponding to the third proxy node, the third proxy node is added to the proxy node connection pool, and new proxy nodes are added continuously until the preset stopping condition is met.

[0011] In one embodiment, the message interaction device further includes a receiving unit, configured to: The terminal receives a second message sent by other network nodes in the target mesh network through a second proxy node in the proxy node connection pool, excluding the first proxy node.

[0012] In one embodiment, the message interaction device is further configured to: The terminal acquires monitoring information of network nodes in the target mesh network, and updates the operating status information of the network nodes based on the monitoring information. The operating status information includes at least one of recent active time, offline status, and online status. The terminal sends a status read request to a specific network node that meets the preset status feedback conditions, so that the specific network node returns a status message based on the status read request, and updates the operating status information of the specific network node based on the status message.

[0013] Furthermore, embodiments of this application also provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the message interaction methods provided in embodiments of this application.

[0014] Furthermore, embodiments of this application also provide a computer-readable storage medium including a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of any of the message interaction methods provided in embodiments of this application.

[0015] Furthermore, embodiments of this application also provide a computer program product, including a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any of the message interaction methods provided in embodiments of this application.

[0016] This embodiment of the application determines a first proxy node for sending messages from the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and each proxy node has a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node. The first message is sent to the corresponding target network node in the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool. Thus, by pre-creating a proxy node connection pool for the terminal in the mesh network based on at least one proxy node that has established a connection with the terminal and the proxy sessions created for the proxy nodes, a first proxy node for sending messages can be selected from the proxy node connection pool, and messages can be sent through the proxy session corresponding to the first proxy node. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the proxy node connection pool, achieving rapid switching and activation of the proxy node. This allows for rapid response to message interaction needs based on the new first proxy node, avoiding the problem of prolonged service control interruption due to rescanning and reconnection after the proxy node is disconnected from the terminal, effectively improving the message interaction efficiency in the mesh network. Attached Figure Description

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

[0018] Figure 1 This is a schematic diagram illustrating an implementation scenario of a message interaction method provided in this application embodiment; Figure 2 This is a flowchart illustrating a message interaction method provided in an embodiment of this application; Figure 3a This is a schematic diagram of the specific architecture of a message interaction method provided in the embodiments of this application; Figure 3b This is a schematic diagram of a message interaction method provided in the embodiments of this application; Figure 3c This is a timing diagram of a message interaction method provided in an embodiment of this application; Figure 3d This is another specific flowchart illustrating a message interaction method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the message interaction device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0019] The technical solutions of 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.

[0020] Furthermore, in the description of the embodiments of this application, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0021] In some message exchange methods, when a terminal accesses a network such as a mesh network, it typically connects to a proxy node and sends and receives messages for that terminal through the proxy node. However, when the proxy node disconnects from the terminal, the terminal often needs to rescan for proxy nodes and re-establish a connection with a new proxy node, resulting in a prolonged interruption of business control and low message exchange efficiency.

[0022] To address the aforementioned technical issues, this application provides a message interaction method. By pre-establishing a connection pool of proxy nodes in the mesh network based on at least one proxy node connected to the terminal and a proxy session created for that proxy node, a first proxy node for sending messages can be selected from the connection pool. Messages are then sent through the proxy session corresponding to the first proxy node. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the connection pool, enabling rapid switching and activation of the proxy node. This allows for quick response to message interaction needs based on the new first proxy node, avoiding the problem of prolonged service control interruption due to rescanning and reconnection after the proxy node loses connection with the terminal. This effectively improves the message interaction efficiency in the mesh network.

[0023] This application provides a message interaction method, apparatus, electronic device, and storage medium. The message interaction apparatus can be integrated into an electronic device, which may be a server or a terminal, etc.

[0024] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can include, but is not limited to, mobile phones, computers, tablets, smart voice interaction devices, smart home appliances, smart projection devices, vehicle terminals, and aircraft. The terminal and server can be directly or indirectly connected via wired or wireless communication; this application does not impose any restrictions on this connection.

[0025] Please see Figure 1 Taking the integration of messaging devices into electronic devices as an example, Figure 1 This is a schematic diagram of an implementation scenario for the message interaction method provided in this application. The electronic device can be a terminal. The electronic device can determine a first proxy node for sending messages from the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The device obtains the first message to be sent by the terminal through the first proxy node. The device sends the first message to the target network node corresponding to the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event of the proxy node corresponding to the first proxy node is detected, a new first proxy node is selected from the proxy node connection pool.

[0026] It should be noted that, Figure 1 The illustrated scenario of the message interaction method is merely an example. The implementation environment of the message interaction method described in this application is intended to more clearly illustrate the technical solutions of this application and does not constitute a limitation on the technical solutions provided in this application. Those skilled in the art will recognize that, with the evolution of proxy connections and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.

[0027] The solutions provided in this application are specifically illustrated through the following embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0028] This embodiment will be described from the perspective of a message interaction device, which can be integrated into an electronic device, such as a server or a terminal, and this application does not impose any restrictions on it.

[0029] Please see Figure 2 , Figure 2 This is a flowchart illustrating the message interaction method provided in an embodiment of this application. The message interaction method is applied to a terminal and includes: In step 101, a first proxy node for sending messages is determined from the proxy node connection pool corresponding to the target mesh network.

[0030] The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node can create a corresponding proxy session.

[0031] The target mesh network can be the mesh network accessed by the terminal. A mesh network, also known as a wireless mesh network, is a type of wireless network based on multi-hop interconnection. A mesh network can include various types of network nodes, such as proxy nodes, relay nodes, edge nodes, and low-power nodes. The proxy node connects the terminal to the mesh network and acts as a routing gateway within the mesh network, responsible for network access and data forwarding. The proxy session refers to a session created for the proxy node, providing it with a message sending and receiving channel to interact with other network nodes in the target mesh network. The proxy node connection pool can be a collection of data established based on at least one proxy node connected to the terminal. For example, the proxy node connection pool can include the node identifier of at least one proxy node connected to the terminal, the proxy session corresponding to the proxy node, and the proxy session corresponding to the at least one proxy node connected to the terminal. The first proxy node can be the proxy node currently used to send messages in the proxy node connection pool, also known as the sending proxy.

[0032] There are several ways to determine the first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. For example, the communication quality association parameters of each proxy node in the proxy node connection pool corresponding to the target mesh network can be obtained; based on the communication quality association parameters, the communication quality score of each proxy node can be calculated; and the first proxy node can be determined in the proxy node connection pool based on the communication quality score.

[0033] Among them, the communication quality-related parameters include at least one of broadcast signal strength and historical packet loss rate.

[0034] The communication quality correlation parameter can be a parameter related to the communication quality of the proxy node, and can be used to evaluate the link communication quality of the proxy node. The broadcast signal strength can be used to describe the signal strength of the broadcast signal emitted by the proxy node. The historical packet loss rate can be the packet loss rate of the proxy node in the historical message sending and receiving process.

[0035] There are several ways to calculate the communication quality score of each agent node based on the communication quality association parameter. For example, when the communication quality association parameter includes one parameter, a corresponding communication quality score can be set for each value range of the communication quality score. Thus, the communication quality score of each agent node can be determined according to the range in which the communication quality association parameter of each agent node is located.

[0036] Optionally, when the communication quality associated parameters include multiple parameters, a corresponding weight can be set for each communication quality associated parameter. This allows for a weighted summation of the communication quality associated parameters of each agent node based on the weights, resulting in a communication quality score for each agent node.

[0037] For example, suppose the communication quality correlation parameters include broadcast signal strength and historical packet loss rate. We can also assume that the broadcast signal strength of a proxy node is A, the historical packet loss rate is B, and that the weight corresponding to the broadcast signal strength is 'a', and the weight corresponding to the historical packet loss rate is 'b'. The weights a and b can be positive or negative, and their specific values ​​can be determined based on whether the communication quality correlation parameters are positively or negatively correlated with communication quality. If positively correlated, the weights can be set to positive values; if negatively correlated, the weights can be set to negative values, and so on. Therefore, we can perform a weighted summation of the communication quality correlation parameters for the proxy node based on these weights to obtain the communication quality score for that proxy node as a×A + b×B.

[0038] After calculating the communication quality score for each proxy node based on the communication quality correlation parameters, the first proxy node can be determined from the proxy node connection pool based on the communication quality score. There are several ways to determine the first proxy node from the proxy node connection pool based on the communication quality score; for example, the proxy node with the highest communication quality score in the proxy node connection pool can be determined as the first proxy node.

[0039] Optionally, the terminal can dynamically select the first proxy node from the proxy node connection pool each time it needs to send a message to the target mesh network. This allows it to perceive and utilize the current optimal communication link in real time, effectively avoiding communication interruptions caused by signal fluctuations or failures of a single proxy node. Simultaneously, it enables load balancing among multiple proxy nodes, avoiding single-point congestion and significantly improving the terminal's success rate, real-time performance, and overall robustness in transmitting control messages to the Mesh network.

[0040] The step of determining the first proxy node for sending the message in the proxy node connection pool corresponding to the target mesh network may include: upon receiving a message sending request for the first message, the terminal determines the first proxy node for sending the first message in the proxy node connection pool corresponding to the target mesh network.

[0041] The first message can be a message that the terminal needs to send to a target network node. This target network node can be a network node in the target mesh network, used to receive the first message sent by the terminal. The message sending request can be a request to send the first message to the target network node.

[0042] There are several ways to determine the first proxy node for sending the first message from the proxy node connection pool corresponding to the target mesh network. For example, the topological feature information of each proxy node in the proxy node connection pool relative to the target network node in the target mesh network can be obtained, where the target network node is the network node receiving the first message; based on the topological feature information, the first proxy node for sending the first message can be selected from the proxy node connection pool.

[0043] The topology feature information describes the relative positional relationship or connectivity between the proxy node and the target network node within the target mesh network. For example, this topology feature information may include at least one of the topological distance between the proxy node and the target network node, or the estimated number of hops required for the proxy node to reach the target network node. The topological distance can be the distance between the proxy node and the target network node in the network topology and can be used to describe the distance between them. The estimated number of hops can refer to the number of hops required for a data packet to travel from the proxy node to the target network node; for example, it can refer to the number of relay nodes a data packet needs to pass through to reach the target network node.

[0044] There are several ways to select the first proxy node for sending the first message from the proxy node connection pool based on topology feature information. For example, the proxy node with the shortest topology distance or the fewest estimated route hops in the proxy node connection pool can be determined as the first proxy node.

[0045] Optionally, the terminal can send messages to the target mesh network through a single agent node and receive messages from the target mesh network through multiple agent nodes. This message interaction mechanism, in which a single sending agent and multiple receiving agents work together, can effectively reduce resource contention when the message interaction processes such as sending and receiving packets share a single link, thereby improving the success rate and accuracy of message interaction.

[0046] For example, a second message sent to the terminal by other network nodes in the target mesh network can be received through a second proxy node in the proxy node connection pool, other than the first proxy node.

[0047] The second proxy node can be a proxy node used to receive messages, or it can be called a receiving proxy. The second message can be a message sent by a network node in the target mesh network to the terminal.

[0048] In one embodiment, there are several ways to create a proxy node connection pool for the terminal in the target mesh network. For example, when the terminal accesses the target mesh network, it can scan the connectable proxy nodes in the target mesh network according to a preset first number of proxy nodes, and establish connections with the proxy nodes; create corresponding proxy sessions for the proxy nodes after the connection is established, and assign corresponding session identifiers to the proxy sessions; and add the proxy nodes to the proxy node connection pool based on the session identifiers.

[0049] The number of first proxy nodes can be the number of proxy nodes included in the proxy node connection pool. The session identifier can be information indicating the proxy session of the proxy node and can be used to uniquely identify a proxy session. For example, the session identifier can be a handle to the proxy session.

[0050] For example, after a terminal connects to a target mesh network, it can first set connection management parameters such as the number of initial proxy nodes, scan timeout duration, connection timeout duration, automatic retry switch, maximum number of retries, and retry interval. Then, the terminal can scan for connectable proxy nodes in the target mesh network, establish independent proxy sessions for proxy nodes not yet added to the proxy node connection pool, assign a unique handle to each proxy session, and add the proxy session to the terminal's corresponding proxy node connection pool.

[0051] In the target mesh network, whenever a terminal establishes a connection with a proxy node, a session instance uniquely corresponding to that proxy node can be created. This session instance can include at least a handle to the proxy session, a dedicated message sending and receiving channel for the proxy node, a receiving execution unit, a lifecycle state, and a link evaluation state. The message sending and receiving channel can be a channel used for sending and receiving messages. The receiving execution unit can be a unit used for receiving and processing messages. The lifecycle state can be information describing the state of the proxy session. The link evaluation state can be information evaluating the communication quality of the proxy node's session link. Then, the session instances of each proxy node can be added to the proxy node connection pool. The proxy manager dynamically selects the first proxy node's proxy session for sending messages based on the proxy node's corresponding communication quality score and a preset failover policy, while maintaining continuous reception for other proxy sessions. This achieves single-proxy sending and multi-proxy parallel access, isolates single-proxy session failures, and enables rapid switching and activation of sending paths, improving the message interaction efficiency of the mesh network.

[0052] In one specific embodiment, after the proxy node successfully establishes a connection with the terminal, a dedicated proxy session object can be created. This proxy session object can be bound only to the underlying link of the proxy node, such as the proxy channel, and does not reuse the same send / receive context with other proxy nodes. Then, the proxy session object can be instantiated to obtain a session instance of the proxy session. The proxy channel in the Mesh network can refer to the logical channel for relaying messages between non-Mesh devices (such as mobile phones) and the Mesh network, with protocol conversion implemented by the proxy node.

[0053] In step 102, the first message that the terminal needs to send is obtained through the first proxy node.

[0054] The first message can be a message that the terminal needs to send to the target mesh network. The message sending request can be a request to send the first message to the target network node.

[0055] There are several ways to obtain the first message that the terminal needs to send through the first agent node. For example, the terminal can store the first message that needs to be sent in a specified storage space, so that the first agent node can obtain the first message in the specified storage space and send it.

[0056] For example, the terminal can write the encapsulated first message data packet into the proxy service provided by the first proxy node as the feature value of the data input port (Mesh Proxy Data In). Then, the first proxy node can receive the data written through Mesh Proxy Data In, thereby obtaining the first message that the terminal needs to send.

[0057] In step 103, the first message is sent to the target network node in the target mesh network through the proxy session corresponding to the first proxy node.

[0058] The target network node can be a network node in the target mesh network or the receiver of the first message.

[0059] Since the proxy session corresponding to the first proxy node is created and maintained when the first proxy node is added to the proxy node connection pool, after the first proxy node for sending messages is determined, the first message can be quickly and directly sent to the corresponding target network node in the target mesh network through the proxy session of the first proxy node, thereby improving the message sending rate.

[0060] In step 104, if an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool.

[0061] Among them, the abnormal event of the agent node can be an event that indicates that the first agent node has an abnormality.

[0062] For example, the abnormal event of the proxy node may include, but is not limited to, at least one of the following events: The first agent node lost its communication connection with the terminal; The first proxy node was actively removed by the user; The message transmission for the first proxy node is shut down.

[0063] Optionally, when the terminal needs to select the first proxy node for sending messages from the proxy node connection pool before each message is sent, the proxy node exception event may also include the end of the session stream for the first message.

[0064] In one embodiment, if the first message has not yet been successfully sent to the target network node, the first message can be sent to the target network node in the target mesh network through the proxy session corresponding to the new first proxy node.

[0065] In one embodiment, when the number of proxy nodes in the proxy node connection pool is lower than a preset number, the scanning, retry, and connection process can be retried to add new proxy nodes to the proxy node connection pool.

[0066] Optionally, if the number of proxy nodes in the proxy node connection pool is less than the preset number of second proxy nodes, the terminal is triggered to scan for connectable third proxy nodes in the target mesh network; a connection is established with the third proxy node, and a corresponding proxy session is created for the third proxy node after the connection is established, and a session identifier is assigned to the proxy session corresponding to the third proxy node; based on the session identifier corresponding to the third proxy node, the third proxy node is added to the proxy node connection pool, and new proxy nodes are added until the preset stopping condition is met.

[0067] The second number of proxy nodes can be a preset threshold for the number of proxy nodes. When the number of proxy nodes in the proxy node connection pool is less than this threshold, it indicates that there are too few proxy nodes in the connection pool and they need to be added. The preset stopping condition can be a condition for stopping the addition of new proxy nodes to the proxy node connection pool. For example, it can include that the number of proxy nodes in the connection pool is not less than the number of first proxy nodes, or that there are no other connectable proxy nodes in the target mesh network.

[0068] Optionally, the terminal can maintain the status of network nodes in the target mesh network for management and maintenance purposes. For example, the terminal can acquire monitoring information of network nodes in the target mesh network and update the operational status information of the network nodes based on the monitoring information; the terminal can also send a status read request to a specific network node that meets preset status feedback conditions, so that the specific network node returns a status message based on the status read request, and the operational status information of the specific network node is updated based on the status message.

[0069] The operational status information can describe the operational status of a network node. This operational status information may include at least one of the following: recent active time, offline status, and online status. The monitoring information can be information used to monitor network nodes; for example, it may include information proactively fed back to the terminal by a proxy node when it receives status messages, service responses, or other valid messages sent to the terminal from other network nodes. The preset status feedback condition may refer to a condition where the status is not proactively reported, and the specific network node may be a network node that has not proactively reported its status. For a specific network node, the terminal can obtain its status through proactive probing. The status read request may be a request to obtain the status of a specific network node. The status message may be a message fed back by a specific network node describing its operational status.

[0070] For example, when any proxy node receives a status message, service response packet, or other valid inbound message from a network node, the terminal can update the network node's most recent active time. When a network node does not generate any valid activity within a set timeout window, the terminal can mark it as offline. For network nodes already in the proxy node connection pool, they can be directly marked as online.

[0071] For non-agent nodes that do not actively report their status, the terminal can actively probe these nodes by sending lightweight status read requests in a round-robin fashion. To avoid resource contention caused by active probing sharing the write channel with the terminal's foreground service transmission, the terminal can pause active probing during foreground service transmission and resume it from the original polling position after transmission is completed. The results obtained from active probing and inbound reception can be written into the unified runtime model. This unified runtime model can be a data structure used to maintain the runtime status and related information of network nodes. It can be used to maintain information such as the agent node connection pool, the mapping between session handles and agent node addresses, node runtime status, sequence number, initialization vector index (IV index), and key refresh phase.

[0072] In one specific embodiment, please refer to Figure 3a , Figure 3a This is a schematic diagram of the specific architecture of a message interaction method provided in this application embodiment. The terminal can be deployed with a connection establishment and session management module and a runtime maintenance module. The connection establishment and session management module manages the entry of proxy nodes into the pool, obtaining the proxy node connection pool corresponding to the terminal in a single target mesh network. The terminal and proxy nodes interact based on a unified Mesh protocol stack. The target mesh network can include proxy nodes such as Proxy 1 and Proxy 2, and network nodes such as Node A, Node B, and Node C. The proxy node connection pool aggregates proxy sessions of multiple proxy nodes. Within the proxy node connection pool, a single proxy node can be designated as a sending proxy for sending outbound messages, and other proxy nodes can be designated as receiving proxies, with multiple proxy nodes used to receive inbound messages in parallel. For example, the proxy node connection pool can include receiving proxy A, receiving proxy B, ..., receiving proxy N. The runtime maintenance module is responsible for tasks such as runtime synchronization of network nodes, updating and displaying the online view based on the runtime status of network nodes in the target mesh network, and maintaining the mapping between proxy sessions and proxy nodes.

[0073] In one specific embodiment, please refer to Figure 3b , Figure 3bThis is a schematic diagram illustrating a specific process of a message interaction method provided in this application embodiment. After the terminal loads the current target mesh network, it can scan devices broadcasting proxy services according to a preset first number of proxy nodes, scan timeout, connection timeout, and retry policy to sequentially establish connections with multiple proxy nodes in the target mesh network. Specifically, it can determine whether a connectable proxy node has been found; if not, it waits; if so, it determines whether the proxy node is already in the proxy node connection pool. If so, it skips to avoid duplicate connections; if not, it establishes a proxy session, assigns a handle, adds it to the proxy node connection pool, and configures it. If the current sending proxy is empty, the currently added proxy node can be set as the sending proxy. Next, it can determine whether the number of proxy nodes in the proxy node connection pool has reached the first number of proxy nodes; if so, automatic connection ends; if not, it continues scanning and connecting, or retryes to replenish the required proxy nodes. For each proxy connection established, an independent proxy session can be created and a session handle assigned, and then the proxy node's proxy session can be added to the proxy node connection pool. For example, the first proxy node to join the proxy node connection pool can be designated as the current sending proxy, while the remaining proxy nodes remain in the pool and participate in inbound message reception. When establishing a new proxy connection subsequently, only the handle and status of its proxy session are registered; the existing sending path is not changed, unless the current sending proxy has become invalid.

[0074] In one specific embodiment, please refer to Figure 3c , Figure 3c This is a timing diagram illustrating a message interaction method provided in this application embodiment. When the upper-layer service sends Mesh control messages or configuration messages, the terminal can send messages through the current first proxy node and receive status / acknowledgement (ACK) packets from the first proxy node. The remaining second proxy nodes continue to be responsible for receiving inbound messages. If the current first proxy node experiences link jitter such as Bluetooth disconnection, session stream termination, bearer shutdown, or being actively removed by the user, the terminal can immediately select a new first proxy node from the remaining second proxy nodes to ensure that the outbound link is not interrupted. Unlike the traditional method where a single proxy simultaneously undertakes sending, receiving, and probing tasks, this application embodiment concentrates the sending responsibility on the current first proxy node and keeps multiple second proxy nodes as receiving proxies, thereby forming a collaborative structure where a single sending path and multiple receiving paths coexist, reducing the contention for sending and receiving resources on the same link.

[0075] Optionally, the system can check if the number of proxy nodes in the proxy node connection pool is insufficient. If the number of proxy nodes in the connection pool is lower than the second-highest number of proxy nodes, the terminal can re-enter the scanning, matching, and connection process to establish connections with proxy nodes that have not yet been added to the connection pool and replenish them, thus completing the required number of proxy nodes. During this replenishment process, the terminal retains the connections of the already established proxy nodes and continues to replenish them according to the preset retry interval and maximum number of retries until the number of proxy nodes is restored to the first-highest number or other stopping conditions are met. After replenishment, the proxy node connection pool can be restored with a safety margin to ensure the continuous availability of services.

[0076] In one specific embodiment, please refer to Figure 3d , Figure 3d This is another specific flowchart illustrating a message interaction method provided in this application embodiment. The terminal can receive inbound status messages, heartbeats, service messages, etc., reported by proxy nodes, refresh the recent active time of network nodes in the target mesh network, synchronize information such as Sequence Number (Seq) / IV Index / key phase, calculate whether network nodes are online, and manage them accordingly by notifying the upper-layer user interface (UI), logs, or diagnostic modules based on node status. Furthermore, the terminal can trigger an active probing timer. Probing is paused when foreground service transmission is in progress, and can continue probing and select the next batch of non-proxy nodes for active probing when foreground service transmission is not in progress. If the terminal does not receive a status message from a non-proxy node, it can accumulate timeout and wait. If the terminal receives a status message from a non-proxy node, it can refresh the recent active time of that node. After updating the node's running status, it can be displayed in a unified online view for processing and maintenance by relevant administrators.

[0077] Taking lighting control as an example, when a user sends a control command message on the terminal interface, the terminal first determines the current first proxy node, and then sends the control command through the first proxy node. Multiple second proxy nodes continue to listen for device response packets in parallel. If the current first proxy node fails during the control process, the terminal can immediately switch to a backup second proxy node to continue sending, without having to go through the entire process of scanning, discovering, and establishing a connection again to restore service. When the device returns a status message, the terminal can refresh the most recent active time of the corresponding node and synchronize its running state. If the number of proxy nodes in the proxy node connection pool is lower than the number of second proxy nodes, the background continues to execute the proxy node completion process. Thus, this embodiment integrates multiple proxy connection pools, sending path switching, connection completion, online detection, and running state synchronization into a terminal-side connection management mechanism for a single Mesh network, improving connection stability, service continuity, and state observability in complex field environments without changing the Mesh basic protocol.

[0078] In current Mesh network-based message interaction methods, when a terminal accesses a Mesh network, it typically still uses a single proxy node to connect and send and receive messages through that single proxy for an extended period. When the mesh network is large, the proxy nodes are scattered, or there are obstructions, interference, or link fluctuations in the field, existing single-proxy connection solutions still have some problems: the single connection sending path is fragile. After the current proxy node is disconnected, the terminal often needs to rescan, re-identify, and re-establish the connection, resulting in a long interruption of service control; the sharing of a single link for sending, receiving, and probing leads to contention. When the same proxy node undertakes service sending, status packet reception, and online probing at the same time, it is easy to generate write channel contention and response jitter; multiple available proxy nodes in the network are not used in a coordinated manner. Even if there are multiple connectable proxy nodes in the same network, traditional solutions are difficult to organize these proxies into a proxy node connection pool with redundancy capabilities; there is a lack of connection pool-level redundancy recovery. Existing solutions usually only perform single connection reconnection instead of continuously maintaining multiple connected proxy nodes, which cannot achieve rapid switching and connection replenishment; the upper layer lacks runtime awareness. The set of connectable proxies, node online status, sequence number, IV Index, and key phase, etc., are not uniformly maintained, resulting in insufficient basis for diagnosis and control decisions.

[0079] To address this, this application provides a connection management method that maintains multiple proxy connections for a single Mesh network on the terminal side, and performs sending selection, failover, connection replenishment, and runtime maintenance among these multiple proxy connections. This method extends the traditional single-proxy access method to a multi-proxy connection management mechanism for a single target Mesh network on the terminal side without modifying the Mesh underlying protocol stack. Through this mechanism, the terminal can maintain a proxy node connection pool within the same network, continue outbound capability when the current sending proxy fails, automatically replenish connections when the number of proxy nodes in the connection pool decreases, and synchronize node online status and network runtime with upper-layer services. This allows multiple active proxy connections to be maintained within the same network, shortening service interruption time after the current sending proxy fails. Furthermore, by having a single sending proxy and multiple receiving proxies work together, resource contention when sending, receiving, and online probing share a single link can be reduced. Connection pool-level failover and automatic completion can improve continuous control capabilities in complex deployment environments and link fluctuation scenarios. By utilizing multiple proxy nodes distributed in different locations within the same network, the stability and redundancy of a single network access plane can be improved. A unified runtime model can provide more direct connection status and node online information to the upper-layer UI, log, and diagnostic modules.

[0080] As described above, this embodiment of the application determines a first proxy node for sending messages from the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and each proxy node has a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node. The first message is sent to the corresponding target network node in the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool. Thus, by pre-creating a proxy node connection pool for the terminal in the mesh network based on at least one proxy node that has established a connection with the terminal and the proxy sessions created for the proxy nodes, a first proxy node for sending messages can be selected from the proxy node connection pool, and messages can be sent through the proxy session corresponding to the first proxy node. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the proxy node connection pool, achieving rapid switching and activation of the proxy node. This allows for rapid response to message interaction needs based on the new first proxy node, avoiding the problem of prolonged service control interruption due to rescanning and reconnection after the proxy node and terminal are disconnected, effectively improving the message interaction efficiency in the mesh network.

[0081] To better implement the above methods, embodiments of the present invention also provide a message interaction device, which can be integrated into an electronic device, which can be a terminal.

[0082] For example, such as Figure 4 The diagram shown is a schematic representation of the message interaction device provided in this application embodiment. This message interaction device can be applied to a terminal and includes a determining unit 201, an acquiring unit 202, a sending unit 203, and a switching unit 204, as follows: The determining unit 201 is used to determine the first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal and the proxy node has created a corresponding proxy session. Acquisition unit 202 is used to acquire the first message that the terminal needs to send through the first proxy node; The sending unit 203 is used to send the first message to the corresponding target network node in the target mesh network through the proxy session corresponding to the first proxy node; The switching unit 204 is used to select a new first proxy node from the proxy node connection pool when an abnormal event of the proxy node corresponding to the first proxy node is detected.

[0083] In one embodiment, a determining unit is configured to: Obtain the communication quality correlation parameters of each proxy node in the proxy node connection pool corresponding to the target mesh network. The communication quality correlation parameters include at least one of broadcast signal strength and historical packet loss rate. Based on communication quality correlation parameters, calculate the communication quality score for each agent node; The first proxy node is determined from the proxy node connection pool based on the communication quality score.

[0084] In one embodiment, a determining unit is configured to: Upon receiving a message sending request for the first message, the terminal determines the first proxy node for sending the first message from the proxy node connection pool corresponding to the target mesh network. The messaging device is also used for: The first message is sent to the target network node in the target mesh network through the proxy session corresponding to the new first proxy node.

[0085] In one embodiment, the process of the terminal determining a first proxy node for sending the first message from the proxy node connection pool corresponding to the target mesh network is specifically used for: Obtain the topological characteristics of each proxy node in the proxy node connection pool relative to the target network node in the target mesh network. The target network node is the network node that receives the first message. Based on topology feature information, the first proxy node for sending the first message is selected from the proxy node connection pool. The topology feature information includes at least one of the following: the topology distance between the proxy node and the target network node, and the estimated number of hops from the proxy node to the target network node.

[0086] In one embodiment, the message interaction device is further configured to: When the terminal accesses the target mesh network, the system scans the connectable proxy nodes in the target mesh network according to the preset first number of proxy nodes, and establishes connections with the proxy nodes. Create a corresponding proxy session for the proxy node after the connection is established, and assign a corresponding session identifier to the proxy session; Based on the session identifier, the proxy node is added to the proxy node connection pool.

[0087] In one embodiment, the message interaction device is further configured to: If the number of proxy nodes in the proxy node connection pool is less than the preset number of second proxy nodes, the terminal is triggered to scan for a third proxy node that can be connected in the target mesh network. Establish a connection with the third proxy node, create a corresponding proxy session for the third proxy node after the connection is established, and assign a session identifier to the proxy session corresponding to the third proxy node; Based on the session identifier corresponding to the third proxy node, the third proxy node is added to the proxy node connection pool, and new proxy nodes are added continuously until the preset stopping condition is met.

[0088] In one embodiment, the message interaction device further includes a receiving unit, configured to: The terminal receives the second message sent by other network nodes in the target mesh network through the second proxy node in the proxy node connection pool, excluding the first proxy node.

[0089] In one embodiment, the message interaction device is further configured to: The monitoring information of network nodes in the target mesh network is obtained through the terminal, and the running status information of the network nodes is updated based on the monitoring information. The running status information includes at least one of the following: recent active time, offline status, and online status. The terminal sends a status read request to a specific network node that meets the preset status feedback conditions, so that the specific network node returns a status message based on the status read request, and updates the operating status information of the specific network node based on the status message.

[0090] As can be seen from the above, in this embodiment of the application, the determining unit 201 determines a first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The obtaining unit 202 obtains the first message that the terminal needs to send through the first proxy node. The sending unit 203 sends the first message to the target network node corresponding to the target mesh network through the proxy session corresponding to the first proxy node. The switching unit 204 selects a new first proxy node in the proxy node connection pool when an abnormal event of the proxy node corresponding to the first proxy node is detected. In this way, by pre-establishing a connection between at least one proxy node and the terminal, and by creating a proxy session for the proxy node, a proxy node connection pool is created for the terminal in the mesh network. This allows the terminal to select a first proxy node from the proxy node connection pool to send messages, and send messages through the proxy session corresponding to the first proxy node. Even if the first proxy node fails, a new first proxy node can be quickly selected from the proxy node connection pool, enabling rapid switching and activation of proxy nodes. This allows for quick response to message interaction needs based on the new first proxy node, avoiding the problem of long-term interruption of business control due to rescanning and reconnection after the proxy node is disconnected from the terminal. This effectively improves the message interaction efficiency in the mesh network.

[0091] Accordingly, this application also provides an electronic device, which can be a terminal, such as a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), etc. Alternatively, the electronic device can be a server.

[0092] like Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0093] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 through various interfaces and lines. By running or loading software programs and / or units stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device 300 and processes data. The processor 301 may be a CPU, GPU, network processor (NP), etc., and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0094] In this embodiment, the processor 301 in the electronic device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to realize various functions, such as: In the proxy node connection pool corresponding to the target mesh network, a first proxy node for sending messages is determined. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal and the proxy node has created a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node. The first message is sent to the target network node corresponding to the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event of the proxy node corresponding to the first proxy node is detected, a new first proxy node is selected from the proxy node connection pool.

[0095] This solution identifies a first proxy node for sending messages from a proxy node connection pool corresponding to the target mesh network. This pool includes at least one proxy node connected to the terminal, with each node having a corresponding proxy session. The solution obtains the first message the terminal needs to send from the first proxy node and sends it to the corresponding target network node in the mesh network via the proxy session. If an abnormal event is detected with the first proxy node, a new first proxy node is selected from the connection pool. By pre-establishing a connection pool for the terminal within the mesh network based on at least one proxy node connected to the terminal and the proxy sessions created for it, the solution allows for the selection of a first proxy node for sending messages. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the connection pool, enabling rapid switching and activation of the proxy node. This allows for quick response to message interaction needs based on the new first proxy node, avoiding prolonged service control interruptions caused by rescanning and reconnection after a proxy node disconnects from the terminal. This effectively improves message interaction efficiency within the mesh network.

[0096] Furthermore, the various functions implemented by running the application stored in memory 302 can also be found in the description of the foregoing embodiments, and will not be repeated here.

[0097] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0098] Optional, such as Figure 5 As shown, the electronic device 300 also includes: a touch display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0099] The touch display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and display panel can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.

[0100] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.

[0101] Audio circuitry 305 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and then processed by processor 301 before being transmitted via radio frequency circuitry 304 to, for example, another electronic device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and electronic devices.

[0102] The input unit 306 can be used to receive input target video and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0103] Power supply 307 is used to supply power to various components of electronic device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0104] although Figure 5 As not shown in the diagram, the electronic device 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0105] In the above embodiments, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be found in the relevant descriptions of other embodiments. It should be noted that the electronic device provided in this application's embodiments belongs to the same concept as the message interaction method in the above embodiments, and its specific implementation process is detailed in the above method embodiments, and will not be repeated here.

[0106] As can be seen from the above, the electronic device provided in this application embodiment can determine a first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The device obtains the first message that the terminal needs to send through the first proxy node; sends the first message to the target network node corresponding to the target mesh network through the proxy session corresponding to the first proxy node; and selects a new first proxy node from the proxy node connection pool when an abnormal event of the proxy node corresponding to the first proxy node is detected. In this way, by pre-creating a proxy node connection pool for the terminal in the mesh network based on at least one proxy node that has established a connection with the terminal and the proxy session created for the proxy node, the device can select a first proxy node for sending messages from the proxy node connection pool and send messages through the proxy session corresponding to the first proxy node. Even if the first proxy node is abnormal, a new first proxy node can be quickly selected from the proxy node connection pool, realizing rapid switching and activation of the proxy node. This allows for rapid response to message interaction needs based on the new first proxy node, avoiding the problem of long-term interruption of service control due to rescanning and reconnection after the proxy node is disconnected from the terminal, and effectively improving the message interaction efficiency in the mesh network.

[0107] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0108] Therefore, embodiments of this application provide a computer-readable storage medium, including a computer program. When the computer program is run on an electronic device, the computer program is used to cause the electronic device to execute any of the message interaction methods provided in embodiments of this application. For example, the computer program can execute the steps of the following message interaction method: In the proxy node connection pool corresponding to the target mesh network, a first proxy node for sending messages is determined. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal and the proxy node has created a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node. The first message is sent to the target network node corresponding to the target mesh network through the proxy session corresponding to the first proxy node. If an abnormal event of the proxy node corresponding to the first proxy node is detected, a new first proxy node is selected from the proxy node connection pool.

[0109] This solution identifies a first proxy node for sending messages from a proxy node connection pool corresponding to the target mesh network. This pool includes at least one proxy node connected to the terminal, with each node having a corresponding proxy session. The solution obtains the first message the terminal needs to send from the first proxy node and sends it to the corresponding target network node in the mesh network via the proxy session. If an abnormal event is detected with the first proxy node, a new first proxy node is selected from the connection pool. By pre-establishing a connection pool for the terminal within the mesh network based on at least one proxy node connected to the terminal and the proxy sessions created for it, the solution allows for the selection of a first proxy node for sending messages. Even if the first proxy node malfunctions, a new first proxy node can be quickly selected from the connection pool, enabling rapid switching and activation of the proxy node. This allows for quick response to message interaction needs based on the new first proxy node, avoiding prolonged service control interruptions caused by rescanning and reconnection after a proxy node disconnects from the terminal. This effectively improves message interaction efficiency within the mesh network.

[0110] Furthermore, the detailed steps of the above method can be found in the description of the foregoing embodiments, and will not be repeated here.

[0111] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0112] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0113] Since the computer program stored in the computer-readable storage medium can execute any of the message interaction methods provided in the embodiments of this application, it can achieve the beneficial effects that any of the message interaction methods provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.

[0114] According to one aspect of this application, a computer program product is also provided, comprising a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the methods provided in various optional implementations of the above embodiments.

[0115] In the above embodiments of the message interaction device, computer-readable storage medium, electronic device, and computer program product, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the message interaction device, computer-readable storage medium, computer program product, electronic device, and their corresponding units described above can be referred to the description of the message interaction method in the above embodiments, and will not be repeated here.

[0116] The foregoing has provided a detailed description of a message interaction method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A message interaction method, characterized in that, Applied to terminals, including: In the proxy node connection pool corresponding to the target mesh network, a first proxy node for sending messages is determined. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The first message to be sent by the terminal is obtained through the first proxy node; The first message is sent to the target network node in the target mesh network through the proxy session corresponding to the first proxy node; If an abnormal event is detected in the proxy node corresponding to the first proxy node, a new first proxy node is selected from the proxy node connection pool. The terminal receives a second message sent by other network nodes in the target mesh network through a second proxy node in the proxy node connection pool, excluding the first proxy node.

2. The message interaction method as described in claim 1, characterized in that, The step of determining the first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network includes: Obtain the communication quality association parameters of each proxy node in the proxy node connection pool corresponding to the terminal in the target mesh network. The communication quality association parameters include at least one of broadcast signal strength and historical packet loss rate. Based on the communication quality correlation parameters, calculate the communication quality score corresponding to each of the agent nodes; The first proxy node is determined from the proxy node connection pool based on the communication quality score.

3. The message interaction method as described in claim 1, characterized in that, The step of determining the first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network includes: Upon receiving a message sending request for the first message, the terminal determines a first proxy node from the proxy node connection pool corresponding to the target mesh network for sending the first message. After selecting a new first proxy node from the proxy node connection pool, the process further includes: The first message is sent to the target network node in the target mesh network through the proxy session corresponding to the new first proxy node.

4. The message interaction method as described in claim 3, characterized in that, The step of determining the first proxy node for sending the first message from the proxy node connection pool corresponding to the target mesh network from the terminal includes: Obtain the topological feature information of each proxy node in the proxy node connection pool relative to the target network node in the target mesh network, wherein the target network node is the network node that receives the first message; Based on the topology feature information, a first proxy node for sending the first message is selected from the proxy node connection pool; The topology feature information includes at least one of the topology distance between the proxy node and the target network node, and the estimated number of hops from the proxy node to the target network node.

5. The message interaction method as described in claim 1, characterized in that, Before determining the first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network, the method further includes: When the terminal accesses the target mesh network, the system scans the connectable proxy nodes in the target mesh network according to a preset first number of proxy nodes, and establishes connections with the proxy nodes. Create a corresponding proxy session for the proxy node after the connection is established, and assign a corresponding session identifier to the proxy session; Based on the session identifier, the proxy node is added to the proxy node connection pool.

6. The message interaction method as described in claim 1, characterized in that, The method further includes: If the number of proxy nodes in the proxy node connection pool is less than the preset second number of proxy nodes, the terminal is triggered to scan for a third connectable proxy node in the target mesh network. Establish a connection with the third proxy node, create a corresponding proxy session for the third proxy node after the connection is established, and assign a session identifier to the proxy session corresponding to the third proxy node; Based on the session identifier corresponding to the third proxy node, the third proxy node is added to the proxy node connection pool, and new proxy nodes are added continuously until the preset stopping condition is met.

7. The message interaction method according to any one of claims 1 to 6, characterized in that, Also includes: The terminal acquires monitoring information of network nodes in the target mesh network, and updates the operating status information of the network nodes based on the monitoring information. The operating status information includes at least one of recent active time, offline status, and online status. The terminal sends a status read request to a specific network node that meets the preset status feedback conditions, so that the specific network node returns a status message based on the status read request, and updates the operating status information of the specific network node based on the status message.

8. A message interaction device, characterized in that, Applied to terminals, including: The determining unit is used to determine a first proxy node for sending messages in the proxy node connection pool corresponding to the target mesh network. The proxy node connection pool includes at least one proxy node that has established a connection with the terminal, and the proxy node has created a corresponding proxy session. The acquisition unit is used to acquire the first message that the terminal needs to send through the first proxy node; The sending unit is used to send the first message to the target network node in the target mesh network through the proxy session corresponding to the first proxy node; A switching unit is used to select a new first proxy node from the proxy node connection pool when an abnormal event of the proxy node corresponding to the first proxy node is detected. The receiving unit is configured to receive a second message sent to the terminal by other network nodes in the target mesh network through a second proxy node in the proxy node connection pool, excluding the first proxy node.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the message interaction method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, Includes a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of the message interaction method according to any one of claims 1 to 7.