LoRa-based data edge collection method and device, equipment and medium
By establishing a LoRa communication connection between nodes and gateways in a LoRa star network, nodes receive and execute edge acquisition rules and send data, thus solving the problem of low edge acquisition efficiency in LoRa networks and improving acquisition efficiency without increasing costs.
Patent Information
- Application Number
- CN202211702890.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-12-29
AI Technical Summary
Existing LoRa networks have low data collection efficiency at the edge, especially when there are many nodes and data points. The gateway and nodes need to interact multiple times to complete data collection, resulting in low efficiency without increasing equipment costs.
In a LoRa star network, a LoRa communication connection is established between nodes and a gateway. Nodes receive target edge acquisition rules and collect data according to the rules. After receiving a synchronization request from the gateway, they send data to achieve one-time synchronization of edge acquisition rules and periodic data transmission.
Without increasing equipment costs, it improves the efficiency of LoRa data edge acquisition, reduces the number of data interactions, and increases the speed of data acquisition.
Smart Images

Figure CN116033379B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data collection, and in particular to a LoRa-based data edge collection method, device, equipment and medium. BACKGROUND
[0002] Nowadays, with the gradual maturity and rapid development of LoRa (Long Range wireless transmission technology), more and more fields are applying LoRa for intelligent data collection and device control, and even many LoRa-based application scenarios are developing towards data collection edge.
[0003] A typical LoRa star network is composed of a gateway and a plurality of nodes, the gateway and the nodes communicate through LoRa technology, based on the characteristics of LoRa half-duplex and low rate, the time of data transmission between the gateway and the nodes is significantly longer than most other wireless communication methods, especially when the number of nodes in a LoRa network is large and the number of data points mounted under the nodes is also large, the gateway needs to interact with the nodes multiple times to complete data edge collection, and the collection efficiency is obviously low.
[0004] In summary, how to improve the LoRa-based data edge collection efficiency without increasing the cost of equipment has become a technical problem to be solved in the field. SUMMARY
[0005] The main purpose of the present application is to provide a LoRa-based data edge collection method, device, equipment and medium, which aims to improve the LoRa-based data edge collection efficiency without increasing the cost of equipment.
[0006] To achieve the above purpose, the present application provides a LoRa-based data edge collection method applied to any node in a LoRa star network, the LoRa star network further comprising a gateway, the gateway and the node being connected in communication based on LoRa, the LoRa-based data edge collection method comprising:
[0007] receiving a target edge collection rule based on the LoRa communication connection between the node and the gateway;
[0008] collecting data according to the target edge collection rule;
[0009] sending the collected data to the gateway after receiving the synchronization request of the gateway.
[0010] Optionally, the step of collecting data according to the target edge collection rule comprises:
[0011] convert the target edge collection rule to obtain a standard collection instruction;
[0012] collect data of at least one data point hung under the node according to the standard collection instruction.
[0013] Optionally, after the step of collecting data according to the target edge collection rule, the method further comprises:
[0014] saving the collected data in a preset storage area and covering original data in the storage area;
[0015] Optionally, the step of sending the collected data to the gateway after receiving the synchronization request of the gateway comprises:
[0016] sending data in the storage area to the gateway after receiving the synchronization request of the gateway.
[0017] Optionally, if the step of sending the collected data to the gateway after receiving the synchronization request of the gateway comprises:
[0018] integrating the data into a data packet with a preset frame number after receiving the synchronization request of the gateway;
[0019] sending the data packet to the gateway.
[0020] In addition, to achieve the above-mentioned purposes, the application also provides a LoRa-based data edge collection method applied to a gateway in a LoRa star network, wherein the LoRa star network further comprises at least one node, the gateway and the node are connected based on LoRa communication, and the LoRa-based data edge collection method comprises:
[0021] converting an initial edge collection rule to obtain a target edge collection rule;
[0022] sending the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule;
[0023] sending a synchronization request to the node to obtain data collected by the node.
[0024] Optionally, the initial edge collection rule comprises a collection period, and the step of sending the synchronization request to the node to obtain data collected by the node comprises:
[0025] setting a sending time of the synchronization request according to the collection period;
[0026] According to the sending time, the synchronization request is sent to the node to obtain the data collected by the node.
[0027] Optionally, the initial edge collection rule further comprises a calculation formula and a reporting condition, and after the step of sending the synchronization request to the node to obtain the data collected by the node, the method further comprises:
[0028] According to the calculation formula, the data sent by the node is processed;
[0029] According to the reporting condition, the processed data is reported to a preset cloud platform.
[0030] In addition, to achieve the above-mentioned purpose, the application further provides a LoRa-based data edge collection device, which comprises:
[0031] A node data sending module is configured to receive a target edge collection rule based on the LoRa communication connection between the node and the gateway, collect data according to the target edge collection rule, and send the collected data to the gateway after receiving the synchronization request of the gateway;
[0032] A gateway data acquisition module is configured to convert an initial edge collection rule to obtain a target edge collection rule, send the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule, and send a synchronization request to the node to obtain the data collected by the node.
[0033] In addition, to achieve the above-mentioned purpose, the application further provides a terminal device, which comprises a memory, a processor, and a LoRa-based data edge collection program stored on the memory and executable on the processor, and the LoRa-based data edge collection program implements the steps of the LoRa-based data edge collection method when executed by the processor.
[0034] In addition, to achieve the above-mentioned purpose, the application further provides a computer readable storage medium, which stores a LoRa-based data edge collection program, and the LoRa-based data edge collection program implements the steps of the LoRa-based data edge collection method when executed by a processor.
[0035] The application provides a data edge collection method and device based on LoRa, a terminal equipment and a computer readable storage medium.
[0036] Compared with a traditional data edge collection method based on LoRa, the application establishes a LoRa communication connection between a node and a gateway, the node receives a target edge collection rule for collecting data from the gateway, then the node collects data according to the received target collection rule, and finally, the node sends the collected data to the gateway after receiving a synchronization request from the gateway.
[0037] Thus, the application synchronizes the edge collection rule based on the LoRa communication connection between the gateway and the node, the node collects data according to the rule and periodically sends the data to the gateway, so that the data edge collection efficiency based on LoRa is improved without increasing the equipment cost. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 A device structure schematic diagram of a hardware running environment of a terminal equipment related to an embodiment of the application is shown in the figure.
[0039] Figure 2 A flowchart of a first embodiment of the data edge collection method based on LoRa is shown in the figure.
[0040] Figure 3 A node working flowchart related to an embodiment of the data edge collection method based on LoRa is shown in the figure.
[0041] Figure 4 A system overall flowchart related to an embodiment of the data edge collection method based on LoRa is shown in the figure.
[0042] Figure 5 A flowchart of a second embodiment of the data edge collection method based on LoRa is shown in the figure.
[0043] Figure 6 A traditional collection method principle schematic diagram related to an embodiment of the data edge collection method based on LoRa is shown in the figure.
[0044] Figure 7 A collection method principle schematic diagram related to an embodiment of the data edge collection method based on LoRa is shown in the figure.
[0045] Figure 8A gateway workflow schematic diagram related to an embodiment of the LoRa-based data edge collection method of the present application is shown in the figure.
[0046] Figure 9 A functional module schematic diagram of an embodiment of the LoRa-based data edge collection device of the present application is shown in the figure.
[0047] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the present application and do not limit the present application.
[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings. 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 efforts fall within the scope of the present application.
[0050] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative positional relationship, movement condition, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directional indications also change accordingly.
[0051] In the present application, unless otherwise explicitly specified and limited, the terms "connection", "fixation", etc. should be understood broadly, for example, "fixation" can be fixed connection, or detachable connection, or integral; can be mechanical connection, or electrical connection; can be direct connection, or indirect connection through an intermediate medium; can be internal connection of two elements or interaction relationship between two elements, unless otherwise explicitly limited. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0052] In addition, the description such as "first", "second", etc. in the present application is only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of various embodiments can be combined with each other, but it must be based on the fact that the technical solutions can be realized by those skilled in the art, and when the combination of technical solutions appears to be contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, and is not within the scope of protection claimed by the present application.
[0053] The embodiment of the present application provides a terminal device.
[0054] As shown in Figure 1 , Figure 1 is a device structure diagram of a hardware running environment of a terminal device related to an embodiment of the present application.
[0055] As shown in Figure 1 , in the hardware running environment of the terminal device, the terminal device can include a processor 1001, for example, a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection communication between the components. The user interface 1003 can include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 can further include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory) such as a disk memory. The memory 1005 can also be an independent storage device from the aforementioned processor 1001.
[0056] Those skilled in the art can understand that Figure 1 the terminal device structure shown in the above does not constitute a limitation on the device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0057] As shown in Figure 1 , the memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a LoRa-based data edge collection program.
[0058] In the device shown in Figure 1 , the network interface 1004 is mainly used to connect a background server and communicate data with the background server; the user interface 1003 is mainly used to connect a client (user end) and communicate data with the client; and the processor 1001 can be used to call the LoRa-based data edge collection program stored in the memory 1005 and perform the following operations:
[0059] receiving a target edge collection rule based on the LoRa communication connection of the node and the gateway;
[0060] collecting data according to the target edge collection rule;
[0061] sending the collected data to the gateway after receiving the synchronization request of the gateway.
[0062] Optionally, the processor 1001 can be further configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations:
[0063] convert the target edge collection rule to obtain a standard collection instruction;
[0064] collect data of at least one data point hung under the node according to the standard collection instruction.
[0065] Optionally, the processor 1001 can be further configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations after the step of collecting data according to the target edge collection rule:
[0066] save the collected data in a preset storage area and overwrite the original data in the storage area;
[0067] Optionally, the processor 1001 can be further configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations:
[0068] send the data in the storage area to the gateway after receiving the synchronization request of the gateway.
[0069] Optionally, the processor 1001 can be further configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations:
[0070] integrate the data into a data packet of a preset frame number after receiving the synchronization request of the gateway;
[0071] send the data packet to the gateway.
[0072] The processor 1001 can be configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations:
[0073] convert the initial edge collection rule to obtain a target edge collection rule;
[0074] send the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule;
[0075] send a synchronization request to the node to obtain the data collected by the node.
[0076] Optionally, the initial edge collection rule includes a collection period, and the processor 1001 can be further configured to invoke the LoRa-based data edge collection program stored in the memory 1005, and perform the following operations:
[0077] setting a sending time of the synchronization request according to the collection period;
[0078] sending the synchronization request to the node according to the sending time to obtain the data collected by the node.
[0079] Optionally, the initial edge collection rule further comprises a calculation formula and a reporting condition, and the processor 1001 can further be used for calling the LoRa-based data edge collection program stored in the memory 1005, and after performing the step of sending the synchronization request to the node to obtain the data collected by the node, the following operations are further performed:
[0080] processing the data sent by the node according to the calculation formula;
[0081] reporting the processed data to a preset cloud platform according to the reporting condition.
[0082] Based on the above hardware structure, the overall concept of each embodiment of the LoRa-based data edge collection method is proposed.
[0083] In the embodiments of the present application, with the gradual maturity and rapid development of LoRa, more and more fields are applying LoRa for intelligent data collection and device control, and even many LoRa-based application scenarios are developing towards data edge collection.
[0084] A typical LoRa star network is composed of a gateway and a plurality of nodes, the gateway and the nodes communicate through LoRa technology, based on the characteristics of LoRa such as half-duplex and low rate, the time for the gateway and the nodes to transmit data is significantly longer than most other wireless communication methods, especially when the number of nodes in a LoRa network is large and the number of data points mounted under the nodes is also large, the gateway needs to interact with the nodes multiple times to complete data edge collection, and the collection efficiency is obviously low.
[0085] In summary, how to improve the LoRa-based data edge collection efficiency without increasing the cost of equipment has become a technical problem to be solved in the field.
[0086] To solve the above problems, the embodiments of the present application propose a LoRa-based data edge collection method, which comprises: receiving a target edge collection rule based on a LoRa communication connection between the node and the gateway; collecting data according to the target edge collection rule; and sending the collected data to the gateway after receiving the synchronization request of the gateway.
[0087] Compared with a traditional LoRa-based data edge collection method, the LoRa communication connection between the node and the gateway is established, the node receives the target edge collection rule for collecting data from the gateway, then the node collects data according to the received target collection rule, and finally, the node sends the collected data to the gateway after receiving the synchronization request from the gateway.
[0088] Thus, the edge collection rule is synchronously collected by the gateway and the node based on the LoRa communication connection once, the node collects data based on the rule, and then the node periodically sends data to the gateway, so that the LoRa-based data edge collection efficiency is improved without increasing the cost of equipment.
[0089] Based on the overall concept of the LoRa-based data edge collection method of the present application, various embodiments of the LoRa-based data edge collection method of the present application are proposed.
[0090] Please refer to Figure 2 , Figure 2 The flowchart of the first embodiment of the LoRa-based data edge collection method of the present application is shown. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that shown here.
[0091] In this embodiment, the LoRa-based data edge collection method of the present application is applied to any node in a LoRa star network, the LoRa star network further includes a gateway, and the gateway is connected with the node based on LoRa communication. For the sake of understanding and description, in this embodiment, the node is taken as the direct execution subject to describe the LoRa-based data edge collection method of the present application.
[0092] In the embodiment of the present application, the node can be various devices, such as a smoke sensor, a water meter, an electric meter or any other device supporting communication based on LoRa communication technology and gateway.
[0093] As shown in Figure 2 In this embodiment, the LoRa-based data edge collection method of the present application can include:
[0094] Step S10: receiving a target edge collection rule based on the LoRa communication connection between the node and the gateway;
[0095] In this embodiment, the node can automatically receive the target edge collection rule from the gateway based on the LoRa communication connection between the node and the gateway, and if the target edge collection rule is changed, the node can also automatically receive the changed target edge collection rule from the gateway.
[0096] It should be noted that in the present embodiment, the target edge collection rule received by the node from the gateway based on the LoRa communication connection includes but is not limited to device address, register address, data point type, and the node saves the target edge collection rule locally after receiving the target edge collection rule. The target edge collection rule occupies small space and can save the storage resources of the node itself.
[0097] In addition, in a feasible embodiment, the node sends a network access request to the gateway immediately after power-on, that is, the node attempts to establish a LoRa communication connection with the gateway. If the gateway does not reply, the node waits according to a preset time length, and then attempts to establish a LoRa communication connection with the gateway again after reaching the preset time length.
[0098] Step S20: collecting data according to the target edge collection rule;
[0099] In the present embodiment, the node receives the target edge collection rule from the gateway based on the LoRa communication connection, and then collects data of all data points mounted by the node according to the received target edge collection rule.
[0100] It should be noted that in the present embodiment, one node can mount multiple data points. The node collects data of all data points mounted by the node in real time according to the received target edge collection rule.
[0101] Exemplarily, in a feasible embodiment, the node mounts three sensor data points. After receiving the target edge collection rule, the node continuously collects data of the three sensor data points in real time according to the device address, register address and data point type contained in the target edge collection rule, so as to ensure that the latest data of the three sensor data points mounted by the node is collected.
[0102] Optionally, in a feasible embodiment, the above step S20 can include:
[0103] Step S201: converting the target edge collection rule to obtain a standard collection instruction;
[0104] In the present embodiment, the node receives the target edge collection rule from the gateway based on the LoRa communication connection, and then converts the received target edge collection rule into a standard collection instruction. The standard collection instruction is a standard collection protocol that can be recognized by the data points mounted by the node.
[0105] Step S202: collecting data of at least one data point mounted by the node according to the standard collection instruction.
[0106] In the embodiment, the node is hung with at least one data point, the node converts the received target edge collection rule into a standard collection instruction identifiable by the data point, the node collects data of the data point hung by the node through the standard collection instruction, in the case that the node is hung with multiple data points, the node collects data of each data point hung by the node one by one, wherein the collected data is the latest data of each data point needed to be collected by the node according to the standard collection instruction.
[0107] Step S30: sending the collected data to the gateway after receiving the synchronization request of the gateway.
[0108] In the embodiment, the node continuously collects data of the data point hung by the node according to the target edge collection rule received from the gateway, when the node receives the synchronization request sent by the gateway based on LoRa, the node sends the collected data to the gateway.
[0109] Exemplarily, as shown in Figure 3 , after sending the network access request to the gateway, the node receives the reply of the gateway and establishes the communication connection between the node and the gateway, and receives the rule through the communication connection, the node converts the received rule into a collection instruction and collects each data point according to the collection instruction, the node saves the collected data in the storage area of the node, when receiving the data synchronization request sent by the gateway, the node returns the data point data to the gateway, and the node continues to collect each data point according to the collection instruction after returning the data point data to the gateway.
[0110] Optionally, in a feasible embodiment, after the above-mentioned step S20: collecting data according to the target edge collection rule, the LoRa-based data edge collection method of the application can further include:
[0111] Step A10: saving the collected data in the preset storage area and covering the original data in the storage area;
[0112] In the embodiment, after the node collects data of all the data points hung by the node according to the received target edge collection rule, the node saves the data of all the data points in the preset storage area of the node and covers the original data saved in the storage area with the collected data.
[0113] It should be noted that in the embodiment, the node only saves the obtained data in the preset storage area of the node, and does not perform any calculation or processing on the obtained data.
[0114] Based on this, in the embodiment, the above-mentioned step S30: sending the collected data to the gateway after receiving the synchronization request of the gateway can include:
[0115] Step S301: sending the data in the storage area to the gateway after receiving the synchronization request of the gateway.
[0116] In this embodiment, the node continuously collects the data of the data points mounted by the node according to the target edge collection rule received from the gateway, and saves the collected data in the storage area of the node. When the node receives the synchronization request sent by the gateway based on LoRa, the node sends the data currently saved in the storage area to the gateway.
[0117] For example, in this embodiment, after the node collects the data of the three sensor data points mounted by the node according to the received target edge collection rule, the node stores the collected data of the three sensor data points in the storage area of the node. Then, the node continues to collect new data of the three sensor data points and stores the new data in the storage area of the node to replace the previously collected data. That is, the storage area of the node only saves the real-time latest data of all the data points mounted by the node, and does not save historical data. When the node receives the synchronization request sent by the gateway based on LoRa, the node sends the data currently saved in the storage area to the gateway.
[0118] Optionally, in a possible embodiment, the step S30 can further include:
[0119] Step S302: integrating the data into a data packet with a preset frame number after receiving the synchronization request of the gateway.
[0120] In this embodiment, the node continuously collects the data of the data points mounted by the node according to the target edge collection rule received from the gateway, and saves the collected data in the storage area of the node. When the node receives the synchronization request sent by the gateway based on LoRa, the node integrates the data currently saved in the storage area into a data packet with a preset frame number.
[0121] Step S303: sending the data packet to the gateway.
[0122] In this embodiment, when the node receives the synchronization request sent by the gateway based on LoRa, the node integrates the data currently saved in the storage area into a data packet with a preset frame number, and sends the integrated data packet to the gateway.
[0123] It should be noted that in the embodiment, the node and the gateway are based on LoRa for data transmission, and in LoRa communication, data of the same byte length is sent, and the fewer the frame number of the data packet, the faster the transmission speed, preferably, the preset frame number is one frame, that is, the node integrates the collected data into one frame data packet before sending to the gateway, so as to improve the data edge collection efficiency.
[0124] Exemplarily, as shown in the application flow, Figure 4 after the gateway synchronizes the rule to the node, the node receives the rule and stores the converted rule, then the node collects data according to the rule and stores the collected data, finally, the node synchronizes all data to the gateway after receiving the data synchronization instruction sent by the gateway.
[0125] The application provides a data edge collection method based on LoRa, the node receives target edge collection rules from the gateway through the LoRa communication connection established by the node and the gateway; then, the node collects data of all data points mounted by the node according to the received target edge collection rules; finally, when the node receives a synchronization request sent by the gateway based on LoRa, the node sends the collected data to the gateway.
[0126] In this way, the application synchronizes the edge collection rules through the gateway and the node based on the LoRa communication connection once, the node collects data according to the rules and periodically sends data to the gateway, so as to realize the improvement of the data edge collection efficiency based on LoRa without increasing the cost of equipment.
[0127] Further, based on the first embodiment of the data edge collection method based on LoRa, the second embodiment of the data edge collection method based on LoRa is provided.
[0128] As shown in the flowchart of the second embodiment of the data edge collection method based on LoRa, Figure 5 , Figure 5 is a flowchart of the second embodiment of the data edge collection method based on LoRa, in the embodiment, the data edge collection method based on LoRa is applied to the gateway in a LoRa star network, the LoRa star network further includes at least one node, the gateway and the node are connected based on LoRa communication, for the sake of understanding and description, the gateway is directly taken as an execution subject in the embodiment to describe the data edge collection method based on LoRa.
[0129] As shown in the flowchart of the second embodiment of the data edge collection method based on LoRa, Figure 5 in the embodiment, the data edge collection method based on LoRa can include:
[0130] Step S40: converting the initial edge collection rule to obtain a target edge collection rule;
[0131] In the embodiment, the gateway converts the initial edge collection rule to obtain the target edge collection rule sent to the node which establishes the LoRa connection with the gateway, wherein the initial edge collection rule is issued to the gateway by the user through the cloud platform, and the content of the initial edge collection rule can be modified according to the actual use, and the application does not specifically limit the content of the initial edge collection rule.
[0132] For example, in the embodiment, the initial edge collection rule includes the sensor device address, the data point register address to be collected, the data type to be collected, the collection period, the reporting condition, and the calculation formula. After the gateway and the node establish the communication connection, the gateway simplifies the complete initial edge collection rule and extracts the sensor device address, the data point register address to be collected, and the data point type to be collected as the target edge collection rule required by the node for data edge collection.
[0133] Step S50: sending the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule.
[0134] In the embodiment, the gateway sends the target edge collection rule converted from the initial edge collection rule to the node based on the communication connection between the gateway and the node, so that the node collects data of the preset data point according to the received target edge collection rule.
[0135] It should be noted that in the embodiment, one LoRa star network is composed of one gateway and at least one node, one gateway can establish LoRa communication connection with multiple nodes and sequentially send the target edge collection rule to the multiple nodes, and the multiple nodes simultaneously start to collect data of the data points mounted thereon according to the received target edge collection rule.
[0136] In addition, in a feasible embodiment, if a new node needs to join the LoRa star network of the gateway, the gateway establishes a communication connection based on LoRa with the new node after receiving the network access request of the new node, and records the information of the new node. Specifically, the information of the new node can be the unique identification ID of the node, and the gateway can manage the new node according to the unique identification ID of the new node after establishing the communication connection with the new node.
[0137] Step S60: sending a synchronization request to the node to obtain the data collected by the node.
[0138] In the embodiment, the gateway sends a synchronization request to the node which is collecting data according to the target edge collection rule based on the LoRa communication connection between the gateway and the node, to obtain the data collected by the node.
[0139] It should be noted that in this embodiment, after the gateway sends a synchronization request to the node, the gateway receives the current data stored in the node's storage area. Then, the node continues to collect data according to the target edge collection rules and waits for the gateway to send another synchronization request before performing a new data synchronization.
[0140] Optionally, in a feasible embodiment, the initial edge acquisition rule includes an acquisition period, and step S60 described above may include:
[0141] Step S601: Set the sending time of the synchronization request according to the acquisition cycle;
[0142] In this embodiment, the initial edge acquisition rules saved by the gateway include the acquisition period. The gateway sets the sending time of the synchronization request to the node that is acquiring data according to the acquisition period. Based on the acquisition period, the gateway and the node can periodically synchronize the data acquired by the node.
[0143] Step S602: Send the synchronization request to the node according to the sending time to obtain the data collected by the node.
[0144] In this embodiment, the initial edge acquisition rules stored by the gateway include an acquisition period. After the gateway sends the target edge acquisition rules transformed from the initial edge acquisition rules to the node, the gateway immediately sends a synchronization request to the node according to the sending time set by the acquisition period in order to obtain the data of the data points attached to the node.
[0145] It should be noted that, in this embodiment, the initial edge acquisition rules stored by the gateway, including the acquisition cycle, are issued to the gateway by the user through a preset cloud platform. The content of the initial edge acquisition rules and the acquisition cycle can be modified according to actual usage. Each time the preset duration of an acquisition cycle is reached, the gateway immediately sends a synchronization request to the nodes currently performing data edge acquisition. This invention is based on LoRa data...
[0146] The edge acquisition method does not impose specific limitations on the initial edge acquisition rules and the preset duration of the acquisition cycle.
[0147] For example, such as Figure 6 As shown, taking the collection of data from three sensor data points under a single node as an example, the traditional data edge acquisition method is based on the LoRa communication connection between the gateway and the node. When the gateway collects data, it first collects the data from sensor 1 under the node, and the node replies with the data from sensor 1. Then the gateway collects the data from sensor 2 under the node, and the node replies with the data from sensor 2. Finally, the gateway collects the data from sensor 3 under the node, and the node replies with the data from sensor 3.
[0148] The gateway collects a round of data by interacting 3 times, and the more sensor data points, the more times of collection; for example Figure 7 Figure 7 The data edge collection method of the embodiment of the application is based on the LoRa communication connection between the gateway and the node, and the gateway will first send a rule for synchronous collection of data to the node when collecting data, so that the node can actively collect sensor data points according to the rule.
[0149] Then the gateway sends a request for synchronous sensor data to the node to prompt the node to return sensor data.
[0150] In this way, the gateway only needs to send a request for synchronous sensor data to the node to prompt the node to return sensor data in the later collection of sensor data, thereby reducing the number of interactions in the data collection process.
[0151] Optionally, in a feasible embodiment, the initial edge collection rule further includes a calculation formula and a reporting condition, and after the step S60 of sending a synchronous request to the node to obtain the data collected by the node, the LoRa-based data edge collection method of the application can further include:
[0152] Step S70: processing the data sent by the node according to the calculation formula.
[0153] In this embodiment, the initial edge collection rule saved by the gateway further contains a calculation formula, and the gateway processes the received data according to the calculation formula after receiving the data collected by the node.
[0154] It should be noted that in this embodiment, the processing of data by the gateway can be storage and calculation, of course, based on different design needs of actual application, in other any feasible implementation manner, the processing of data by the gateway can also be other operation modes, the LoRa-based data edge collection method of the application does not specifically limit the processing of data by the gateway.
[0155] In this embodiment, the gateway processes the received data according to the calculation formula, and then reports the processed data to the preset cloud platform according to the reporting condition contained in the initial edge collection rule.
[0156] In this embodiment, the gateway processes the received data according to the calculation formula, and then reports the processed data to the preset cloud platform according to the reporting condition contained in the initial edge collection rule.
[0157] In this embodiment, the gateway processes the received data according to the calculation formula, and then reports the processed data to the preset cloud platform according to the reporting condition contained in the initial edge collection rule.
[0158] Example one, as Figure 4 As shown in the application flow, the gateway judges whether a node network access request is received, if yes, the gateway converts the rules saved by itself and synchronizes the converted rules to the node, so that the node collects data according to the rules and synchronizes the data to the gateway, finally, the gateway reports the data to the cloud platform.
[0159] As shown in the second example, Figure 8 As shown, the gateway judges whether a node network access request is received, if yes, the gateway replies to the node network access result and establishes a communication connection between the gateway and the node, the gateway converts the complete rules saved by itself into simple rules and sends the simple rules to the node, if the time length after the gateway sends the simple rules reaches the collection period in the complete rules, the gateway sends a data synchronization request to the node, and after receiving the data returned by the node, the gateway stores, calculates or processes the data and reports to the cloud platform.
[0160] The application provides a LoRa-based data edge collection method, the gateway converts initial edge collection rules to obtain target edge collection rules sent to nodes connected with the gateway through LoRa; then, the gateway sends the target edge collection rules converted from the initial edge collection rules to the nodes based on the communication connection between the gateway and the nodes, so that the nodes collect data of preset data points according to the received target edge collection rules; finally, the gateway sends a synchronization request to the nodes collecting data according to the target edge collection rules based on the LoRa communication connection between the gateway and the nodes, so as to obtain the collected data from the nodes.
[0161] In this way, the gateway and the nodes synchronize the edge collection rules based on the LoRa connection once, the nodes collect data according to the rules and periodically send data to the gateway, so that the LoRa-based data edge collection efficiency is improved without increasing the cost of devices.
[0162] In addition, the application embodiment also provides a LoRa-based data edge collection device.
[0163] Please refer to Figure 9 The LoRa-based data edge collection device provided by the application comprises:
[0164] The node data sending module 10 is used for receiving target edge collection rules based on the LoRa communication connection between the node and the gateway, collecting data according to the target edge collection rules, and sending the collected data to the gateway after receiving the synchronization request of the gateway.
[0165] The gateway data acquisition module 20 is configured to convert the initial edge collection rule to obtain a target edge collection rule, send the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule, and send a synchronization request to the node to obtain the data collected by the node.
[0166] Optionally, the node data sending module 10 is further configured to:
[0167] convert the target edge collection rule to obtain a standard collection instruction;
[0168] collect data of at least one data point hung under the node according to the standard collection instruction.
[0169] Optionally, the node data sending module 10 is further configured to:
[0170] save the collected data in a preset storage area and overwrite the original data in the storage area, and send the data in the storage area to the gateway after receiving the synchronization request of the gateway.
[0171] Optionally, the node data sending module 10 is further configured to:
[0172] integrate the data into a data packet of a preset frame number after receiving the synchronization request of the gateway;
[0173] send the data packet to the gateway.
[0174] Optionally, the initial edge collection rule includes a collection period, and the gateway data acquisition module 20 is further configured to:
[0175] set a sending time of the synchronization request according to the collection period;
[0176] send the synchronization request to the node according to the sending time to obtain the data collected by the node.
[0177] Optionally, the initial edge collection rule further includes a calculation formula and a reporting condition, and the gateway data acquisition module 20 is further configured to:
[0178] process the data sent by the node according to the calculation formula;
[0179] report the processed data to a preset cloud platform according to the reporting condition.
[0180] The functions of each module in the LoRa-based data edge collection device correspond to the steps in the above LoRa-based data edge collection method embodiments, and the functions and implementation processes will not be repeated here.
[0181] In addition, the application further provides a storage medium, wherein the storage medium stores a LoRa-based data edge collection program, and the LoRa-based data edge collection program is executed by a processor to realize the steps of the LoRa-based data edge collection method of the application.
[0182] The specific embodiments of the storage medium of the application are basically the same as the embodiments of the LoRa-based data edge collection method described above, and will not be repeated here.
[0183] It should be noted that in this paper, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0184] The above-mentioned embodiment numbers of the application are only for description, not representing the advantages and disadvantages of the embodiments.
[0185] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platform, of course, hardware can also be used, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the application can be embodied in the form of software products, and the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk)
[0186] , and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the application.
[0187] The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk)
[0188] , and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the application.
[0189] The above is only the preferred embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the application.
[0190] 5The above is only the preferred embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the application.
[0191] The above is only the preferred embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the application.
Claims
1. A LoRa-based data edge collection method, characterized in that, The method is applied to any node in a LoRa star network, the LoRa star network further comprising a gateway, the gateway being connected with the node based on LoRa communication, the method comprising: receiving a target edge collection rule based on the LoRa communication connection between the node and the gateway, the target edge collection rule being obtained by simplifying an initial edge collection rule by the gateway, the target edge collection rule comprising a device address, a register address and a data point type; collecting data according to the target edge collection rule; sending the collected data to the gateway after receiving a synchronization request from the gateway; after the step of collecting data according to the target edge collection rule, the method further comprising: saving the collected data in a preset storage area and covering original data in the storage area; the step of sending the collected data to the gateway after receiving the synchronization request from the gateway, comprising: integrating data in the storage area into data packets of a preset frame number after receiving the synchronization request from the gateway; sending the data packets to the gateway. 2.The LoRa-based data edge collection method of claim 1, wherein, the step of collecting data according to the target edge collection rule, comprising: converting the target edge collection rule to obtain a standard collection instruction; collecting data of at least one data point hung under the node according to the standard collection instruction.
3. A LoRa-based data edge collection method, characterized in that, The method is applied to a gateway in a LoRa star network, the LoRa star network further comprising at least one node, the gateway being connected with the node based on LoRa communication, the method comprising: simplifying an initial edge collection rule to obtain a target edge collection rule, the target edge collection rule comprising a device address, a register address and a data point type; sending the target edge collection rule to the node based on the LoRa communication connection between the gateway and the node, so that the node collects data according to the target edge collection rule, and the node saves the collected data in a preset storage area and covers original data in the storage area; sending a synchronization request to the node to obtain data collected by the node, the node integrating data in the storage area into data packets of a preset frame number after receiving the synchronization request from the gateway, and sending the data packets to the gateway. 4.The LoRa-based data edge collection method of claim 3, wherein, The initial edge collection rule comprises a collection period, and the step of sending a synchronization request to the node to obtain data collected by the node, comprising: setting a sending time of the synchronization request according to the collection period; sending the synchronization request to the node according to the sending time to obtain data collected by the node. 5.The LoRa-based data edge collection method of claim 3, wherein, The initial edge collection rule further comprises a calculation formula and a reporting condition, and after the step of sending a synchronization request to the node to obtain data collected by the node, the method further comprising: processing data sent by the node according to the calculation formula; reporting the processed data to a preset cloud platform according to the reporting condition.
6. A LoRa-based data edge collection device, characterized in that, The device comprises: The node data sending module is configured to receive a target edge collection rule based on the LoRa communication connection between the node and the gateway, the target edge collection rule being obtained by simplifying an initial edge collection rule by the gateway, the target edge collection rule including a device address, a register address, and a data point type; collect data according to the target edge collection rule; and send the collected data to the gateway after receiving a synchronization request from the gateway. The node data sending module is further configured to save the collected data in a preset storage area and overwrite original data in the storage area; synthesize data in the storage area into a data packet of a preset frame number after receiving the synchronization request from the gateway; and send the data packet to the gateway.
7. A terminal device, characterized by comprising: The terminal device includes a memory, a processor, and a LoRa-based data edge collection program stored in the memory and executable on the processor, and the LoRa-based data edge collection program, when executed by the processor, implements the steps of the LoRa-based data edge collection method in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a LoRa-based data edge collection program, and the LoRa-based data edge collection program, when executed by a processor, implements the steps of the LoRa-based data edge collection method in any one of claims 1 to 5.
Citation Information
Patent Citations
Intelligent gateway data acquisition system and method based on Json data piece
CN111556141A
Electric power monitoring and early warning acquisition system and method based on edge calculation
CN112671111A
Wireless data acquisition system
CN207780960U