Data collection method, device, server and system for multiple measurement sensors
Through a multi-metering sensor data acquisition system connected to multiple metering sensors at the acquisition end, data from electricity, water, and gas meters are uniformly collected, which solves the problems of inconsistent data formats and inconsistent standards, and simplifies and standardizes data management.
Patent Information
- Application Number
- CN202011095288.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2040-10-14
AI Technical Summary
In the prior art, the user's electricity meter, water meter, and gas meter data are collected by different meter reading systems, resulting in inconsistent data formats and inconsistent standards, which increases the complexity of data management.
It provides a data acquisition method and system for multi-metering sensors. It connects the electrical metering sensor, water metering sensor and gas metering sensor through the acquisition terminal device, receives the collection instructions sent by the network server, and uniformly collects the data of multiple metering sensors, solving the problem of inconsistent data formats and inconsistent standards.
It realizes unified collection of multiple metrological sensor data, reduces the complexity of data management, standardizes data acquisition standards, and unifies the format of data acquisition.
Smart Images

Figure CN112133074B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things and communication technology, and in particular to a data acquisition method, device, server and system for multiple metering sensors. Background Art
[0002] With the rapid development of Internet of Things technology and wireless communication technology, remote meter reading system has replaced the traditional manual meter reading method. Data reading can be realized through remote data collection and data transmission network. For example, smart meter system can realize remote meter reading and online charging. Water meter system and gas meter system can also realize data management through automatic meter reading technology.
[0003] However, the data of users' electricity meters, water meters, and gas meters are collected by different meter reading systems. The data collection method of each meter reading system is diverse and complex, and the data transmission method is also different. The data is stored in different systems, which increases the complexity of data management. Summary of the invention
[0004] The present application provides a data collection method, device, server and system for multiple metering sensors, which solves the problems of inconsistent formats and standards for collected data and reduces the complexity of data management.
[0005] In a first aspect, the present application provides a data collection method for multiple metering sensors, which is applied to a collection end device, the collection end device is connected to a metering sensor, the metering sensor includes a water metering sensor, an electricity metering sensor, and a gas metering sensor, and the method includes:
[0006] Acquire a collection instruction sent by a network server, wherein the collection instruction includes a first sensor identifier of a metering sensor;
[0007] Sending collection instructions to the metering sensor;
[0008] Receiving collected data sent by a metering sensor corresponding to a first sensor identifier;
[0009] The metering sensor corresponding to the first sensor identifier is any one of a water metering sensor, an electricity metering sensor and a gas metering sensor.
[0010] Optionally, after receiving the collected data sent by the metering sensor corresponding to the first sensor identifier, the method further includes:
[0011] The collected data is sent to the network server, so that the network server forwards the collected data to the client server, so that the client server processes the collected data.
[0012] Optionally, the method further comprises:
[0013] receiving a deletion instruction sent by the network server, wherein the deletion instruction includes a second sensor identifier;
[0014] A connection interruption instruction is generated according to the deletion instruction, wherein the connection interruption instruction is used to interrupt the connection between the metering sensor corresponding to the second sensor identifier and the collection end device.
[0015] Optionally, the method further comprises:
[0016] receiving a new instruction sent by the metering sensor, wherein the new instruction includes a third sensor identifier;
[0017] A first connection establishment instruction is generated according to the newly added instruction, wherein the connection establishment instruction is used to establish a connection between the metering sensor corresponding to the third sensor identifier and the collection end device.
[0018] In a second aspect, the present application provides a data collection method for multiple measuring sensors, which is applied to a client server, and the method includes:
[0019] Sending a collection instruction to the network server, wherein the collection instruction includes a first sensor identifier of the metering sensor, so that the network server sends the collection instruction to the collection end device, so that the metering sensor corresponding to the first sensor identifier sends the collection data to the collection end device;
[0020] Receive the collected data sent by the network server.
[0021] Optionally, the method further comprises:
[0022] Sending a second connection establishment instruction to the network server, so that the network server generates first response information indicating successful connection establishment according to the second connection establishment instruction;
[0023] Receiving a first response message sent by the network server;
[0024] Sending a registration instruction to the network server, so that the network server generates second response information indicating successful registration according to the registration instruction;
[0025] Receive second response information sent by the network server.
[0026] Optionally, after receiving the second response information sent by the network server, the method further includes:
[0027] When a clock signal is received, a null message is sent to the network server.
[0028] In a third aspect, the present application provides a collection terminal device, including: a memory, a processor;
[0029] Memory; Memory for storing processor executable instructions;
[0030] The processor is configured to execute the data collection method of multiple metering sensors involved in the first aspect and the optional solution.
[0031] In a fourth aspect, the present application provides a client server, comprising: a memory, a processor;
[0032] Memory; Memory for storing processor executable instructions;
[0033] The processor is configured to execute the data collection method of multiple metering sensors involved in the second aspect and the optional solution.
[0034] In a fifth aspect, the present application provides a data collection system for multiple measuring sensors, including: a collection terminal device as in the third aspect, a network server, and a client server as in the fourth aspect.
[0035] The present application provides a data collection method, device, server and system for multiple metering sensors. The collection end device obtains a collection instruction sent by a network server, wherein the collection instruction includes a first sensor identifier of the metering sensor. The collection end device sends a collection instruction to the metering sensor. The collection end device receives the collected data sent by the metering sensor corresponding to the first sensor identifier. The metering sensor corresponding to the first sensor identifier is any one of a water metering sensor, an electricity metering sensor and a gas metering sensor. The unified collection of data from multiple metering sensors is achieved, the problem of inconsistent formats and standards of collected data is solved, and the complexity of data management is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] Figure 1 A schematic diagram of a data acquisition system for multiple measurement sensors provided by the present application according to an exemplary embodiment;
[0038] Figure 2 A schematic diagram of a data acquisition system for multiple measurement sensors provided by the present application according to another exemplary embodiment;
[0039] Figure 3 A schematic diagram of a data acquisition system for multiple measurement sensors provided by the present application according to another exemplary embodiment;
[0040] Figure 4 This is a flow chart of a data collection method for multiple measuring sensors according to an exemplary embodiment of the present application;
[0041] Figure 5This is a flow chart of a data collection method for multiple measuring sensors according to another exemplary embodiment of the present application;
[0042] Figure 6 This is a flow chart of a data collection method for multiple measuring sensors according to another exemplary embodiment of the present application;
[0043] Figure 7 The figure is a schematic diagram of the hardware structure of a collection terminal device according to an exemplary embodiment of the present application.
[0044] Description of reference numerals:
[0045] 1-electricity metering sensor; 2-water metering sensor; 3-gas metering sensor; 4-collection end device; collection circuit 41; first conversion circuit 42; first sending circuit 43; timing control circuit 44; 5-gateway device; second conversion circuit 51; second sending circuit 52; receiving circuit 53; 6-server end; 61-network server; 62-client server; client device 621; client server 622.
[0046] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below in conjunction with the drawings in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0048] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0049] In recent years, the Internet of Things technology and wireless communication technology have developed rapidly, and society is moving towards intelligence. "Internet of Everything" has become the main theme of the development of the times. More and more smart sensors read data through remote data collection and data transmission networks.
[0050] At present, the remote meter reading system has replaced the traditional manual meter reading method, collecting data in real time, managing and storing the data, greatly improving work efficiency and metering accuracy. For example, the smart meter system can realize remote meter reading and online charging. The water meter system and gas meter system can also realize data management through automatic meter reading technology.
[0051] However, the data of users' electricity meters, water meters, and gas meters are collected by different meter reading systems. The data collection method of each meter reading system is diverse and complex, and the data transmission method is also different. The data is stored in different systems, which increases the complexity of data management.
[0052] In order to solve the above problems, an embodiment of the present application provides a data acquisition system for multiple metering sensors, which includes: a collection end device and a server end; the collection end device is used to connect to the electricity metering sensor, the water metering sensor and the gas metering sensor respectively, and the collection end device is connected to the server end for communication. By configuring the above multi-metering sensor data acquisition system on the electricity metering sensor, the water metering sensor and the gas metering sensor, the collection end device can collect data from the electricity metering sensor, the water metering sensor and the gas metering sensor according to the instructions of the server end. The server end can store and manage the data in a unified manner. This standardizes the data acquisition standards, unifies the data acquisition format, and reduces the complexity of data management.
[0053] Several realizable data acquisition systems for multiple measuring sensors are introduced below in conjunction with the accompanying drawings so that those skilled in the art can more clearly understand the technical solutions and advantages of the present application.
[0054] Figure 1 Schematic diagram of a data acquisition system of multiple measuring sensors provided by the present application according to an exemplary embodiment. Figure 1 As shown, the data acquisition system of multiple metering sensors provided in this embodiment includes: a collection end device 4 and a server end 6; the collection end device 4 is used to connect to the electricity metering sensor 1, the water metering sensor 2 and the gas metering sensor 3 respectively, and the collection end device 4 is communicatively connected to the server end 6.
[0055] The data in the electricity metering sensor 1, the water metering sensor 2, and the gas metering sensor 3 are the data generated by the user's electricity meter, water meter, and gas meter, respectively. The collection end device 4 is connected to the electricity metering sensor 1, the water metering sensor 2, and the gas metering sensor 3, and collects the data of the electricity metering sensor. The collection end device 4 receives the collection instruction of the server end 6, outputs the collection instruction to the metering sensor, receives the collected data of the metering sensor, and outputs the collected data to the server end 6. The server end 6 outputs the collection instruction to the collection end device 4, and receives the collected data output by the collection end device 4.
[0056] like Figure 1As shown, there are three metering sensors in the data acquisition system of multiple metering sensors provided in this embodiment. The server outputs the acquisition instruction to the acquisition end device, and the acquisition end device receives the acquisition instruction and outputs the acquisition instruction to the metering sensor. The metering sensor receives and parses the acquisition instruction, determines which metering sensor data to collect, and the corresponding metering sensor responds to the acquisition instruction, and other metering sensors automatically ignore the acquisition instruction. The corresponding metering sensor outputs the collected data to the acquisition end device, and the acquisition end device receives the collected data and outputs the collected data to the server. The server receives the collected data and processes the collected data.
[0057] The data acquisition system for multiple metering sensors provided in this embodiment includes a collection terminal device and a server side. The collection terminal device is used to connect to the electricity metering sensor, the water metering sensor and the gas metering sensor respectively, and the collection terminal device is connected to the server side for communication. Multiple metering sensors are connected to the collection terminal device, and the same system is used to collect data from multiple metering sensors. The system can determine the metering sensor that needs to collect data through collection instruction analysis, and the corresponding metering sensor returns the collected data, which solves the problem of inconsistent collection data formats and standards and reduces the complexity of data management.
[0058] Figure 2 FIG. 1 is a schematic diagram of a data acquisition system for multiple measuring sensors provided by the present application according to another exemplary embodiment. Figure 2 As shown, the server end 6 includes a network server 61 for receiving data and a client server 62 for processing data; the network server 61 and the client server 62 are communicatively connected, and the network server 62 is communicatively connected to the acquisition end device 4 .
[0059] The data acquisition system of multiple measuring sensors also includes: a gateway device 5 ; a communication connection between the gateway device 5 and the acquisition terminal device 4 , and a communication connection between the gateway device 5 and the network server 6 .
[0060] The client server 62 outputs a collection instruction to the network server 61 and receives the collection data output by the network server 61. The network server 61 outputs a collection instruction to the collection terminal device 4 and receives the collection data output by the collection terminal device 4, and outputs the collected data to the client server 62 after summarizing the collected data.
[0061] The gateway device 5 connects the collection terminal device 4 and the network server 61 to realize the message communication protocol conversion and forwarding between the collection terminal device 4 and the network server 61, thereby realizing the one-way transmission of data.
[0062] More specifically, a series of interface communication protocols are defined between the network server and the client server. The protocol messages are encoded in JSON format. Each message transmits an application programming interface (API) request or response. Single messages are separated by one or more '\0'. The specific registration command is defined as: {"CMD":"CSREG","Token":1,"CsEUI":"AA555A0000000","APPNonce":1234}.
[0063] Among them, "CMD" is the command identifier; "CSREG" is the registration command; "Token" is the message sequence number, which is carried in the response message; "CsEUI" is the unique identification number of the client server, represented by a hexadecimal integer string and pre-assigned by the network server; "APPNonce" is a random number represented by an unsigned integer.
[0064] If the return result of the registration command is: {"CODE":1, "CsEUI":"AA555A0000000", "CMD":"CSREG", "Token":1, "MSG":"CSREG ACCEPT"}, it means that the registration is successful. Among them, "CODE" is 1, which means the registration is successful; "CsEUI" is the unique identification number of the client server; "CMD" is the command identifier; "Token" is the message sequence number; "MSG" is the message identifier, indicating that the registration is successful.
[0065] After the client server successfully registers on the network server, the network server classifies and manages different client servers according to the unique identification number of the client server. The network server communicates with the client server by establishing a TCP SOCKET long connection to achieve data collection. The heartbeat mode of the client server is turned on after successful registration, and is responsible for sending a '\0' to the network server every 40 seconds to maintain the TCP SOCKET long connection.
[0066] If the return result of the registration command is: {"CODE":0, "CsEUI":"AA555A0000000", "CMD":"CSREG", "Token":1, "MSG":"CSREG Refused"}, it means that the registration failed. Among them, "CODE" is 0, which means the registration failed; "CsEUI" is the unique identification number of the client server; "CMD" is the command identifier; "Token" is the message sequence number; "MSG" is the message identifier, indicating that the registration failed.
[0067] More specifically, after the client server successfully registers on the network server, the client server can output a delete instruction to the network server, and the network server deletes the corresponding metering sensor according to the delete instruction. The network server generates a disconnection instruction according to the delete instruction, and the deleted metering sensor cannot perform data collection operations. Correspondingly, the client server outputs a new addition instruction to the network server, and the network server generates a connection establishment instruction according to the new addition instruction, and the metering sensor after the connection is established can perform data collection operations.
[0068] The working process of the data acquisition system of multiple metering sensors provided in this embodiment is as follows: the client server outputs the acquisition instruction to the network server, the network server receives the acquisition instruction, and outputs the acquisition instruction to the gateway device. The gateway device can realize the mutual conversion between wireless transmission and 4G signal transmission, and outputs the acquisition instruction to the acquisition terminal device. The acquisition terminal device receives the acquisition instruction and outputs the acquisition instruction to the metering sensor. The metering sensor receives and parses the acquisition instruction, determines which metering sensor data to collect, the corresponding metering sensor responds to the acquisition instruction, and other metering sensors automatically ignore the acquisition instruction. The corresponding metering sensor outputs the collected data to the collection terminal device, the collection terminal device receives the collected data, and outputs the collected data to the gateway device. The gateway device outputs the collected data to the network server. The network server receives the collected data, summarizes the collected data and outputs it to the client server. The client server receives the collected data output by the network server, performs statistical analysis, and saves it to the local database.
[0069] The client server outputs the collection command: {“CMD”:“SENDTO”,“CsEUI”:“AA555A0000000”,“Token”:2,“DevEUI”:“AA00000000001”,“payload”:“xxxxx”}.
[0070] Among them, "DevEUI" is the first sensor identifier of the metering sensor, which is represented by a hexadecimal integer string; "SENDTO" is the metering sensor for collecting data indicated in the collection instruction output by the client server; "payload" is the application layer data, which is first packaged according to the metering sensor protocol when packaging, generally in hexadecimal protocol format, packaged into a hexadecimal array, and then the metering sensor protocol data is base64 encoded.
[0071] The collected data output by the measuring sensor is: {"CODE":1,"CsEUI":"AA555A0000000","DevEUI":"AA00000000001","CMD":"SENDTO","Token":2,"MSG":"READY SEND"}, which means that the collected data has been queued and is ready to be sent.
[0072] The acquisition device outputs the data to the gateway device: {“CODE”:2,“CsEUI”:“AA555A0000000”,“DevEUI”:“AA00000000001”,“CMD”:“SENDTO”,“Token”:2,“MSG”:“SENDED TO GW”}, indicating that the data has been sent from the acquisition device to the gateway device.
[0073] Optionally, both the acquisition terminal device 4 and the gateway device 5 are long-distance radio transmission LoRa devices.
[0074] More specifically, the gateway device 5 forwards the collection instruction output by the network server 61 to the collection terminal device 4, and the collection terminal device 4 outputs the collected data to the gateway device 5. The data collection system of multiple metering sensors provided in this embodiment utilizes the technical advantages of LoRa technology such as low power consumption, long distance, and low cost. Both the collection terminal device 4 and the gateway device 5 are long-distance radio transmission LoRa devices.
[0075] LoRa is the abbreviation of Long Range. It is one of the low-power wide area network (LPWAN) communication technologies. It is a dedicated radio modulation and demodulation technology and a technology that works in unlicensed frequency bands. It uses linear frequency modulation spread spectrum modulation technology, which maintains the same low-power characteristics as FSK (frequency shift keying) modulation, and significantly increases the communication distance. At the same time, it improves network efficiency and eliminates interference, that is, terminals with different spread spectrum sequences will not interfere with each other even if they use the same frequency to send at the same time. Therefore, the concentrator / gateway developed on this basis can receive and process data from multiple nodes in parallel, greatly expanding the system capacity. LoRa technology is easy to deploy, low-cost, and unifies long distance and low power consumption. The current automatic meter reading system will use wired communication technology, power line carrier communication technology and wireless communication technology. The application stability of wired communication technology is good, but due to their large amount of wiring engineering, they are prone to human damage, especially in relatively densely populated residential areas. Power line carrier communication technology is often affected by other types of signals such as radio, pulse, and electromagnetic, so that the signal will be lost and garbled during transmission. Wireless communication methods include Zigbee, Bluetooth, GPRS, 4G, NB-IoT, LoRa, etc. Among them, Zigbee and Bluetooth have small coverage, short transmission distance, and are suitable for small areas and occasions with a small number of sensors; GPRS and 4G technologies have a wide access range, high transmission rate, fast connection, and good real-time communication, but they use a method of charging according to traffic. If the data volume is large, the operating cost is high, and during peak communication periods such as holidays, the network will be congested, resulting in poor information transmission. LoRa technology is an emerging wireless communication technology for the Internet of Things, with the characteristics of low power consumption, long transmission distance, strong anti-interference, and low cost. LoRa technology is the development direction of future Internet of Things deployment.
[0076] The data acquisition system for multiple measuring sensors provided in this embodiment includes a network server for receiving data and a client server for processing data on the server side. The network server and the client server are communicatively connected, and the network server is communicatively connected to the collection end device. The system also includes: a gateway device. The gateway device is communicatively connected to the collection end device, and the gateway device is communicatively connected to the network server. Dividing the server side into a network server for receiving data and a client server for processing data makes the division of labor on the server side clearer, making subsequent system maintenance and error detection and correction easier. Both the collection end device and the gateway device are long-distance radio transmission LoRa devices, which give the data acquisition system for multiple measuring sensors the advantages of long distance, low power consumption, and large network capacity.
[0077] Figure 3 FIG. 1 is a schematic diagram of a data acquisition system for multiple measuring sensors provided by the present application according to another exemplary embodiment. Figure 3As shown, the collection end device 4 includes a collection circuit 41 for collecting data and a first conversion circuit 42 for converting the collected data into LoRa data; wherein the output end of the collection circuit 41 is connected to the input end of the first conversion circuit 42, and the input end of the collection circuit 41 is used to be connected to the electricity metering sensor 1, the water metering sensor 2 and the gas metering sensor 3 respectively.
[0078] More specifically, the acquisition circuit 41 is responsible for acquiring data generated by the metering sensor, and the first conversion circuit 42 is responsible for data conversion in the acquisition terminal device 4. The acquisition circuit 41 performs data acquisition according to the acquisition instruction received by the acquisition terminal device 4, and outputs the acquired data to the first conversion circuit 42. The output end of the acquisition circuit 41 is connected to the input end of the first conversion circuit 42. The input end of the first conversion circuit 42 receives the acquired data output by the acquisition circuit 41, and converts the acquired data into LoRa data.
[0079] Optionally, the collection end device 4 also includes: a first sending circuit 43 for sending LoRa data; wherein the input end of the first sending circuit 43 is connected to the output end of the first conversion circuit 42, and the output end of the first sending circuit 43 is connected to the input end of the gateway device 5.
[0080] More specifically, the first sending circuit 43 is responsible for sending LoRa data in the acquisition terminal device, receiving the LoRa data from the first conversion circuit 42 , and sending the LoRa data to the gateway device 5 .
[0081] Optionally, the acquisition terminal device 4 further includes: a timing control circuit 44 ; wherein the output end of the timing control circuit 44 is connected to the input end of the acquisition circuit 41 .
[0082] More specifically, the timing control circuit 44 is responsible for managing the calling sequence of the data acquisition system of the multiple metering sensors, ensuring that the system executes in sequence and achieving stable data acquisition.
[0083] Optionally, the gateway device 5 includes a second conversion circuit 51 and a second sending circuit 52 for converting LoRa data into 4G data; wherein the output end of the second conversion circuit 51 is connected to the input end of the second sending circuit 52 .
[0084] More specifically, the second conversion circuit 51 is responsible for data conversion in the gateway device 5, and the second sending circuit 52 is responsible for data sending in the gateway device 5. The second conversion circuit 51 receives LoRa data and converts the LoRa data into 4G data. The second sending circuit 52 receives 4G data and sends the 4G data to the network server.
[0085] Optionally, the gateway device 5 further includes: a receiving circuit 53 ; wherein the receiving circuit 53 is communicatively connected with the acquisition terminal device 4 .
[0086] More specifically, the receiving circuit 53 is responsible for receiving the LoRa data output by the acquisition terminal device 4 , and outputting the received LoRa data to the second conversion circuit 51 .
[0087] Optionally, the data acquisition system of multiple metering sensors further includes: a client device 621 ; wherein the client device 621 is communicatively connected with a client server 622 .
[0088] More specifically, the client device 621 is responsible for receiving user requirements and outputting the user requirements to the client server 622. The client server 622 receives the user requirements output by the client device 621, converts the user requirements into collection commands, and outputs them to the network server 61.
[0089] The data acquisition system for multiple metering sensors provided in this embodiment connects multiple metering sensors to the acquisition end device, and uses the same system to collect data from the multiple metering sensors. The system can determine the metering sensors that need to collect data through acquisition instruction analysis, and the corresponding metering sensors return the collected data, which solves the problems of inconsistent formats and standards for collected data and reduces the complexity of data management.
[0090] The following describes the data collection method of multiple measurement sensors provided by the present application. The method is applied to Figure 2 The data acquisition system of multiple measuring sensors. Figure 4 FIG. 1 is a flow chart of a data collection method for multiple measuring sensors according to an exemplary embodiment of the present application. Figure 4 As shown, the data collection method of multiple metering sensors in this embodiment is applied to a collection end device, the collection end device is connected to a metering sensor, the metering sensor includes a water metering sensor, an electricity metering sensor and a gas metering sensor, and the method includes:
[0091] S101, the collection terminal device obtains the collection instruction sent by the network server.
[0092] More specifically, the collection instruction includes a command identifier, a unique identification number of a client server, a first sensor identifier of a metering sensor, etc. Among them, the command identifier indicates sending a collection instruction. The unique identification number of a client server uniquely corresponds to one client server, indicating that the collection instruction is sent by this client server. The first sensor identifier of a metering sensor corresponds to the unique identifier of one or more metering sensors, indicating which metering sensor data needs to be collected for this collection instruction.
[0093] The network server sends a collection instruction to the collection terminal device, wherein the collection instruction includes a first sensor identifier of the metering sensor. The collection terminal device obtains the collection instruction sent by the network server.
[0094] S102: The collection end device sends a collection instruction to the metering sensor.
[0095] More specifically, after the collection end device obtains the collection instruction sent by the network server, it sends the collection instruction to the metering sensor. Each metering sensor connected to the collection end device will receive the collection instruction accordingly, but only the metering sensor corresponding to the first sensor identifier will respond, and other metering sensors will automatically ignore the collection instruction. The metering sensor corresponding to the first sensor identifier sends the collection data to the collection end device.
[0096] S103: The collection end device receives the collection data sent by the metering sensor corresponding to the first sensor identifier.
[0097] The metering sensor corresponding to the first sensor identifier is any one of a water metering sensor, an electricity metering sensor and a gas metering sensor.
[0098] The collected data includes the unique identification number of the client server, the first sensor identifier of the metering sensor, the command identifier, the message identifier, etc. The unique identification number of the client server corresponds to a unique client server, indicating that the collected data is sent to this client server. The first sensor identifier of the metering sensor can correspond to the unique identifier of one or more metering sensors, indicating which metering sensor is sending the collected data this time. The command identifier indicates that the collected data is sent. The message identifier indicates that the data collection is completed and the collected data is ready to be sent.
[0099] For example, if the metering sensor corresponding to the first sensor identifier is a unique identifier of a water metering sensor, the water metering sensor sends collected data to the collection end device, and the collected data includes the unique identification number of the client server, the water metering sensor identifier, the command identifier, the message identifier, etc. The collection end device receives the collected data sent by the water metering sensor.
[0100] In the method provided in this embodiment, the collection end device obtains the collection instruction sent by the network server, wherein the collection instruction includes the first sensor identifier of the metering sensor. The collection end device sends the collection instruction to the metering sensor. The collection end device receives the collection data sent by the metering sensor corresponding to the first sensor identifier. The metering sensor corresponding to the first sensor identifier is any one of a water metering sensor, an electricity metering sensor, and a gas metering sensor. The unified collection of data from multiple metering sensors is achieved, the problem of inconsistent formats and standards of collected data is solved, and the complexity of data management is reduced.
[0101] Figure 5 FIG. 1 is a flow chart of a data collection method for multiple measuring sensors according to another exemplary embodiment of the present application. Figure 5As shown, the data collection method of multiple measuring sensors in this embodiment is applied to a collection end device, and the method includes:
[0102] S201 to S203 and Figure 4 S101 to S103 of the illustrated embodiment are the same and will not be described in detail here.
[0103] After S203, the method further includes:
[0104] S204: Send the collected data to the network server, so that the network server forwards the collected data to the client server, so that the client server processes the collected data.
[0105] More specifically, after receiving the collected data sent by the metering sensor corresponding to the first sensor identifier, the collection end device outputs the collected data to the gateway device. At this time, the message identifier in the collected data changes to the gateway device, indicating that the collected data has been sent from the collection end device to the gateway device. The gateway device sends the collected data to the network server. The network server receives the collected data and forwards the collected data to the client server corresponding to the unique identification number of the client server. The corresponding client server receives the collected data and processes the collected data.
[0106] S205, receiving a deletion instruction sent by the network server, wherein the deletion instruction includes the second sensor identifier, and generating a connection interruption instruction according to the deletion instruction, wherein the connection interruption instruction is used to interrupt the connection between the metering sensor corresponding to the second sensor identifier and the collection end device.
[0107] More specifically, the second sensor identifier is a unique identifier of one or more metering sensors to be deleted. The client server sends a deletion instruction to the network server. The network server sends the deletion instruction to the collection end device. The collection end device receives the deletion instruction sent by the network server, generates a disconnection instruction according to the deletion instruction, and disconnects the connection between the metering sensor corresponding to the second sensor identifier and the collection end device according to the disconnection instruction.
[0108] S206, receiving a new instruction sent by the metering sensor, wherein the new instruction includes a third sensor identifier, and generating a first connection establishment instruction according to the new instruction, wherein the connection establishment instruction is used to establish a connection between the metering sensor corresponding to the third sensor identifier and the collection end device.
[0109] More specifically, the third sensor identifier is a unique identifier of one or more metering sensors that need to be added. The client server sends a new instruction to the network server. The network server sends the new instruction to the collection end device. The collection end device receives the new instruction sent by the network server, generates a first connection establishment instruction according to the new instruction, and establishes a connection between the metering sensor corresponding to the third sensor identifier and the collection end device according to the first connection establishment instruction.
[0110] It should be noted that steps S205 and S206 are for deleting or adding a metering sensor. In the specific implementation process, steps S205 and S206 can be executed before step S204 or after step S204. In addition, the execution order of steps S205 and S206 is not limited here.
[0111] Figure 6 FIG. 1 is a flow chart of a data collection method for multiple measuring sensors according to another exemplary embodiment of the present application. Figure 6 As shown, the data collection method of multiple measuring sensors in this embodiment is applied to a client server, and the method includes:
[0112] S301. The client server sends a collection instruction to the network server, wherein the collection instruction includes a first sensor identifier of a metering sensor, so that the network server sends the collection instruction to a collection terminal device, so that the metering sensor corresponding to the first sensor identifier sends collection data to the collection terminal device.
[0113] More specifically, the first sensor identifier of the metering sensor corresponds to the unique identifier of one or more metering sensors, indicating which metering sensor data needs to be collected for this collection instruction. The client server sends a collection instruction to the network server. The network server receives the collection instruction sent by the client server, and sends the collection instruction to the gateway device. The gateway device forwards the collection instruction to the collection end device. The collection end device receives the collection instruction sent by the gateway device, and sends the collection instruction to all metering sensors. The metering sensor corresponding to the first sensor identifier sends the collection data to the collection end device, and other metering sensors automatically ignore the collection instruction.
[0114] S302: The client server receives the collected data sent by the network server.
[0115] More specifically, the acquisition terminal device sends the collected data to the gateway device. The gateway device forwards the collected data to the network server. The network server encodes and packages the collected data into an interface message and forwards it to the client server. The client server receives the collected data sent by the network server, parses the corresponding metering sensor value, and saves it to the database.
[0116] S303: The client server sends a second connection establishment instruction to the network server, so that the network server generates first response information indicating successful connection establishment according to the second connection establishment instruction.
[0117] More specifically, the second connection establishment instruction is a connection establishment instruction sent by the client server to the network server.
[0118] S304: The client server receives the first response information sent by the network server.
[0119] More specifically, the first response information is response information generated by the network server according to the second connection establishment instruction and sent to the client server, indicating that the client server has successfully established a connection with the network server.
[0120] S305. The client server sends a registration instruction to the network server, so that the network server generates second response information indicating successful registration according to the registration instruction.
[0121] More specifically, the registration instruction is a registration command sent by the client server to the network server. The second response information is generated by the network server according to the registration instruction and sent to the client server, indicating that the client server is successfully registered on the network server.
[0122] For example, the registration instruction can be expressed as: {"CMD":"CSREG","Token":1,"CsEUI":"AA555A0000000","APPNonce":1234}. Among them, "CMD" is the command identifier, "CSREG" is the registration command; "Token" is the message sequence number, which is carried in the response message; "CsEUI" is the unique identification number of the client server, represented by a hexadecimal integer string and pre-assigned by the network server; "APPNonce" is a random number represented by an unsigned integer.
[0123] S306: The client server receives the second response information sent by the network server.
[0124] For example, the second response information can be expressed as {"CODE":1, "CsEUI":"AA555A0000000", "CMD":"CSREG", "Token":1, "MSG":"CSREG ACCEPT"}. "CODE" is 1, indicating successful registration; "CsEUI" is the unique identification number of the client server; "CMD" is the command identifier; "Token" is the message sequence number; "MSG" is the message identifier, indicating successful registration.
[0125] S307. When receiving the clock signal, the client server sends an empty message to the network server.
[0126] More specifically, after receiving the second response information sent by the network server, the client server is provided with a clock signal in order to maintain a long connection between the client server and the network server. The clock signal can be set as needed. For example, if the clock signal is set to 40 seconds, the client server sends an empty message to the network server every 40 seconds.
[0127] Figure 7 FIG. 1 is a schematic diagram of the hardware structure of a collection terminal device according to an exemplary embodiment of the present application. Figure 7 As shown, the acquisition terminal device 70 of this embodiment includes: a memory 72, a processor 71;
[0128] Memory 72; Memory for storing processor executable instructions;
[0129] The processor 71 is configured to implement the data collection method of multiple measuring sensors executed by the collection end device in the above embodiment.
[0130] The embodiment of the present application also provides a client server comprising: a memory, a processor;
[0131] Memory; Memory for storing processor executable instructions;
[0132] The processor is configured to implement the data collection method of multiple metering sensors executed by the client server in the above embodiment.
[0133] The embodiment of the present application also provides a data collection system for multiple measuring sensors, including: the collection terminal device, the network server and the client server in the above embodiment.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data collection method for multiple measuring sensors, characterized in that: Applied to a collection end device, the collection end device is connected to a metering sensor, the metering sensor includes a water metering sensor, an electricity metering sensor and a gas metering sensor, the collection end device includes: a timing control circuit, an acquisition circuit, a first conversion circuit and a first sending circuit, the timing control circuit is used to manage the calling sequence of the data acquisition system of multiple metering sensors, the acquisition circuit is used to collect data generated by the metering sensor, the first conversion circuit is used to convert the data sent by the acquisition circuit into LoRa data, the first sending circuit is used to send the LoRa data to a gateway device, the method includes: Acquire a collection instruction sent by a network server, wherein the collection instruction includes a first sensor identifier of a metering sensor; Sending the collection instruction to the metering sensor; Receiving the collected data sent by the metering sensor corresponding to the first sensor identifier; The metering sensor corresponding to the first sensor identifier is any one of the water metering sensor, the electricity metering sensor and the gas metering sensor; After receiving the collected data sent by the metering sensor corresponding to the first sensor identifier, the method further includes: Send the collected data to the network server, so that the network server forwards the collected data to the client server, so that the client server processes the collected data; wherein the network server classifies and manages different client servers according to the unique identification number of the client server; the network server communicates with the client server by establishing a TCPSOCKET long connection.
2. The data collection method of multiple measuring sensors according to claim 1, characterized in that: The method further comprises: receiving a deletion instruction sent by the network server, wherein the deletion instruction includes a second sensor identifier; A connection interruption instruction is generated according to the deletion instruction, wherein the connection interruption instruction is used to interrupt the connection between the metering sensor corresponding to the second sensor identifier and the acquisition end device.
3. The data collection method of multiple measuring sensors according to claim 1, characterized in that: The method further comprises: receiving a new instruction sent by the metering sensor, wherein the new instruction includes a third sensor identifier; A first connection establishment instruction is generated according to the newly added instruction, wherein the connection establishment instruction is used to establish a connection between the metering sensor corresponding to the third sensor identifier and the acquisition end device.
4. A data collection method for multiple measuring sensors, characterized in that: Applied to a client server, the method comprises: Sending a collection instruction to a network server, wherein the collection instruction includes a first sensor identifier of a metering sensor, so that the network server sends the collection instruction to a collection end device, so that the metering sensor corresponding to the first sensor identifier sends the collected data to the collection end device; the collection end device includes: a timing control circuit, a collection circuit, a first conversion circuit and a first sending circuit, the timing control circuit is used to manage the calling sequence of the data collection system of multiple metering sensors, the collection circuit is used to collect data generated by the metering sensor, the first conversion circuit is used to convert the data sent by the collection circuit into LoRa data, and the first sending circuit is used to send the LoRa data to a gateway device; Receive the collected data sent by the network server; wherein the network server classifies and manages different client servers according to the unique identification numbers of the client servers; the network server communicates with the client servers by establishing a TCP SOCKET long connection.
5. The data collection method of multiple measuring sensors according to claim 4 is characterized in that: The method further comprises: Sending a second connection establishment instruction to the network server, so that the network server generates first response information indicating successful connection establishment according to the second connection establishment instruction; Receiving the first response information sent by the network server; Sending a registration instruction to the network server, so that the network server generates second response information indicating successful registration according to the registration instruction; Receive second response information sent by the network server.
6. The data collection method of multiple measuring sensors according to claim 5, characterized in that: After receiving the second response information sent by the network server, the method further includes: When a clock signal is received, a null message is sent to the network server.
7. A collection terminal device, characterized in that: include: Memory, processor; Memory; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the data collection method of multiple metering sensors as described in any one of claims 1 to 3.
8. A client server, characterized in that: include: Memory, processor; Memory; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the data collection method of multiple metering sensors as described in any one of claims 4 to 6.
9. A data acquisition system for multiple measuring sensors, characterized in that: include: The acquisition terminal device and network server as described in claim 7 and the client server as described in claim 8.
Citation Information
Patent Citations
Remote meter reading method and system
CN110853317A