CN112911024A - Method and system for collecting data of Internet of things, electronic device and storage medium - Google Patents

Method and system for collecting data of Internet of things, electronic device and storage medium Download PDF

Info

Publication number
CN112911024A
CN112911024A CN202110493266.4A CN202110493266A CN112911024A CN 112911024 A CN112911024 A CN 112911024A CN 202110493266 A CN202110493266 A CN 202110493266A CN 112911024 A CN112911024 A CN 112911024A
Authority
CN
China
Prior art keywords
data
transmission unit
platform
sensor
data transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110493266.4A
Other languages
Chinese (zh)
Other versions
CN112911024B (en
Inventor
王雷雷
张国宏
龙文件
赵宪鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Jianjie Iot Technology Co ltd
Original Assignee
Zhejiang Jianjie Iot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Jianjie Iot Technology Co ltd filed Critical Zhejiang Jianjie Iot Technology Co ltd
Priority to CN202110493266.4A priority Critical patent/CN112911024B/en
Publication of CN112911024A publication Critical patent/CN112911024A/en
Application granted granted Critical
Publication of CN112911024B publication Critical patent/CN112911024B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L25/00Baseband systems
    • H04L25/38Synchronous or start-stop systems, e.g. for Baudot code
    • H04L25/40Transmitting circuits; Receiving circuits
    • H04L25/49Transmitting circuits; Receiving circuits using code conversion at the transmitter; using predistortion; using insertion of idle bits for obtaining a desired frequency spectrum; using three or more amplitude levels ; Baseband coding techniques specific to data transmission systems
    • H04L25/4906Transmitting circuits; Receiving circuits using code conversion at the transmitter; using predistortion; using insertion of idle bits for obtaining a desired frequency spectrum; using three or more amplitude levels ; Baseband coding techniques specific to data transmission systems using binary codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application relates to a method, a system, an electronic device and a storage medium for data acquisition of the Internet of things, wherein the method comprises the following steps: the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, the JSON request data is coded into binary data through a Lua script, and then the binary data is sent to the sensor; the sensor triggers an uplink request response according to the downlink request data and reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives the binary sampling data sent by the sensor, decodes the binary sampling data into JSON response data through the Lua script and reports the JSON response data to the IOT data platform according to the service identifier; the data transmission unit comprises a Lua script, the Lua script is updated and edited on the DTU + management platform through MQTT messages, and remote modification can be carried out according to a sensor protocol. Through the application, the efficiency is improved, and the cost is reduced.

Description

Method and system for collecting data of Internet of things, electronic device and storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a method, a system, an electronic device, and a storage medium for data acquisition in the internet of things.
Background
With the rapid development of the internet of things IoT technology, the internet of things technology is adopted in more and more industry fields, however, the sensor industry technology cannot be used for timely docking various types of all-five internet of things platforms. Therefore, in the market, a mode that the sensor is matched with a Data Transfer unit (DTU for short) to directly access Data to the cloud server is often adopted, and the cloud server completes the work of analyzing binary protocol Data. Firstly, analyzing from the connection characteristics, the DTU can lengthen the data acquisition link, thereby increasing the risk of data loss and the flow consumed by data acquisition; then, from the analysis of information recovery, the information recovery refers to the decoding/encoding of binary data, which is realized by the background programmer through hard coding to achieve the purpose of increasing the device type, but the device access efficiency is very low. In addition, due to the characteristic of platform centralization, when new equipment is added or later maintenance and debugging are needed, workers need to inquire clues in thousands of equipment, and debugging is very difficult; finally, analysis on ease of use, the DTU scheme, lack of remote configuration management, and any modification requires an engineer to go to the site for configuration debugging.
At present, no effective solution is provided aiming at the problems of high risk of data acquisition loss, low sensor equipment access efficiency and lack of remote configuration management when the sensor data is acquired through an internet of things system in the related art.
Disclosure of Invention
The embodiment of the application provides a method, a system, an electronic device and a storage medium for acquiring data of the Internet of things, and at least solves the problems that when sensor data are acquired through the Internet of things system in the related art, the acquired data are high in risk of being lost, sensor equipment is low in access efficiency, and remote configuration management is lacked.
In a first aspect, an embodiment of the present application provides a data acquisition method, which is applied in an internet of things system, where the system includes: the data acquisition method comprises the following steps of (1) a cloud platform, a data transmission unit and a sensor, wherein the cloud platform comprises an IOT data platform and a DTU + management platform, and the data acquisition method comprises the following steps:
the data transmission unit comprises a Lua script, and the Lua script is updated and edited on the DTU + management platform through an MQTT message and can be remotely modified according to a sensor protocol;
the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, codes the JSON request data into binary data through the Lua script, and then sends the binary data to the sensor;
the sensor triggers an uplink request response according to the downlink request data, reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives binary sample data sent by the sensor, decodes the binary sample data into JSON response data through the Lua script, and reports the JSON response data to the IOT data platform according to a service identifier, wherein the service identifier is a message stream for classifying data based on service attributes.
In some embodiments, in the case that the IOT data platform does not issue request data, the method includes:
the sensor actively sends sampling data to the IOT data platform through the data transmission unit, the data transmission unit acquires binary sampling data actively sent by the sensor, decodes the binary sampling data into JSON data, and reports the JSON data to the IOT data platform according to event identification.
In some embodiments, the IOT data platform initiating a downlink request for data to the sensor via the data transmission unit comprises:
and the IOT data platform configures an automatic calling period and issues the downlink request data to the sensor through the data transmission unit according to the calling period.
In some of these embodiments, said remotely modifying according to the sensor protocol comprises:
the data transmission unit reports DTU + information to the DTU + management platform through MQTT information, and the DTU + management platform receives the DTU + information and configures in an associated configuration group;
and the DTU + management platform issues the configuration information in the configuration group to the data transmission unit, and the data transmission unit automatically replaces local configuration and takes effect immediately after receiving the configuration information.
In a second aspect, an embodiment of the present application provides a system for data acquisition of an internet of things, where the system is applied to a system of an internet of things, and the system includes: the system comprises a cloud platform, a data transmission unit and a sensor, wherein the cloud platform comprises an IOT data platform and a DTU + management platform,
the data transmission unit comprises a Lua script, and the Lua script is updated and edited on the DTU + management platform through an MQTT message and can be remotely modified according to a sensor protocol;
the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, codes the JSON request data into binary data through the Lua script, and then sends the binary data to the sensor;
the sensor triggers an uplink request response according to the downlink request data, reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives binary sample data sent by the sensor, decodes the binary sample data into JSON response data through the Lua script, and reports the JSON response data to the IOT data platform according to a service identifier, wherein the service identifier is a message stream for classifying data based on service attributes.
In some embodiments, in the case that the IOT data platform does not issue request data, the method includes:
the sensor actively sends sampling data to the IOT data platform through the data transmission unit, the data transmission unit acquires binary sampling data actively sent by the sensor, decodes the binary sampling data into JSON data, and reports the JSON data to the IOT data platform according to event identification.
In some embodiments, the IOT data platform configures an automatic call period, and issues the downlink request data to the sensor through the data transmission unit according to the call period.
In some embodiments, the data transmission unit reports DTU + information to the DTU + management platform through MQTT messages, and the DTU + management platform receives and replies to a configuration group associated with the DTU + management platform;
and the DTU + management platform issues the configuration in the configuration group to the data transmission unit, and the data transmission unit automatically replaces the local configuration and takes effect immediately after receiving the configuration.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the method for data acquisition of an internet of things described in any one of the foregoing descriptions.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored in the storage medium, where the computer program is configured to, when running, execute any one of the methods for data acquisition in the internet of things.
Compared with the related art, the method for acquiring the data of the internet of things is applied to the system of the internet of things, wherein the system comprises the following steps: the system comprises a cloud platform, a data transmission unit and a sensor, wherein the cloud platform comprises an IOT data platform and a DTU + management platform; the data transmission unit comprises a Lua script, the Lua script is updated and edited on the DTU + management platform through MQTT messages, and can be remotely modified according to a sensor protocol; the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, the JSON request data is coded into binary data through a Lua script, and then the binary data is sent to the sensor; the sensor triggers an uplink request response according to the downlink request data, reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives the binary sampling data sent by the sensor, decodes the binary sampling data into JSON response data through the Lua script, and reports the JSON response data to the IOT data platform according to the service identifier, wherein the service identifier is a message stream for classifying the data based on the service attribute. The problems that in the prior art, when the sensor data are collected through the Internet of things system, the existing collected data are high in risk of losing, the sensor equipment is low in access efficiency and lacks of remote configuration management are solved, the risk of losing the collected data is reduced, the equipment access efficiency and the later maintenance efficiency are improved, and therefore the cost is effectively reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of a data acquisition method according to an embodiment of the present application;
FIG. 2 is a block diagram of a data acquisition system according to an embodiment of the present application;
FIG. 3 is a system diagram of data acquisition and DTU + configuration management according to an embodiment of the present application
FIG. 4 is a schematic diagram of a data acquisition system for use in an Internet of things system according to an embodiment of the application;
FIG. 5 is a schematic diagram of data conversion of JSON data into binary data according to an embodiment of the present application;
FIG. 6 is a schematic diagram of data conversion of binary data to JSON data according to an embodiment of the present application;
fig. 7 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any creative effort belong to the protection scope of the present application. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference herein to "a plurality" means greater than or equal to two. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The embodiment of the application provides a method for acquiring data of an internet of things, which is applied to an internet of things system, and the system comprises the following steps: the cloud platform comprises an IOT data platform and a DTU + management platform, fig. 1 is a flowchart of a data acquisition method according to an embodiment of the present disclosure, and as shown in fig. 1, the flowchart includes the following steps:
step S101, the data transmission unit comprises a Lua script, the Lua script is updated and edited on a DTU + management platform through an MQTT message, and remote modification can be carried out according to a sensor protocol; it should be noted that both the internet of things platform and the background communication adopt JSON character strings, and data that can be identified by the sensor is binary data, so that in order to achieve the purpose that the sensor is accessed to the internet of things platform to acquire data, the embodiment performs data conversion based on the Lua virtual machine and the OpenCPU, and converts binary data streams that are not convenient for a platform engineer to process into readable JSON data through a custom Lua script. The dynamically changing codes in the self-defined Lua script are updated and edited on a DTU + management platform through MQTT messages, the logic of the script core is unchanged in use, and the core logic mainly completes common characteristics in the system, such as data polling, protocol body processing related to a protocol, the logic of the data platform and the configuration of the DTU +. The variable code of the user in the custom Lua script at least comprises but is not limited to three Lua functions: the method comprises the following steps of (1) initializing an init () function, a decode () function and an encode () function, wherein the init () function is used for initializing variables, and initializing a timer variable which needs to automatically send request data; the decode () function is used for converting binary data into a json data structure after adding field names to the binary data; the function of the encode () function is to merge the values of each field fetched from the json data into a binary format.
The Lua script used for realizing the analysis and conversion of the data in the embodiment can be written by an embedded engineer who knows embedded characteristics better, and does not need to be written by a back-end engineer, so that developers can develop and write codes more conveniently, and the development cost is effectively reduced. In addition, because the Lua script is edited on the cloud platform and can be remotely modified according to the sensor protocol, a worker does not need to go to an engineering site to carry out operation and debugging, remote configuration management can be carried out, and the usability is high.
Preferably, the remotely modifying according to the sensor protocol comprises: the data transmission unit reports DTU + information to the DTU + management platform through the MQTT message, and the DTU + management platform receives the DTU + information and configures the DTU + information in the associated configuration group; and the DTU + management platform issues the configuration information in the configuration group to the data transmission unit, and the data transmission unit automatically replaces the local configuration and takes effect immediately after receiving the configuration information. In this embodiment, the user only needs to modify the configuration information in the relevant configuration group on the DTU + management platform according to the reported DTU + information, and then the remote DTU + configuration is automatically changed accordingly. If the configuration needs to take effect immediately, the configuration can be triggered to be updated immediately only by sending a restart command remotely on the management platform, and engineers do not need to modify one by one on site, so that the working efficiency is greatly improved.
Step S102, the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, the JSON request data is coded into binary data through the Lua script, and then the binary data is sent to the sensor; the Data transmission unit in this embodiment is developed based on a 4G module OpenCPU, and is hereinafter referred to as DTU +, and the DTU + is different from a Data Transfer Unit (DTU) in the market, in which a Lua virtual machine and a Lua tool are transplanted, and a Lua protocol is used as a basic structure to implement a multitask processing logic. In addition, the encoding and decoding codes are operated in one protocol of Lua through the Lua script, and the conversion of binary data and JSON general data can be realized; furthermore, all interface configurations of the DTU + and Lua scripts for realizing the encoding and decoding conversion of binary data and JSON general data are edited in a DTU + management platform, and the DTU + is issued after the remote configuration through a cloud. And the user can be according to sensor protocol in the long-range management in high in the clouds, modify Lua script configuration and make it take effect, does not need the engineer to go on modifying one by one to the scene, compares in using a great deal of drawbacks of relevant technique DTU, adopts the DTU + transmission data of this embodiment can effectual raise the efficiency, reduces the cost of labor, is convenient for the engineer to carry out the access and the later maintenance debugging of equipment.
Fig. 5 is a schematic diagram of data conversion from JSON data to binary data according to an embodiment of the present application, and in particular, a data encoding process for encoding JSON request data into binary data by using a Lua script function in the embodiment is as shown in fig. 5, for example, three json data "K1" =5, "K2" =7, "K3" =3 are encoded, a cache is first created from the init data item information, then, the init table is traversed, the values of the arrays [ index ] key in the init table are read as K1, K2 and K3 respectively, then using the value as key of json data, finding out the corresponding value, reading the values of the arrays [ index ] reg/offset in the init table to be 0, 1 and 2 respectively, finally writing the value into the positions of reg/offset of cache to be 0, 1 and 2 respectively, binary data of 0x05, 0x07 and 0x03 are obtained, and through the process, conversion of json data into binary data is completed.
And S103, triggering an uplink request response by the sensor according to the downlink request data, reporting the uplink request response to the IOT data platform through the data transmission unit, receiving the binary sampling data sent by the sensor by the data transmission unit, decoding the binary sampling data into JSON response data through the Lua script, and reporting the JSON response data to the IOT data platform according to a service identifier, wherein the service identifier is a message stream for classifying data based on the service attribute. Optionally, each service packet is composed of a downlink data stream and an uplink data stream, in this embodiment, the downlink data stream is initiated by invoking the IOT data platform, and the uplink data stream triggered by the downlink data stream each time is reported to the IOT data platform according to the service identifier.
Fig. 6 is a schematic diagram of data conversion from binary data to JSON data according to an embodiment of the present application, specifically, in this embodiment, a data decoding process for encoding binary sample data into JSON response data by using a Lua script function is as shown in fig. 6, for example, three binary data 0x05, 0x07, and 0x03 are decoded, a cache is first created according to information of an init data item, then an init table is traversed, values of an array [ index ] reg/offset in the init table are read as 0, 1, and 2, respectively, data of a format = 8 in the init table is intercepted, data of a reg/offset position in the binary data is intercepted, values of an array [ index ] key in the init table are read as K1, K2, and K3, and finally a value of an array [ index ] key is used as a key for outputting JSON data, the intercepted and formatted data is used as a value of JSON data, and the obtained as a value of JSON data, and the JSON data are "K1K 8678" = 367 ″ data, "K3" =3, and by the above-described procedure, data conversion of binary to json data is completed.
In some embodiments, when the IOT data platform does not issue the request data, the sensor actively sends the sample data to the IOT data platform through the data transmission unit, the data transmission unit obtains the binary sample data actively sent by the sensor, decodes the binary sample data into JSON data, and finally reports the JSON data to the IOT data platform according to the event identifier. Optionally, each event only needs to be an uplink data stream, and if there is no downlink data stream triggered, the uplink data stream is reported to the cloud platform according to the event identifier.
As can be seen from the above, in this embodiment, by introducing the concept of service/event, the reported data is divided into different service attributes, for example, an uplink data stream triggered by a downlink data stream is reported according to a service identifier; and reporting the uplink data stream without any downlink data stream trigger according to the event identifier. The message flow classified based on the service attributes is convenient for a back-end engineer to understand and call, and the working efficiency is improved.
In some embodiments, when the sensor does not actively report data, the IOT data platform initiates downlink request data to the sensor through the data transmission unit, and may further specify an automatic call period, that is, the IOT data platform configures the automatic call period, and issues the downlink request data to the sensor according to the period through the data transmission unit, so as to call the sensor to acquire data. Optionally, the IOT data platform issues request data to the sensor according to a set automatic call period, where the request data is subjected to data conversion via a data transmission unit DTU +, that is, the JSON request data is decoded into binary request data that can be recognized by the sensor; the sensor acquires the binary request data, samples related equipment data and replies uplink binary sampling data according to a period; the binary sampling data is converted into JSON response data through the coding of a data transmission unit DTU +, and the JSON response data is reported to the cloud platform according to the service identifier. The whole process realizes automatic periodic acquisition of data.
Through the steps S101 to S103, compared with the prior art, the scheme of accessing the sensor to the cloud end by using the DTU has many disadvantages, for example, the link for data acquisition is long, and the risk of data loss and the flow consumed by data acquisition are increased; the equipment access efficiency is very low, and due to the centralized characteristic of the platform, when new equipment is added or later maintenance and debugging are needed, workers need to inquire clues in thousands of equipment, so that the debugging is very difficult; and the problems that remote configuration management is lacked, and any modification requires an engineer to go to the site for configuration debugging and the like. The embodiment develops a new data transmission unit DTU +, and the sensor is accessed into the cloud platform of the Internet of things system through the DTU +, so that the rapid access of the equipment and the complete acquisition of data are realized, the problems that the acquired data are high in loss risk when the sensor data are acquired through the Internet of things system in the related art are solved, the sensor equipment is low in access efficiency and lacks in remote configuration management, the loss risk of the acquired data is reduced, the equipment access and later maintenance efficiency is improved, and the equipment cost and the labor cost are effectively reduced.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The embodiment also provides a system for acquiring data of the internet of things, which is used for implementing the above embodiments and preferred embodiments, and the description of the system is omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a block diagram of a data acquisition system according to an embodiment of the present application, and as shown in fig. 2, the system includes an IOT data platform 20, a DTU + management platform 21, a data transmission unit 22, and a sensor 23:
the data transmission unit 22 comprises a Lua script, the Lua script is updated and edited on the DTU + management platform 21 through an MQTT message, and can be remotely modified according to a sensor protocol;
the IOT data platform 20 initiates downlink request data to the sensor 23 through the data transmission unit 22, the data transmission unit 22 receives JSON request data initiated by the IOT data platform 20, codes the JSON request data into binary data, and then sends the binary data to the sensor 23;
the sensor 23 triggers an uplink request response according to the downlink request data, and reports the uplink request response to the IOT data platform 20 through the data transmission unit 22, and the data transmission unit 22 receives the binary sample data sent by the sensor 23, decodes the binary sample data into JSON response data, and reports the JSON response data to the IOT data platform 20 according to a service identifier, where the service identifier is a message stream for classifying data based on a service attribute.
In some embodiments, when the IOT data platform 20 does not issue the request data, the sensor 23 actively sends the sampled data to the IOT data platform 20 through the data transmission unit 22, the data transmission unit 22 obtains the binary sampled data actively sent by the sensor 23, decodes the binary sampled data into JSON data, and finally reports the JSON data to the IOT data platform 20 according to the event identifier. Optionally, each event only needs one uplink data stream, and if there is no downlink data stream triggered, the uplink data stream is reported to the IOT data platform according to the event identifier.
In some embodiments, when the sensor 23 does not actively report data, the IOT data platform 20 initiates downlink request data to the sensor 23 through the data transmission unit 22, and may further specify an automatic call period, that is, the IOT data platform 20 configures the automatic call period, and issues the downlink request data to the sensor 23 according to the period through the data transmission unit 22, so as to call the sensor 23 to collect data. Optionally, the IOT data platform 20 issues request data to the sensor 23 according to the set automatic call period, where the request data is subjected to data conversion via the data transmission unit DTU +, that is, the JSON request data is decoded into binary request data that can be recognized by the sensor 23; the sensor 23 acquires the binary request data, samples the data of the relevant equipment, and replies the uplink binary sampling data according to the period; the binary sampling data is converted into JSON response data through the coding of a data transmission unit DTU +, and the JSON response data is reported to the IOT data platform according to the service identification. The whole process realizes automatic periodic acquisition of data.
In some of these embodiments, remotely modifying according to the sensor protocol includes: the data transmission unit 22 reports the DTU + information to the DTU + management platform 21 through the MQTT message, and the DTU + management platform 21 receives the DTU + information and configures in the associated configuration group; the DTU + management platform 21 issues the configuration information in the configuration group to the data transmission unit 22, and the data transmission unit 22 automatically replaces the local configuration and immediately takes effect after receiving the configuration information. In this embodiment, the user only needs to modify the configuration information in the relevant configuration group at the DTU + management platform 21 according to the reported DTU + information, and then the remote DTU + configuration is automatically changed accordingly. If the configuration needs to take effect immediately, the configuration can be triggered to be updated immediately only by sending a restart command remotely on the management platform, and engineers do not need to modify one by one on site, so that the working efficiency is greatly improved.
Fig. 3 is a schematic diagram of a system for data acquisition and DTU + configuration management according to an embodiment of the application, and as shown in fig. 3, the entire system accesses a sensor to an IOT data platform of an internet of things system through an autonomously developed DTU +, so as to implement fast access of a device and complete acquisition of data, and reports and replies DTU + configuration information through MQTT messages, and remotely updates and modifies a Lua script on the DTU + management platform, thereby solving the problems of high risk of data acquisition loss, low sensor device access efficiency and lack of remote configuration management when acquiring sensor data through the internet of things system in the related art, reducing the risk of data acquisition loss, improving the efficiency of device access and later maintenance, and effectively reducing the device cost and labor cost.
The present invention will be described in detail with reference to the following application scenarios.
The invention aims to provide a method and a system for data acquisition, fig. 4 is a schematic diagram of a data acquisition system applied to an internet of things system according to an embodiment of the application, and as shown in fig. 4, the flow steps of the technical scheme of data acquisition in the embodiment include:
s1, the cloud platform initiates downlink request data or directly configures an automatic calling period;
s2, the data transmission unit receives the downlink request data, converts the downlink request data from JSON data into binary data through a Lua script, and sends the binary data to an external sensor;
s3, the external sensor acquires downlink request data initiated by the cloud platform to trigger an uplink request response, or the external sensor forwards the request data to step S5 when the cloud platform does not send the request data;
s4, the data transmission unit receives the uplink request response replied by the sensor, converts the uplink request response from the binary data into JSON data through a Lua script, and finally reports the JSON response data to the cloud platform according to the service identifier;
and S5, the data transmission unit receives the sampling binary data actively sent by the sensor, converts the sampling binary data into JSON data through the Lua script, and finally reports the JSON data to the cloud platform according to the event identifier.
The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In addition, by combining the method for acquiring the data of the internet of things in the embodiments, the embodiments of the present application can provide a storage medium to implement. The storage medium having stored thereon a computer program; when executed by a processor, the computer program implements any one of the methods for internet of things data collection in the above embodiments.
In one embodiment, fig. 7 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application, and as shown in fig. 7, there is provided an electronic device, which may be a server, and an internal structure diagram of which may be as shown in fig. 7. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the electronic device is used for storing data. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of internet of things data collection.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the electronic devices to which the subject application may be applied, and that a particular electronic device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for collecting data of an Internet of things is applied to an Internet of things system, and is characterized in that the system comprises: the data acquisition method comprises the following steps of (1) a cloud platform, a data transmission unit and a sensor, wherein the cloud platform comprises an IOT data platform and a DTU + management platform, and the data acquisition method comprises the following steps:
the data transmission unit comprises a Lua script, and the Lua script is updated and edited on the DTU + management platform through an MQTT message and can be remotely modified according to a sensor protocol;
the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, codes the JSON request data into binary data through the Lua script, and then sends the binary data to the sensor;
the sensor triggers an uplink request response according to the downlink request data, reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives binary sample data sent by the sensor, decodes the binary sample data into JSON response data through the Lua script, and reports the JSON response data to the IOT data platform according to a service identifier, wherein the service identifier is a message stream for classifying data based on service attributes.
2. The method of claim 1, wherein in the event that the IOT data platform does not issue request data, the method comprises:
the sensor actively sends sampling data to the IOT data platform through the data transmission unit, the data transmission unit acquires binary sampling data actively sent by the sensor, decodes the binary sampling data into JSON data, and reports the JSON data to the IOT data platform according to event identification.
3. The method of claim 1, wherein the IOT data platform initiating a downlink request for data from the sensor via the data transmission unit comprises:
and the IOT data platform configures an automatic calling period and issues the downlink request data to the sensor through the data transmission unit according to the calling period.
4. The method of claim 1, wherein the remotely modifying according to the sensor protocol comprises:
the data transmission unit reports DTU + information to the DTU + management platform through MQTT information, and the DTU + management platform receives the DTU + information and configures in an associated configuration group;
and the DTU + management platform issues the configuration information in the configuration group to the data transmission unit, and the data transmission unit automatically replaces local configuration and takes effect immediately after receiving the configuration information.
5. The utility model provides a system for thing networking data acquisition, is applied to among the thing networking system, its characterized in that, the system includes: the system comprises a cloud platform, a data transmission unit and a sensor, wherein the cloud platform comprises an IOT data platform and a DTU + management platform,
the data transmission unit comprises a Lua script, and the Lua script is updated and edited on the DTU + management platform through an MQTT message and can be remotely modified according to a sensor protocol;
the IOT data platform initiates downlink request data to the sensor through the data transmission unit, the data transmission unit receives JSON request data initiated by the IOT data platform, codes the JSON request data into binary data through the Lua script, and then sends the binary data to the sensor;
the sensor triggers an uplink request response according to the downlink request data, reports the uplink request response to the IOT data platform through the data transmission unit, the data transmission unit receives binary sample data sent by the sensor, decodes the binary sample data into JSON response data through the Lua script, and reports the JSON response data to the IOT data platform according to a service identifier, wherein the service identifier is a message stream for classifying data based on service attributes.
6. The system of claim 5, wherein in the event that the IOT data platform does not issue request data,
the sensor actively sends sampling data to the IOT data platform through the data transmission unit, the data transmission unit acquires binary sampling data actively sent by the sensor, decodes the binary sampling data into JSON data, and reports the JSON data to the IOT data platform according to event identification.
7. The system of claim 5,
and the IOT data platform configures an automatic calling period and issues the downlink request data to the sensor through the data transmission unit according to the calling period.
8. The system of claim 5,
the data transmission unit reports DTU + information to the DTU + management platform through MQTT information, and the DTU + management platform receives and replies a configuration group associated with the DTU + management platform;
and the DTU + management platform issues the configuration in the configuration group to the data transmission unit, and the data transmission unit automatically replaces the local configuration and takes effect immediately after receiving the configuration.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the method for data collection of internet of things according to any one of claims 1 to 4.
10. A storage medium having a computer program stored thereon, wherein the computer program is configured to execute the method for data collection of internet of things as claimed in any one of claims 1 to 4 when the computer program is executed.
CN202110493266.4A 2021-05-07 2021-05-07 Method and system for collecting data of Internet of things, electronic device and storage medium Active CN112911024B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110493266.4A CN112911024B (en) 2021-05-07 2021-05-07 Method and system for collecting data of Internet of things, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110493266.4A CN112911024B (en) 2021-05-07 2021-05-07 Method and system for collecting data of Internet of things, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112911024A true CN112911024A (en) 2021-06-04
CN112911024B CN112911024B (en) 2021-08-06

Family

ID=76109020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110493266.4A Active CN112911024B (en) 2021-05-07 2021-05-07 Method and system for collecting data of Internet of things, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112911024B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138562A (en) * 2021-06-22 2021-07-20 武汉慧联无限科技有限公司 Terminal control system and terminal control method based on Internet of things
WO2024000117A1 (en) * 2022-06-27 2024-01-04 西门子股份公司 Edge computing device and method, and internet of things system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638826A (en) * 2011-02-12 2012-08-15 苏州达联信息科技有限公司 Remote configuration updating method for railway track monitoring sensor node
CN103024059A (en) * 2012-12-19 2013-04-03 北京时代凌宇科技有限公司 Middleware system of Internet of Things
CN105245445A (en) * 2015-09-08 2016-01-13 浙江风向标科技有限公司 Internet of things gateway
CN205049934U (en) * 2015-10-21 2016-02-24 贵州电网公司信息通信分公司 Realize online device of modifing of monitored control system service logic
US20180262388A1 (en) * 2006-09-25 2018-09-13 Weaved, Inc. Remote device deployment
CN109814915A (en) * 2018-12-29 2019-05-28 天津字节跳动科技有限公司 Method for parameter configuration, device, medium and electronic equipment based on lua
CN110989381A (en) * 2019-11-29 2020-04-10 合肥美的电冰箱有限公司 Household appliance and control method thereof, server and control method thereof, and client
CN111654498A (en) * 2020-06-03 2020-09-11 深圳市信锐网科技术有限公司 Equipment adding method and Internet of things platform
CN112380428A (en) * 2020-10-29 2021-02-19 浙江简捷物联科技有限公司 Method, system, electronic device and storage medium for cloud-edge coordinated edge computing

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180262388A1 (en) * 2006-09-25 2018-09-13 Weaved, Inc. Remote device deployment
CN102638826A (en) * 2011-02-12 2012-08-15 苏州达联信息科技有限公司 Remote configuration updating method for railway track monitoring sensor node
CN103024059A (en) * 2012-12-19 2013-04-03 北京时代凌宇科技有限公司 Middleware system of Internet of Things
CN105245445A (en) * 2015-09-08 2016-01-13 浙江风向标科技有限公司 Internet of things gateway
CN205049934U (en) * 2015-10-21 2016-02-24 贵州电网公司信息通信分公司 Realize online device of modifing of monitored control system service logic
CN109814915A (en) * 2018-12-29 2019-05-28 天津字节跳动科技有限公司 Method for parameter configuration, device, medium and electronic equipment based on lua
CN110989381A (en) * 2019-11-29 2020-04-10 合肥美的电冰箱有限公司 Household appliance and control method thereof, server and control method thereof, and client
CN111654498A (en) * 2020-06-03 2020-09-11 深圳市信锐网科技术有限公司 Equipment adding method and Internet of things platform
CN112380428A (en) * 2020-10-29 2021-02-19 浙江简捷物联科技有限公司 Method, system, electronic device and storage medium for cloud-edge coordinated edge computing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡涛等: ""边缘设备接入技术的研究"", 《计算机时代》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138562A (en) * 2021-06-22 2021-07-20 武汉慧联无限科技有限公司 Terminal control system and terminal control method based on Internet of things
CN113138562B (en) * 2021-06-22 2021-09-24 武汉慧联无限科技有限公司 Terminal control system and terminal control method based on Internet of things
WO2024000117A1 (en) * 2022-06-27 2024-01-04 西门子股份公司 Edge computing device and method, and internet of things system

Also Published As

Publication number Publication date
CN112911024B (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN112911024B (en) Method and system for collecting data of Internet of things, electronic device and storage medium
CN112738216B (en) Equipment adaptation method, device, equipment and computer readable storage medium
CN107957940B (en) Test log processing method, system and terminal
CN105786998A (en) Database middleware system and method for processing data through database middleware system
CN111343020A (en) Unified management method and device for multi-protocol Internet of things equipment
CN109768623A (en) Monitoring method, device, computer equipment and the storage medium of electric system
CN110719296B (en) Method for automatically analyzing message data in terminal communication protocol
CN104219316A (en) Method and device for processing call request in distributed system
CN112685248A (en) Intelligent network card monitoring log obtaining method and device, electronic equipment and storage medium
CN108363588B (en) Method for realizing interaction between web and native function, electronic device and readable storage medium
CN111552838A (en) Data processing method and device, computer equipment and storage medium
CN107562426B (en) Method and system for collecting and analyzing Trace of browser in non-embedded cloud
CN109639737A (en) Agreement generating device, the method for converting protocol of data collection station and configuration method
CN110769002A (en) LabVIEW-based message analysis method, system, electronic device and medium
CN113839902B (en) Communication protocol adaptation method, device, computer equipment and storage medium
CN114362885A (en) Internet of things data transmission method, device, equipment and medium
CN115329170A (en) Webpage crawling method, device, equipment and storage medium
CN114025027B (en) Method and device for running data transmission script, storage medium and electronic device
CN113783860B (en) Message processing method, device, equipment and storage medium based on visual configuration
CN117499380A (en) Custom protocol data acquisition method
CN117348900A (en) Electric energy meter matching upgrading method and related equipment
CN104468702B (en) A kind of general virtual test real object equipment access system
CN105407133A (en) Method and system for mobile application automation release
CN113746850B (en) Multichannel data acquisition method for Internet of things
CN109981674B (en) Remote procedure calling method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant