Internet of Things platform equipment data storage method designed for intelligent building industry
By classifying and unifying data table management for devices in the smart building industry, and using scheduled tasks for calculations, the problems of complex operations and difficult queries on traditional IoT platforms are solved, and the user experience and data query efficiency are improved.
Patent Information
- Application Number
- CN202410729676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-27
AI Technical Summary
In the smart building industry, traditional IoT platforms lack a unified data display and management interface, resulting in complex user operations, difficult queries, and poor user experience.
By classifying the equipment, create a unified data table, use scheduled tasks to perform scheduled calculations, save the calculation data in the data table, and establish a scheduled calculation information storage table to store query SQL and calculation results, improving query speed and statistics. efficiency.
By storing data of the same type in one table, query and statistics speeds are significantly improved, business logic is simplified, and the problem of poor user experience is solved.
Smart Images

Figure CN118708583A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to an Internet of Things platform device data storage method designed for the smart building industry. Background Art
[0002] In the smart building industry, the IoT platform involves connecting to a large number of devices and analyzing the data generated by these devices.
[0003] Traditional IoT platforms generally only focus on device access and the application of individual devices, while smart buildings will have various hierarchical and itemized data statistics and query functions. Due to the lack of a unified data display and management interface, users may face problems such as complex operations and difficult queries when using traditional IoT platforms, resulting in a poor user experience. Summary of the invention
[0004] The purpose of the present invention is to provide an Internet of Things platform device data storage method designed for the smart building industry, which solves the problems that users may face when using traditional Internet of Things platforms, such as complex operations and difficult queries, resulting in poor user experience.
[0005] To achieve the above object, the present invention provides an Internet of Things platform device data storage method designed for the smart building industry, comprising the following steps:
[0006] Classify equipment products;
[0007] Create a unified data table for classification;
[0008] Create a scheduled task, use the scheduled task to perform scheduled calculations, and save the calculation data in a data table.
[0009] The step of classifying the equipment products further includes:
[0010] Group devices with similar functions or features into one category and define common properties for each category of devices.
[0011] The step of creating a unified data table for the classification further includes:
[0012] The common field data of the equipment under the category is stored in a category data table, and the equipment data unique to the product under the category is stored in another product data table.
[0013] The step of creating a scheduled task, executing scheduled calculations through the scheduled task, and saving the calculation data in a data table further includes:
[0014] Establish a timing calculation information storage table;
[0015] According to the query SQL in the scheduled calculation information table, create a corresponding data storage table to save the data after the scheduled calculation;
[0016] Create a scheduled task to perform scheduled calculations regularly and save the calculation results to the corresponding data storage table.
[0017] Wherein, the step of establishing a timing calculation information storage table further includes:
[0018] The scheduled calculation information storage table is used to store the query SQL, WHERE conditions, grouping fields and other information of the scheduled calculation.
[0019] Among them, creating a scheduled task, executing scheduled calculations through the scheduled task and saving the calculation data in a data table, the steps further include:
[0020] First, query the data in the scheduled calculation. For the data not in the scheduled calculation, perform real-time data query through the query SQL saved in the scheduled calculation information.
[0021] The present invention discloses a device data storage method for an Internet of Things platform designed for the smart building industry. First, devices with the same function or characteristic are classified into one category. Devices of the same category have common attributes for the category. Next, a unified data table is created for the category. Field data common to the devices under the category are uniformly stored in a category data table. Device data specific to the product under the category is stored in another product data table. A timing calculation information storage table is established for storing timing calculation information. A corresponding data storage table is created according to the query SQL of the timing calculation for storing the data after the timing calculation. Finally, a corresponding timing task is created, and the timing calculation is performed regularly through the timing task to save the calculation data. When in use, the data in the timing calculation is first queried. For data not in the timing calculation, the query SQL saved in the timing calculation information is used to perform real-time data query. By storing the same type of data in one table, the query speed and statistical speed are greatly improved. Especially when it comes to business logic, it is easier to use. By summarizing the statistical calculation data by timing calculation, the query speed of statistical data is greatly improved. The problem that users may face problems such as complex operation and difficult query when using traditional Internet of Things platforms, resulting in poor user experience, is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0023] Figure 1 It is a classification-product-equipment relationship diagram of the present invention.
[0024] Figure 2 It is a classification-product-data table relationship diagram of the present invention.
[0025] Figure 3 It is a step diagram of the data storage method of the Internet of Things platform device designed for the smart building industry of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, but should not be construed as limiting the present invention.
[0027] The first embodiment of the present application is:
[0028] See also Figures 1 to 3 ,in, Figure 1 It is a classification-product-equipment relationship diagram of the present invention. Figure 2 It is a classification-product-data table relationship diagram of the present invention. Figure 3 The present invention provides a method for storing data on an Internet of Things platform device designed for the smart building industry, which includes the following steps:
[0029] S100: Classify equipment products;
[0030] Specifically, first, classify devices with the same functions or characteristics into one category, such as lighting, air conditioning, electric meter, water meter, etc. The classified devices will have common attributes of the category, such as lighting switches, air conditioning temperature, electric meter readings, etc. The relationship between category-product-device is as follows: Figure 1 .
[0031] S200: Create a unified data table for the classification;
[0032] Specifically, a unified data table is created for the category. The common field data of the equipment under the category is uniformly stored in a category data table, and the equipment data unique to the product under the category is stored in another product data table. The benefits of doing this are as follows: 1. When data statistics are required, the query efficiency will be greatly improved. All data is stored in one table, avoiding multiple queries from multiple tables. Both real-time statistics and aggregate calculations of historical data have been greatly improved. 2. Data of similar equipment can be easily and quickly queried, such as querying all lights and air conditioners in a building. The category-product-data table relationship is as follows: Figure 2 .
[0033] S300: Create a scheduled task, execute scheduled calculations through the scheduled task, and save the calculation data in a data table.
[0034] Specifically, commonly used time series databases on the market provide functions such as continuous aggregation and streaming computing, which are similar to saving data after periodic calculation. However, these functions have certain limitations. For example, the continuous aggregation of timescaledb can only be associated with one table, and the conditions are limited. In actual project use, continuous aggregation is not very easy to use. In order to solve these problems, the present invention proposes a general method to use a program to implement the timed calculation function.
[0035] First, you need to create a scheduled calculation information storage table to store scheduled calculation information. In the scheduled calculation information, you need to save the query SQL, where conditions, grouping fields, etc. of the scheduled calculation.
[0036] Secondly, you also need to create a corresponding data storage table based on the query SQL of the scheduled calculation to save the data calculated by the scheduled calculation.
[0037] Finally, create the corresponding scheduled task, use the scheduled task to perform scheduled calculations regularly, and save the calculation data.
[0038] When in use, first query the data in the scheduled calculation, and then perform real-time data query through the query SQL saved in the scheduled calculation information for the data not in the scheduled calculation.
[0039] Embodiment 1:
[0040] In smart buildings, electricity meter data needs to be divided into different layers and items, that is, the data of air conditioning electricity consumption, lighting electricity consumption, etc. on each floor needs to be counted, and statistical calculations need to be performed according to the following steps:
[0041] Step 1: Create a table to store the electricity meter statistical calculation data, including four fields: statistical time, floor, electricity use, and electricity consumption.
[0042] Step 2: Write a SQL statement to query the electricity consumption statistics for each floor and each purpose per hour.
[0043] Step 3: Start a scheduled task that is executed once every hour. The content of the scheduled task is to store the results of the SQL statement query in step 2 into the table created in step 1.
[0044] Step 4: Record the original SQL statement for querying the meter data.
[0045] Step 5: When querying data, make a judgment based on time. If the data to be queried is already stored in the table created in step 1, read it directly from the table. If the data to be queried involves the latest data, use the SQL statement in step 4 plus the conditions to be queried to quickly query the latest data. Finally, merge the two parts of data as the final query result.
[0046] By storing the same type of data in one table, the query speed and statistical speed are greatly improved. Especially when it comes to business logic, it is easier to use. By performing regular calculations and summarization of statistical calculation data, the query speed of statistical data is greatly improved. It solves the problem that users may face problems such as complex operations and difficult queries when using traditional IoT platforms, resulting in poor user experience.
[0047] What is disclosed above is only one or more preferred embodiments of the present application, and cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data storage method for IoT platform equipment designed for the smart building industry, characterized in that: The following steps are involved: Classify equipment products; Create a unified data table for classification; Create a scheduled task, use the scheduled task to perform scheduled calculations, and save the calculation data in a data table.
2. The method for storing data on an Internet of Things platform device designed for the smart building industry as claimed in claim 1, characterized in that: Classifying the equipment products, the step further includes: Group devices with similar functions or features into one category and define common properties for each category of devices.
3. The method for storing data on an Internet of Things platform device designed for the smart building industry as claimed in claim 1, characterized in that: Creating a unified data table for the classification, the step further includes: The common field data of the equipment under the category is stored in a category data table, and the equipment data unique to the product under the category is stored in another product data table.
4. The method for storing data of an Internet of Things platform device designed for the smart building industry as claimed in claim 1, characterized in that: Creating a scheduled task, executing scheduled calculations through the scheduled task and saving the calculation data in a data table, the steps further include: Establish a timing calculation information storage table; According to the query SQL in the scheduled calculation information table, create a corresponding data storage table to save the data after the scheduled calculation; Create a scheduled task to perform scheduled calculations regularly and save the calculation results to the corresponding data storage table.
5. The method for storing data of an Internet of Things platform device designed for the smart building industry as claimed in claim 4, characterized in that: Establishing a timing calculation information storage table, the step further includes: The scheduled calculation information storage table is used to store the query SQL, WHERE conditions, grouping fields and other information of the scheduled calculation.
6. The method for storing data of an Internet of Things platform device designed for the smart building industry as claimed in claim 4, characterized in that: Creating a scheduled task, executing scheduled calculations through the scheduled task and saving the calculation data in a data table, the steps further include: First, query the data in the scheduled calculation. For the data not in the scheduled calculation, perform real-time data query through the query SQL saved in the scheduled calculation information.
Citation Information
Cited By
IOT data processing method and device and communication system
CN121958257A
