Non-coal mine substation real-time communication system and method based on cross-platform mobile terminal
By using the React Native framework and TCP Socket communication for cross-platform mobile devices, combined with disconnection reconnection, heartbeat keep-alive and data caching mechanisms, the mobile, network adaptability and security issues of the non-coal mine safety monitoring system are solved, achieving low-cost development and stability and security for real-time underground data acquisition and remote control.
Patent Information
- Application Number
- CN202511317555.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-11-18
AI Technical Summary
Existing safety monitoring systems for non-coal mines lack mobility, have poor terminal compatibility, and cannot be used to directly view data or remotely control equipment underground. They also have insufficient network adaptability and security, and are prone to interruption and data theft, especially in weak network environments.
It adopts the React Native framework for cross-platform mobile devices, combined with TCP Socket communication, and introduces mechanisms for reconnection after disconnection, heartbeat keep-alive and data caching. It achieves cross-platform communication through two-way authentication and encrypted transmission by dynamic key negotiation, and optimizes the data frame protocol in weak network environments.
It enables low-cost development and maintenance across platforms, improves communication stability and security, ensures real-time data acquisition and remote control in the well, and enhances communication adaptability and security in weak network environments.
Smart Images

Figure CN120980126A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of mine safety monitoring and control, and particularly relates to a system and method for realizing real-time communication between a cross-platform mobile terminal and a non-coal mine substation through a TCP Socket protocol. BACKGROUND
[0002] A non-coal mine safety monitoring system is usually composed of multiple substations and monitoring sensors, and transmits monitoring data to a ground monitoring center through a wired or wireless network to realize real-time monitoring and alarm of mine gas concentration, temperature and humidity, equipment running state and other parameters. However, the existing system generally relies on a special industrial computer or a Windows platform client and does not have mobile features, which has the following defects: Poor terminal adaptability: different platforms need to be developed respectively, and the Android and ios version codes cannot be reused, resulting in high maintenance cost.
[0003] Insufficient mobility: the inspection personnel cannot directly view data or remotely control equipment in the underground, and the data transmission delay is large.
[0004] Poor network adaptability: the network delay in the mining area is high, the packet loss rate is large, the traditional TCP connection is easy to be interrupted under network jitter, and lacks a reconnection and retransmission mechanism.
[0005] Insufficient security protection: the communication data between the existing mine substation and the client is mostly transmitted in plaintext, lacks strong authentication mechanism, and has the risk of being stolen or tampered.
[0006] Therefore, a cross-platform, mobile, weak network adaptive and high security mine substation communication solution is needed. SUMMARY
[0007] The purpose of the present application is to provide a TCP Socket real-time communication system and method based on a React Native cross-platform mobile terminal and a non-coal mine substation, which establishes a long connection between the mobile terminal application and the substation through an innovative communication process design, uses a customized data frame protocol for communication, and introduces a disconnection reconnection, heartbeat keep-alive and data caching mechanism in a weak network environment to improve the communication stability and real-time performance.
[0008] To solve the above problems, the present application provides a non-coal mine substation real-time communication system based on a cross-platform mobile terminal, which comprises a cross-platform mobile terminal communication module, a substation communication protocol adaptation module and a weak network environment optimization module. The cross-platform mobile terminal communication module is connected with the non-coal mine substation and is used for sending and receiving data frames. The substation communication protocol adaptation module is connected with the cross-platform mobile terminal communication module, and is used for parsing the received binary data into service data and generating a sending frame conforming to a protocol format; The weak network environment optimization module is connected with the substation communication protocol adaptation module, and is used for heartbeat detection, automatic reconnection of disconnection and cache and retransmission on the sending frame of the substation communication protocol adaptation module.
[0009] In order to reduce the repeated development cost and reduce the maintenance cost, the cross-platform mobile terminal communication module adopts a ReactNative framework, integrates a TCP Socket communication library, and is adapted to Android and iOS platforms.
[0010] In order to be able to dynamically identify different types of sensor data, the substation communication protocol adaptation module has a hierarchical adaptive data frame splitting module, which can dynamically adjust the data frame size according to the network condition.
[0011] In order to prevent illegal access and consume substation resources, the substation communication protocol adaptation module has a two-way authentication and dynamic key negotiation module, which completes identity verification through challenge response when first connected, and uses a temporary key and an AEAD algorithm for encrypted transmission in a session.
[0012] In order to improve the safety response speed, the substation communication protocol adaptation module has a closed-loop control confirmation module, which requires the non-coal mine substation to return an execution confirmation message to update the mobile terminal state after the execution of the control instruction.
[0013] In order to improve the adaptability of weak networks, the heartbeat detection detects the connection activity by periodically sending short packets, the automatic reconnection detects the disconnection of the connection, and uses an exponential backoff strategy to try to reconnect, and the cache and retransmission cache the data that has not been sent during network interruption, and retransmits in batches after the network recovers.
[0014] The application also provides a communication method of the non-coal mine substation real-time communication system based on the cross-platform mobile terminal. (1) The cross-platform mobile terminal communication module initiates a TCP connection request to the non-coal mine substation; (2) The cross-platform mobile terminal communication module and the non-coal mine substation perform identity verification through a preset key and perform encrypted transmission through an AEAD algorithm; (3) The substation communication protocol adaptation module parses the binary data sent by the cross-platform mobile terminal communication module into service data, and generates a sending frame conforming to a protocol format; (4) The weak network environment optimization module periodically sends short packets to detect the connection activity of the substation communication protocol adaptation module, and when the connection is detected to be disconnected, an exponential backoff strategy is used to attempt to reconnect, and the unsent data is cached during the network interruption, and after the network is restored, the data is retransmitted in batches.
[0015] Compared with the prior art, the present application has the following technical advantages and beneficial effects: (1) Cross-platform and low cost: React Native enterprise-level development once, suitable for Android and ios, reducing the cost of repeated development and reducing the maintenance cost; (2) Significant improvement in weak network adaptability: through the heartbeat packet, disconnection reconnection and cache retransmission mechanism, priority cache is used to effectively ensure the communication stability under the complex network of the mining area; (3) Enhanced security: two-way authentication and dynamic key negotiation block eavesdropping and replay attacks; (4) Real-time guarantee: based on the closed-loop feedback control mechanism, the underground inspection personnel can directly obtain real-time data through the mobile phone and remotely control the equipment, and the safety response speed is improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is the overall architecture diagram of the non-coal mine substation real-time communication system based on the cross-platform mobile terminal of the present application; Figure 2 is a schematic diagram of the data frame structure of the sending end of the present application; Figure 3 is a schematic diagram of the data frame structure of the receiving end of the present application; Figure 4 is a flowchart of the communication method of the non-coal mine substation real-time communication system based on the cross-platform mobile terminal of the present application. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, so that the advantages and features of the present application can be more easily understood by those skilled in the art, and the protection scope of the present application can be more clearly and explicitly defined.
[0018] As shown in Figure 1 A non-coal mine substation real-time communication system based on a cross-platform mobile terminal, comprising a cross-platform mobile terminal communication module, a substation communication protocol adaptation module and a weak network environment optimization module.
[0019] Specifically, the cross-platform mobile terminal communication module is connected with the non-coal mine substation, the non-coal mine substation collects sensor data and communicates with the cross-platform mobile terminal communication module through the TCP protocol, the cross-platform mobile terminal communication module adopts the ReactNative framework, integrates the TCP Socket communication library, adapts to the Android and iOS platforms, the mobile terminal of the React Native framework is used for interface display, user interaction and data visualization, and the cross-platform mobile terminal communication module is responsible for establishing the communication connection with the non-coal mine substation and sending and receiving data frames.
[0020] Specifically, the substation communication protocol adaptation module is connected with the cross-platform mobile terminal communication module, is used for parsing the received binary data into business data, and generates a sending frame conforming to the protocol format. The substation communication protocol adaptation module designs a custom data frame structure according to the non-coal mine substation communication protocol, provides protocol analysis and packet functions, and supports dynamic identification of different types of sensor data.
[0021] In addition, the substation communication protocol adaptation module has a hierarchical adaptive data frame splitting module, which can dynamically adjust the data frame size according to the network condition. The data frame is composed of a sending end and a receiving end. As shown in Figure 2 , the sending end data frame includes data fragments, version numbers, file CRCs, file lengths, byte numbers, write register numbers, data packet numbers, expected response numbers, starting addresses, function codes and the like, and the receiving end data frame includes the length below the next data packet, the upgrade state, the offset, the function code and the like. Figure 3
[0022] The substation communication protocol adaptation module also has a bidirectional authentication and dynamic key negotiation module. The identity verification is completed through challenge response when connecting for the first time, and the session key is negotiated through the TLS protocol in the session, and then the ChaCha20-Poly1305 algorithm in the AEAD mode is used to encrypt the transmission data. The device ID authentication is performed before the mobile terminal connects the non-coal mine substation, so as to prevent illegal access and consume substation resources.
[0023] The substation communication protocol adaptation module also has a closed-loop control confirmation module. The closed-loop control confirmation module requires the non-coal mine substation to return an execution confirmation message to update the mobile terminal state after the control instruction is executed, so as to realize closed-loop control.
[0024] Specifically, the weak network environment optimization module is connected with the substation communication protocol adaptation module, and is used for heartbeat detection, automatic reconnection, buffering and retransmission of the sending frame of the substation communication protocol adaptation module.
[0025] The heartbeat detection detects the connection activity by periodically sending short packets, the automatic reconnection detects the disconnection of the connection and attempts to reconnect using an exponential backoff strategy, and the buffer and retransmission buffers the unsent data during network interruption and retransmits the data in bulk after the network is restored.
[0026] As shown in Figure 4 The communication method of the above-mentioned real-time communication system for non-coal mine substation based on cross-platform mobile terminal includes the following steps: (1) Device discovery and connection The mobile terminal application of the cross-platform mobile terminal communication module scans and identifies the target non-coal mine substation through Bluetooth / wifi communication mode; (2) Connection establishment and authentication The cross-platform mobile terminal communication module and the non-coal mine substation perform identity verification through a pre-set key, perform encrypted transmission through an AEAD algorithm, establish a TCP connection, and realize two-way authentication communication; (3) Data encoding and transmission The mobile terminal selects a file and reads the content of the file through the loadFile function, then encodes the data through the data encoding format of Figure 2 , and transmits the data to the substation. The substation communication protocol adaptation module parses the binary data sent by the cross-platform mobile terminal communication module into business data, generates a sending frame conforming to the protocol format, and returns the received data and execution confirmation information to the mobile terminal. The format of the received data is Figure 3 The mobile terminal parses the received data, judges whether the data transmission is completed through the packetNo field and the status bit, if not, it continues to send the data fragments to the substation according to the response, and the cycle continues until it is judged that the data transmission is completed. If it is completed, the mobile terminal prompts the OTA completion success information, and closes the connection with the substation.
[0027] The above are preferred embodiments of the present application, which do not limit the protection scope of the present application, therefore: any equivalent changes made on the structure, shape, principle and application direction of the present application should be covered within the protection scope of the present application.
Claims
1. A non-coal mine substation real-time communication system based on a cross-platform mobile terminal, characterized in that, The cross-platform mobile terminal communication module, the substation communication protocol adaptation module and the weak network environment optimization module are included. The cross-platform mobile terminal communication module is connected with the non-coal mine substation, and is used for sending and receiving data frames. The substation communication protocol adaptation module is connected with the cross-platform mobile terminal communication module, and is used for parsing the received binary data into business data, and generating sending frames conforming to the protocol format. The weak network environment optimization module is connected with the substation communication protocol adaptation module, and is used for performing heartbeat detection, automatic reconnection and cache and retransmission on the sending frames of the substation communication protocol adaptation module. 2.The non-coal mine substation real-time communication system based on a cross-platform mobile terminal according to claim 1, wherein, The cross-platform mobile terminal communication module adopts the React Native framework, and integrates the TCP Socket communication library, and is adapted to the Android and iOS platforms. 3.The non-coal mine substation real-time communication system based on a cross-platform mobile terminal according to claim 1, wherein, The substation communication protocol adaptation module has a layered adaptive data frame splitting module, which can dynamically adjust the data frame size according to the network condition.
4. The cross-platform mobile terminal-based non-coal mine substation real-time communication system of claim 1, wherein, The substation communication protocol adaptation module has a bidirectional authentication and dynamic key negotiation module, which completes identity verification through challenge response when first connected, and uses a temporary key and AEAD algorithm for encrypted transmission in the session.
5. The cross-platform mobile terminal-based non-coal mine substation real-time communication system according to claim 1, characterized in that, The substation communication protocol adaptation module has a closed-loop control confirmation module, which requires the non-coal mine substation to return an execution confirmation message to update the mobile terminal state after the control instruction is executed.
6. The cross-platform mobile terminal-based non-coal mine substation real-time communication system according to claim 1, characterized in that, The heartbeat detection detects the connection activity by periodically sending short packets, the automatic reconnection detects the disconnection of the connection, and uses the exponential backoff strategy to attempt reconnection, and the cache and retransmission caches the unsent data during network interruption, and performs batch retransmission after the network recovers.
7. The communication method of the cross-platform mobile terminal-based non-coal mine substation real-time communication system according to any one of claims 1-6, characterized in that, The method comprises the following steps: (1) The cross-platform mobile terminal communication module initiates a TCP connection request to the non-coal mine substation; (2) The cross-platform mobile terminal communication module and the non-coal mine substation perform identity verification through a preset key, and perform encrypted transmission through the AEAD algorithm; (3) The substation communication protocol adaptation module parses the binary data sent by the cross-platform mobile terminal communication module into business data, and generates sending frames conforming to the protocol format; (4) The weak network environment optimization module periodically sends short packets to detect the connection activity of the sending frames of the substation communication protocol adaptation module, and attempts reconnection through the exponential backoff strategy when the connection is detected to be disconnected, caches the unsent data during network interruption, and performs batch retransmission after the network recovers.
