Remote communication system of metering terminal
By designing a combination of communication management module, remote communication module and Bluetooth communication module in the metering terminal, the problem of data cannot be uploaded when the remote communication module fails, and the effect of automated fault handling and timely uploading of data is achieved.
Patent Information
- Application Number
- CN202411936224.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, when the remote communication module of the metering terminal fails, it cannot be processed automatically, resulting in the inability to upload business data to the main site on time, increasing the workload of operation and maintenance personnel.
A remote communication system for metering terminals is designed, including a communication management module, a remote communication module and a Bluetooth communication module. The communication management module is used to receive task data and judge the working status of the remote communication module. The remote communication module is used to send it to the main station after receiving task data. The Bluetooth communication module is used to establish a Bluetooth communication connection with other metering terminals when the remote communication module fails and forward task data to the main station.
It realizes the automatic fault handling capability of the metering terminal when the remote communication module fails, reduces the workload of operation and maintenance personnel, and ensures the timely upload of business data to the main site.
Smart Images

Figure CN119767173A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of remote communications, and in particular to a remote communication system of a metering terminal. Background Art
[0002] The metering terminal can realize functions such as electric energy information collection, data management, data transmission, and execution of control commands issued by the master station. In the metering terminal, maintaining communication with the master station is one of the most important functions. In daily use, the remote communication module uploads the data collected by the metering terminal to the master station and receives the data actively sent by the master station. Therefore, when the remote communication module fails, the only communication channel between the metering terminal and the master station is disconnected, and the metering terminal cannot communicate normally with the master station.
[0003] At present, when the remote communication module of the metering terminal fails, due to the lack of necessary automated processing means, the operation and maintenance personnel mainly go to the site to check and maintain the metering terminal. When the operation and maintenance personnel find that the terminal has no data uploaded for a long time at the metering master station, they will go directly to the site to check the remote communication module. In this process, the operation and maintenance personnel need to connect the metering terminal on site and locate the cause of the failure of the remote communication module from the communication log of the terminal, and finally repair the failure. This method has the following defects: (1) When the remote communication module fails, the business data of the metering terminal cannot be uploaded to the metering master station before the operation and maintenance personnel repair the failure, which will cause some business data of the metering master station to be lost; (2) When the remote communication module fails, the operation and maintenance personnel cannot find the fault information in time, and need to query the data reception status of the metering terminal to determine the remote communication module failure, resulting in the inability to find and handle the fault in time; (3) When the remote communication module fails, the operation and maintenance personnel cannot remotely analyze the fault information, and need to go to the site to analyze the communication log of the terminal to locate the fault, and the fault handling process is time-consuming and labor-intensive. Summary of the invention
[0004] The present invention provides a remote communication system for a metering terminal, so as to solve the technical problem in the prior art that when a remote communication module fails, the metering terminal cannot communicate with a main station.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a remote communication system for a metering terminal, comprising: a master station and a plurality of metering terminals connected to the master station for communication; each of the metering terminals comprises a communication management module and a remote communication module and a Bluetooth communication module respectively connected to the communication management module;
[0006] The communication management module is used to receive the collected task data, obtain the working status of the remote communication module, and send the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module;
[0007] The remote communication module is used to send the task data to the main station after receiving the task data;
[0008] The Bluetooth communication module is used to set the initial slave mode to the host mode after receiving the task data, and establish a communication connection with the remaining metering terminals in the slave mode, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the master station.
[0009] As a preferred solution, obtaining the working status of the remote communication module specifically includes:
[0010] Sending a detection signal to the remote communication module, so that the remote communication module generates and sends a response message according to the detection signal;
[0011] Receive a response message sent by the remote communication module, and determine the working status of the remote communication module according to the response message; wherein the working status includes a normal working status and a fault offline status.
[0012] As a preferred solution, the remote communication module is also used for:
[0013] After receiving the detection signal sent by the communication management module, read the current in-place state, and send the in-place state to the communication management module, so that the communication management module analyzes the in-place state and initiates heartbeat detection to the other end of the remote communication module according to the analysis result;
[0014] After receiving the heartbeat detection signal, a response is initiated to the remote communication module, so that when the communication management module receives the response message from the remote communication module, it determines that the remote communication module is currently in a normal working state; when the response message from the remote communication module is not received, it is determined that the remote communication module is currently in a faulty offline state.
[0015] As a preferred solution, the analyzing the in-place status and initiating a heartbeat detection to the other end of the remote communication module according to the analysis result specifically includes:
[0016] If the current in-place state is in the running state, a heartbeat detection is initiated to the opposite end of the remote communication module, so that the remote communication module generates a heartbeat message according to the signal of the heartbeat detection, and sends the heartbeat message to the management communication module; the received heartbeat message is monitored, and according to the monitored heartbeat message, the communication state between the remote communication module and the master station is obtained by parsing;
[0017] If the current on-site status is in a stopped state, the remote communication module is directly judged as a fault offline state.
[0018] As a preferred solution, when receiving the response message of the remote communication module, determining that the remote communication module is currently in a normal working state specifically includes:
[0019] According to the communication status and the heartbeat message, an AT instruction set is generated;
[0020] According to the AT instruction set, the response of the remote communication module is tested, and after the remote communication module responds, the remote communication module is marked as being in a normal working state.
[0021] As a preferred solution, after the remote communication module responds, the method further includes:
[0022] Obtaining version information of the Bluetooth communication module, and determining whether the Bluetooth module is in a normal data transmission state according to the version information;
[0023] If the Bluetooth communication module is not in a normal data transmission state, keeping the Bluetooth communication module in slave mode;
[0024] If the Bluetooth communication module is in a normal data transmission state, the Bluetooth communication module is set to slave mode and kept in an on state until the Bluetooth communication module waits for the external Bluetooth communication module to reply to all data and then disconnects from the external Bluetooth communication module.
[0025] As a preferred solution, sending the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module specifically includes:
[0026] When the remote communication module is in a normal working state, sending the task data to the remote communication module;
[0027] When the remote communication module is in a fault offline state, the task data is sent to the Bluetooth communication module.
[0028] As a preferred solution, the remote communication module is also used for:
[0029] When it is found that the communication link of the other end is closed or a link abnormality occurs, the communication link is closed and a fault signal is sent to the communication management module; wherein the fault signal is used to identify the current fault offline state of the remote communication module;
[0030] The determining the current working state of the remote communication module further includes:
[0031] When the fault identification sent by the remote communication module is received, it is determined that the remote communication module is currently in a fault offline state.
[0032] As a preferred solution, the working modes of the Bluetooth communication module include: host mode and slave mode;
[0033] When the remote communication module is in normal working state, the working mode of the Bluetooth communication module is set to slave mode;
[0034] When the remote communication module is in a fault offline state, the working mode of the Bluetooth communication module is set to the host mode.
[0035] As a preferred solution, when the working mode of the Bluetooth communication module is set to slave mode, it includes:
[0036] Determining whether the Bluetooth communication module has a communication link with other metering terminals whose Bluetooth communication modules are in host mode;
[0037] If not, the Bluetooth communication module is periodically started according to a preset period;
[0038] If yes, the Bluetooth communication module will continue to be activated.
[0039] As a preferred solution, when the working mode of the Bluetooth communication module is set to slave mode, it also includes:
[0040] When the Bluetooth communication module receives a signal that the Bluetooth communication module of another metering terminal is in host mode and the metering terminal has a request to establish a communication link, the identity information of the metering terminal corresponding to the request is obtained and the identity information is verified. After the verification is passed, the Bluetooth communication module continues to remain in the started state and establishes a communication channel with the external Bluetooth communication module of the metering terminal corresponding to the request.
[0041] As a preferred solution, after the Bluetooth communication module establishes a communication channel with the Bluetooth communication module in the metering terminal corresponding to the request, the method further includes:
[0042] The metering terminals of the established communication channel are mutually identified, and the established communication channel is associated and stored with the identity of the external Bluetooth communication module;
[0043] When receiving business data sent by an external Bluetooth communication module, the business data is decrypted, and then the decrypted task data is sent to the communication management module, so that the communication management module sends the task data to the remote communication module, and the remote communication module forwards the business data to the main station.
[0044] As a preferred solution, the communication connection is established with other metering terminals in slave mode, and after the connection is successful, the task data is sent to the connected metering terminal, so that the connected metering terminal forwards the task data to the master station, specifically including:
[0045] Continuously search for external Bluetooth signals of other metering terminals. When an accessible external Bluetooth signal is found, send a connection request to the external Bluetooth communication module, obtain the identity of the external Bluetooth communication module, and determine whether the external Bluetooth communication module can be safely accessed according to the identity;
[0046] When it is determined that the external Bluetooth communication module can be safely accessed and the external Bluetooth communication module passes the connection request, communicating with the external Bluetooth communication module and establishing a Bluetooth communication channel;
[0047] The business data is encrypted, and the encrypted business data is sent to the external Bluetooth communication module through the established Bluetooth communication channel, so that the external Bluetooth communication module decrypts the business data after receiving the encrypted business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
[0048] As a preferred solution, the encrypting the service data includes:
[0049] Encrypting the business data through a preset encryption chip;
[0050] The decrypting the service data comprises:
[0051] Decrypting the business data through the encryption chip;
[0052] Wherein, the Bluetooth communication modules are all provided with encryption chips.
[0053] As a preferred solution, the encrypting the service data further includes:
[0054] The business data is encrypted and a key is generated by a preset encryption algorithm; wherein the encryption algorithm includes: a symmetric encryption algorithm or an asymmetric encryption algorithm;
[0055] The decrypting of the service data further includes:
[0056] The business data is decrypted using a preset decryption algorithm and the key.
[0057] As a preferred solution, when the working mode of the Bluetooth communication module is the slave mode, the Bluetooth communication module is periodically started according to a preset start-up period, and broadcasts the Bluetooth access information according to a preset broadcast duration when started;
[0058] When the working mode of the Bluetooth communication module is the host mode, or when a connection request of an external Bluetooth is received, the Bluetooth communication module continues to remain in the startup state.
[0059] As a preferred solution, when the Bluetooth communication module is in the host mode and communicates with the external Bluetooth communication module for data transmission, if the remote communication module is back online and in a working state, it also includes:
[0060] The Bluetooth communication module interrupts data transmission with the external Bluetooth communication module and marks all task data currently sent;
[0061] After the external Bluetooth communication module responds to the sent data, the communication link is disconnected;
[0062] The communication management module sends all corresponding task data to the remote communication module according to the marked task data, so that the remote communication module sends the marked task data to the main station.
[0063] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0064] The technical solution of the present invention is through a communication management module, a remote communication module and a Bluetooth communication module; the communication management module is connected to the remote communication module and the Bluetooth communication module respectively, and the remote communication module is connected to the main station; the communication management module is used to receive the task data collected by the metering terminal and judge the current working status of the remote communication module, the remote communication module is used to send the task data to the main station after receiving the task data, and the Bluetooth communication module is used to establish a communication connection with other metering terminals after receiving the task data, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the main station, so that the metering terminal has the ability to automatically handle communication failures, reduces the workload of operation and maintenance personnel, and solves the problem that the data of the metering terminal cannot be uploaded to the main station on time when the remote communication module fails.
[0065] The present invention can obtain the communication status of the remote communication module through the communication management module. When the remote communication module of the metering terminal is in normal working state, the communication management module sends the task data collected by the metering terminal to the remote communication module, and the remote communication module sends the task data to the main station. At this time, normal communication is maintained between the metering terminal and the main station.
[0066] When the remote communication module of the metering terminal is in a faulty offline state and loses connection with the main station, a Bluetooth communication connection can be established with other surrounding metering terminals through the Bluetooth communication module, thereby using the remote communication channels of other metering terminals to forward the service data of the metering terminal to the main station. The remote communication method of the present invention solves the problem that the remote communication module of the metering terminal fails and the service data cannot be uploaded to the main station on time, thereby improving the communication capability of the metering terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 : A structural diagram of a remote communication system of a metering terminal provided by an embodiment of the present invention;
[0068] Figure 2 :It is the remote communication flow chart between the metering terminal and the master station when the remote communication module fails;
[0069] Figure 3 :It is the remote communication flow chart between the metering terminal and the master station when the remote communication module works normally;
[0070] Figure 4 : Flow chart of remote communication of metering terminal.
[0071] The reference numerals of the drawings in the specification are as follows:
[0072] Metering terminal 01 , communication management module 11 , remote communication module 12 , Bluetooth communication module 13 . DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0074] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0075] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0076] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0077] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0078] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0079] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0080] Embodiment 1
[0081] Please refer to Figure 1 , a remote communication system for a metering terminal provided in an embodiment of the present invention, includes: a main station and a plurality of metering terminals 01 connected to the main station for communication; each of the metering terminals 01 includes a communication management module 11 and a remote communication module 12 and a Bluetooth communication module 13 respectively connected to the communication management module 11.
[0082] In this embodiment, the master station can receive business data uploaded by the metering terminal and can actively send data to the metering terminal. There are several metering terminals, all of which realize communication connection with the master station through wireless or wired communication. The metering terminal can be installed in the intelligent collection and control terminal equipment of the dedicated transformer or public transformer area, and adopts hardware modularization and functional software design to realize flexible function expansion. At the same time, the metering terminal can realize the collection of electric energy information, data management, data transmission and execution of control commands issued by the master station.
[0083] The communication management module 11 is used to receive the collected task data, obtain the working status of the remote communication module, and send the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module.
[0084] In this embodiment, the communication management module 11 can be used to receive task data uploaded by the application, wherein the application is used to configure the collection tasks of the metering terminal and send the collected task data to the communication management module. It is also used to complete a computer program for one or more functions, including database, message parsing, business processing, data analysis and processing, task reporting, alarm reporting, etc., thereby generating corresponding task data and sending it to the communication management module 11, and the communication management module 11 sends the corresponding task data to the corresponding master station through the corresponding communication module (including the remote communication module and the Bluetooth communication module).
[0085] The remote communication module 12 is used to send the task data to the main station after receiving the task data.
[0086] In this embodiment, the above-mentioned remote communication module 12 is a hardware module for remote communication with the main station, which is responsible for sending and receiving data with the main station. Under normal circumstances, the remote communication module is responsible for uploading the data collected by the metering terminal to the main station and receiving the data actively sent by the main station. When the remote communication module fails, the only communication channel between the metering terminal and the main station is disconnected. At this time, the metering terminal cannot communicate with the main station, resulting in communication interruption.
[0087] The Bluetooth communication module 13 is used to set the initial slave mode to the host mode after receiving the task data, and establish a communication connection with the remaining metering terminals in the slave mode, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the master station.
[0088] In this embodiment, the Bluetooth communication module 13 is a hardware module for performing Bluetooth communication with the metering terminal, and is responsible for sending and receiving data with the metering terminal. The Bluetooth communication module 13 can work in a slave mode or a host mode.
[0089] It can be understood that adding a Bluetooth communication module 13 to the metering terminal can enable the metering terminal with a faulty remote communication module to communicate with the main station through other metering terminals, which can greatly improve the communication stability of the metering terminal, reduce the cost of manual maintenance, and expand the use scenarios of the metering terminal. At the same time, one metering terminal can serve as a medium for multiple metering terminals to communicate with the main station at the same time. Each metering terminal has a unique communication logical address in the network. The metering terminal acting as a medium records the terminal logical address and the corresponding Bluetooth channel that has the need to forward data. When it receives the message sent by the main station, it forwards it to the corresponding Bluetooth channel according to the logical address, ensuring that there is no crosstalk when multiple metering terminals exist at the same time.
[0090] For example, the application sends the collected task data to the communication management module; the communication management module determines whether the current remote communication module is normal according to whether the remote communication module is in place, module heartbeat message monitoring, communication status with the main station, etc.; at the same time, the response of the remote communication module is checked according to the AT command test, and the version information of the Bluetooth communication module is obtained to check whether the Bluetooth communication module is transmitting data normally, so as to understand the operating status of each communication module in the metering terminal, and forward the task data to the remote communication module or the Bluetooth communication module; then the remote communication module sends the data to the main station or the Bluetooth communication module forwards the data to the surrounding metering terminals that have established Bluetooth communication channels; finally, after receiving the data sent by the metering terminal, the main station replies to confirm the received data.
[0091] In this embodiment, during the operation of the metering terminal, the remote communication module fails and the service data of the metering terminal cannot be uploaded to the metering master station. A method for sharing a remote communication channel between metering terminals is proposed. The method for sharing a remote communication channel uses a Bluetooth transmission scheme. When the remote communication module fails, the failed metering terminal can establish a Bluetooth communication channel with the surrounding metering terminals, thereby using the remote communication channels of the surrounding metering terminals to communicate with the master station. This method increases the communication disaster recovery mechanism of the metering terminal, ensures that the metering terminal with a failed remote communication module can normally upload data to the metering master station, and improves the ability of the metering terminal to automatically handle communication failures.
[0092] Implementing the above embodiments has the following effects:
[0093] The present invention is aimed at the problem that during the operation of the metering terminal, the remote communication module fails and the data of the metering terminal cannot be uploaded to the main station on time, and proposes a method and system for the metering terminal to share a remote communication channel. In this shared remote communication channel system, an application program, a communication management module, a remote communication module and a Bluetooth communication module for the metering terminal to obtain task data are involved. The present invention proposes a Bluetooth data transmission strategy based on the Bluetooth communication module, that is, when the remote communication module of the metering terminal fails and cannot maintain communication with the main station, the Bluetooth communication module of the metering terminal establishes a Bluetooth communication channel with the Bluetooth communication modules of the surrounding metering terminals, so that the data of the faulty terminal is transmitted to the surrounding terminals through the Bluetooth channel, and finally the data of the faulty terminal is uploaded to the main station by borrowing the remote communication channel of the surrounding terminals. Through the shared remote communication channel method proposed by the present invention, the metering terminal has the ability to automatically handle communication failures, reduces the workload of operation and maintenance personnel, and solves the problem that the data of the metering terminal cannot be uploaded to the main station on time when the remote communication module fails.
[0094] Embodiment 2
[0095] See also Figure 2 , 3 and 4. This embodiment provides a remote communication module in a metering terminal, wherein the remote communication module is used to send the task data to a master station after receiving the task data.
[0096] In this embodiment, the module in the metering terminal responsible for sending and receiving data with the master station is the only module in the metering terminal that can communicate with the master station.
[0097] As a preferred solution of this embodiment, the communication management module obtains the working status of the remote communication module, specifically including:
[0098] Send a detection signal to the remote communication module so that the remote communication module generates and sends a response message according to the detection signal; receive the response message sent by the remote communication module, and judge the working status of the remote communication module according to the response message; wherein the working status includes a normal working status and a fault offline status.
[0099] In this embodiment, the communication management module ensures that the remote communication function module is not in a faulty state by sending a corresponding detection signal to the remote communication module, that is, it can ensure the transmission of task data, and receive and parse the response message generated by the corresponding remote communication module in response to the corresponding detection signal, so as to judge the working status of the remote communication module, and finally determine the status of the remote communication module, that is, determine whether the remote communication module is in a normal working state or a faulty offline state.
[0100] As a preferred solution of this embodiment, the remote communication module is also used for:
[0101] After receiving the detection signal sent by the communication management module, read the current in-place state, and send the in-place state to the communication management module, so that the communication management module analyzes the in-place state and initiates heartbeat detection to the other end of the remote communication module according to the analysis result;
[0102] After receiving the heartbeat detection signal, a response is initiated to the remote communication module, so that when the communication management module receives the response message from the remote communication module, it determines that the remote communication module is currently in a normal working state; when the response message from the remote communication module is not received, it is determined that the remote communication module is currently in a faulty offline state.
[0103] In this embodiment, after receiving the detection signal sent by the communication management module, the remote communication module immediately reads the current remote communication module's own in-place status, and sends the corresponding in-place status to the communication management module to ensure that the remote communication module can remain in place for a long time during the data transmission process, avoiding the situation where the module suddenly goes offline and causes the data transmission to be terminated and failed. At the same time, after receiving the in-place status of the remote communication module, the communication management module initiates a heartbeat detection to the other end of the remote communication module, so that the remote communication module initiates a response after receiving the heartbeat detection signal, that is, the remote communication module generates a corresponding response message after performing its own heartbeat detection, and sends it to the communication management module. When the communication management module receives the response message of the remote communication module, it determines that the remote communication module is currently in a normal working state; otherwise, the upstream communication module is currently in a faulty offline state.
[0104] As a preferred solution of this embodiment, the analyzing the in-place status and initiating a heartbeat detection to the other end of the remote communication module according to the analysis result specifically includes:
[0105] If the current in-place state is in the running state, a heartbeat detection is initiated to the opposite end of the remote communication module, so that the remote communication module generates a heartbeat message according to the signal of the heartbeat detection, and sends the heartbeat message to the management communication module; the received heartbeat message is monitored, and according to the monitored heartbeat message, the communication state between the remote communication module and the master station is obtained by parsing;
[0106] If the current on-site status is in a stopped state, the remote communication module is directly judged as a fault offline state.
[0107] In this embodiment, when the communication management module analyzes the in-place status, it determines whether the in-place status of the current remote communication function module is in a running state. If so, the communication management module initiates a heartbeat detection to the other end of the remote communication module according to the analysis result, and then the remote communication module generates a heartbeat message according to the heartbeat detection signal, and sends the heartbeat message to the management communication module, so that the management communication module monitors the received heartbeat message, and then analyzes the communication status of the remote communication module and the main station according to the monitored heartbeat message.
[0108] As a preferred solution of this embodiment, when receiving the response message of the remote communication module, judging that the remote communication module is currently in a normal working state specifically includes:
[0109] According to the communication status and the heartbeat message, an AT instruction set is generated;
[0110] According to the AT instruction set, the response of the remote communication module is tested, and after the remote communication module responds, the remote communication module is marked as being in a normal working state.
[0111] In this embodiment, the communication management module generates a corresponding AT instruction set through the received communication status of the remote communication module and its corresponding heartbeat message. The AT instruction set is a standard command set for controlling and configuring modems, mobile phones and other communication devices. The error code and message report of the AT instruction are crucial for debugging and ensuring the normal operation of the device. For example, "OK" means that the command is executed successfully, while "ERROR" means that the command fails to execute. Therefore, the response of the remote communication module is tested by the AI instruction set, so that the current working status of the remote communication module can be finally determined, so as to avoid errors in data transmission and improve the accuracy of data transmission.
[0112] As a preferred solution of this embodiment, after the remote communication module responds, the method further includes:
[0113] Obtaining version information of the Bluetooth communication module, and determining whether the Bluetooth module is in a normal data transmission state according to the version information;
[0114] If the Bluetooth communication module is not in a normal data transmission state, keeping the Bluetooth communication module in slave mode;
[0115] If the Bluetooth communication module is in a normal data transmission state, the Bluetooth communication module is set to slave mode and kept in an on state until the Bluetooth communication module waits for the external Bluetooth communication module to reply to all data and then disconnects from the external Bluetooth communication module.
[0116] In this embodiment, after the remote communication module responds, it is also necessary to ensure that the Bluetooth communication module is in the working state of the slave mode to ensure that during the data transmission process, if there is a sudden failure of its own remote communication module or a communication failure of other metering terminals, the data of other metering terminals can be taken over and sent to the main station.
[0117] In this embodiment, when the Bluetooth communication module is not in a normal data transmission state, the Bluetooth communication module is maintained in slave mode, that is, the Bluetooth communication module operates in slave mode and is started periodically; and when the Bluetooth communication module is in a normal data transmission state, the Bluetooth communication module is directly set from host mode to slave mode, and the Bluetooth communication module no longer sends data to the external Bluetooth communication module. At the same time, the Bluetooth communication module waits for the external Bluetooth communication module to reply to all data before disconnecting from the external Bluetooth communication module.
[0118] As a preferred solution of this embodiment, sending the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module specifically includes:
[0119] When the remote communication module is in a normal working state, the task data is sent to the remote communication module; when the remote communication module is in a fault offline state, the task data is sent to the Bluetooth communication module.
[0120] In this embodiment, when the remote communication module is in a normal working state, the task data is sent to the remote communication module, and the remote communication module transmits the task data; when the remote communication module is in a faulty offline state, the task data is sent to the Bluetooth communication module, and the Bluetooth communication module sends the corresponding task data to other metering terminals, and the other metering terminals implement the uploading of the task data, and the other metering terminals will also feedback the corresponding data transmission information to the Bluetooth communication module to ensure the accuracy and security of data transmission.
[0121] As a preferred solution of this embodiment, the remote communication module is also used for:
[0122] When it is found that the communication link of the other end is closed or a link abnormality occurs, the communication link is closed and a fault signal is sent to the communication management module; wherein the fault signal is used to identify the current fault offline state of the remote communication module;
[0123] The determining the current working state of the remote communication module further includes:
[0124] When the fault identification sent by the remote communication module is received, it is determined that the remote communication module is currently in a fault offline state.
[0125] In this embodiment, when the remote communication module finds that the communication link of the other end is closed or a link abnormality occurs, that is, the communication link between the remote communication module and the main station is abnormal, it directly closes the corresponding communication link and sends a fault signal to the communication management module, thereby indicating that the remote communication module is currently unable to communicate with the main station, that is, it is in a faulty offline state.
[0126] Implementing the above embodiments has the following effects:
[0127] In the embodiment of the present invention, when the remote communication module of the metering terminal fails and cannot maintain communication with the main station, the Bluetooth communication module of the metering terminal establishes a Bluetooth communication channel with the external Bluetooth communication modules of the surrounding metering terminals, so that the data of the faulty terminal is transmitted to the surrounding terminals through the Bluetooth channel, and finally the data of the faulty terminal is uploaded to the main station by borrowing the remote communication channel of the surrounding terminals. Through the shared remote communication channel method proposed by the present invention, the metering terminal has the ability to automatically handle communication failures, reduces the workload of operation and maintenance personnel, and solves the problem that the data of the metering terminal cannot be uploaded to the main station on time when the remote communication module fails.
[0128] Embodiment 3
[0129] See also Figure 2 , 3and 4. This embodiment provides a Bluetooth communication module in a metering terminal, wherein the Bluetooth communication module is used to set the initial slave mode to the host mode after receiving the task data, and establish a communication connection with the remaining metering terminals in the slave mode, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the master station.
[0130] In this embodiment, the Bluetooth communication module is a hardware module that performs Bluetooth communication with the metering terminal and is responsible for sending and receiving data with the terminal. The Bluetooth communication module can work in slave mode or host mode.
[0131] The working mode of the Bluetooth communication module includes: a host mode and a slave mode; when the remote communication module is in a normal working state, the working mode of the Bluetooth communication module is set to the slave mode; when the remote communication module is in a fault offline state, the working mode of the Bluetooth communication module is set to the host mode.
[0132] In this embodiment, in order to ensure the robustness and reliability of the communication system and ensure that when a problem occurs in the main communication link, the backup link can take over in time to maintain the continuity of communication, the working mode of the Bluetooth communication module is switched under different working conditions, so that the Bluetooth communication module can be set to switch to slave mode or host mode when the remote communication module is in normal working state and fault offline state respectively.
[0133] As a preferred solution of this embodiment, when the working mode of the Bluetooth communication module is set to slave mode, it includes:
[0134] Determine whether the Bluetooth communication module has a communication link with the metering terminal of other Bluetooth communication modules in host mode; if not, the Bluetooth communication module is periodically started according to a preset period; if yes, the Bluetooth communication module continues to remain in the started state.
[0135] As a preferred solution of this embodiment, when the working mode of the Bluetooth communication module is set to slave mode, it also includes:
[0136] When the Bluetooth communication module receives a signal that the Bluetooth communication module of another metering terminal is in host mode and the metering terminal has a request to establish a communication link, the identity information of the metering terminal corresponding to the request is obtained and the identity information is verified. After the verification is passed, the Bluetooth communication module continues to remain in the started state and establishes a communication channel with the external Bluetooth communication module of the metering terminal corresponding to the request.
[0137] As a preferred solution of this embodiment, after the Bluetooth communication module establishes a communication channel with the Bluetooth communication module in the metering terminal corresponding to the request, the method further includes:
[0138] The metering terminals of the established communication channel are mutually identified, and the established communication channel is associated with the identity identification of the external Bluetooth communication module and stored; when the business data sent by the external Bluetooth communication module is received, the business data is decrypted, and then the decrypted task data is sent to the communication management module, so that the communication management module sends the task data to the remote communication module, and the remote communication module forwards the business data to the main station.
[0139] As a preferred solution of this embodiment, the communication connection is established with other metering terminals in slave mode, and after the connection is successful, the task data is sent to the connected metering terminal, so that the connected metering terminal forwards the task data to the master station, specifically including:
[0140] Continuously search for external Bluetooth signals of other metering terminals. When an accessible external Bluetooth signal is found, send a connection request to the external Bluetooth communication module, obtain the identity of the external Bluetooth communication module, and determine whether the external Bluetooth communication module can be safely accessed according to the identity;
[0141] When it is determined that the external Bluetooth communication module can be safely accessed and the external Bluetooth communication module passes the connection request, communicating with the external Bluetooth communication module and establishing a Bluetooth communication channel;
[0142] The business data is encrypted, and the encrypted business data is sent to the external Bluetooth communication module through the established Bluetooth communication channel, so that the external Bluetooth communication module decrypts the business data after receiving the encrypted business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
[0143] In this embodiment, by continuously searching for external Bluetooth signals of other metering terminals, when an accessible external Bluetooth signal is searched, a connection request is sent to the external Bluetooth communication module to ensure that the Bluetooth communication module can accurately access the corresponding external Bluetooth, and at the same time obtain the identity of the external Bluetooth communication module, and judge whether the external Bluetooth communication module can be safely accessed according to the identity, so as to improve the reliability and security of Bluetooth communication and avoid the security risks caused by identity forgery of Bluetooth communication devices.
[0144] In this embodiment, when it is determined that the external Bluetooth communication module can be safely accessed, and at the same time, the external Bluetooth communication module can communicate with the external Bluetooth communication module through a connection request, a Bluetooth communication channel is established between the Bluetooth communication modules in the two metering terminals to ensure Bluetooth communication interoperability between the metering terminals.
[0145] In this embodiment, after constructing the corresponding Bluetooth communication channel, the business data to be sent is encrypted, and then the encrypted business data is sent to the external Bluetooth communication module through the established Bluetooth communication channel, so that the external Bluetooth communication module decrypts the business data after receiving the encrypted business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
[0146] As a preferred solution of this embodiment, encrypting the service data includes:
[0147] Encrypting the business data through a preset encryption chip;
[0148] The decrypting the service data comprises:
[0149] The business data is decrypted by the encryption chip; wherein the Bluetooth communication modules are all provided with an encryption chip.
[0150] As a preferred solution of this embodiment, the encrypting the service data further includes:
[0151] The business data is encrypted and a key is generated by a preset encryption algorithm; wherein the encryption algorithm includes: a symmetric encryption algorithm or an asymmetric encryption algorithm;
[0152] The decrypting of the service data further includes:
[0153] The business data is decrypted using a preset decryption algorithm and the key.
[0154] In this embodiment, encryption of business data can be achieved by means of an encryption chip or an encryption algorithm. Preferably, each metering terminal is provided with an ESAM encryption chip, which is an embedded security module chip. The ESAM chip usually has built-in hardware encryption and security algorithms, and can provide secure identity authentication, encryption and decryption functions. It can also store digital certificates and keys, and provide protection for these confidential information. The metering terminal encrypts the message to be sent through ESAM and sends it out through Bluetooth. Similarly, the message returned through the Bluetooth channel is decrypted by ESAM and the plaintext message is parsed out.
[0155] As a preferred solution of this embodiment, when the working mode of the Bluetooth communication module is the slave mode, the Bluetooth communication module is periodically started according to a preset start-up cycle, and broadcasts the Bluetooth access information according to a preset broadcast duration when started;
[0156] When the working mode of the Bluetooth communication module is the host mode, or when a connection request of an external Bluetooth is received, the Bluetooth communication module continues to remain in the startup state.
[0157] In this embodiment, when the working mode of the Bluetooth communication module is the slave mode, it means that the remote communication module of the metering terminal is in normal working state, so the metering terminal can be used as a relay for transmitting data from other metering terminals to the master station. Thus, the Bluetooth communication module can be started periodically according to the preset startup cycle, which can reduce the energy consumption of the device operation, and broadcast the Bluetooth access information according to the preset broadcast duration when starting. When the working mode of the Bluetooth communication module is the host mode, or when receiving a connection request from an external Bluetooth, the Bluetooth communication module continues to remain in the startup state to avoid sudden interruption of the Bluetooth communication module during data transmission.
[0158] As a preferred solution of this embodiment, when the Bluetooth communication module is in the host mode and communicates with the external Bluetooth communication module for data transmission, if the remote communication module is back online and in a working state, it also includes:
[0159] The Bluetooth communication module interrupts data transmission with the external Bluetooth communication module and marks all currently sent task data; after the external Bluetooth communication module replies to the sent data, the communication link is disconnected; the communication management module sends all corresponding task data to the remote communication module based on the marked task data, so that the remote communication module sends the marked task data to the main station.
[0160] In this embodiment, when the remote communication module is back online and in a working state, the Bluetooth communication module directly interrupts the data transmission with the external Bluetooth communication module, and marks all the currently sent task data to be re-transmitted or continued by the remote communication module. At the same time, after the external Bluetooth communication module replies to the sent data, the communication link is disconnected to avoid corresponding deviations between the transmitted data, resulting in low accuracy and reliability of data transmission. Then, the communication management module sends all the corresponding task data to the remote communication module according to the marked task data, so that the remote communication module re-transmits the marked task data to the main station or continues to send it.
[0161] Implementing the above embodiments has the following effects:
[0162] In the embodiment of the present invention, when the remote communication module of the metering terminal fails and cannot maintain communication with the main station, the Bluetooth communication module of the metering terminal establishes a Bluetooth communication channel with the external Bluetooth communication modules of the surrounding metering terminals, so that the data of the faulty terminal is transmitted to the surrounding terminals through the Bluetooth channel, and finally the data of the faulty terminal is uploaded to the main station by borrowing the remote communication channel of the surrounding terminals. Through the shared remote communication channel method proposed by the present invention, the metering terminal has the ability to automatically handle communication failures, reduces the workload of operation and maintenance personnel, and solves the problem that the data of the metering terminal cannot be uploaded to the main station on time when the remote communication module fails.
[0163] Embodiment 4
[0164] Please refer to Figure 1 , is a structural diagram of a remote communication system of a metering terminal provided by an embodiment of the present invention, comprising: a communication management module, a remote communication module and a Bluetooth communication module;
[0165] The communication management module is connected to the remote communication module and the Bluetooth communication module respectively, and the remote communication module is connected to the main station;
[0166] The communication management module is used to receive the task data collected by the metering terminal and determine the current working state of the remote communication module. When the remote communication module is in a normal working state, the task data is sent to the remote communication module; when the remote communication module is in a fault offline state, the task data is sent to the Bluetooth communication module;
[0167] The remote communication module is used to send the task data to the main station after receiving the task data;
[0168] The Bluetooth communication module is used to establish a communication connection with other metering terminals after receiving the task data, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the main station.
[0169] As a preferred solution, the remote communication system of the metering terminal further includes: an application module; the application module is connected to the communication management module; the application module is used to configure the collection tasks of the metering terminal and send the task data collected by the metering terminal to the communication management module.
[0170] like Figure 1 As shown, the present invention sets a communication management module, a remote communication module and a Bluetooth communication module inside the metering terminal to realize the interaction between the metering terminal and the main station. The functions of each module are as follows:
[0171] Application: configures the collection tasks of the metering terminal and sends the task data collected by the metering terminal to the communication management module.
[0172] Communication management module: responsible for managing the data transmission channel in the metering terminal, and can forward the business data of the application to the remote communication module or Bluetooth communication module.
[0173] Remote communication module: The module in the metering terminal that is responsible for sending and receiving data with the main station. It is the only module in the metering terminal that can communicate with the main station.
[0174] Bluetooth communication module: A module in the metering terminal that is responsible for sending and receiving data with other metering terminals. When the remote communication module fails, a Bluetooth communication channel can be established with the surrounding metering terminals through the Bluetooth communication module, thereby using the remote communication channels of the surrounding metering terminals to communicate with the master station. The Bluetooth communication module can work in slave mode. When the Bluetooth communication module in slave mode receives encrypted data from other terminals, it decrypts the data and forwards it to the communication management module; the Bluetooth communication module can also work in host mode. When the Bluetooth communication module in host mode receives data from the communication management module, it encrypts the data and forwards it to the surrounding metering terminals that have established Bluetooth communication channels.
[0175] Master station: Receives and responds to task data uploaded by the metering terminal.
[0176] As a preferred solution, the determination of the current working state of the remote communication module includes: initiating a heartbeat detection to the other end of the remote communication module, and when a response from the remote communication module is received, determining that the remote communication module is currently in a normal working state; if no response from the remote communication module is received, determining that the remote communication module is currently in a faulty offline state.
[0177] As a preferred solution, the remote communication module is also used to close the socket link and send a fault signal to the communication management module when it is found that the socket link of the other end is closed or a link abnormality occurs; wherein the fault signal is used to identify the current fault offline state of the remote communication module; the judging of the current working state of the remote communication module also includes: when receiving the fault identifier sent by the remote communication module, judging that the remote communication module is currently in a fault offline state.
[0178] When the metering terminal interacts with the main station, the application first sends the task data collected by the metering terminal to the communication management module. The communication management module will determine the current working status of the remote communication module and the Bluetooth communication module, and then decide to forward the data to the remote communication module or the Bluetooth communication module according to the current working status of the remote communication module and the Bluetooth communication module; when the remote communication module is in normal working state, the task data is forwarded to the remote communication module, and when the remote communication module is in a fault offline state and the Bluetooth communication module is in an online state, the task data is sent to the Bluetooth communication module; then the remote communication module sends the data to the main station or the Bluetooth communication module forwards the data to the metering terminal that has established a Bluetooth communication channel around it; finally, after receiving the data sent by the metering terminal, the main station replies to confirm the received data.
[0179] The communication management module can determine the current working status of the remote communication module and the Bluetooth communication module in the following three ways:
[0180] 1. If the remote communication module finds that the socket link of the other end is closed or a link abnormality occurs, the socket connection is closed and a signal indicating its fault offline state is returned to the communication management module; when the communication management module receives the signal, it determines that the remote communication module is currently in a fault offline state;
[0181] 2. The communication management module initiates a heartbeat detection to the other end of the remote communication module. When receiving a response from the remote communication module, it is determined that the remote communication module is currently in a normal working state; if no response from the remote communication module is received, it is determined that the remote communication module is currently in a fault offline state;
[0182] 3. The communication management module inquires about the link status of the Bluetooth communication module, and the Bluetooth communication module returns offline or online information. When the offline information of the Bluetooth communication module is received, it is determined that the Bluetooth communication module is currently in an offline state; when the online information of the Bluetooth communication module is received, it is determined that the Bluetooth communication module is currently in an online state.
[0183] As a preferred embodiment, the working mode of the Bluetooth communication module includes: host mode and slave mode; when the remote communication module is in a normal working state, the working mode of the Bluetooth communication module is slave mode; when the remote communication module is in a fault offline state, the working mode of the Bluetooth communication module is host mode.
[0184] As a preferred solution, when the working mode of the Bluetooth communication module is the host mode, a communication connection is established with other metering terminals, and after the connection is successful, the task data is sent to the connected metering terminal, so that the connected metering terminal forwards the task data to the main station, including: continuously searching for external Bluetooth signals of other metering terminals, and when an accessible external Bluetooth signal is searched, sending a connection request to the external Bluetooth, and obtaining the identity of the external Bluetooth, and judging whether the external Bluetooth can be safely accessed according to the identity; when it is determined that the external Bluetooth can be safely accessed and the external Bluetooth passes the connection request, communicating with the external Bluetooth and establishing a Bluetooth communication channel; encrypting the business data, and sending the encrypted business data to the external Bluetooth through the established Bluetooth communication channel, so that the external Bluetooth decrypts the business data after receiving the encrypted business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
[0185] As a preferred solution, the encrypting the business data includes: decrypting the business data through a preset chip; the decrypting the business data includes: decrypting the business data through the chip.
[0186] As a preferred solution, the encrypting the business data also includes: encrypting the business data and generating a key through a preset encryption algorithm; wherein the encryption algorithm includes: a symmetric encryption algorithm or an asymmetric encryption algorithm; the decrypting the business data also includes: decrypting the business data through a preset decryption algorithm and the key.
[0187] Please refer to Figure 2 , is a remote communication flow chart between the metering terminal and the main station when the remote communication module fails. When the remote communication module fails and cannot be connected to the main station for a long time, the application sends data to the communication management module, and then the communication management module forwards the data to the Bluetooth communication module. At this time, the Bluetooth communication module works in host mode.
[0188] Among them, the basic principle is: when the remote communication module fails and cannot connect to the main station for a long time, the communication management module marks the remote communication module as offline; after the remote communication module is offline, the Bluetooth communication module works in host mode and remains started until the remote communication module is back online.
[0189] The working mechanism of the Bluetooth communication module in host mode is as follows:
[0190] After the communication management module marks the remote communication module offline, the Bluetooth communication module works in host mode and remains started until the remote communication module is back online; the Bluetooth communication module continuously searches for surrounding Bluetooth signals, and when an accessible Bluetooth signal is found, it attempts to access the Bluetooth signal; when the Bluetooth communication module attempts to establish a link, it needs to verify the identity of the external Bluetooth signal to confirm whether the external Bluetooth can be safely accessed, and the external Bluetooth also needs to verify the identity of the Bluetooth communication module to confirm the access information of the Bluetooth communication module; after the Bluetooth communication module establishes a Bluetooth communication channel with the external Bluetooth, the business data to be uploaded to the main station is encrypting and then sending it to the external Bluetooth; when the remote communication module is back online, the Bluetooth communication module no longer sends data to the external Bluetooth, and the Bluetooth communication module waits for all data replies from the external Bluetooth before disconnecting from the external Bluetooth.
[0191] After receiving the encrypted business data, the external Bluetooth decrypts the business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
[0192] Among them, when the Bluetooth communication module encrypts the business data, there are two encryption methods: hard encryption: configure an encryption chip in the metering terminal, and when the metering terminal needs to transmit sensitive data, use the encryption chip for encryption; when the metering terminal receives the encrypted data, it can also use the encryption chip for decryption; soft encryption: design an encryption algorithm in the metering terminal, such as the currently commonly used symmetric and asymmetric encryption and decryption algorithms. Among them, the public key and private key of the encryption algorithm can be configured by the master station or the terminal itself.
[0193] As a preferred solution, when the working mode of the Bluetooth communication module is the slave mode, the Bluetooth communication module is also used to obtain the identity of the external Bluetooth when receiving a connection request from an external Bluetooth, and verify the identity of the external Bluetooth according to the identity; when the identity authentication of the external Bluetooth is passed, communicate with the external Bluetooth and establish a Bluetooth communication channel through the connection request of the external Bluetooth; the established Bluetooth communication channel is associated with the identity of the external Bluetooth and stored; when business data sent by the external Bluetooth is received, the business data is decrypted, and the decrypted task data is sent to the communication management module, so that the communication management module sends the task data to the remote communication module, and the remote communication module forwards the business data to the main station.
[0194] Please refer to Figure 3, which is a remote communication flow chart between the metering terminal and the master station when the remote communication module works normally. When the remote communication module of the metering terminal works normally, the application sends data to the communication management module, and then the communication management module forwards the data to the remote communication module, and finally the remote communication module sends the data to the master station. At this time, the Bluetooth communication module works in slave mode.
[0195] Among them, the basic principles are: the remote communication module receives the data sent by the communication management module, and then uploads the data directly to the main station; the Bluetooth communication module works in slave mode, when the Bluetooth communication module has no external link, the Bluetooth communication module starts periodically; when the Bluetooth communication module has an external link, the Bluetooth communication module remains started.
[0196] The working mechanism of the Bluetooth communication module in slave mode is as follows: when the remote communication module works normally, the Bluetooth communication module works in slave mode and starts periodically; when the Bluetooth communication module finds that there is an external link attempt to establish, it needs to verify the identity of the external link first. After the identity authentication is passed, the Bluetooth inside the metering terminal successfully establishes a communication channel with the external Bluetooth. At this time, the Bluetooth communication module remains in the startup state until the external communication channel is disconnected; after the Bluetooth communication channel between the terminals is successfully established, the metering terminals need to identify each other and save the identity ID of the linked terminal to prevent the transmission link from being confused when sending and receiving data, and the data cannot reach the destination terminal; when the Bluetooth communication module transmits data, it needs to encrypt the data; after the Bluetooth communication module inside the metering terminal receives the encrypted data transmitted by the external Bluetooth, it decrypts the encrypted data and sends it to the communication management module, and finally the communication management module sends the decrypted data to the remote communication module and the remote communication module uploads it to the master station; when the Bluetooth communication module receives the disconnection information of the external Bluetooth and the external Bluetooth receives the disconnection confirmation of the Bluetooth communication module, the pair of Bluetooth communication channels are disconnected, and both parties clear the historical data of the Bluetooth communication channel.
[0197] As a preferred solution, when the working mode of the Bluetooth communication module is a slave mode, the Bluetooth communication module is periodically started according to a preset startup cycle, and broadcasts Bluetooth access information according to a preset broadcast duration when started; when the working mode of the Bluetooth communication module is a host mode, or when a connection request from an external Bluetooth is received, the Bluetooth communication module continues to remain in the started state.
[0198] It should be noted that when the working mode of the Bluetooth communication module is the host mode, or when a connection request from an external Bluetooth is received, the Bluetooth communication module continues to remain in the startup state. When the working mode of the Bluetooth communication module is the slave mode, the Bluetooth communication module will broadcast Bluetooth access information. At this time, in order to reduce the power consumption of the Bluetooth module, the Bluetooth communication module will be periodically started according to a preset startup cycle, and will broadcast Bluetooth access information according to a preset broadcast duration when started. In a specific embodiment, the Bluetooth communication module can be set to start once every 15 seconds, and broadcast the Bluetooth access signal for 5 seconds each time when started, wherein the startup cycle and broadcast duration can be set according to specific needs.
[0199] The following provides a specific interaction example to further illustrate the interaction process of the remote communication system of the present invention:
[0200] Please refer to Figure 4 , which is the process of remote communication of metering terminal Figure 4 ,Scenario: There are two metering terminals in the substation, namely metering terminal 1 and metering terminal 2.
[0201] The metering terminal 1 is configured with an application 1 , a communication management module 1 , a remote communication module 1 and a Bluetooth communication module 1 .
[0202] The metering terminal 2 is configured with an application 2 , a communication management module 2 , a remote communication module 2 and a Bluetooth communication module 2 .
[0203] When the remote communication module 1 of the metering terminal 1 operates normally and maintains connection with the master station, and the remote communication module 2 of the metering terminal 2 fails and loses communication with the master station:
[0204] The Bluetooth communication module 1 works in the slave mode, and the Bluetooth communication module 2 works in the host mode;
[0205] The Bluetooth communication module 2 searches for surrounding Bluetooth signals and tries to connect to the Bluetooth communication module 1;
[0206] The Bluetooth communication module 1 and the Bluetooth communication module 2 mutually authenticate each other's identities. If the identity authentication is successful, the two parties establish a formal Bluetooth communication channel and start sending and receiving data; otherwise, the two parties disconnect the temporary communication channel;
[0207] The communication management module 2 receives the data sent by the application 2, and then forwards the data to the Bluetooth communication module 2;
[0208] After receiving the data from the communication management module 2, the Bluetooth communication module 2 encrypts the data and sends it to the Bluetooth communication module 1;
[0209] After receiving the data from the Bluetooth communication module 2, the Bluetooth communication module 1 decrypts the data and sends it to the communication management module 1, which is finally sent to the main station by the remote communication module 1;
[0210] The master station sends the data to be sent to the metering terminal 2 to the metering terminal 1. After receiving the data from the metering terminal 2, the remote communication module 1 forwards the data to the communication management module 1. The communication management module 1 sends the data to the Bluetooth communication module 1. Finally, the Bluetooth communication module 1 encrypts the data and sends it to the Bluetooth communication module 2.
[0211] After receiving the data returned by the Bluetooth communication module 1 , the Bluetooth communication module 2 decrypts the data and sends it to the communication management module 2 , which is finally forwarded to the application 2 by the communication management module 2 .
[0212] It can be seen that the present invention provides a remote communication system for a metering terminal, which can obtain the communication status of the remote communication module through the communication management module. When the remote communication module of the metering terminal is in normal working state, the communication management module sends the task data collected by the metering terminal to the remote communication module, and the remote communication module sends the task data to the main station. At this time, normal communication is maintained between the metering terminal and the main station.
[0213] When the remote communication module of the metering terminal is in a faulty offline state and loses connection with the main station, a Bluetooth communication connection can be established with other surrounding metering terminals through the Bluetooth communication module, thereby using the remote communication channels of other metering terminals to forward the service data of the metering terminal to the main station. Through the remote communication method of the present invention, the metering terminal has the ability to automatically handle communication failures, reduces the workload of operation and maintenance personnel, and solves the problem that the data of the metering terminal cannot be uploaded to the main station on time when the remote communication module fails.
[0214] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A remote communication system for a metering terminal, characterized in that: include: A main station and several metering terminals connected to the main station in communication; each of the metering terminals includes a communication management module and a remote communication module and a Bluetooth communication module respectively connected to the communication management module; The communication management module is used to receive the collected task data, obtain the working status of the remote communication module, and send the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module; The remote communication module is used to send the task data to the main station after receiving the task data; The Bluetooth communication module is used to set the initial slave mode to the host mode after receiving the task data, and establish a communication connection with the remaining metering terminals in the slave mode, and send the task data to the connected metering terminal after the connection is successful, so that the connected metering terminal forwards the task data to the master station.
2. A remote communication system for a metering terminal as claimed in claim 1, characterized in that: The obtaining of the working status of the remote communication module specifically includes: Sending a detection signal to the remote communication module, so that the remote communication module generates and sends a response message according to the detection signal; Receive a response message sent by the remote communication module, and determine the working status of the remote communication module according to the response message; wherein the working status includes a normal working status and a fault offline status.
3. A remote communication system for a metering terminal as claimed in claim 2, characterized in that: The remote communication module is also used for: After receiving the detection signal sent by the communication management module, read the current in-place state, and send the in-place state to the communication management module, so that the communication management module analyzes the in-place state and initiates heartbeat detection to the other end of the remote communication module according to the analysis result; After receiving the heartbeat detection signal, a response is initiated to the remote communication module, so that when the communication management module receives the response message from the remote communication module, it determines that the remote communication module is currently in a normal working state; when the response message from the remote communication module is not received, it is determined that the remote communication module is currently in a faulty offline state.
4. A remote communication system for a metering terminal according to any one of claim 3, characterized in that: The analyzing the in-place status and initiating a heartbeat detection to the other end of the remote communication module according to the analysis result specifically includes: If the current in-place state is in the running state, a heartbeat detection is initiated to the opposite end of the remote communication module, so that the remote communication module generates a heartbeat message according to the signal of the heartbeat detection, and sends the heartbeat message to the management communication module; the received heartbeat message is monitored, and according to the monitored heartbeat message, the communication state between the remote communication module and the master station is obtained by parsing; If the current on-site status is in a stopped state, the remote communication module is directly judged as a fault offline state.
5. A remote communication system for a metering terminal according to any one of claims 4, characterized in that: When receiving the response message of the remote communication module, determining that the remote communication module is currently in a normal working state specifically includes: According to the communication status and the heartbeat message, an AT instruction set is generated; According to the AT instruction set, the response of the remote communication module is tested, and after the remote communication module responds, the remote communication module is marked as being in a normal working state.
6. A remote communication system for a metering terminal as claimed in claim 5, characterized in that: After the remote communication module responds, the method further includes: Obtaining version information of the Bluetooth communication module, and determining whether the Bluetooth module is in a normal data transmission state according to the version information; If the Bluetooth communication module is not in a normal data transmission state, keeping the Bluetooth communication module in slave mode; If the Bluetooth communication module is in a normal data transmission state, the Bluetooth communication module is set to slave mode and kept in an on state until the Bluetooth communication module waits for the external Bluetooth communication module to reply to all data and then disconnects from the external Bluetooth communication module.
7. A remote communication system for a metering terminal according to any one of claims 1 to 6, characterized in that: The step of sending the task data to the communication management module or the Bluetooth communication module according to the working status of the remote communication module specifically includes: When the remote communication module is in a normal working state, sending the task data to the remote communication module; When the remote communication module is in a fault offline state, the task data is sent to the Bluetooth communication module.
8. A remote communication system for a metering terminal according to any one of claims 1 to 6, characterized in that: The remote communication module is also used for: When it is found that the communication link of the other end is closed or a link abnormality occurs, the communication link is closed and a fault signal is sent to the communication management module; wherein the fault signal is used to identify the current fault offline state of the remote communication module; The determining the current working state of the remote communication module further includes: When the fault identification sent by the remote communication module is received, it is determined that the remote communication module is currently in a fault offline state.
9. A remote communication system for a metering terminal as claimed in claim 1, characterized in that: The working modes of the Bluetooth communication module include: host mode and slave mode; When the remote communication module is in normal working state, the working mode of the Bluetooth communication module is set to slave mode; When the remote communication module is in a fault offline state, the working mode of the Bluetooth communication module is set to the host mode.
10. A remote communication system for a metering terminal as claimed in claim 9, characterized in that: When the working mode of the Bluetooth communication module is set to slave mode, it includes: Determining whether the Bluetooth communication module has a communication link with other metering terminals whose Bluetooth communication modules are in host mode; If not, the Bluetooth communication module is periodically started according to a preset period; If yes, the Bluetooth communication module will continue to be activated.
11. A remote communication system for a metering terminal as claimed in claim 10, characterized in that: When the working mode of the Bluetooth communication module is set to slave mode, it also includes: When the Bluetooth communication module receives a signal that the Bluetooth communication module of another metering terminal is in host mode and the metering terminal has a request to establish a communication link, the identity information of the metering terminal corresponding to the request is obtained and the identity information is verified. After the verification is passed, the Bluetooth communication module continues to remain in the started state and establishes a communication channel with the external Bluetooth communication module of the metering terminal corresponding to the request.
12. A remote communication system for a metering terminal as claimed in claim 10, characterized in that: After the Bluetooth communication module establishes a communication channel with the Bluetooth communication module in the metering terminal corresponding to the request, the method further includes: The metering terminals of the established communication channel are mutually identified, and the established communication channel is associated and stored with the identity of the external Bluetooth communication module; When receiving business data sent by an external Bluetooth communication module, the business data is decrypted, and then the decrypted task data is sent to the communication management module, so that the communication management module sends the task data to the remote communication module, and the remote communication module forwards the business data to the main station.
13. A remote communication system for a metering terminal as claimed in claim 9, characterized in that: The step of establishing a communication connection with other metering terminals in slave mode and sending the task data to the connected metering terminals after the connection is successful, so that the connected metering terminals forward the task data to the master station, specifically includes: Continuously search for external Bluetooth signals of other metering terminals. When an accessible external Bluetooth signal is found, send a connection request to the external Bluetooth communication module, obtain the identity of the external Bluetooth communication module, and determine whether the external Bluetooth communication module can be safely accessed according to the identity; When it is determined that the external Bluetooth communication module can be safely accessed and the external Bluetooth communication module passes the connection request, communicating with the external Bluetooth communication module and establishing a Bluetooth communication channel; The business data is encrypted, and the encrypted business data is sent to the external Bluetooth communication module through the established Bluetooth communication channel, so that the external Bluetooth communication module decrypts the business data after receiving the encrypted business data, and then forwards the decrypted task data to the main station through the corresponding external remote communication module.
14. A remote communication system for a metering terminal as claimed in claim 13, characterized in that: The encrypting the business data includes: Encrypting the business data through a preset encryption chip; The decrypting the service data comprises: Decrypting the business data through the encryption chip; Wherein, the Bluetooth communication modules are all provided with encryption chips.
15. A remote communication system for a metering terminal according to any one of claims 13 or 14, characterized in that: The encrypting the business data further includes: The business data is encrypted and a key is generated by a preset encryption algorithm; wherein the encryption algorithm includes: a symmetric encryption algorithm or an asymmetric encryption algorithm; The decrypting of the service data further includes: The business data is decrypted using a preset decryption algorithm and the key.
16. A remote communication system for a metering terminal according to any one of claims 9, characterized in that: When the working mode of the Bluetooth communication module is the slave mode, the Bluetooth communication module is periodically started according to a preset start-up period, and broadcasts Bluetooth access information according to a preset broadcast duration when started; When the working mode of the Bluetooth communication module is the host mode, or when a connection request of an external Bluetooth is received, the Bluetooth communication module continues to remain in the startup state.
17. A remote communication system for a metering terminal according to any one of claims 9, characterized in that: When the Bluetooth communication module is in the host mode and communicates with the external Bluetooth communication module for data transmission, if the remote communication module is back online and in a working state, it also includes: The Bluetooth communication module interrupts data transmission with the external Bluetooth communication module and marks all task data currently sent; After the external Bluetooth communication module responds to the sent data, the communication link is disconnected; The communication management module sends all corresponding task data to the remote communication module according to the marked task data, so that the remote communication module sends the marked task data to the main station.
Citation Information
Cited By
Remote communication system for metering terminal
WO2026137869A1