Communication management method and device, edge terminal, storage medium and program product
By enabling edge terminals to listen to preset ports when communication connections are abnormal, rapid reconnection between edge terminals and remote servers is achieved, solving the problems of resource waste and low network bandwidth utilization, and improving system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-03-10
AI Technical Summary
In industrial IoT systems, when the communication connection between the edge terminal and the remote server is interrupted, the edge terminal keeps trying to reconnect, leading to resource waste and low network bandwidth utilization.
When the edge terminal encounters a communication connection failure, it first initiates a first communication connection request to the remote server and listens on a preset local port. When the remote server initiates a second communication connection request, a connection is established to avoid invalid retries.
It reduces connection recovery latency, improves resource utilization, and reduces unnecessary retries.
Smart Images

Figure CN121644636A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a communication management method and device, an edge terminal, a storage medium and a program product. BACKGROUND
[0002] In an industrial Internet of Things system, an edge terminal undertakes key tasks such as data acquisition, protocol conversion, edge computing, and communication with a remote server. Between the edge terminal and the remote server, a traditional communication architecture usually adopts a client-server mode, that is, the edge terminal acts as a client, the remote server acts as a server, the edge terminal initiates a communication connection to the remote server actively, and continuously reports data through the communication connection. When network fluctuation occurs or the remote server end is unavailable due to maintenance, restart, etc., the communication connection between the edge terminal and the remote server will be interrupted. In the traditional method, the edge terminal constantly attempts to reconnect until it successfully reconnects with the remote server.
[0003] However, in the case where the server is not recovered, these retries are invalid, wasting device computing resources and network bandwidth, and there is a problem of low resource utilization. SUMMARY
[0004] Therefore, it is necessary to provide a communication management method, device, edge terminal, storage medium and program product capable of improving resource utilization.
[0005] In a first aspect, the present application provides a communication management method applied to an edge terminal, comprising:
[0006] After the edge terminal is enabled, a preconfigured server address is acquired;
[0007] Based on the server address, a first communication connection request is initiated to a remote server to establish a first communication connection between the edge terminal and the remote server;
[0008] In response to the first communication connection being abnormal, a local preset port is listened to;
[0009] When a second communication connection request initiated by the remote server is listened to through the preset port, a second communication connection between the edge terminal and the remote server is established.
[0010] In one of the embodiments, after the step of establishing the second communication connection between the edge terminal and the remote server when the second communication connection request initiated by the remote server is listened to through the preset port, the method further comprises:
[0011] In the case that the second communication connection is successfully established, a third communication connection is established with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the monitoring of the preset port is closed.
[0012] In one embodiment, the method further comprises:
[0013] In the case that the second communication connection is successfully established, a third communication connection is established with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the monitoring of the preset port is closed.
[0014] In the case that the third communication connection is successfully established, the initiation of the third communication connection request to the remote server is stopped, and the monitoring of the preset port is closed.
[0015] In one embodiment, the method further comprises:
[0016] In the case that the second communication connection is successfully established, a third communication connection is established with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the monitoring of the preset port is closed.
[0017] In the case that the second communication connection is successfully established, a third communication connection is established with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the monitoring of the preset port is closed.
[0018] In the case that the third communication connection is successfully established, the initiation of the third communication connection request to the remote server is stopped, and the monitoring of the preset port is closed.
[0019] In one embodiment, the method further comprises:
[0020] In the case that the second communication connection is successfully established, a third communication connection is established with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the monitoring of the preset port is closed.
[0021] In the case that the connection state is a disconnection state, it is determined that the first communication connection is abnormal.
[0022] In one of the embodiments, the edge terminal is a communication gateway in the site, and the data interaction with the remote server through the first communication connection comprises:
[0023] receiving device uplink data reported by a data collector in the site, and transmitting the device uplink data to the remote server through the first communication connection; and / or,
[0024] receiving a downlink instruction issued by the remote server through the first communication connection.
[0025] In a second aspect, the application further provides a communication management device, comprising:
[0026] a first connection management module, configured to, after the edge terminal is enabled, acquire a preconfigured server address, and initiate a first communication connection request to a remote server based on the server address to establish a first communication connection between the edge terminal and the remote server;
[0027] a second connection management module, configured to, in response to an abnormality of the first communication connection, listen to a local preset port, and when a second communication connection request initiated by the remote server is listened to through the preset port, establish a second communication connection between the edge terminal and the remote server.
[0028] In a third aspect, the application further provides an edge terminal, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0029] acquiring a preconfigured server address after the edge terminal is enabled;
[0030] initiating a first communication connection request to a remote server based on the server address to establish a first communication connection between the edge terminal and the remote server;
[0031] listening to a local preset port in response to an abnormality of the first communication connection;
[0032] establishing a second communication connection between the edge terminal and the remote server when a second communication connection request initiated by the remote server is listened to through the preset port.
[0033] In a fourth aspect, the application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0034] acquiring a preconfigured server address after the edge terminal is enabled;
[0035] initiate a first communication connection request to a remote server based on the server address to establish a first communication connection with the remote server;
[0036] listen to a local preset port in response to the first communication connection being abnormal;
[0037] establish a second communication connection with the remote server when a second communication connection request initiated by the remote server is listened to through the preset port.
[0038] In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:
[0039] obtain a preconfigured server address after the edge terminal is enabled;
[0040] initiate a first communication connection request to a remote server based on the server address to establish a first communication connection with the remote server;
[0041] listen to a local preset port in response to the first communication connection being abnormal;
[0042] establish a second communication connection with the remote server when a second communication connection request initiated by the remote server is listened to through the preset port.
[0043] The communication management method, device, edge terminal, storage medium and program product described above, after the edge terminal is enabled, first initiates a first communication connection request to a remote server to establish a first communication connection with the remote server, that is, first runs in a client mode, and then listens to a local preset port when the first communication connection is abnormal, so that a second communication connection is established when a second communication connection request initiated by the remote server is listened to. In this way, compared with the way in which the edge terminal constantly tries to reconnect in the traditional method, the edge terminal directly starts to listen to the local preset port when the first communication connection is found to be abnormal, that is, a signal that it is ready is transmitted to the remote server. Once the remote server recovers, it can actively and immediately reestablish a communication connection with the edge terminal, reduces the delay of connection recovery, avoids useless retry consumption, and improves resource utilization. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0045] Figure 1 Figure 1 is a diagram of an application environment of a communication management method in an embodiment;
[0046] Figure 2 Figure 2 is a flowchart of a communication management method in an embodiment;
[0047] Figure 3 Figure 3 is a diagram of an overall architecture of a communication management method in an embodiment;
[0048] Figure 4 Figure 4 is a diagram of a specific step flowchart of a communication management method in an embodiment;
[0049] Figure 5 Figure 5 is a diagram of an edge terminal state transition in an embodiment;
[0050] Figure 6 Figure 6 is a block diagram of a communication management device in an embodiment;
[0051] Figure 7 Figure 7 is a diagram of an internal structure of an edge terminal in an embodiment. DETAILED DESCRIPTION
[0052] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely intended to explain the present application and not to limit the present application.
[0053] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "and / or" used in the present application means one of the solutions or any combination of multiple solutions.
[0054] The communication management method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the edge terminal 110 can communicate with the remote server 120 through the network. After the edge terminal 110 is enabled, the preconfigured server address can be acquired, and based on the server address, the remote server 120 is initiated to establish a first communication connection, and in response to the first communication connection exception, the local preset port is listened to, and when the second communication connection request initiated by the remote server 120 is listened to through the preset port, the second communication connection is established. Among them, the edge terminal 110 can be an edge terminal device, such as a distributed new energy station, a remote pump station, a distributed power distribution cabinet or other on-site communication gateway, data collector or other terminal device with remote server communication. The remote server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The remote server 120 can run a remote monitoring platform, which can remotely monitor various on-site situations by communicating with the application program of the edge terminal 110.
[0055] In an exemplary embodiment, as shown in Figure 2 A communication management method is provided, and the method is applied to Figure 1 The edge terminal 110 in the example is described, including the following steps 210 to 240.
[0056] Among them:
[0057] Step 210, after the edge terminal is enabled, the preconfigured server address is acquired.
[0058] Among them, the server address is the communication address of the remote server. The server address can specifically include the IP address (Internet Protocol Address) of the server and the server port. The edge terminal can be powered on. The edge terminal can deploy a connection management module, which can be an application program, specifically a Java program running on the Netty network communication framework (a Java open source network framework provided by JBOSS).
[0059] After the edge terminal is enabled, the connection management module of the edge terminal can first run in the client mode, at which time the connection management module can act as a client, acquire the preconfigured server address, and actively initiate a communication connection request to the remote server to establish a communication connection between the edge terminal and the remote server. The server address determines where the edge terminal initiates the connection in the client mode.
[0060] Exemplarily, after the edge terminal is enabled, the connection management module of the edge terminal can be initialized, and in the initialization process, the preconfigured server address is read.
[0061] In one embodiment, after the edge terminal is enabled, the connection management module of the edge terminal can be initialized, and in the initialization process, the preconfigured server address and the preset port number can be read.
[0062] The connection management module can be switched from the client mode to the server mode, and in the server mode, a communication connection request initiated by a remote server is listened to through a preset port represented by a preset port number, so as to establish a new communication connection between the edge terminal and the remote server. The preset port determines the port on which the edge terminal waits to be connected in the server mode. The preset port is also read in the client mode, so that the preparation action for mode switching can be performed, so as to quickly switch to the server mode when the first communication connection is abnormal.
[0063] In step 220, a first communication connection request is initiated to a remote server based on a server address, so as to establish a first communication connection between the edge terminal and the remote server.
[0064] The first communication connection request is a communication connection request actively initiated by the edge terminal to the remote server when the edge terminal is first run in the client mode after being enabled. The first communication connection is a communication connection established based on the first communication connection request, and the communication connection can be a TCP (Transmission Control Protocol) long connection.
[0065] Taking the TCP long connection as an example, the connection management module of the edge terminal can send a SYN packet to the remote server represented by the server address. After the remote server receives the SYN packet, a SYN-ACK packet is returned. After the connection management module receives the SYN-ACK packet, an ACK packet is sent for confirmation. In this way, the TCP long connection between the edge terminal and the remote server can be established.
[0066] After the first communication connection is established, the edge terminal and the remote server can perform identity authentication according to a preset protocol through the first communication connection, and then maintain heartbeat and exchange data. The preset protocol can be an application layer communication protocol, a link layer management protocol or other protocols. The application layer communication protocol is used for business data exchange. The application layer communication protocol can be, for example, an MQTT protocol (Message Quueuing Telemetry Transport), which supports heartbeat and identity authentication. The application layer communication protocol can also be customized, and the protocol packet structure can be customized, and the packet length, command word, sequence number and other information contained in the packet header are defined, followed by payload data. The link layer management protocol can be used to maintain the connection itself. The link layer management protocol can include an identity authentication protocol, a heartbeat protocol or other protocols. After the communication connection is established, the edge terminal can first send a data packet containing device ID, authentication token (Token) and other information to the remote server through the identity authentication protocol for verification. After verification, the edge terminal can periodically send a small data packet (heartbeat request) to the remote server through the heartbeat protocol, and the remote server returns a response packet (heartbeat response) immediately after receiving it, to prove that the link is active.
[0067] In step 230, the local preset port is listened to in response to the first communication connection exception.
[0068] The first communication connection exception can be that the first communication connection is successfully established and then disconnected, or that the first communication connection fails to be established. The first communication connection exception can be determined when a heartbeat response timeout event or a TCP link exception event is triggered. The heartbeat response timeout event can be triggered when the edge terminal periodically sends a heartbeat request to the remote server and starts a timer, and no heartbeat response from the remote server is received within a preset time interval (for example, 30 seconds). The TCP link exception event can include receiving a TCP packet with the RST flag set to 1, receiving a FIN packet, failing to reach the maximum number of TCP retransmissions, or other events.
[0069] When the first communication connection is abnormal, the connection management module of the edge terminal can identify that the client mode is switched to the connection disconnected state, which is a transient state and will not stay in this state, but will immediately perform the subsequent action, i.e. listening to the local preset port, at this time it can leave the "connection disconnected" transient state and formally enter the server mode, in which the role of the connection management module is changed to a server.
[0070] For example, the connection management module of the edge terminal can obtain a local preset port number in response to the first communication connection exception, and listen to the preset port represented by the preset port number.
[0071] The connection management module of the edge terminal can switch to the server mode when detecting the abnormality of the first communication connection, and listen to a preset port represented by a preset port number in the server mode. It can be understood that the preset port number can also be obtained when obtaining the server address in step 210, that is, the preset port number is obtained in advance to be switched to the server mode.
[0072] The connection management module can be a Java program running on the Netty network communication framework, and the code of the program can include code for implementing the client mode, code for implementing the server mode, and code for implementing mode switching and management. The code for implementing the client mode can be implemented based on the Bootstrap class of Netty, and can include uplink and downlink message listening, encoders, decoders, heartbeat processors, protocol library distribution processing classes, channel event processing classes, and other logic in the ChannelPipeline component. It can also include connection acquisition logic and disconnection logic. The code for implementing the server mode can be implemented based on the ServerBootstrap class of Netty, and can also configure a corresponding ChannelPipeline. The code for implementing mode switching and management is the core of the connection management module, and is responsible for monitoring whether the trigger condition of mode switching is met and triggering mode switching.
[0073] In a possible implementation, the connection management module of the edge terminal can create a socket instance, bind the IP address of the edge terminal and the preset port number to the socket instance, and listen to the preset port represented by the preset port number through the socket instance.
[0074] In step 240, when a second communication connection request initiated by a remote server is listened to through the preset port, a second communication connection between the edge terminal and the remote server is established.
[0075] The second communication connection request is a communication connection request initiated by the remote server to the preset port. The second communication connection is a communication connection established based on the second communication connection request. The second communication connection can be a long connection or a short connection. In some scenarios, the second communication connection can also be referred to as a reverse connection.
[0076] The remote server (or the connection relay service deployed therein) can be preconfigured with the IP address of the edge terminal and the preset port number. After detecting the abnormality of the first communication connection, the remote server initiates a second communication connection request to the preset port through the IP address of the edge terminal and the preset port number, to establish a second communication connection.
[0077] It can be understood that for the edge terminal, when the first communication connection is detected to be abnormal, it does not know whether the state of the remote server is normal, at this time, if the reconnection is blindly repeated, and the remote server is abnormal and not recovered, the edge terminal cannot be answered, which will cause resource waste, and because the adjacent reconnection requests in the reconnection process have a time interval, the connection cannot be established immediately after the remote server is recovered, and the connection recovery has a delay. The connection management module of the edge terminal of the application directly starts to listen to the preset port after the first communication connection is abnormal, waits to be connected by the remote server, that is, it is not necessary to blindly repeatedly actively initiate the reconnection, after the remote server is recovered, the remote server will actively initiate a second communication connection request immediately, and reestablish the communication connection, which reduces the delay of connection recovery and avoids useless retry consumption.
[0078] Exemplarily, the connection management module of the edge terminal can continuously listen to the preset port, the remote server can obtain the preconfigured IP address of the edge terminal and the preset port after the first communication connection is abnormal, initiate a second communication connection request based on the IP address of the edge terminal and the preset port, and the connection management module of the edge terminal establishes a second communication connection with the remote server after listening to the second communication connection request through the preset port.
[0079] In one embodiment, after the second communication connection is successfully established, the edge terminal can perform data interaction with the remote server through the second communication connection.
[0080] In the above communication management method, after the edge terminal is enabled, the edge terminal actively initiates a first communication connection request to the remote server to establish a first communication connection between the edge terminal and the remote server, that is, the edge terminal runs in a client mode first, and then listens to a local preset port when the first communication connection is abnormal, so as to establish a second communication connection when a second communication connection request initiated by the remote server is listened to. In this way, compared with the way that the edge terminal constantly tries to reconnect in the traditional method, when the edge terminal discovers that the first communication connection is abnormal, the edge terminal directly starts to listen to the local preset port, that is, the edge terminal transmits a "ready" signal to the remote server, and once the remote server recovers, the remote server can actively and immediately reestablish the communication connection with the edge terminal, which reduces the delay of connection recovery, avoids useless retry consumption, and improves the resource utilization rate.
[0081] In one exemplary embodiment, after step 240, the above communication management method further includes the following steps: in the case that the second communication connection is successfully established, a third communication connection between the edge terminal and the remote server is established by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the listening to the preset port is closed.
[0082] The third communication connection request is a communication connection request initiated by the edge terminal to the remote server after the second communication connection is successfully established. The third communication connection is a communication connection established through the third communication connection request. The preset port is closed, which can be specifically unbound or released.
[0083] In the embodiment, after the second communication connection is successfully established, if the preset port is kept listening for a long time, that is, the edge terminal stays in the server mode for a long time, it means that the memory and processor resources need to be continuously occupied to maintain the listening port and process potential connection requests, which is inconsistent with the positioning of the edge terminal. In addition, opening the listening port on the network increases the risk of being attacked. In the embodiment, after the second communication connection is successfully established, it can be determined that the network link between the edge terminal and the remote server and the remote server is restored to normal. At this time, the edge terminal initiates a third communication connection request to the remote server, so that after the third communication connection is successfully established, the preset port is closed. The communication connection between the edge terminal and the remote server can be ensured while reducing resource consumption and reducing the risk of being attacked.
[0084] In a possible implementation, the connection management module of the edge terminal can initiate a third communication connection request to the remote server based on the server address to establish a third communication connection between the edge terminal and the remote server at a regular time after the second communication connection is successfully established. When the third communication connection is successfully established, the third communication connection request to the remote server is stopped, and the preset port is closed.
[0085] In the embodiment, after the second communication connection is successfully established, the connection management module can first keep listening to the preset port, and start to attempt to initiate a third communication connection request to the remote server at a regular time, for example, a timer can be triggered every 30 seconds, and a third communication connection request is initiated after the timer is triggered. Until the third communication connection request is successfully established, the preset port is closed.
[0086] In another possible implementation, the connection management module of the edge terminal can suspend listening to the preset port after the second communication connection is successfully established. A third communication connection request is initiated to the remote server based on the server address to establish a third communication connection between the edge terminal and the remote server. When the third communication connection fails, the preset port is resumed to listen, and the step of establishing a second communication connection between the edge terminal and the remote server through the second communication connection request initiated by the remote server through the preset port is continued until the third communication connection is successfully established, and the preset port is closed.
[0087] When the preset port is paused from being listened to, the established second communication connection can be disconnected. When the third communication connection fails to be established, the connection management module can return to step 240 for continuous execution. Specifically, step 240 can be executed, and then the following steps can be executed: after the second communication connection is successfully established, the preset port is paused from being listened to; a third communication connection request is initiated to the remote server based on the server address, so as to establish a third communication connection between the edge terminal and the remote server; if the third communication connection still fails to be established, the preset port is resumed from being listened to, and the edge terminal returns to step 240 for continuous execution; and if the third communication connection is successfully established, the loop is stopped, and the preset port is closed from being listened to.
[0088] In an exemplary embodiment, after step 220, the above communication management method further includes: after the first communication connection is successfully established, performing data interaction with the remote server through the first communication connection, and monitoring a connection state of the first communication connection; and when the connection state is a connection disconnection state, determining that the first communication connection is abnormal.
[0089] In the embodiment, by monitoring the connection state of the first communication connection, whether the connection is disconnected can be found in time, so that the server mode can be switched to in time subsequently, and the efficiency of connection recovery is improved.
[0090] In an exemplary embodiment, the edge terminal is a communication gateway in a field station, and the data interaction with the remote server through the first communication connection includes: receiving device uplink data reported by a data collector in the field station, and transmitting the device uplink data to the remote server through the first communication connection; and / or receiving a downlink instruction issued by the remote server through the first communication connection.
[0091] In the embodiment, the field station is a general term of a series of devices, buildings and control systems that are centrally established for the purpose of production, conversion, transportation, distribution or storage of a specific form of energy. The field station can be deployed with a communication gateway, a data collector, a power electronic device or the like. The communication gateway is a device used for communication in the field station. The communication gateway can be a Modbus gateway, an edge computing gateway, a wireless communication gateway or the like. The data collector is a special device deployed in the field station for real-time collection of device data of the power electronic device. The data collector can be a remote terminal unit, an intelligent data collection module, a photovoltaic data collector or the like. The power electronic device is a device that takes power electronic devices as core functional elements and realizes power processing through power conversion and control. The power electronic device can be a rectifier, an inverter, a direct-current converter, an alternating-current converter or the like.
[0092] The device uplink data can include device data collected by the data collector from the power electronic device, such as electrical data, operating state data, environmental data, etc. The electrical data can be current, voltage, power, frequency, power generation, or other, and the operating state data can represent the working mode of the power electronic device itself, such as grid-connected, off-grid, standby, fault, or other. The environmental data can be wind speed, ambient temperature, solar irradiance, or other.
[0093] The downlink instruction is an instruction issued by the remote server for regulating the devices in the station. The downlink instruction can include control instructions, query instructions, maintenance instructions, or other. The control instructions can be device start-stop instructions, power adjustment instructions, parameter setting instructions, or other. The query instruction can be used to instruct to query device data. The maintenance instruction can be a configuration update instruction, a software upgrade instruction, a time synchronization instruction, or other.
[0094] In one specific application scenario, referring to the overall architecture diagram of the communication management method as shown in Figure 3 , the specific step flow diagram of the communication management method as shown in Figure 4 , the edge terminal state transition diagram as shown in Figure 5 , the above-mentioned communication management can specifically include the following steps.
[0095] The connection management module of the edge terminal can be initialized after the edge terminal is enabled. In the initialization process, the preconfigured server address and the preset port number are read.
[0096] The connection management module of the edge terminal can initiate a first communication connection request to the remote server based on the server address to establish a first communication connection between the edge terminal and the remote server. After the first communication connection is successfully established, the edge terminal can perform data interaction with the remote server through the first communication connection, and the connection management module can monitor the connection state of the first communication connection. At this time, the connection management module runs in the client mode.
[0097] When the connection state is the connection disconnected state, the connection management module of the edge terminal can determine that the first communication connection is abnormal, listen to the local preset port, and when the second communication connection request initiated by the remote server is listened to through the preset port, the second communication connection between the edge terminal and the remote server is established. At this time, the connection management module runs in the server mode.
[0098] After the second communication connection is successfully established, the connection management module of the edge terminal can periodically initiate a third communication connection request to the remote server based on the server address to establish a third communication connection between the edge terminal and the remote server. When the third communication connection is successfully established, the initiation of the third communication connection request to the remote server is stopped, and the listening to the preset port is closed. In this way, the connection management module switches back to the client mode.
[0099] It should be understood that although each step in the flowchart involved in each of the above-described embodiments is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least some of the steps in the flowchart involved in each of the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time but can be executed at different times, and the execution of these steps or stages is not necessarily sequential but can be performed alternately or alternately with at least some of the other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.
[0100] Based on the same inventive concept, the embodiments of the present application also provide a communication management apparatus for implementing the above-mentioned communication management method. The problem-solving implementation scheme provided by the apparatus is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more communication management apparatus embodiments provided below can refer to the limitations of the communication management method described above, which will not be repeated here.
[0101] In one exemplary embodiment, as shown in Figure 6 A communication management apparatus 600 is provided, comprising: a first connection management module 610 and a second connection management module 620, wherein:
[0102] The first connection management module 610 is configured to, after the edge terminal is enabled, acquire a preconfigured server address; based on the server address, initiate a first communication connection request to a remote server to establish a first communication connection with the remote server.
[0103] The second connection management module 620 is configured to, in response to an abnormality of the first communication connection, listen to a local preset port; when a second communication connection request initiated by the remote server is listened to through the preset port, establish a second communication connection with the remote server.
[0104] In one exemplary embodiment, the communication management apparatus 600 further comprises a third connection management module, the third connection management module is configured to, in the case that the second communication connection is successfully established, establish a third communication connection with the remote server by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, close the listening to the preset port.
[0105] In an exemplary embodiment, the third connection management module is further configured to, after the second communication connection is successfully established, periodically initiate a third communication connection request to the remote server based on the server address to establish a third communication connection with the remote server; when the third communication connection is successfully established, stop initiating the third communication connection request to the remote server, and close the preset port.
[0106] In an exemplary embodiment, the third connection management module is further configured to, after the second communication connection is successfully established, suspend monitoring the preset port; initiate a third communication connection request to the remote server based on the server address to establish a third communication connection with the remote server; when the third communication connection fails, resume monitoring the preset port, and return to the step of establishing the second communication connection with the remote server through the preset port when the second communication connection request initiated by the remote server is monitored, and continue to execute until the third communication connection is successfully established, and the preset port is closed.
[0107] In an exemplary embodiment, the communication management device 600 further comprises a communication module and a state management module, the communication module is configured to, after the first communication connection is successfully established, perform data interaction with the remote server through the first communication connection, and the state management module is configured to monitor the connection state of the first communication connection; when the connection state is a disconnection state, it is determined that the first communication connection is abnormal.
[0108] In an exemplary embodiment, the edge terminal is a communication gateway in the site station, and the communication module is further configured to receive device uplink data reported by a data collector in the site station, and transmit the device uplink data to the remote server through the first communication connection; and / or, receive a downlink instruction issued by the remote server through the first communication connection.
[0109] Each module in the above communication management device can be realized by software, hardware and their combinations in whole or in part. Each module described above can be embedded in or independent of the processor in the edge terminal in hardware form, or can be stored in the memory in the edge terminal in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0110] In an exemplary embodiment, an edge terminal is provided, and its internal structure diagram can be as shown in Figure 7As shown. The edge terminal includes a processor, a memory, an input / output interface and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the edge terminal is used to provide computing and control capability. The memory of the edge terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the edge terminal is used to exchange information between the processor and external devices. The communication interface of the edge terminal is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, near field communication (NFC) or other technologies. The computer program is executed by the processor to realize a communication management method.
[0111] Those skilled in the art can understand that, Figure 7 The skilled in the art can understand that,
[0112] In one exemplary embodiment, an edge terminal is provided, comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the following steps: after the edge terminal is enabled, a preconfigured server address is acquired; based on the server address, a first communication connection request is initiated to a remote server to establish a first communication connection between the edge terminal and the remote server; in response to an abnormality of the first communication connection, a local preset port is listened to; when a second communication connection request initiated by the remote server is listened to through the preset port, a second communication connection between the edge terminal and the remote server is established.
[0113] In one embodiment, the processor executes the computer program to further realize the following steps: in the case that the second communication connection is successfully established, a third communication connection between the edge terminal and the remote server is established by initiating a third communication connection request to the remote server, and in the case that the third communication connection is successfully established, the listening to the preset port is closed.
[0114] In one embodiment, the processor executes the computer program to further realize the following steps: after the second communication connection is successfully established, a third communication connection between the edge terminal and the remote server is established by periodically initiating a third communication connection request to the remote server based on the server address; when the third communication connection is successfully established, the initiation of the third communication connection request to the remote server is stopped, and the listening to the preset port is closed.
[0115] In one embodiment, the processor, when executing the computer program, further implements the following steps: after the second communication connection is successfully established, suspending the listening on the preset port; based on the server address, initiating a third communication connection request to the remote server to establish a third communication connection with the remote server; when the third communication connection fails to be established, resuming the listening on the preset port, and returning to the step of establishing the second communication connection with the remote server based on the second communication connection request initiated by the remote server through the listening on the preset port, until the third communication connection is successfully established, and the listening on the preset port is closed.
[0116] In one embodiment, the processor, when executing the computer program, further implements the following steps: after the first communication connection is successfully established, performing data interaction with the remote server through the first communication connection, and monitoring the connection state of the first communication connection; when the connection state is a disconnection state, determining that the first communication connection is abnormal.
[0117] In one embodiment, the edge terminal is a communication gateway in the site, and the processor, when executing the computer program, further implements the following steps: receiving device uplink data reported by a data collector in the site, and transmitting the device uplink data to the remote server through the first communication connection; and / or receiving a downlink instruction issued by the remote server through the first communication connection.
[0118] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0119] In one embodiment, a computer program product is provided, and the computer program product includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0120] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0121] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.
[0122] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A communication management method characterized by comprising: The method applied to an edge terminal comprises: After the edge terminal is enabled, a pre-configured server address is acquired; Based on the server address, a first communication connection request is initiated to a remote server to establish a first communication connection with the remote server; In response to an abnormality of the first communication connection, a local preset port is listened to; When a second communication connection request initiated by the remote server is listened to through the preset port, a second communication connection with the remote server is established.
2. The method of claim 1, wherein, After the step of establishing the second communication connection with the remote server when the second communication connection request initiated by the remote server is listened to through the preset port, the method further comprises: In a case where the second communication connection is successfully established, a third communication connection with the remote server is established by initiating a third communication connection request to the remote server, and in a case where the third communication connection is successfully established, the preset port is closed.
3. The method of claim 2, wherein, The step of establishing the third communication connection with the remote server in a case where the second communication connection is successfully established by initiating the third communication connection request to the remote server, and in a case where the third communication connection is successfully established, the preset port is closed, comprises: After the second communication connection is successfully established, the third communication connection with the remote server is initiated based on the server address to the remote server to establish the third communication connection with the remote server; When the third communication connection is successfully established, the third communication connection request to the remote server is stopped, and the preset port is closed.
4. The method of claim 2, wherein, The step of establishing the third communication connection with the remote server in a case where the second communication connection is successfully established by initiating the third communication connection request to the remote server, and in a case where the third communication connection is successfully established, the preset port is closed, comprises: After the second communication connection is successfully established, the preset port is suspended; Based on the server address, a third communication connection request is initiated to the remote server to establish a third communication connection with the remote server; When the third communication connection fails, the preset port is resumed to return to the step of establishing the second communication connection with the remote server when the second communication connection request initiated by the remote server is listened to through the preset port, and the step is continued to be executed until the third communication connection is successfully established and the preset port is closed.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: After the first communication connection is successfully established, data interaction is performed between the edge terminal and the remote server through the first communication connection, and a connection state of the first communication connection is monitored; When the connection state is a disconnection state, it is determined that the first communication connection is abnormal.
6. The method of claim 5, wherein, The edge terminal is a communication gateway in a site, and the data interaction between the edge terminal and the remote server through the first communication connection comprises: Receiving device uplink data reported by a data collector in the site, and transmitting the device uplink data to the remote server through the first communication connection; and / or, Through the first communication connection, a downlink instruction issued by the remote server is received.
7. A communication management apparatus characterized by comprising: The device is applied to an edge terminal and comprises: A first connection management module is configured to, after the edge terminal is enabled, acquire a preconfigured server address, initiate a first communication connection request to a remote server based on the server address, and establish a first communication connection with the remote server. A second connection management module is configured to, in response to an abnormality of the first communication connection, listen to a local preset port, and establish a second communication connection with the remote server when a second communication connection request initiated by the remote server is listened to through the preset port.
8. An edge terminal comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.