Internet of Things (IoT) data management methods, devices, servers, and storage media
By constructing a gateway object model and routing table to manage IoT data, the problem of data clutter caused by the diversity of device types in IoT cloud platforms is solved, and flexible storage and efficient management of device data are achieved.
Patent Information
- Application Number
- CN202411734452.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When an IoT cloud platform connects multiple devices under the same gateway with inconsistent data types, the data becomes messy, making batch management difficult. Furthermore, when a device switches gateways, storage needs to be reconfigured, impacting maintenance and management efficiency.
Build gateway object models, classify and store IoT data according to gateway type and data type, quickly locate target gateway object models through routing tables, store data in the database, and automatically adapt to changes in device data types and gateway switching.
The IoT cloud platform has been optimized for batch management of multiple types of devices, simplifying device data maintenance and management, reducing user operations, and improving storage and query efficiency.
Smart Images

Figure CN119561821B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to an IoT data management method, device, server, and storage medium. Background Technology
[0002] In the Internet of Things (IoT), IoT devices serve as data acquisition terminals. Since there are many types of IoT devices (such as those that can connect to the internet and those that cannot), IoT devices are directly or indirectly connected to an IoT cloud platform built on a server. This IoT cloud platform provides users with a better platform for managing and operating the devices. By acquiring the collected data uploaded by each IoT device, it provides the data foundation for user management and operation, enabling users to access and control IoT devices through the IoT cloud platform.
[0003] When many IoT devices are connected to the same gateway and their data types are inconsistent, the data stored on the IoT cloud platform becomes disorganized, increasing the difficulty of data processing and hindering batch management of devices. This also impedes the maintenance and management of IoT devices. Furthermore, when IoT devices switch gateways, users need to reconfigure the storage of the data reported by the devices, making it even more difficult to effectively maintain and manage the device data. Summary of the Invention
[0004] This application provides an IoT data management method, device, server, and storage medium, which solves the technical problem that IoT cloud platforms are unable to effectively maintain and manage the data of IoT devices in related technologies. This solution can optimize the batch management of IoT devices by IoT cloud platforms, thereby facilitating the maintenance of IoT device data and the management of IoT devices.
[0005] In a first aspect, this application provides an Internet of Things (IoT) data management method applied to a server, wherein the server is communicatively connected to several gateway devices, and each gateway device is communicatively connected to several IoT devices. The IoT data management method includes:
[0006] Based on the gateway type corresponding to the connected gateway device, several gateway object models are constructed and gateway devices of the same gateway type are associated with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type.
[0007] Upon receiving IoT data uploaded by any IoT device through its corresponding gateway device, the target gateway object model is determined within the constructed gateway object model.
[0008] Obtain the field information carried by IoT data and determine the data type of IoT data;
[0009] Based on the data event items included in the target gateway's IoT model and the data type of the IoT data, determine whether to store the received IoT data;
[0010] Given that the received IoT data is to be stored, the received IoT data is stored in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
[0011] Secondly, this application also provides an IoT data management device applied to a server, wherein the server is communicatively connected to several gateway devices, and each gateway device is communicatively connected to several IoT devices. The IoT data management device includes:
[0012] The model building module is configured to build several gateway object models based on the gateway type corresponding to the connected gateway device, and associate gateway devices of the same gateway type with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type.
[0013] The model selection module is configured to determine the target gateway object model from the constructed gateway object model when receiving IoT data uploaded by any IoT device through the corresponding gateway device.
[0014] The information acquisition module is configured to acquire field information carried by IoT data and determine the data type of IoT data;
[0015] The storage determination module is configured to determine whether to store the received IoT data based on the data event items included in the target gateway's IoT model and the data type of the IoT data.
[0016] The data storage module is configured to, when it is determined that the received IoT data is to be stored, store the received IoT data in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
[0017] Thirdly, this application also provides a server, which includes:
[0018] One or more processors;
[0019] Storage device for storing one or more programs.
[0020] When one or more programs are executed by one or more processors, the one or more processors implement the IoT data management method of this application.
[0021] Fourthly, this application also provides a storage medium for storing computer-executable instructions, which, when executed by a processor, are used to execute the Internet of Things data management method of this application.
[0022] This application uses a gateway object model to store and manage different types of IoT data, thereby enabling flexible management of numerous types of IoT devices in the IoT cloud platform. This effectively optimizes the batch management of IoT devices by the IoT cloud platform, thus facilitating the maintenance of IoT device data and the management of IoT devices. Attached Figure Description
[0023] Figure 1 This is a schematic diagram illustrating the steps of an IoT data management method provided in an embodiment of this application;
[0024] Figure 2 This is a schematic diagram illustrating the steps of storing IoT data according to an embodiment of this application;
[0025] Figure 3 This is a schematic diagram of the topology of the gateway object model in this application;
[0026] Figure 4 This is a schematic diagram of data interaction in an Internet of Things (IoT) network according to an embodiment of this application;
[0027] Figure 5 A schematic diagram of the structure of an Internet of Things (IoT) data management device is provided for one embodiment of this application;
[0028] Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0029] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, the accompanying drawings only show the parts related to the embodiments of this application, not all structures. Those skilled in the art, after reading this specification, should be able to conceive that any combination of technical features can constitute an optional implementation method, provided that the technical features do not contradict each other.
[0030] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this application, "multiple" means two or more, and "several" means one or more.
[0031] As a crucial stage in the development of the "information age," the Internet of Things (IoT) comprises IoT devices, which are fundamental units within the IoT network. These devices are capable of sensing, collecting, processing, and transmitting data. Acting as data acquisition terminals, IoT devices can connect directly or indirectly to an IoT cloud platform built on a server, either through gateway devices. The collected data is uploaded by the IoT devices and then forwarded to the server by the corresponding gateway devices. The IoT cloud platform, on the other hand, provides users with a better platform for managing and operating these devices. By acquiring the collected data uploaded by various IoT devices, it provides the data foundation for user management and operation, enabling users to access and control IoT devices through the IoT cloud platform.
[0032] However, in practical applications, the inventors discovered that when many IoT devices are connected to the same gateway, and the data collected by these devices is of inconsistent data types (e.g., some IoT devices collect temperature data while others collect humidity data), the data stored on the IoT cloud platform becomes disorganized. This increases the difficulty of data processing, hinders batch management of devices, and is detrimental to the maintenance and management of IoT devices. Furthermore, when an IoT device switches to another gateway to connect to the IoT cloud platform, the IoT cloud platform needs to reconfigure the storage of the data reported by the IoT device, which is also detrimental to the maintenance and management of the IoT devices.
[0033] To address this issue, this application provides an IoT data management method. This method is applied to a server, on which a corresponding IoT cloud platform can be built to provide users with the functions of managing and operating devices. In the IoT network, the server communicates with several gateway devices, and each gateway device communicates with several IoT devices, enabling the IoT data collected by each IoT device to be forwarded to the server through its connected gateway device.
[0034] Figure 1 The figure illustrates the steps of an IoT data management method provided in an embodiment of this application. As shown, this application constructs corresponding gateway object models in a server to correspond to IoT data uploaded by gateway devices of different gateway types, and classifies and stores IoT data according to data event items constructed based on data type, which helps to better manage IoT data. Specific steps include steps S110-S150:
[0035] Step S110: Based on the gateway type corresponding to the connected gateway device, construct several gateway object models and associate gateway devices of the same gateway type with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type.
[0036] An object model is a data model used in an IoT platform to describe product functionality. It digitizes entities in physical space and builds a data model in the cloud. In this application, the IoT cloud platform built in the cloud (i.e., the server side) contains several gateway object models. The server builds gateway object models based on the gateway types corresponding to the connected gateway devices. That is, given the number of gateway types corresponding to the currently connected gateway devices, a corresponding number of gateway object models are built. It is conceivable that the server can determine the gateway devices connected to it and their gateway types through its routing table.
[0037] The gateway object model includes several data event items, each associated with a different data type. Therefore, for IoT data of a specific data type, the IoT cloud platform can store the IoT data through the corresponding data event items in the gateway object model. Based on this, gateway devices of the same gateway type will also be associated with the same gateway object model, so that data uploaded by gateway devices of the same gateway type can be stored through the same gateway object model. It should be noted that the aforementioned data types refer to the parameter types corresponding to the data, such as temperature, humidity, and pressure, and not to integer, floating-point, or other data types.
[0038] Step S120: Upon receiving IoT data uploaded by any IoT device through the corresponding gateway device, determine the target gateway object model in the constructed gateway object model.
[0039] It is understandable that in an IoT network scenario where data transmission between a server and IoT devices is accomplished through a gateway device, when any IoT device uploads its collected IoT data, it uploads the IoT data to the server through the connected gateway device. Optionally, in one embodiment, the server and IoT devices can communicate according to a preset communication protocol before uploading IoT data, such as defining the format and data type of the uploaded data, so that the IoT devices can upload the corresponding IoT data.
[0040] When a server receives IoT data, it can determine the target gateway object model in the constructed gateway object model based on the gateway device that forwarded the IoT data. The target gateway object model is associated with the gateway device that uploaded the IoT data.
[0041] In one embodiment, the server can determine the selection of the target gateway object model through its routing table, specifically including steps S121-S122:
[0042] Step S121: Determine the target gateway device for forwarding IoT data based on the server's routing table.
[0043] Step S122: Select the gateway object model associated with the target gateway device from the constructed gateway object model as the target gateway object model.
[0044] As is understandable, gateway devices act as connections between different networks. During the process of sending data packets carrying IoT data from the source device (i.e., the IoT device) to the server, they are forwarded through one or more gateway devices. Although the data packets themselves do not directly record a field indicating "which gateway device they came from," the server can determine this through routing information in its routing table.
[0045] When a data packet arrives at the local area network (LAN) where the server resides, it is forwarded through a specific gateway device. The server can determine which network ranges of data packets are forwarded through that gateway device by consulting its routing table, and thus identify the corresponding gateway device. Optionally, in one embodiment, if the server's network has multiple gateway devices for connecting different network areas, the server can determine the gateway device based on the network range to which the source IP address of the data packet belongs, combined with the routing table. Based on this, the server can determine the gateway object model corresponding to the gateway device as the target gateway object model based on the association between the gateway object model and the gateway device.
[0046] Therefore, the server can quickly identify the gateway device that forwards IoT data by using the routing information in the routing table, thereby quickly locking the corresponding gateway device model and improving the efficiency of storing IoT data.
[0047] Step S130: Obtain the field information carried by the IoT data and determine the data type of the IoT data.
[0048] It is conceivable that in network transmission, such as at the network layer, IoT data is transmitted in the form of encapsulated data packets. During the encapsulation of IoT data according to the communication protocol, IoT devices can encapsulate the corresponding field information in the data packets or IoT data, such as encapsulating the field information at the beginning or end of the data portion. Optionally, in one embodiment, the information included in the field information can also be encapsulated separately, such as encapsulating part of it in the beginning and another part in the end.
[0049] The field information includes the data type. After the server receives IoT data, it can parse the received data packet to obtain the IoT data and the field information it carries, and thus determine the data type corresponding to the IoT data.
[0050] Step S140: Determine whether to store the received IoT data based on the data event items included in the target gateway IoT model and the data type of the IoT data.
[0051] In the gateway object model, each data event item is associated with a different data type. Therefore, after determining the data type corresponding to the IoT data, the server can determine whether to store the IoT data based on the data event items included in the target gateway object model and the data type of the IoT data. It is conceivable that this can be achieved by comparing the data type corresponding to the IoT data with the data type associated with each data event item in the target gateway object model; if the same data type exists, the IoT data is stored.
[0052] Optionally, in one embodiment, the server may create corresponding files (such as documents, tables, etc.) for the data event items associated with each gateway object model to record the data event item's associated data type. After receiving IoT data, the server queries this file to determine whether the currently received IoT data belongs to one of the data types recorded in the file. If the same data type exists, the server determines to store the IoT data.
[0053] Step S150: If it is determined that the received IoT data is to be stored, the received IoT data is stored in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
[0054] In response, when determining which IoT data can be stored, the server needs to select the corresponding data events to store the data. For example, based on the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway object model, it can be assumed that each data event item in the gateway object model is associated with a different data type. Therefore, the data event item corresponding to the IoT data can be determined according to the data type. That is, the data type associated with the selected data event item is the same as the data type corresponding to the IoT data, and then the IoT data is stored in the database according to the corresponding data event item.
[0055] As can be seen from the above scheme, the server stores and manages different types of IoT data through the gateway object model, thereby flexibly managing a wide variety of IoT devices in the IoT cloud platform. This effectively optimizes the batch management of IoT devices by the IoT cloud platform, and makes it convenient to maintain IoT device data and manage IoT devices.
[0056] In one embodiment, for storing IoT data, the server generates corresponding node data in a database to store the IoT data, such as... Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the steps for storing IoT data according to an embodiment of this application. The specific steps are as follows:
[0057] Step S210: Parse the field information carried by the IoT data to determine the data type and event name of the IoT data.
[0058] Step S220: Based on the association information between data types and data event items in the mapping relationship, determine the corresponding target data event item.
[0059] Step S230: Treat the IoT data as a node data of the target data event item and store it according to the event name.
[0060] Understandably, the field information includes data type and event name. After receiving IoT data, the server parses the field information carried by the data. It is conceivable that the server and IoT devices can determine the storage location and format of the field information in the data packet through the communication protocol, so that the server can obtain the corresponding field information when parsing the data, and then determine the data type and event name of the IoT data.
[0061] To address this, the server searches for the data event item corresponding to the data type of the IoT data, based on the association information between the data types recorded in the mapping relationship, and uses this as the target data event item. Then, during storage, the IoT data is treated as a node data item of the target data event item and stored according to the event name. It's conceivable that there can be multiple node data items under the same data event item, each node data item corresponding to one IoT data item, and each node data item in the database is stored according to the event name. For example, each data item stores an `event_name` field, which corresponds to the event name. When querying the node data of a data event item, the `event_name` field is queried to retrieve the list of data items under that data event item.
[0062] For example, an IoT device is a temperature detection device. It uploads the detected temperature data to the server as IoT data. When the server receives the IoT data, it determines that the data belongs to the temperature type. Then, it creates a node data under the data event item associated with the temperature data type to store the temperature data uploaded by the IoT device. Correspondingly, it also records the corresponding event name in the event_name field of the data, such as identifying it as Event_TEMP_01.
[0063] Therefore, the server can select the corresponding data event item in the gateway object model by parsing the field information, thereby optimizing the batch management of IoT devices by the IoT cloud platform and making the maintenance and management of IoT devices and their data more convenient.
[0064] In some embodiments, when an IoT device switches the content of the data it collects, such as when the data type of the data collected by the IoT device changes—for example, if the IoT device is a temperature and humidity detector that acquires both temperature and humidity data—and if the IoT device initially only uploaded temperature data, but then changes the reported data, such as switching from uploading temperature data to uploading humidity data, the server needs to re-store the data in the database.
[0065] It is conceivable that, in one embodiment, when storing data uploaded by an IoT device, the server can record relevant information about the IoT device, such as device ID (identity document, account), IP (Internet Protocol) address, data type, etc., so that the server can determine whether the data type of the data uploaded by the IoT device has changed after receiving IoT data based on the above records.
[0066] When the server determines that the data type of IoT data uploaded by the same IoT device has changed, the server parses the currently received IoT data to obtain the corresponding field information. Based on this field information, the server determines the data type and event name corresponding to the changed IoT data. Similarly, the server also searches for another target data event item associated with the changed IoT data data. A new node data item is added to this target data event item, and the IoT data is stored according to the newly determined event name. It is conceivable that in some embodiments, if a node data item corresponding to the changed IoT data exists in the target gateway IoT model, the received IoT data will be stored using this node data item.
[0067] Therefore, when IoT devices switch the content of the collected data, users do not need to operate on the IoT cloud platform. The server can reconfigure and store the collected IoT data, which helps to optimize the batch management of IoT devices by the IoT cloud platform.
[0068] In one embodiment, when network fluctuations or failures occur, IoT devices may switch to another gateway device to upload IoT data. In response, after receiving the IoT data uploaded by the IoT device, the server needs to query the gateway device forwarding the data, such as by querying the routing table as described in the previous embodiment, to determine if the gateway device forwarding the data has changed. Furthermore, if it is determined that the IoT device has switched gateway devices, the server searches for a corresponding gateway object model in the constructed gateway object model based on the gateway type of the switched gateway device to re-determine the target gateway object model.
[0069] In response, if the constructed gateway object model does not contain a target gateway object model associated with the switched-over gateway device, the aforementioned IoT data will not be stored temporarily, and the server can discard the IoT data; however, previously uploaded data will be automatically treated as historical data by the server. If the constructed gateway object model contains a target gateway object model associated with the switched-over gateway device, node data will be added under the corresponding data event item in the target gateway object model to store the IoT data.
[0070] Therefore, when IoT devices switch gateways, the IoT cloud platform can automatically process the data without requiring users to configure storage, thus enabling convenient maintenance of IoT device data and management of IoT devices.
[0071] It should be noted that in some embodiments, when an IoT device switches gateway devices, the server searches for a corresponding gateway object model in the constructed gateway object model based on the gateway type of the switched gateway device. It is conceivable that if the two gateway devices before and after the switch belong to the same gateway type, the target gateway object model selected by the server remains unchanged, and the re-determined target gateway object model is still the gateway object model used before the switch.
[0072] In some embodiments, when managing data through an IoT cloud platform, the server can respond to user query requests. For example, for a query request for IoT data, after receiving the query request, the server parses the query request to obtain the corresponding event name. Optionally, in one embodiment, when a user queries IoT data of an IoT device on a terminal device, such as querying temperature data collected by the device, the server can parse the query request to obtain corresponding keywords, such as temperature, device ID, etc., and then the server determines the event name accordingly based on the above keywords. For example, the corresponding event name is Event_TEMP_01, where TEMP corresponds to temperature and 01 corresponds to the IoT device.
[0073] After obtaining the event name, the server adds it to the query criteria, facilitating a search in the database for the corresponding target field in the stored node data. It's conceivable that the target field in the stored node data records the event name corresponding to the IoT data. Subsequently, the server extracts the node data matching the query criteria and sends it back to the query request initiator. In response, the server can provide node data matching the user's query request, thus offering a convenient data management solution for IoT devices.
[0074] Figure 3 The diagram shows the topology of the gateway object model in this application. In the gateway object model, the corresponding data event items are divided into DataEvent01, DataEvent02 and DataEvent03. Each data event item is configured with corresponding node data (such as data1, data2, etc. in the figure). Figure 4 This is a data interaction diagram of an Internet of Things (IoT) network provided in an embodiment of this application. As shown in the figure, IoT device E1 transmits IoT data to server S1 through gateway device G1.
[0075] For example, refer to Figure 3 and Figure 4The server is equipped with an IoT cloud platform, and the IoT cloud platform has corresponding gateway object models for different gateway types. When IoT device E1 reports IoT data, it forwards the data to the server through gateway device E1. For example, if IoT device E1 is a device that collects temperature data, the IoT data it uploads is the collected temperature value. If data event item DataEvent01 is a data event item of the corresponding temperature type, a node data is added under this data event item (data1, data2, etc. in the figure), and the added node data is the reported temperature data. Moreover, when storing data, the event_name field of the data records the corresponding event name, such as using Event_TEMP_01 to identify the event name of the data, to indicate that this data is of the corresponding temperature type.
[0076] Figure 5 This application provides a schematic diagram of the structure of an IoT data management device according to an embodiment. This device is used to execute the IoT data management method provided in the above embodiment and has corresponding functional modules and beneficial effects for executing the method. The device is applied to a server, which is communicatively connected to several gateway devices, and each gateway device is communicatively connected to several IoT devices. As shown in the figure, the IoT data management device includes: a model building module 501, a model selection module 502, an information acquisition module 503, a storage determination module 504, and a data storage module 505.
[0077] The model building module 501 is configured to build several gateway object models based on the gateway type corresponding to the connected gateway device and associate gateway devices of the same gateway type with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type.
[0078] The model selection module 502 is configured to determine the target gateway object model from the constructed gateway object model when receiving IoT data uploaded by any IoT device through the corresponding gateway device.
[0079] The information acquisition module 503 is configured to acquire field information carried by IoT data and determine the data type of IoT data;
[0080] The storage determination module 504 is configured to determine whether to store the received IoT data based on the data event items included in the target gateway's IoT model and the data type of the IoT data.
[0081] The data storage module 505 is configured to, when it is determined that the received IoT data is to be stored, store the received IoT data in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
[0082] Based on the above embodiments, the model selection module 502 is specifically configured as follows:
[0083] Based on the server's routing table, determine the target gateway device for forwarding IoT data;
[0084] In the constructed gateway object model, select the gateway object model associated with the target gateway device as the target gateway object model.
[0085] Based on the above embodiments, the field information includes data type and event name, and the data storage module 505 is specifically configured as follows:
[0086] Parse the field information carried by IoT data to determine the data type and event name of the IoT data;
[0087] Based on the association information between data types and data event items in the mapping relationship, the corresponding target data event item is determined;
[0088] IoT data is used as a node in the target data event item and stored according to the event name.
[0089] Based on the above embodiments, the data storage module 505 is further configured as follows:
[0090] When it is determined that the data type of IoT data uploaded by the same IoT device has changed, the data type and event name of the IoT data are re-determined based on the field information carried by the IoT data after the data type change.
[0091] The IoT data is added as node data in another target data event item in the target gateway IoT model, and the IoT data is stored according to the redefined event name.
[0092] Based on the above embodiments, the IoT data management device further includes a model reselection module, which is configured as follows:
[0093] When it is determined that an IoT device is switching gateway devices, the target gateway device model is redefined based on the gateway type corresponding to the switched gateway device.
[0094] If the constructed gateway object model does not contain a target gateway object model associated with the switched gateway device, the above-mentioned IoT data will not be stored for the time being, and the IoT data uploaded by the IoT device before switching the gateway device will be regarded as historical data.
[0095] If the constructed gateway object model contains a target gateway object model associated with the switched gateway device, then node data is added under the corresponding data event item in the target gateway object model to store IoT data.
[0096] Based on the above embodiments, the model reselection module is further configured as follows:
[0097] If the two gateway devices before and after the IoT device switch belong to the same gateway type, the target gateway object model should be redefined as the gateway object model used before the switch.
[0098] Based on the above embodiments, the IoT data management device further includes a data query module, which is configured as follows:
[0099] In response to a query request for IoT data, the query request is parsed to obtain the event name, and the event name is added to the query conditions;
[0100] According to the query conditions, the target field corresponding to the stored node data is searched to return the node data that matches the query conditions to the query request initiator. The target field is used to record the event name corresponding to the IoT data.
[0101] It is worth noting that in the embodiments of the above-mentioned device, the modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each module are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.
[0102] Figure 6 This is a schematic diagram of a server provided in one embodiment of this application. The device is used to execute the IoT data management method provided in the above embodiment and has corresponding functional modules and beneficial effects for executing the method. As shown in the figure, the server includes a processor 601, a memory 602, an input device 603, and an output device 604. The number of processors 601 can be one or more; one processor 601 is shown as an example in the figure. The processor 601, memory 602, input device 603, and output device 604 can be connected via a bus or other means; a bus connection is shown as an example in the figure. The memory 602, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the IoT data management method in the embodiments of this application. The processor 601 executes various corresponding functional applications and data processing by running the software programs, instructions, and modules stored in the memory 602, thereby realizing the above-mentioned IoT data management method.
[0103] The memory 602 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data recorded or created during use. Furthermore, the memory 602 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 602 may further include memory remotely located relative to the processor 601, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0104] The input device 603 can be used to input corresponding digital or character information to the processor 601, and to generate key signal inputs related to the user settings and function control of the device; the output device 604 can be used to send or display key signal outputs related to the user settings and function control of the device.
[0105] This application also provides a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform related operations in the IoT data management method provided in any embodiment of this application.
[0106] Computer-readable storage media include both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0107] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0108] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. An Internet of Things (IoT) data management method, characterized in that, Applied to a server, wherein the server is communicatively connected to several gateway devices, and each gateway device is communicatively connected to several IoT devices, the IoT data management method includes: Based on the gateway type corresponding to the connected gateway device, several gateway object models are constructed and gateway devices corresponding to the same gateway type are associated with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type. Upon receiving IoT data uploaded by any of the aforementioned IoT devices through the corresponding gateway device, a target gateway object model is determined in the constructed gateway object model. Obtain the field information carried by the IoT data and determine the data type of the IoT data; Based on the data event items included in the target gateway IoT model and the data type of the IoT data, determine whether to store the received IoT data; If it is determined that the received IoT data is to be stored, the received IoT data is stored in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
2. The IoT data management method according to claim 1, characterized in that, Upon receiving IoT data uploaded by any of the IoT devices through the corresponding gateway device, determining the target gateway object model in the constructed gateway object model includes: Based on the server's routing table, determine the target gateway device for forwarding the IoT data; In the constructed gateway object model, the gateway object model associated with the target gateway device is selected as the target gateway object model.
3. The IoT data management method according to claim 1, characterized in that, The field information includes data type and event name; In the case of determining to store the received IoT data, storing the received IoT data in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model includes: Parse the field information carried by the IoT data to determine the data type and event name of the IoT data; Based on the association information between data types and data event items in the mapping relationship, the corresponding target data event item is determined; The IoT data is used as a node data of the target data event item and stored according to the event name.
4. The IoT data management method according to claim 3, characterized in that, The step of storing the received IoT data in the database, based on the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model, further includes: When it is determined that the data type of IoT data uploaded by the same IoT device has changed, the data type and event name of the IoT data are re-determined based on the field information carried by the IoT data after the data type change. The IoT data is added as node data in another target data event item of the target gateway IoT model, and the IoT data is stored according to the redefined event name.
5. The IoT data management method according to claim 1, characterized in that, Before determining whether to store the received IoT data based on the data event items included in the target gateway IoT model and the data type of the IoT data, the method further includes: When it is determined that an IoT device is switching gateway devices, the target gateway device model is redefined based on the gateway type corresponding to the switched gateway device. If there is no target gateway object model associated with the switched gateway device in the constructed gateway object model, the above-mentioned IoT data will not be stored for the time being, and the IoT data uploaded by the IoT device before switching the gateway device will be regarded as historical data. If the constructed gateway object model contains a target gateway object model associated with the switched gateway device, then node data is added under the corresponding data event item in the target gateway object model to store IoT data.
6. The IoT data management method according to claim 5, characterized in that, If the constructed gateway object model contains a target gateway object model associated with the switched gateway device, then node data is added under the corresponding data event item in the target gateway object model to store IoT data, including: If the two gateway devices before and after the IoT device switch belong to the same gateway type, the target gateway object model will be redefined as the gateway object model used before the switch.
7. The IoT data management method according to claim 1, 3, or 4, characterized in that, In the case of determining that the received IoT data is to be stored, after storing the received IoT data in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model, the method further includes: In response to a query request for the IoT data, the query request is parsed to obtain the event name, and the event name is added to the query conditions; According to the query conditions, the target field corresponding to the stored node data is searched to return the node data matching the query conditions to the initiator of the query request. The target field is used to record the event name corresponding to the IoT data.
8. An Internet of Things (IoT) data management device, characterized in that, An IoT data management device is applied to a server, wherein the server is communicatively connected to several gateway devices, and each gateway device is communicatively connected to several IoT devices. The IoT data management device includes: The model building module is configured to build several gateway object models based on the gateway type corresponding to the connected gateway device, and associate gateway devices of the same gateway type with the same gateway object model. Each gateway object model includes several data event items, and each data event item is associated with a different data type. The model selection module is configured to determine the target gateway object model from the constructed gateway object model when receiving IoT data uploaded by any of the IoT devices through the corresponding gateway device. The information acquisition module is configured to acquire field information carried by the IoT data and determine the data type of the IoT data; The storage determination module is configured to determine whether to store the received IoT data based on the data event items included in the target gateway IoT model and the data type of the IoT data. The data storage module is configured to, when it is determined that the received IoT data is to be stored, store the received IoT data in the database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway IoT model.
9. A server, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the Internet of Things data management method as described in any one of claims 1-7.
10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a processor, are used to perform the Internet of Things data management method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and device for acquiring gateway access data, electronic equipment and storage medium
CN113609130A
Gateway configuration method and device, electronic equipment and storage medium
CN114448802A