Internet of Things data management method and device, server and storage medium
By building gateway object models and data event items in the server of the IoT cloud platform, the problem that the IoT cloud platform is difficult to manage data of multiple types of devices is solved, and flexible data classification storage and batch management is realized, which improves the storage configuration efficiency during device switching.
Patent Information
- Application Number
- CN202411734452.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When the IoT cloud platform processes a large number of data from different types of IoT devices, it is difficult to achieve batch management, and the device needs to reconfigure storage when switching gateways, resulting in increased management difficulty.
By building a gateway object model in the server, building data event items based on the gateway type and data type, determining the data storage policy, and classifying storage in the database.
It realizes flexible management of data of various types of IoT devices, optimizes the batch management process, reduces the complexity of storage configuration during device switching, and improves the convenience of data maintenance and management.
Smart Images

Figure CN119561821A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to an Internet of Things data management method, device, server and storage medium. Background Art
[0002] In the Internet of Things, IoT devices serve as data collection terminals, and there are many types of IoT devices (such as those that can be connected to the Internet and those that cannot). Therefore, IoT devices are directly or indirectly connected to the IoT cloud platform built on the server through gateway devices. The IoT cloud platform is a platform that facilitates users to better manage and operate devices. It obtains the collected data uploaded by each IoT device, and then provides a data basis for user management and operation, so that users can access and control IoT devices through the IoT cloud platform.
[0003] When there are many IoT devices connected to the same gateway and the data types are not uniform, the data stored in the IoT cloud platform is messy, which makes it more difficult to process the data, making it difficult to achieve batch management of devices, and is not conducive to the maintenance and management of IoT devices. In addition, when the IoT device switches the gateway, the user needs to reconfigure the storage of the data reported by the IoT device accordingly, making it more difficult to effectively maintain and manage the device data. Summary of the invention
[0004] The present application provides an IoT data management method, device, server and storage medium, which solves the technical problem in the related technology that the IoT cloud platform is difficult to effectively maintain and manage the data of IoT devices. This solution can optimize the IoT cloud platform's batch management of IoT devices, thereby conveniently maintaining the data of IoT devices and managing IoT devices.
[0005] In a first aspect, the present application provides an Internet of Things data management method, which is applied to a server, the server is communicatively connected to a plurality of gateway devices, and each gateway device is communicatively connected to a plurality of Internet of Things devices, and the Internet of Things 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 corresponding to the same gateway type are associated with the same gateway object model, and each gateway object model includes several data event items, and each data event item is associated with a different data type;
[0007] In the case of receiving IoT data uploaded by any IoT device through the corresponding gateway device, determining a target gateway object model in the constructed gateway object model;
[0008] Obtain the field information carried by IoT data and determine the data type of IoT data;
[0009] Determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data;
[0010] In the case of determining to store the received IoT data, 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 object model.
[0011] In a second aspect, the present application further provides an IoT data management device, which is applied to a server, the server is communicatively connected to a plurality of gateway devices, and each gateway device is communicatively connected to a plurality of IoT devices, and the IoT data management device comprises:
[0012] A model building module is configured to build a plurality of gateway object models based on the gateway type corresponding to the connected gateway device and associate the gateway devices corresponding to the same gateway type with the same gateway object model, and each gateway object model includes a plurality of data event items, each data event item is respectively associated with a different data type;
[0013] A model selection module is configured to determine a target gateway object model in the constructed gateway object model when receiving the IoT data uploaded by any IoT device through the corresponding gateway device;
[0014] An information acquisition module, configured to acquire field information carried by IoT data and determine the data type of IoT data;
[0015] A storage determination module, configured to determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data;
[0016] The data storage module is configured to store the received IoT data in a database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway object model when determining to store the received IoT data.
[0017] In a third aspect, the present application further provides a server, the server comprising:
[0018] one or more processors;
[0019] a 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 Internet of Things data management method of the present application.
[0021] In a fourth aspect, the present application also provides a storage medium storing computer executable instructions, which, when executed by a processor, are used to execute the Internet of Things data management method of the present application.
[0022] This application uses the gateway object model to store and manage different types of IoT data, so that it can flexibly manage many types of IoT devices in the IoT cloud platform, effectively optimizing the IoT cloud platform's batch management of IoT devices, so that it can conveniently maintain the data of IoT devices and manage IoT devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the steps of the Internet of Things data management method provided in one embodiment of the present application;
[0024] Figure 2 A schematic diagram of steps for storing IoT data provided in one embodiment of the present application;
[0025] Figure 3 A schematic diagram of the model topology of the gateway object model of this application;
[0026] Figure 4 A schematic diagram of data interaction in an Internet of Things network provided in one embodiment of the present application;
[0027] Figure 5 A structural diagram of an Internet of Things data management device is provided for an embodiment of the present application;
[0028] Figure 6 A schematic diagram of the structure of a server provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only the parts related to the embodiments of the present application rather than all structures are shown in the accompanying drawings, and those skilled in the art should be able to think of it after reading the specification of this application that as long as the technical features do not contradict each other, any combination of the technical features can constitute an optional implementation method.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated before and after are in an "or" relationship. In the description of the present application, "multiple" means two or more, and "several" means one or more.
[0031] The Internet of Things is an important development stage in the "informatization" era. In the Internet of Things, the Internet of Things device is a basic unit in the Internet of Things network, which can sense, collect, process and transmit data. That is, the Internet of Things device is a data collection terminal. The Internet of Things device can be directly or indirectly connected to the Internet of Things cloud platform built on the server through a gateway device. That is, the Internet of Things device uploads the collected data, and then the corresponding gateway device forwards it to the server. Among them, the Internet of Things cloud platform is a platform that facilitates users to better manage and operate devices. It obtains the collected data uploaded by each Internet of Things device, and then provides a data basis for the user's management and operation, so that users can access and control the Internet of Things devices through the Internet of Things cloud platform.
[0032] However, in actual application, the inventors found that when there are many IoT devices connected to the same gateway and the data types corresponding to the data collected by each IoT device are not uniform, for example, when some IoT devices collect temperature data and other IoT devices collect humidity data, the data stored in the IoT cloud platform is messy, which increases the difficulty of data processing and makes it difficult to achieve batch management of devices, which is not conducive to the maintenance and management of IoT devices. In addition, when an IoT device switches to another gateway device to connect to the IoT cloud platform through the gateway device, the IoT cloud platform needs to reconfigure the storage of the data reported by the IoT device, which is also not conducive to the maintenance and management of IoT devices.
[0033] In this regard, the present application provides an IoT data management method, which is applied to a server, and a corresponding IoT cloud platform can be built on the server to provide users with the functions of managing and operating devices. In an IoT network, a server is connected to a plurality of gateway devices in communication, and each gateway device is connected to a plurality of IoT devices in communication, so that the IoT data collected by each IoT device can be forwarded to the server through the gateway device to which it is connected.
[0034] Figure 1 The schematic diagram of the steps of the IoT data management method provided by an embodiment of the present application is shown in the figure. The present application constructs a corresponding gateway object model in the server to correspond to the IoT data uploaded by gateway devices of different gateway types, and classifies and stores the IoT data according to the data event items constructed according to the data type, which helps to better manage the IoT data. The specific steps include steps S110-S150:
[0035] Step S110: 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, and each gateway object model includes several data event items, each data event item is associated with a different data type.
[0036] The object model is a data model used to describe product functions in the IoT platform. It digitizes entities in the physical space and builds data models in the cloud. In this regard, in the IoT cloud platform built in the cloud (i.e., the server side), several gateway object models are built. The server builds the gateway object model based on the gateway type corresponding to the connected gateway device. That is, there are several gateway types corresponding to the currently connected gateway device. Accordingly, a corresponding number of gateway object models are built. It can be imagined that the server can determine the gateway device and its gateway type connected to the server through the routing table on it.
[0037] The gateway object model includes several data event items, each of which is associated with a different data type. Therefore, for IoT data of a data type, the IoT cloud platform can store the IoT data through the corresponding data event item in the gateway object model. Based on this, gateway devices corresponding to the same gateway type are also associated with the same gateway object model to store the data uploaded by gateway devices of the same gateway type through the same gateway object model. It should be noted that the above data types are parameter types corresponding to the data, such as temperature, humidity, pressure and other parameter types, and do not refer to integer, floating point and other data types.
[0038] Step S120: upon receiving IoT data uploaded by any IoT device through a corresponding gateway device, a target gateway object model is determined in the constructed gateway object model.
[0039] It is understandable that in a scenario where data transmission is completed between a server and an IoT device in an IoT network through a gateway device, when any IoT device uploads the IoT data it has collected, it uploads the IoT data to the server through the connected gateway device. Optionally, in one embodiment, the server and the IoT device may communicate according to a preset communication protocol before uploading the IoT data, such as defining the format and data type of the uploaded data, so that the IoT device can upload the corresponding IoT data.
[0040] When the server receives IoT data, it can determine the target gateway object model in the constructed gateway object model according to the gateway device that forwards the IoT data, and the target gateway object model is associated with the gateway device that uploads the IoT data.
[0041] In one embodiment, the server may determine the selection of the target gateway object model through the routing table thereon, and the specific steps include steps 121-S122:
[0042] Step S121: Determine the target gateway device for forwarding IoT data according to the routing table of the server.
[0043] Step S122: Select a gateway object model associated with a target gateway device from the constructed gateway object models as a target gateway object model.
[0044] It is understandable that the gateway device is a device that connects different networks. When a data packet carrying IoT data is sent from a source device (i.e., IoT device) to a server, it will be forwarded through one or more gateway devices. Although the data packet itself does not directly record the field "which gateway device it comes from", the server can determine it through the routing information in its routing table.
[0045] When a data packet arrives at the local area network where the server is located, it is forwarded through a specific gateway device. The server can determine which network ranges of data packets are forwarded through the gateway device by checking its own routing table, and then determine the corresponding gateway device. Optionally, in one embodiment, if the network where the server is located 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 relationship between the gateway object model and the gateway device.
[0046] Therefore, the server can use the routing information in the routing table to quickly determine the gateway device that forwards the IoT data, so as to quickly lock the corresponding gateway object model to improve the efficiency of storing IoT data.
[0047] Step S130: Acquire field information carried by IoT data and determine the data type of the IoT data.
[0048] It is conceivable that in network transmission, such as in the network layer, IoT data is transmitted in the form of data packets. In the process of encapsulating IoT data according to the communication protocol, the IoT device can encapsulate the corresponding field information in the data packet or IoT data, such as encapsulating the field information in the header or tail of the data part. Optionally, in one embodiment, the information included in the field information can also be encapsulated separately, such as encapsulating a part in the header and the other part in the tail.
[0049] Field information includes data type. After the server receives IoT data, it can obtain IoT data and the field information it carries by parsing the received data packet, and then determine the data type corresponding to the IoT data.
[0050] Step S140: Determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data.
[0051] In the gateway object model, each of the data event items 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 the data type corresponding to the IoT data can be compared with the data type associated with each data event item in the target gateway object model, and when the same data type exists, the IoT data is determined to be stored.
[0052] Optionally, in one embodiment, the server may establish a corresponding file (such as a document, table, etc.) for the data type associated with the data event item included in each gateway object model to record the data type associated with the data event item. After receiving the IoT data, the file is queried to determine whether the currently received IoT data belongs to one of the data types recorded in the file, and then when the same data type exists, the IoT data is determined to be stored.
[0053] Step S150: When it is determined to store the received IoT data, 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 object model.
[0054] In this regard, when determining that the received IoT data can be stored, the server needs to select the corresponding data event 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 imagined that in the gateway object model, each of the data event items is respectively associated with a different data type. For this, 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] From the above solution, it can be seen that the server stores and manages different types of IoT data through the gateway object model, so that it can flexibly manage many types of IoT devices in the IoT cloud platform, effectively optimizing the IoT cloud platform's batch management of IoT devices, so that it can conveniently maintain the data of IoT devices and manage IoT devices.
[0056] In one embodiment, for storage of IoT data, the server generates corresponding node data in a database to store IoT data, such as Figure 2 As shown, Figure 2 A schematic diagram of the steps for storing IoT data provided in an embodiment of the present 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: Determine the corresponding target data event item based on the association information between the data type and the data event item in the mapping relationship.
[0059] Step S230: The IoT data is used as a node data of the target data event item and is stored according to the event name.
[0060] It can be understood that the field information includes the data type and event name. After receiving the IoT data, the server parses the field information carried by the data. It can be imagined that the server and the IoT device 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] In this regard, the server searches for the data event item corresponding to the data type of the IoT data according to the association information between the data type and the data event item recorded in the mapping relationship, and uses it as the target data event item. Then, when storing, the IoT data is used as a node data of the target data event item and stored according to the event name. It can be imagined that there can be multiple node data under the same data event item, and each node data corresponds to an IoT data, and each node data is stored in the database according to the event name. For example, each data will store the event_name field, which corresponds to the event name. When querying the node data of the data event item, query the event_name field to obtain the data list under the data event item.
[0062] Exemplarily, an IoT device is a temperature detection device, which uploads the detected temperature data as IoT data to the server. When the server receives the IoT data, it determines that it is temperature type data, and then establishes a node data under the data event item associated with the temperature data type to store the temperature data uploaded by the IoT device. Accordingly, the corresponding event name is also recorded in the event_name field of the data, such as identified by Event_TEMP_01.
[0063] Therefore, the server can select the data event items corresponding to the data in the gateway object model by parsing the field information, thereby optimizing the batch management of IoT devices by the IoT cloud platform, making the maintenance and management of IoT devices and their data more convenient.
[0064] In some embodiments, in the case where the IoT device switches the content of the collected data, such as the data type of the data collected by the IoT device changes, for example, the IoT device is a temperature and humidity detector, which is used to obtain data of two types, temperature and humidity. If the IoT device initially uploads only temperature data, and then changes the reported data, such as changing from initially uploading temperature data to uploading humidity data, the server needs to re-store it in the database.
[0065] It is conceivable that, in one embodiment, when the server stores data uploaded by an IoT device, it can record relevant information of the IoT device, such as the 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 based on the above records after receiving the IoT data.
[0066] When the server determines that the data type corresponding to the IoT data uploaded by the same IoT device has changed, the server parses the currently received IoT data to obtain the corresponding field information, and then determines the data type and event name corresponding to the IoT data after the data type has changed based on the field information. In this regard, the server also re-searches another target data event item, which is associated with the data type of the IoT data after the change, and then adds a node data to the target data event item, and stores the IoT data according to the re-determined event name. It is conceivable that in some embodiments, if there is node data corresponding to the IoT data after the type change in the target gateway object model, the received IoT data is stored with the node data.
[0067] Therefore, when the IoT device switches the content of the collected data, the user does not need to operate on the IoT cloud platform. The server can reconfigure and store the collected IoT data, which helps to optimize the IoT cloud platform's batch management of IoT devices.
[0068] In one embodiment, when there are fluctuations, failures, and other problems in the network, the IoT device may switch to another gateway device to upload IoT data. In this regard, after receiving the IoT data uploaded by the IoT device, the server also needs to query the gateway device that forwards the IoT data, such as using the solution of querying the routing table in the above embodiment to determine whether the gateway device that forwards the data has changed. Furthermore, when it is determined that the IoT device switches the gateway device, the server searches for the gateway model corresponding to the gateway type in the constructed gateway model according to the gateway type corresponding to the switched gateway device to re-determine the target gateway model.
[0069] In this regard, if the constructed gateway object model does not contain the target gateway object model associated with the switched gateway device, the above IoT data will not be stored temporarily, and the server can discard the IoT data; and for the previously uploaded data, the server automatically treats it as historical data. If the constructed gateway object model contains the target gateway object model associated with the switched gateway device, the 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 the IoT device switches gateways, the IoT cloud platform can automatically process the data without the need for users to perform storage configuration, making it easy to maintain the data of IoT devices and manage IoT devices.
[0071] It should be noted that in some embodiments, when the IoT device switches the gateway device, the server searches for the gateway object model corresponding to the gateway type in the constructed gateway object model according to the gateway type corresponding to the switched gateway device. It is conceivable that when 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 data management is performed through the IoT cloud platform, the server may respond to the user's query request. 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 the IoT data of an IoT device on a terminal device, such as querying the temperature data collected by the device, the server may parse the query request to obtain the corresponding keywords, such as temperature, device ID, etc., and then the server determines the event name according to 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 the event name to the query condition, so as to facilitate searching the target field corresponding to the stored node data in the database according to the query condition. It can be imagined that the target field in the stored node data is used to record the event name corresponding to the IoT data. Then, the server extracts the node data matching the query condition and feeds it back to the initiator of the query request. In this regard, the server can respond to the query request initiated by the user, thereby feeding back the node data matching the query request, so as to provide a convenient data management solution for IoT devices.
[0074] Figure 3 This is a model topology diagram of the gateway object model of the present application. As shown in the figure, the corresponding data event items in the gateway object model are divided into DataEvent01, DataEvent02 and DataEvent03, and each data event item is configured with corresponding node data (such as data1, data2, etc. in the figure). Figure 4 A data interaction diagram of an Internet of Things network provided for an embodiment of the present application, as shown in the figure, the Internet of Things device E1 transmits the Internet of Things data to the server S1 through the gateway device G1, and the Internet of Things device E1 transmits the Internet of Things data to the server S1 through the gateway device G1.
[0075] For example, refer to Figure 3 and Figure 4, an IoT cloud platform is built in the server, and the IoT cloud platform is provided with corresponding gateway object models corresponding to gateway devices of different gateway types. When IoT device E1 reports IoT data, it is transparently forwarded to the server through gateway device E1. For example, IoT device E1 is a device for collecting temperature data, and the IoT data uploaded by it is the collected temperature value. If the data event item DataEvent01 is a data event item corresponding to the temperature type, accordingly, a node data is added under the data event item (such as data1, data2, etc. in the figure), and the added node data is the reported temperature data. Moreover, when storing data, the corresponding event name is recorded in the event_name field of the data, such as using Event_TEMP_01 to identify the event name of the data, to indicate that this data is data of the corresponding temperature type.
[0076] Figure 5 A schematic diagram of the structure of an Internet of Things data management device is provided for an embodiment of the present application. The device is used to execute the Internet of Things data management method provided in the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. The device is applied to a server, and the server is connected to a plurality of gateway devices for communication, and each gateway device is connected to a plurality of Internet of Things devices for communication. As shown in the figure, the Internet of Things data management device includes: a model construction 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 a plurality of gateway object models based on the gateway type corresponding to the connected gateway device and associate the gateway devices corresponding to the same gateway type with the same gateway object model, and each gateway object model includes a plurality of data event items, each data event item is respectively associated with a different data type;
[0078] The model selection module 502 is configured to determine a target gateway object model in the constructed gateway object model when receiving the 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 the IoT data and determine the data type of the IoT data;
[0080] The storage determination module 504 is configured to determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data;
[0081] The data storage module 505 is configured to store the received IoT data in a database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway object model when determining to store the received IoT data.
[0082] Based on the above embodiment, the model selection module 502 is specifically configured as follows:
[0083] Determine the target gateway device for forwarding IoT data based on the server’s routing table;
[0084] A gateway object model associated with a target gateway device is selected from the constructed gateway object models as the target gateway object model.
[0085] Based on the above embodiment, the field information includes the data type and the 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 IoT data;
[0087] Determine the corresponding target data event item based on the association information between the data type and the data event item in the mapping relationship;
[0088] The IoT data is taken as a node data of the target data event item and stored according to the event name.
[0089] Based on the above embodiment, the data storage module 505 is further configured as follows:
[0090] When it is determined that the data type corresponding to the IoT data uploaded by the same IoT device has changed, the data type and event name corresponding to the IoT data are re-determined based on the field information carried by the IoT data after the data type has changed;
[0091] The IoT data is used as newly added node data in another target data event item of the target gateway object model, and the IoT data is stored according to the re-determined event name.
[0092] On the basis of the above embodiment, the Internet of Things data management device further includes a model reselection module, and the model reselection module is configured as follows:
[0093] When it is determined that the IoT device switches the gateway device, the target gateway object model is re-determined according to the gateway type corresponding to the switched gateway device;
[0094] If the target gateway object model associated with the switched gateway device does not exist in the constructed gateway object model, the above IoT data will not be stored temporarily, and the IoT data uploaded by the IoT device before switching the gateway device will be used as historical data;
[0095] If a target gateway object model associated with the switched gateway device exists in the constructed gateway object model, 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 embodiment, the model reselection module is further configured as follows:
[0097] If the two gateway devices before and after the IoT device is switched belong to the same gateway type, the re-determined target gateway object model is still the gateway object model used before the switch.
[0098] On the basis of the above embodiment, the IoT data management device further includes a data query module, and the data query module is configured as follows:
[0099] In response to a query request for IoT data, the query request is parsed to obtain an event name, and the event name is added to a query condition;
[0100] According to the query conditions, the target field corresponding to the stored node data is searched to feed back 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.
[0101] It is worth noting that in the embodiment of the above-mentioned device, the modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0102] Figure 6 The schematic diagram of the structure of the server provided in one embodiment of the present application is used to execute the Internet of Things data management method provided in the above embodiment, and has the functional modules and beneficial effects corresponding to the execution 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, and one processor 601 is taken as an example in the figure; the processor 601, the memory 602, the input device 603 and the output device 604 can be connected by a bus or other means, and the figure takes the connection through the bus as an example. The memory 602, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the Internet of Things data management method in the embodiment of the present application. The processor 601 executes the corresponding various functional applications and data processing by running the software programs, instructions and modules stored in the memory 602, that is, the above-mentioned Internet of Things data management method is realized.
[0103] The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data recorded or created during use, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 602 may further include a memory remotely arranged relative to the processor 601, and these remotely arranged memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, 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 input related to the user settings and function control of the device; the output device 604 can be used to send or display key signal output related to the user settings and function control of the device.
[0105] An embodiment of the present application also provides a storage medium storing computer executable instructions, which, when executed by a processor, are used to perform relevant operations in the Internet of Things data management method provided in any embodiment of the present application.
[0106] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0107] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0108] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for managing Internet of Things data, characterized in that: Applied to a server, the server is connected to a plurality of gateway devices for communication, and each gateway device is connected to a plurality of IoT devices for communication, the IoT data management method comprises: Based on the gateway type corresponding to the connected gateway device, a plurality of gateway object models are constructed and gateway devices corresponding to the same gateway type are associated with the same gateway object model, and each of the gateway object models includes a plurality of data event items, each of which is associated with a different data type; Upon receiving the IoT data uploaded by any IoT device through the corresponding gateway device, determining a target gateway object model in the constructed gateway object model; Obtaining field information carried by the IoT data and determining the data type of the IoT data; Determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data; In the case of determining to store the received IoT data, the received IoT data is stored in a database according to a mapping relationship between field information carried by the IoT data and data event items in the target gateway object model.
2. The method for managing Internet of Things data according to claim 1, characterized in that: The step of determining a target gateway object model in the constructed gateway object model upon receiving the IoT data uploaded by any IoT device through the corresponding gateway device comprises: Determine, according to the routing table of the server, a target gateway device for forwarding the IoT data; A gateway object model associated with the target gateway device is selected from the constructed gateway object models as the target gateway object model.
3. The method for managing Internet of Things data 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 a database according to a mapping relationship between field information carried by the IoT data and data event items in the target gateway object model includes: Parsing the field information carried by the IoT data to determine the data type and event name of the IoT data; Determine the corresponding target data event item based on the association information between the data type and the data event item in the mapping relationship; The IoT data is used as node data of the target data event item and is stored according to the event name.
4. The method for managing Internet of Things data according to claim 3, characterized in that: In the case of determining to store the received IoT data, storing the received IoT data in a database according to a mapping relationship between field information carried by the IoT data and data event items in the target gateway object model, further comprising: When it is determined that the data type corresponding to the IoT data uploaded by the same IoT device has changed, based on the field information carried by the IoT data after the data type has changed, the data type and event name corresponding to the IoT data are re-determined; The Internet of Things data is used as node data newly added in another target data event item of the target gateway object model, and the Internet of Things data is stored according to the re-determined event name.
5. The method for managing Internet of Things data according to claim 1, characterized in that: Before determining whether to store the received IoT data according to 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 the IoT device switches the gateway device, the target gateway object model is re-determined according to the gateway type corresponding to the switched gateway device; If the target gateway object model associated with the switched gateway device does not exist in the constructed gateway object model, the above-mentioned IoT data is not stored temporarily, and the IoT data uploaded by the IoT device before switching the gateway device is used as historical data; If a target gateway object model associated with the switched gateway device exists in the constructed gateway object model, node data is newly added under the corresponding data event item in the target gateway object model to store the IoT data.
6. The method for managing Internet of Things data according to claim 5, characterized in that: If the constructed gateway object model has a target gateway object model associated with the switched gateway device, then adding node data under the corresponding data event item in the target gateway object model to store the IoT data includes: If the two gateway devices before and after the switching of the IoT device belong to the same gateway type, the target gateway physical model is re-determined to still be the gateway physical model used before the switching.
7. The Internet of Things data management method according to claim 1, 3 or 4, characterized in that: In the case of determining to store the received IoT data, 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 item in the target gateway object model, the method further includes: In response to a query request for the IoT data, parsing the query request to obtain an event name, and adding the event name to a query condition; According to the query condition, the target field corresponding to the stored node data is searched to feed back the node data matching the query condition to the initiator of the query request, and the target field is used to record the event name corresponding to the IoT data.
8. An Internet of Things data management device, characterized in that: Applied to a server, the server is connected to a plurality of gateway devices for communication, and each gateway device is connected to a plurality of IoT devices for communication, the IoT data management device comprises: A model building module is configured to build a plurality of gateway object models based on the gateway type corresponding to the connected gateway device and associate the gateway devices corresponding to the same gateway type with the same gateway object model, and each of the gateway object models includes a plurality of data event items, each of the data event items is respectively associated with a different data type; A model selection module is configured to determine a target gateway object model in the constructed gateway object model when receiving the IoT data uploaded by any of the IoT devices through the corresponding gateway device; An information acquisition module, configured to acquire field information carried by the IoT data and determine the data type of the IoT data; A storage determination module, configured to determine whether to store the received IoT data according to the data event items included in the target gateway object model and the data type of the IoT data; The data storage module is configured to store the received IoT data in a database according to the mapping relationship between the field information carried by the IoT data and the data event items in the target gateway object model when determining to store the received IoT data.
9. A server, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more processors implement the Internet of Things data management method as described in any one of claims 1-7.
10. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a processor, they are used to execute the Internet of Things data management method according to any one of claims 1 to 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
Gateway storage management method and device, electronic equipment and storage medium
CN117950591A
Apparatus and method for exporting data from a database to a data processing terminal
US20020035574A1