A wireless communication method, device and wireless control system

By using LoRa wireless communication technology to directly connect the master and slave devices, the problem of excessive communication latency in wireless control is solved, and real-time wireless communication is achieved.

CN116456506BActive Publication Date: 2026-02-06HANGZHOU HOLLYSYS AUTOMATION
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310128160.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-02
Publication Date
2026-02-06
Estimated Expiration
2043-02-02

AI Technical Summary

Technical Problem

Existing wireless communication technologies suffer from excessively high communication latency in the field of wireless control, making it difficult to meet real-time requirements.

Method used

Using LoRa wireless communication technology, communication messages are transmitted directly between the master LoRa node and the slave LoRa node through a direct connection, avoiding intermediate nodes and realizing wireless communication between the master and slave devices.

Benefits of technology

It significantly shortens the communication response time between the master and slave devices, reduces wireless communication latency, and meets the real-time requirements of wireless communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116456506B_ABST
    Figure CN116456506B_ABST
Patent Text Reader

Abstract

The application discloses a wireless communication method, device and wireless control system, and relates to the wireless control field. When a master LoRa node connected with a host receives a communication message sent by the host, the communication message is sent to a slave LoRa node corresponding to a slave address of the communication message according to the slave address, so that the slave LoRa node sends the communication message to the slave. When the master LoRa node receives a response message sent by the slave LoRa node, the working state of the master LoRa node is set to an online state, and the response message is sent to the host. The wireless communication between the host and the slave is realized through the LoRa wireless communication by connecting each host and slave through the LoRa node. Since the master LoRa node and the slave LoRa node are directly connected, the communication message does not need to be transmitted through an intermediate node, the communication response time between the host and the slave can be obviously shortened, the wireless communication delay is reduced, and the real-time requirement of the wireless communication is met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of wireless control, in particular to a wireless communication method, device and wireless control system. BACKGROUND

[0002] Although the current wireless communication technologies, such as 4G, 5G and WiFi, have relatively wide application and mature technology, their performance in communication delay and communication reliability is ordinary. Taking 5G communication as an example, when the master sends a wireless signal to the slave, the wireless signal needs to pass through the 5G gateway, the base station and the 5G core network of the master side in turn, and then is transmitted to the 5G gateway of the slave side through the base station, and finally the wireless signal sent by the master is sent to the slave through the 5G gateway of the slave side. The signal transmission process needs to pass through multiple nodes, and the wireless signal may need to be format-converted when transmitted to different nodes, resulting in too long communication response time between the master and the slave, i.e. too high communication delay, which is difficult to meet the real-time requirement of wireless communication and wireless control.

[0003] In summary, how to reduce the delay of wireless communication is a technical problem to be solved at present. SUMMARY

[0004] The purpose of the present application is to provide a wireless communication method, device and wireless control system, which can significantly shorten the communication response time between the master and the slave, reduce the wireless communication delay, and thus meet the real-time requirement of wireless communication.

[0005] To solve the above technical problems, the present application provides a wireless communication method applied to a processor of a master LoRa node connected with a master in a wireless control system, wherein the wireless control system further comprises a plurality of slaves, each of which is connected with a slave LoRa node, and the wireless communication method comprises the following steps:

[0006] When receiving a communication message sent by the master, the communication message is sent to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication according to the slave address of the communication message, so that the slave LoRa node sends the communication message to the slave corresponding to the slave LoRa node;

[0007] When receiving a response message corresponding to the communication message sent by the slave through the slave LoRa node, the working state of the slave LoRa node is set to online state;

[0008] The response message is sent to the master.

[0009] Preferably, the communication message is sent to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication according to the slave address of the communication message, comprising:

[0010] The slave address is obtained through the communication message;

[0011] It is judged whether the slave address exists in the network where the address of the host is located;

[0012] If yes, the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication;

[0013] If no, the slave address is registered in the network where the address of the host is located, the working state of the slave LoRa node corresponding to the slave address is set to the listening state, and the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication.

[0014] Preferably, after the communication message is sent to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication according to the slave address of the communication message, it further comprises:

[0015] S21: obtaining the determination result of the slave LoRa node after judging whether the host address of the communication message is consistent with the preset host address, and judging whether the determination result is the result indicating that the addresses are consistent; if yes, go to S22;

[0016] S22: judging whether the working state of the master LoRa node itself is in the listening state; if in the listening state, go to S23; if not in the listening state, go to S24;

[0017] S23: setting the working state of the master LoRa node itself to the synchronization state, and going to S25;

[0018] S24: judging whether the working state of the master LoRa node itself is in the synchronization state; if in the synchronization state, go to S25; if not in the synchronization state, go to the step of detecting whether the response message corresponding to the communication message sent by the slave through the slave LoRa node is received;

[0019] S25: sending the communication message to the slave LoRa node once, and adding 1 to the count of the first counter corresponding to the master LoRa node, the initial value of the first counter being 0, and going to S26;

[0020] S26: judging whether the count of the first counter is greater than the first preset value; if yes, go to S27; if no, return to S25;

[0021] S27: setting the working state of the master LoRa node itself to online state, and entering a step of detecting whether a response message corresponding to the communication message sent by the slave through the slave LoRa node is received.

[0022] Preferably, after judging whether the determination result is a result indicating that the addresses are consistent, the method further comprises:

[0023] If the determination result is a result indicating that the addresses are inconsistent, after the slave LoRa node discards the communication message, it is determined that a communication failure occurs.

[0024] Preferably, before sending the communication message to the slave LoRa node corresponding to the slave address through LoRa wireless communication according to the slave address of the communication message, the method further comprises:

[0025] judging whether there is a working state of the slave LoRa node in idle state;

[0026] If there is, for any slave LoRa node in idle state, judging whether the idle duration of the slave LoRa node is greater than a preset idle duration;

[0027] If the idle duration is greater than the preset idle duration, setting the working state of the slave LoRa node to synchronization state.

[0028] Preferably, when the working state of the master LoRa node is in idle state, the method further comprises:

[0029] When a message sent by any slave LoRa node is received, setting the working state of the master LoRa node to working state.

[0030] Preferably, setting the working state of the slave LoRa node to online state comprises:

[0031] S31: judging whether the working state of the master LoRa node itself is in listening state; if yes, entering S32; if not, entering S33;

[0032] S32: setting the working state of the master LoRa node itself to synchronization state, and entering S34;

[0033] S33: judging whether the working state of the master LoRa node itself is in synchronization state; if yes, entering S34; if not, entering a step of sending the response message to the host;

[0034] S34: send the communication message to the slave LoRa node once, increase the count of a second counter corresponding to the slave LoRa node by 1, the initial value of the second counter is 0, and enter S35;

[0035] S35: determine whether the count of the second counter is greater than a second preset value; if yes, enter S36; if no, return to S34;

[0036] S36: set the working state of the slave LoRa node to online state, and enter the step of sending the response message to the host.

[0037] Preferably, the communication message is sent to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication according to the slave address, comprising:

[0038] packing the communication message and a unique identifier corresponding to the master LoRa node into the same hLRC message;

[0039] broadcasting the hLRC message, so that the slave LoRa node with the same unique identifier as the master LoRa node receives the hLRC message and decompresses to obtain the communication message.

[0040] The application also provides a wireless communication device, comprising:

[0041] a memory for storing a computer program;

[0042] a controller for executing the computer program to realize the steps of the wireless communication method as described above.

[0043] The application also provides a wireless control system, comprising a host, a master LoRa node, a plurality of slaves and a plurality of slave LoRa nodes corresponding to the slaves one by one, and further comprising the wireless communication device as described above;

[0044] the host is connected with the master LoRa node;

[0045] each slave is connected with the slave LoRa node corresponding to the slave itself;

[0046] the master LoRa node and each slave LoRa node are connected through LoRa wireless communication;

[0047] the wireless communication device is arranged in the master LoRa node.

[0048] The application provides a wireless communication method, device and system, the wireless communication system comprises a host and a plurality of slaves, each device is connected with a LoRa node, when the host LoRa node connected with the host receives the communication message sent by the host, the communication message is sent to the slave LoRa node corresponding to the slave address according to the slave address of the communication message, so that the slave LoRa node sends the communication message to the slave connected with the slave LoRa node, when the host LoRa node receives the response message, the working state of the slave LoRa node is set to online state, and the response message is sent to the host. Through the LoRa node connected with each host and slave, the wireless communication between the host and slave is realized through LoRa wireless communication, since the master-slave LoRa nodes are directly connected, the communication message does not need to be transmitted through the intermediate node, the communication response time between the host and slave can be obviously shortened, the wireless communication delay is reduced, and the actuality requirement of wireless communication is met. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0050] Figure 1 A flowchart of a wireless communication method provided by the present application is provided.

[0051] Figure 2 A schematic diagram of the 5G signal wireless transmission process in the prior art is provided.

[0052] Figure 3 A schematic diagram of the communication principle of the 5G gateway is provided.

[0053] Figure 4 A structural diagram of a wireless control system provided by the present application is provided.

[0054] Figure 5 A topology diagram of a LoRa node provided by the present application is provided.

[0055] Figure 6 A schematic diagram of a ProfibusDP protocol message provided by the present application is provided.

[0056] Figure 7 A flowchart of another wireless communication method provided by the present application is provided.

[0057] Figure 8 A flowchart for detecting the idle state of the slave LoRa node provided by the present application is provided.

[0058] Figure 9 A schematic diagram of a communication flow from a LoRa node is provided for the present application;

[0059] Figure 10 A schematic diagram of an hLRC protocol message is provided for the present application;

[0060] Figure 11 A flowchart of a same identifier message discrimination method is provided for the present application;

[0061] Figure 12 A schematic diagram of a wireless communication structure is provided for the present application. DETAILED DESCRIPTION

[0062] The core of the present application is to provide a wireless communication method, device and wireless control system, which can significantly shorten the communication response time between the master and the slave, reduce the wireless communication delay, and thus meet the real-time requirements of wireless communication.

[0063] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0064] The field of wireless communication can be specifically divided into two types: wireless monitoring and wireless control. For wireless monitoring, the purpose is to enable staff to remotely query and observe parameters in a certain device. Wireless monitoring does not have high requirements for the reliability and delay of wireless communication data transmission. As long as the correct parameters can be received, various wireless communication technologies have mature applications in wireless monitoring. However, for wireless control, the purpose is to enable staff to remotely operate and control a certain device. Wireless control requires wireless signals to be transmitted quickly and accurately. However, existing wireless communication technologies have obvious shortcomings in wireless control. Please refer to Figure 2 , Figure 2As a schematic diagram of the prior art 5G signal wireless transmission process, when the host sends a wireless signal to the slave, the host first sends it to the master communication device through RS485 communication, the master communication device sends it to the base station at the host's location through 5GNR, the local base station then sends the wireless signal to the 5G core network, the wireless signal enters the base station at the slave's location through the 5G core network, the base station sends the wireless signal to the slave communication device through 5GNR, and finally the slave communication device sends the wireless signal to the slave through RS485 communication. At this time, the one-way transmission of the signal is completed, and when the slave sends a wireless response signal, the above steps are needed to send the response signal to the host. Moreover, in 5GNR, the wireless signal needs to be encapsulated. Please refer to Figure 3 , Figure 3 As a schematic diagram of the communication principle of the 5G gateway, the signal delay is further prolonged.

[0065] Please refer to Figure 1 , Figure 1 As a flowchart of a wireless communication method provided by the present application, applied to the processor of the master LoRa node connected to the host in the wireless control system, the wireless control system further includes a plurality of slaves, each slave is connected to a slave LoRa node, and the wireless communication method includes:

[0066] S1: When receiving the communication message sent by the host, the communication message is sent to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication according to the slave address of the communication message, so that the slave LoRa node sends the communication message to the slave corresponding to the slave LoRa node;

[0067] S2: When receiving the response message corresponding to the communication message sent by the slave through the slave LoRa node, set the working state of the slave LoRa node to online state;

[0068] S3: Send the response message to the host.

[0069] Considering that in the existing wireless communication technology, when the host sends a wireless signal (i.e. a communication message) to the slave, the wireless signal needs to pass through multiple nodes, resulting in excessive signal delay, in order to reduce signal delay, the present application adopts a wireless communication technology based on LoRa (Long Range Radio, long-range radio). The LoRa-2.4G wireless communication technology has a higher transmission bandwidth than the existing wireless communication technology, and can also fully integrate the ProfibusDP message data bus network structure commonly used in current wireless communication, which can ensure that LoRa wireless communication is suitable for wireless communication in various environments. Therefore, please refer to Figure 4 , Figure 4A structure diagram of a wireless control system provided by the present application is shown in FIG. 1. Each master and slave is connected to a LoRa node. The LoRa node connected to the master is called a master LoRa node, i.e. LoRa-2.4G AP in FIG. 2, and the LoRa node connected to the slave is called a slave LoRa node, i.e. LoRa-2.4G ND in FIG. 3. Figure 4 Figure 4

[0070] Specifically, please refer to Figure 5 Figure 5 A topology diagram of a LoRa node provided by the present application is shown in FIG. 4. When the LoRa node receives a wireless signal sent by a device (i.e. a slave or a master) connected thereto, the CPU (central processing unit) in the LoRa node receives the wireless signal through the UART (universal asynchronous receiver-transmitter) interface after converting the wireless signal in RS485 format into a signal in level form once, transmits the wireless signal through the ping-pong buffer, and transmits the wireless signal to the LoRa Modem (modem) in the LoRa node through the SPI (Serial Peripheral Interface) bus, and sends the wireless signal to other LoRa nodes through the LoRa Modem and an antenna. The ping-pong buffer is used because the running speeds of different modules in the LoRa node are different, and the running speeds of serial adjacent modules affect the signal transmission efficiency of the LoRa node. For example, if the running speed of a previous module is faster than that of a subsequent module, and the previous module processes more data than the subsequent module in a unit of time, the subsequent module cannot process the data immediately. At this time, the ping-pong buffer is used to temporarily store the results of the previous stage, so that the running speeds of the two modules can be independent of each other, and the running of the previous module will not be slowed down by the subsequent module. The ping-pong buffer includes two buffer units, i.e. ping buf and pong buf, which alternately read and write.

[0071] ​​​After the master LoRa node transmits the wireless signal of the host, the address of the host itself is known to the host, and since the host always initiates the signal, the host needs to pre-store the address of each slave, i.e. the address of each slave is also known, therefore, for the master LoRa node connected with the host and each slave LoRa node connected with each slave, the address of the node can be set to the same address as the device connected with the node itself, for example, the address of the master LoRa node is the same as the address of the host, and the host writes the address of the host and the address of the slave into the wireless signal when generating the wireless signal, so that the LoRa node can accurately transmit the wireless signal. Please refer to Figure 6 , Figure 6 A schematic diagram of a Profibus DP protocol message is provided in the present application, wherein SD represents a message start locator, indicating the start of a new frame of message, for example, SD1=0x10, SD2=0x68, SD3=0xA2, SD4=0xDC; ED represents an end locator, indicating the end of a frame of message, which is usually a fixed value such as 0x16; SC represents a short confirmation frame, which takes a fixed value such as 0xE5; DA represents the destination address of the message, i.e. the address of the device receiving the wireless signal message; SA represents the source address of the message, i.e. the address of the device transmitting the wireless signal message; LE and LEr both represent the length of the message; FC represents the function code, PDU represents the load data, and FCS represents the check code. When the master LoRa node transmits the wireless signal, the address of the host is set as SA and the address of the slave is set as DA, and the wireless signal is transmitted to the slave LoRa node with the address equal to the DA based on the DA in the wireless signal.

[0072] When the slave responds to the wireless signal transmitted by the host, the response signal is transmitted to the master LoRa node through the slave LoRa node, at this time, the master LoRa node can be considered normal because it has received the signal from the slave LoRa node, and the master LoRa node sets the state of the slave LoRa node to online at this time, and finally transmits the response signal sent by the slave LoRa node to the host, thereby completing the process of signal transmission and feedback of one wireless communication.

[0073] In summary, the wireless control system includes a host and a plurality of slaves, each device is connected with a LoRa node, when the master LoRa node connected with the host receives the communication message sent by the host, the communication message is sent to the slave LoRa node corresponding to the slave address according to the slave address of the communication message, so that the slave LoRa node sends the communication message to the slave connected with the slave LoRa node, when the master LoRa node receives the response message, the working state of the slave LoRa node is set to online state, and the response message is sent to the host. By connecting each host and slave through LoRa node, wireless communication between host and slave is realized through LoRa wireless communication. Since the master and slave LoRa nodes are directly connected, the communication message does not need to be transmitted through the intermediate node, the communication response time between the host and the slave can be obviously shortened, the wireless communication delay can be reduced, and the practicality requirement of wireless communication can be met.

[0074] On the basis of the above embodiment:

[0075] As a preferred embodiment, according to the slave address of the communication message, the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication, which includes:

[0076] Obtain the slave address through the communication message;

[0077] Determine whether the slave address exists in the network where the address of the host is located;

[0078] If yes, the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication;

[0079] If not, register the slave address in the network where the address of the host is located, set the working state of the slave LoRa node corresponding to the slave address to listening state, and send the communication message to the slave LoRa node corresponding to the slave address through LoRa wireless communication.

[0080] In order to accurately send the communication message to the corresponding slave LoRa node, please refer to Figure 7 , Figure 7As another wireless communication method provided by the present application, a flow chart is provided, which needs to determine whether the slave LoRa node is in the same network as the master LoRa node. If the slave LoRa node is not in the same network as the master LoRa node, the master LoRa node may not recognize the slave address, the master LoRa node may not be able to send the communication message to the slave LoRa node, the master LoRa node may need to perform WLAN (Wireless Local Area Network) networking or other networking operations before sending the communication message, and the like, resulting in that the master LoRa node cannot receive the response of the slave LoRa node or the delay is large. Therefore, before sending the communication message, the master LoRa node needs to determine whether the slave address described in the communication message already exists in the network where the master LoRa node is located. If yes, it means that the slave LoRa node corresponding to the slave address is already in the network, and the master LoRa node can directly send the communication message to the slave LoRa node. If no, it means that the address is not registered in the network where the master LoRa node is located. At this time, the master LoRa node needs to find the slave LoRa node corresponding to the slave address, register it to the network where the master LoRa node is located, and set the working state of the slave LoRa node to a listening state, so that the slave LoRa node can receive the communication message. At this time, the master LoRa node sends the communication message to the slave LoRa node, and the slave LoRa node can normally receive the communication message with a short delay. When the two LoRa nodes communicate subsequently, the delay can also be avoided. Based on this, the communication message can be accurately sent to the corresponding slave LoRa node.

[0081] As a preferred embodiment, after the communication message is sent to the slave LoRa node corresponding to the slave address according to the slave address of the communication message, the method further comprises:

[0082] S21: obtaining the determination result of the slave LoRa node after determining whether the master address of the communication message is consistent with the preset master address, and determining whether the determination result is a result indicating that the addresses are consistent; if yes, S22 is entered;

[0083] S22: determining whether the working state of the master LoRa node itself is in a listening state; if yes, S23 is entered; if not, S24 is entered;

[0084] S23: setting the working state of the master LoRa node itself to a synchronization state, and entering S25;

[0085] S24: judging whether the working state of the master LoRa node is in the synchronization state; if yes, entering S25; if not, entering the step of detecting whether the response message corresponding to the communication message sent by the slave through the slave LoRa node is received;

[0086] S25: sending the communication message to the slave LoRa node, increasing the count of the first counter corresponding to the master LoRa node by 1, the initial value of the first counter being 0, and entering S26;

[0087] S26: judging whether the count of the first counter is greater than the first preset value; if yes, entering S27; if not, returning to S25;

[0088] S27: setting the working state of the master LoRa node as the online state, and entering the step of detecting whether the response message corresponding to the communication message sent by the slave through the slave LoRa node is received.

[0089] In order to ensure the correctness of the wireless communication, in the present application, it is considered that the message received by the LoRa node may be wrong due to electromagnetic interference and the like in the process of transmitting the data through the wireless communication, therefore, please refer to Figure 7 , Figure 7As another wireless communication method provided by the present application, the master LoRa node and the slave LoRa node need to verify whether the contents of the messages and data obtained by both parties are correct when communicating. Specifically, after the master LoRa node sends a communication message to the slave LoRa node, the slave LoRa node first judges whether the host address in the communication message sent by the master LoRa node this time is the same as the host address pre-stored in the slave LoRa node itself, and sends the judgment result to the master LoRa node. When the two host addresses are the same, it means that the master and slave LoRa nodes have established a normal connection. In order to further improve the correctness of wireless communication data transmission, the master LoRa node needs to set its own working state to a synchronous state. When in the synchronous state, the master will send the same communication message to the slave LoRa node multiple times to make the slave LoRa node and the slave respond to each communication message. Each time the master LoRa node receives the response message sent by the slave LoRa node, it will add 1 to the count of the first counter. When the count exceeds the first preset value, it means that the synchronization times of the master LoRa node exceed the limit. At this time, the master LoRa node itself is set to an online state in order to enter the subsequent step of sending the response message to the host. In addition, the number difference between the number of received response messages and the number of communication messages sent by the master LoRa node can be used to determine the quality of wireless communication, and the contents in each response message can be used to further judge the correctness of wireless communication. In addition, in addition to judging according to the count value of the counter, when the master LoRa node finds that the slave LoRa node is no longer in the synchronous state, it can directly enter the subsequent step. Based on this, the correctness of wireless communication can be guaranteed.

[0090] As a preferred embodiment, after judging whether the determination result is a result indicating that the addresses are consistent, it further includes:

[0091] If the determination result is a result indicating that the addresses are inconsistent, after the slave LoRa node discards the communication message, it is determined that a communication failure occurs.

[0092] In order to simply determine the failure of wireless communication, in the present application, after the master LoRa node sends a communication message to the slave LoRa node, if the slave LoRa node finds that the host address in the communication message is not equal to the preset host address saved by the slave LoRa node itself, it may indicate that the communication message is disturbed in the transmission process, the master LoRa node is disturbed in the process of sending the communication message, the master LoRa node fails, the slave LoRa node is disturbed in receiving the communication message, or the slave LoRa node fails, etc. Since there are too many inconsistent host addresses, in order to simply indicate the situation to the staff, the slave LoRa node discards the communication message and does not respond to it, and directly determines that a communication failure has occurred when the inconsistent host address is detected, so that the staff can repair it and reduce the consumption of node processing resources. Based on this, the failure of wireless communication can be simply determined.

[0093] As a preferred embodiment, before the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication according to the slave address of the communication message, it further comprises:

[0094] determining whether there is a working state of the slave LoRa node in an idle state;

[0095] If there is, for any slave LoRa node in the idle state, it is determined whether the idle duration of the slave LoRa node is greater than the preset idle duration;

[0096] If it is greater than the preset idle duration, the working state of the slave LoRa node is set to a synchronization state.

[0097] In order to simply determine whether there is a communication failure, in the present application, please refer to Figure 8 , Figure 8 A flow chart for detecting the idle state of the slave LoRa node provided by the present application, when the master LoRa node has no message to send or receive temporarily, that is, when the master LoRa node is in an idle state, it will also detect the idle state of the slave LoRa node in real time. If it is found that the idle time of a certain slave LoRa node is too long, that is, it is found that the time from the last time a certain slave LoRa node sends a response message to the master LoRa node at the current time is too long, it indicates that there may be a communication failure that causes the slave LoRa node to be unable to normally receive a communication message or send a response message. At this time, the slave LoRa node can be set to a synchronization state, and further the counter thereof can be cleared, so as to determine whether the slave LoRa node can respond normally. If the slave LoRa node cannot be set to a synchronization state, it indicates that there is a communication failure, at which time the staff can be notified so that they can repair it. Based on this, it can be simply determined whether there is a communication failure.

[0098] As a preferred embodiment, when the working state of the master LoRa node is in the idle state, further comprising:

[0099] When receiving any message sent from the slave LoRa node, the working state of the master LoRa node is set to the working state.

[0100] In order to simply determine whether there is a communication failure, in addition to that the master LoRa node detects the idle state and idle time of each slave LoRa node in real time, each slave LoRa node also detects the idle state and idle time of the master LoRa node. When a slave LoRa node finds that the master LoRa node enters the idle state and the idle time is too long, it controls the master LoRa node to enter the working state by sending a message. If the master LoRa node can normally enter the working state, it means that there is no communication failure between the slave LoRa node and the master LoRa node, otherwise it means that there is a communication failure. Based on this, it can be simply determined whether there is a communication failure.

[0101] As a preferred embodiment, the working state of the slave LoRa node is set to the online state, comprising:

[0102] S31: determining whether the working state of the master LoRa node itself is in the listening state; if yes, entering S32; if not, entering S33;

[0103] S32: setting the working state of the master LoRa node itself to the synchronization state, and entering S34;

[0104] S33: determining whether the working state of the master LoRa node itself is in the synchronization state; if yes, entering S34; if not, entering the step of sending a response message to the host;

[0105] S34: sending a communication message to the slave LoRa node, adding 1 to the count of the second counter corresponding to the slave LoRa node, the initial value of the second counter being 0, and entering S35;

[0106] S35: determining whether the count of the second counter is greater than a second preset value; if yes, entering S36; if not, returning to S34;

[0107] S36: setting the working state of the slave LoRa node to the online state, and entering the step of sending a response message to the host.

[0108] In order to ensure the correctness of wireless communication, in the present application, it is considered that the data transmitted through wireless communication may be incorrect due to electromagnetic interference and other reasons. Therefore, the master LoRa node and the slave LoRa node need to verify whether the messages and data obtained by both parties are correct during communication. For details, please refer to Figure 9 , Figure 9 A schematic diagram of the communication process of the LoRa node provided in the present application is shown in the figure. When the master LoRa node sends a communication message to the slave LoRa node, the master LoRa node itself needs to be placed in a synchronized state. At this time, the count value of the second counter of the master LoRa node will increase by 1 every time the master LoRa node sends a communication message. When the count exceeds the second preset value, that is, the number of times the master LoRa node sends a communication message is sufficient to ensure the correctness of wireless communication, the slave LoRa node will send these communication messages sent by the master LoRa node to the slave machine in order to respond to the slave machine. Subsequently, when the slave LoRa node receives the response message from the slave machine, it will send it to the master LoRa node through wireless communication. In addition, in addition to the count value of the counter, if the slave LoRa node finds that the master LoRa node is no longer in a synchronized state, it will also enter the subsequent step of sending a communication message to the slave machine. Based on this, the correctness of wireless communication can be ensured.

[0109] As a preferred embodiment, the communication message is sent to the slave LoRa node corresponding to the slave machine address through LoRa wireless communication according to the slave machine address of the communication message, comprising:

[0110] Packing the communication message and the unique identifier corresponding to the master LoRa node into the same hLRC message;

[0111] Broadcasting the hLRC message so that the slave LoRa node with the same unique identifier as the master LoRa node receives the hLRC message and decompresses the communication message.

[0112] In order to avoid communication interference, in the present application, it is considered that in actual application scenarios, multiple different wireless control systems may be deployed at the same time, that is, there are N masters, N master LoRa nodes, N*M slaves and N*M slave LoRa nodes in the application scenario, N and M are integers not less than 2. When the master LoRa node in a certain wireless control system sends a communication message, it is likely to be received by the slave LoRa node in another wireless control system, or the response message sent by a certain slave LoRa node is received by multiple master LoRa nodes, which will cause incorrect operation. Based on this, in order to avoid communication interference and enable the master and slave LoRa nodes in the same wireless control system to communicate normally, the hLRC protocol can be used to transmit the communication message. For details, please refer to Figure 10 ,Figure 10 A schematic diagram of an hLRC protocol message is provided for the present application. In the hLRC protocol message, SD represents a message start locator. The actual value of the locator needs to be different from that in the figure to distinguish Profibus DP protocol messages from hLRC protocol messages. SW is a unique identifier corresponding to each wireless control system. The CMD field contains a message sequence number (for reliable transmission), a message type (request or response message), and a command type (set, get, or restart, etc.). LS represents a link state, which enables the master LoRa node to perceive the communication quality between all slave LoRa nodes, and enables dynamic allocation of a transmitting antenna in a multi-antenna case. CTL represents a control field, which contains a large amount of information, mainly including frequency hopping channel selection, dynamic antenna switching, baseband modulation parameter adjustment, and other functions. CTL is used to indicate whether the PARAMS field at the end of the hLRC message exists. PLEN represents a payload area length. The gray area is a Profibus DP protocol communication message sent by the host. Based on this, please refer to Figure 11 , Figure 11 A flowchart of a same-identifier message discrimination method is provided for the present application. First, the same unique identifier is set for the master and slave LoRa nodes in the same wireless control system. When the master LoRa node receives a communication message sent by the host, it wraps the message into an hLRC protocol message and sends it. When the slave LoRa node receives a certain message, it first determines whether the message belongs to an hLRC message according to SD. If not, it performs the original response step (i.e., the slave LoRa node sends a response message to the host). If yes, it performs the following steps. Figure 11The wireless node working state flow in the hLRC message is the step in the above embodiment, if it is the hLRC message, whether the SW in the hLRC message is consistent with the unique identifier of the LoRa node is also needed, if it is not consistent, it means that the hLRC message is sent by the master LoRa node in other wireless control systems, at this time, the slave LoRa node will discard the hLRC message and not respond, if it is consistent, it means that the hLRC message is sent by the master LoRa node in the same wireless control system as the slave LoRa node, at this time, it can be responded. When responding, first, the type of the hLRC message is determined according to the CMD, if it is the data data message, it means that the hLRC message only contains the communication message, the slave LoRa node can directly extract the Payload information (that is, the communication message of the ProfibusDP protocol sent by the host) from the hLRC message and send it to the slave to respond; if the hLRC message is determined to be the management message according to the CMD, the specific management instruction is processed or the parameter is modified first, for example, the parameter of the slave LoRa node is modified, and then the subsequent steps of extracting the message are entered; if the hLRC message cannot be determined to be the data message or the management message according to the CMD, it means that the hLRC message is interfered, at this time, it can be discarded and not processed. Similarly, when the master LoRa node receives the response message sent by the slave LoRa node, the SD and SW also need to be verified first. Based on this, the communication interference can be avoided.

[0113] Please refer to Figure 12 , Figure 12 The structure schematic diagram of the wireless communication device provided by the application comprises:

[0114] The memory 21 is used for storing the computer program;

[0115] The controller 22 is used for implementing the steps of the wireless communication method when the computer program is executed.

[0116] For the detailed introduction of the wireless communication device provided by the application, please refer to the above-mentioned embodiments of the wireless communication method, which will not be repeated here.

[0117] The application further provides a wireless control system, which comprises a host, a master LoRa node, a plurality of slaves and a plurality of slave LoRa nodes corresponding to the slaves one by one, and further comprises the above-mentioned wireless communication device;

[0118] The host is connected with the master LoRa node;

[0119] Each slave is connected with the slave LoRa node corresponding to the slave itself;

[0120] The master LoRa node is connected with each slave LoRa node through the LoRa wireless communication.

[0121] The wireless communication device is arranged in a master LoRa node.

[0122] For detailed introduction of the wireless control system provided in the present application, please refer to the embodiments of the wireless communication method described above, which will not be repeated here.

[0123] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0124] It should also be noted that the relational terms herein such as first and second and the like are used solely to distinguish one entity or action from another, without necessarily requiring or implying any actual such relationship or order between or among the entities or actions. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.

[0125] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of wireless communication, the method comprising: The application relates to a wireless control system comprising a host connected to a master LoRa node and a plurality of slaves each connected to a slave LoRa node, and a wireless communication method comprising: when receiving a communication message sent by the host, sending the communication message to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication, so that the slave LoRa node sends the communication message to the slave corresponding to the slave LoRa node; when receiving a response message corresponding to the communication message sent by the slave through the slave LoRa node, setting the working state of the slave LoRa node to online state; sending the response message to the host; wherein, after sending the communication message to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication, the method further comprises: S21: obtaining the determination result of the slave LoRa node after judging whether the host address of the communication message is consistent with the preset host address, and judging whether the determination result is a result indicating that the addresses are consistent; if yes, S22 is entered; S22: judging whether the working state of the master LoRa node itself is in a listening state; if yes, S23 is entered; if not, S24 is entered; S23: setting the working state of the master LoRa node itself to a synchronization state, and entering S25; S24: judging whether the working state of the master LoRa node itself is in a synchronization state; if yes, S25 is entered; if not, the step of detecting whether the response message corresponding to the communication message sent by the slave through the slave LoRa node is received is entered; S25: sending the communication message to the slave LoRa node once, and adding 1 to the count of a first counter corresponding to the master LoRa node, wherein the initial value of the first counter is 0, and entering S26; S26: judging whether the count of the first counter is greater than a first preset value; if yes, S27 is entered; if not, S25 is returned; S27: setting the working state of the master LoRa node itself to an online state, and entering the step of detecting whether the response message corresponding to the communication message sent by the slave through the slave LoRa node is received.

2. The wireless communication method of claim 1, wherein, sending the communication message to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication comprises: obtaining the slave address through the communication message; judging whether the slave address exists in the network where the address of the host is located; if yes, sending the communication message to the slave LoRa node corresponding to the slave address through LoRa wireless communication; If not, the slave address is registered in the network where the host address is located, the working state of the slave LoRa node corresponding to the slave address is set to a listening state, and the communication message is sent to the slave LoRa node corresponding to the slave address through LoRa wireless communication.

3. The wireless communication method of claim 1, wherein, After judging whether the determination result is a result indicating that the addresses are consistent, the method further comprises: If the determination result is a result indicating that the addresses are inconsistent, after the slave LoRa node discards the communication message, it is determined that a communication failure occurs.

4. The wireless communication method of claim 1, wherein, Before sending the communication message to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication, the method further comprises: It is judged whether the working state of the slave LoRa node is in an idle state; If so, for any slave LoRa node in the idle state, it is judged whether the idle duration of the slave LoRa node is greater than a preset idle duration; If greater than the preset idle duration, the working state of the slave LoRa node is set to a synchronization state.

5. The wireless communication method of claim 4, wherein, When the working state of the master LoRa node is in the idle state, the method further comprises: When receiving a message sent by any slave LoRa node, the working state of the master LoRa node is set to an active state.

6. The wireless communication method of claim 1, wherein, Setting the working state of the slave LoRa node to an online state comprises: S31: It is judged whether the working state of the master LoRa node itself is in a listening state; if so, it proceeds to S32; if not, it proceeds to S33; S32: The working state of the master LoRa node itself is set to a synchronization state, and it proceeds to S34; S33: It is judged whether the working state of the master LoRa node itself is in a synchronization state; if so, it proceeds to S34; if not, it proceeds to the step of sending the response message to the host; S34: The communication message is sent to the slave LoRa node once, and the count of a second counter corresponding to the slave LoRa node is incremented by 1, the initial value of the second counter being 0, and it proceeds to S35; S35: It is judged whether the count of the second counter is greater than a second preset value; if so, it proceeds to S36; if not, it returns to S34; S36: The working state of the slave LoRa node is set to an online state, and it proceeds to the step of sending the response message to the host.

7. The wireless communication method according to any one of claims 1 to 6, wherein, Sending the communication message to the slave LoRa node corresponding to the slave address of the communication message through LoRa wireless communication comprises: The communication message and a unique identifier corresponding to the master LoRa node are packed into the same hLRC message; The hLRC message is broadcasted to be received by the slave LoRa node whose unique identifier is consistent with the master LoRa node and decompressed to obtain the communication message.

8. A wireless communication device, comprising: It comprises: a memory for storing a computer program; a controller for executing the computer program to implement the steps of the wireless communication method according to any one of claims 1 to 7.

9. A wireless control system, characterized by The wireless communication device comprises a host, a master LoRa node, a plurality of slaves and a plurality of LoRa nodes corresponding to the slaves one by one, and a wireless communication device as claimed in claim 8; The host is connected with the master LoRa node; Each slave is connected with the slave LoRa node corresponding to the slave itself; The master LoRa node is connected with each slave LoRa node through LoRa wireless communication; The wireless communication device is arranged in the master LoRa node.

Citation Information

Patent Citations

  • Electric energy meter data collection method and device based on LoRa wireless communication

    CN109348314A