A method for batch saving uploaded data of IoT devices

By encapsulating batch storage interfaces in IoT devices and performing entity annotations, automatically storing data in subtables, it solves the problem that database subtables require preset middleware or large amounts of code, improves data writing performance and system stability, and is applicable Application development for small business.

CN118394839BActive Publication Date: 2024-11-12ZHEJIANG DIYUAN INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410509268.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2024-11-12
Estimated Expiration
2044-04-26

AI Technical Summary

Technical Problem

In the prior art, database subtables require a large amount of preset middleware or code, which affects system stability and availability. Especially when data is uploaded in batches of IoT devices, database performance declines, especially when data tables exceed 5 million. When rows, the writing and query performance is severely degraded.

Method used

By encapsulating multiple tasks into batch save interfaces, performing entity annotations on entity classes, establishing cache mappings in memory, encapsulating data tables into transaction interfaces for reading and writing, setting independent data tables or cache records subtable attributes and index information , automatically subtable storage based on these attributes, avoid complex middleware operations, implement entity classes to map multiple data tables with the same data structure, automatically create subtables, and complete subtable writing of data at the batch save interface.

Benefits of technology

Improves data writing performance, simplifies code logic, reduces operation and maintenance costs, and realizes automatic creation of sub-tables based on business volume without sub-tables according to fixed time, meeting the requirements of query performance, and is suitable for small enterprise application development .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394839B_ABST
    Figure CN118394839B_ABST
Patent Text Reader

Abstract

The invention discloses a method for batch saving of data uploaded by an Internet of Things device, comprising: encapsulating multiple tasks together into a batch saving interface, and annotating an entity class of the batch saving interface; establishing a cache mapping in a memory according to the entity annotation, encapsulating a data table into a transaction interface according to the batch saving interface, reading and writing a database in the transaction interface, setting the attributes and index information of an independent data table or a cache record sub-table, dividing the data table into tables according to the attributes and index information of the independent data table or the cache record sub-table, and mapping and storing the sub-tables; the creation of the data table is automatically completed by the interface, and the mapping conversion between the entity class and the database field is automatically completed. One entity class can map multiple data tables with the same table structure, thereby improving the data writing performance of a single data table. When saving multiple types of batch data, there is no need to write extra redundant codes, thereby simplifying the data batch insertion operation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage of Internet of Things devices, and in particular to a method for batch storage of data uploaded by Internet of Things devices. Background Art

[0002] Wireless data collectors and intelligent flow meters based on 4G and NB communication technologies are increasingly used in IoT applications. Their characteristics are that the collectors report data in a centralized manner at regular intervals, and the data is uploaded to the application system in batches. In the application system program, a large number of batch write operations need to be performed on the database. At the same time, the longer the system runs, the more accumulated data there is, and when the number of rows in a single table in the database exceeds 5 million, the write and query performance will be severely reduced. The traditional implementation method is to directly use the JPA interface and configure the batch_size attribute of jdbc to perform batch operations on data. This method can only handle the mapping relationship of a single table. If you want to process the data in the sharded table, you need to rewrite a lot of code, which is very laborious. Sharding-JDBC is currently an important component for sharding libraries and tables, and its functions are very powerful, but it is too complex for general projects and cannot be used for small enterprise application development.

[0003] For example, a "processing method and device based on MySQL database sub-library and sub-table strategy middleware" disclosed in Chinese patent documents, with the announcement number: CN116414840A. The disclosure includes configuring various key parameter attributes related to the target system business based on the created routing annotation class; intercepting the routing annotation class based on the created routing aspect class to intercept method parameters; obtaining the corresponding routing parameter hash value and the corresponding library table index based on the sub-library and sub-table routing parameters to set the library table index to the current thread variable; and determining whether to perform sub-library and sub-table processing on the target system business according to the global configuration corresponding to the target system business read through the created target interceptor interface; if it is determined to perform sub-library and sub-table processing on the target system business according to the global configuration, then executing the corresponding sub-library and sub-table operation and returning the corresponding execution result; otherwise, not executing the sub-library and sub-table operation, but the solution is limited by the stability of the middleware, and the availability of the system will still be affected. Summary of the invention

[0004] In order to solve the problem in the prior art that database table partitioning requires preset middleware or a large amount of code, the present invention provides a method for batch saving uploaded data of IoT devices, which realizes mapping one entity class to multiple data tables with the same data structure, without the need for complex middleware to operate the database.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A method for batch saving of data uploaded by an Internet of Things device comprises: encapsulating a plurality of tasks together into a batch saving interface, and annotating an entity class of the batch saving interface;

[0007] Create a cache mapping in memory based on entity annotations, encapsulate the data table as a transaction interface based on the batch save interface, and read and write the database in the transaction interface;

[0008] Set the properties and index information of independent data tables or cache record sub-tables, divide the data tables according to the properties and index information of independent data tables or cache record sub-tables, and map and store the sub-tables. Use an entity class to map multiple data tables with the same data structure, encapsulate the task into a batch save interface, and automatically create new sub-tables based on the business volume instead of sharding them at a fixed time, avoiding complex middleware operations on the database, and completing the writing of data to sub-tables at the batch save interface.

[0009] Preferably, after the entity annotation is performed, a specific field is marked according to an annotation, a mapping relationship is established for the field type of the specific field, and a sub-table attribute is obtained. The mapping relationship between the field type and the sub-table attribute is obtained, so that the corresponding sub-table attribute can be determined according to the field.

[0010] As a preferred embodiment, the mapping of field types includes determining the relationship through enumeration, field mapping relationship of the data table; after obtaining the attributes of the sub-table, insert and query statements are automatically generated. After obtaining the field mapping relationship of the data table, insert and query statements are automatically generated; sub-table insertion and query are realized, avoiding the operation of complex middleware.

[0011] Preferably, the batch save interface includes an independent save thread and a data queue, wherein the save thread listens to the data queue and executes batch writes to the database. The data queue is mapped to a sub-table and saved by an independent save thread, thereby avoiding complex middleware operations on the database, so that multiple data tables with the same data structure are mapped at the physical interface.

[0012] Preferably, in the batch saving interface, the target entity class object is first determined, and then the sub-table attributes of the entity class object are read;

[0013] Determine whether to save data in the current data table or in a new data table, and finally generate a data table save SQL according to the mapping relationship. The current data table refers to an unfilled data table. By mapping different entity class objects to corresponding data tables, multiple data can be saved in separate tables.

[0014] Preferably, after the SQL statement for saving the data table is generated, the data access layer is called to execute the data saving operation to realize data saving.

[0015] Preferably, when performing batch saving, the data table attributes are first read to obtain the current data table attributes and structure, and then a real-time database insert statement is generated, so that the corresponding database insert statement is generated in real time for each data sub-table, so that the data table can be written into the database only after it is full and replaced with a new data table.

[0016] Preferably, the method includes saving the data in the current data table or in a new data table, and directly saving the data when the amount to be saved does not exceed the storable value of the current data table;

[0017] When the amount of data to be saved exceeds the current data table, the data that does not exceed the storable value is saved in the current data table. When the amount of data to be saved exceeds the current data table, the data that exceeds the storable value is saved in the newly created data table. Replace the properties of the newly created data table with the properties of the current data table to ensure that the data can be divided into tables according to the business volume when saving in batches, ensuring the consistency of the data uploaded in batches.

[0018] As a preferred method, a real-time rolling data queue is established in the batch saving interface, the head of the data queue is pushed into data in real time, and the tail of the data queue is read in real time, so that the data in the batch saving interface can be rolled and updated in real time, ensuring that the data in the batch saving interface can be written into the database in real time.

[0019] Preferably, after reading the tail of the data queue in real time, the data is written into the database, and the data table is updated after the data is written into the database. The data writing of the batch saving interface is realized, and the data table is updated after the data is written, so that the data table can be updated in real time.

[0020] The present invention has the following advantages:

[0021] (1) The creation of data tables is automatically completed by the interface, which is convenient for developers to use. The mapping conversion between entity classes and database fields is automatically completed. One entity class can map multiple data tables with the same table structure, improving the data writing performance of a single data table. When saving multiple types of batch data, there is no need to write extra code, which simplifies the data batch insertion operation process and improves the logic and readability of the code. (2) There is no need for complex middleware to operate the database. New sub-tables are automatically created according to the size of the business volume instead of at a fixed time. At the same time, it can meet certain query performance and reduce operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described below are merely exemplary. A person skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.

[0023] Figure 1 This is the read and write operation logic of batch data in the embodiment.

[0024] Figure 2 2 is a timing diagram of data storage in an embodiment.

[0025] Figure 3 It is a schematic diagram of internal logic saved in batches in the embodiment.

[0026] Figure 4 It is a logical diagram of querying data in the embodiment. DETAILED DESCRIPTION

[0027] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.

[0028] like Figure 1-4 As shown, in a preferred embodiment, the present invention discloses a method for batch saving of data uploaded by an IoT device, characterized in that it includes: encapsulating multiple tasks together into a batch saving interface, and annotating the batch saving interface by entity;

[0029] Each batch save interface includes a save interface, which is connected to the outside world to obtain the data table to be saved. The save interface is connected to a sub-table data table attribute interface, the sub-table data table attribute interface is connected to a sub-table data table attribute cache, the sub-table data table attribute cache is connected to a sub-table data table attribute class, and the sub-table data table attribute class is connected to a sub-table data table attribute table. The sub-table data table attribute interface modifies the sub-table data table attributes in the batch save interface, and the modification includes saving, updating and deleting. The sub-table data table attribute table includes multiple sub-tables storing sub-table data table attributes, and each sub-table stores a sub-table data table attribute.

[0030] The entity annotation includes defining entity classes, defining entity class attributes and attribute annotations, and obtaining a mapping between data and sub-table attributes. The attributes include field attributes, primary key attributes, index attributes and json attributes, and realize the parsing mapping of entity class attributes and sub-table attributes of data.

[0031] Create a cache mapping in memory based on entity annotations, encapsulate the data table as a transaction interface based on the batch save interface, and read and write the database in the transaction interface;

[0032] Establish a first-level cache mapping in memory to improve response speed. Encapsulate the entity batch save interface with the data table to obtain a dedicated transaction interface for each data table, so that the data table can complete the upload, reading and writing of the sub-table at the transaction interface.

[0033] Set the attributes and index information of the independent data table or cache record sub-table, divide the data table into sub-tables according to the attributes and index information of the sub-tables in the independent data table or cache record, and map and store the sub-tables. At the same time, store the attributes and index information of the sub-tables through the independent data table or cache.

[0034] The table creation statement and table reading statement of the sub-table establish a cache mapping according to the entity annotation. The cache mapping establishes a sub-table for mapping storage according to the attributes and index information of the independent data table or the sub-table in the cache.

[0035] In other embodiments, after the entity annotation is performed, a specific field is marked according to an annotation, a mapping relationship is established for the field type of the specific field, and a sub-table attribute is obtained.

[0036] In the entity annotation, specific annotations are set for different field types. Specific fields are marked through entity annotations. The marking includes mapping relationships, and different fields are mapped to specific attributes in the sub-table according to the markings.

[0037] In other embodiments, the establishment of a mapping relationship for field types includes determining the field mapping relationship for a data table by enumeration; and automatically generating insert and query statements after obtaining sub-table attributes.

[0038] Each field type has its own unique sub-table attribute, which means that each field type is converted into a specific sub-table attribute.

[0039] In other embodiments, the batch save interface includes an independent save thread and a data queue, and the save thread monitors the data queue and executes batch writes to the database.

[0040] Each batch saving interface is provided with an independent saving thread, which monitors the data queue and maps the data queue into a sub-table.

[0041] In other embodiments, in the batch saving interface, the target entity class object is first determined, then the sub-table attributes of the entity class object are read, and finally a data table is generated and saved according to the mapping relationship.

[0042] An independent saving thread monitors the data queue, identifies the data in the data queue, judges the data in the data queue, and determines the entity class object category of the data in the data queue. The data in the data queue is identified, and then the sub-table attributes of different data are determined. The sub-table is divided according to the sub-table attributes corresponding to the data in the data queue, including reading the sub-table attributes and saving the sub-table according to the mapping relationship between the sub-table attributes and the data.

[0043] In other embodiments, before the generated data table is saved, it is determined whether the current sub-table has enough space to save it. If the current sub-table is not large enough to save it, a new sub-table is created for storage. Otherwise, the data queue is continuously monitored.

[0044] After the shard table is generated, the shard table attributes are automatically replaced with the current shard table, and subsequent data will be directly stored in the current shard table.

[0045] In other embodiments, when performing batch saving, the data table attributes are first read to obtain the current data table attributes and structure, and then a real-time database insert statement is generated.

[0046] Obtain the attributes and structure of the sub-table, generate a database insert statement based on the attributes and structure of the sub-table generated in real time, and write to the database based on the database insert statement. Write to the sub-table based on the database insert statement.

[0047] In other embodiments, the method includes updating the properties of the current data table after storing the data in the current data table.

[0048] In other embodiments, a real-time rolling data queue is established in the batch saving interface, the head of the data queue pushes data in real time, and the tail of the data queue is read in real time.

[0049] A real-time rolling data queue is set in the batch saving interface, so that data can interact in each batch saving interface, and data can be pushed and read in the batch saving interface, so that data can be uploaded to separate tables through the batch saving interface before entering the database.

[0050] In other embodiments, the method includes writing the data into a database after reading the tail of the data queue in real time, and updating the data table after the data is written into the database.

[0051] In the batch save interface, data is uploaded in separate tables, and one batch save interface maps multiple separate tables. Functions such as batch save and paging query can be implemented in the interface.

[0052] In other embodiments, the SpringBoot JPA development style is maintained, the original JPA function of mapping one entity class to one data table is expanded, one entity class is mapped to multiple data tables with the same data structure, and the tasks are encapsulated into batch saving interfaces for easy use by the caller. The tasks include: entity mapping class, data table attribute object, data table attribute saving and reading, data table creation, batch data saving, and other tasks.

[0053] In another embodiment, specifically, by using Java, SpringBoot, JPA, Hibernate technology, extending dao interface, Entity interface, Entity annotation, encapsulating the data table operation that needs batch processing into a transaction interface, the interface is used to perform database read and write operations. At the same time, the attributes of the sub-table are recorded by an independent data table or cache to record the sub-table attributes and index information, and the sub-table creation SQL and table reading SQL establish a first-level cache mapping in memory according to the Entity annotation to speed up the response speed of the system.

[0054] It includes setting up a business layer, the business layer is connected to a data access layer, and the data access layer is connected to a database.

[0055] In the business layer, the batch save transaction interface is synthesized into a batch save object corresponding to the data table, and the batch save object is equipped with data save operations.

[0056] In other embodiments, specifically, this embodiment is based on the Java-jdbc database connection driver, and by integrating the SpringBoot JPA framework, extends the Hibernate method of operating the sub-table data table, realizes the mapping of one entity class to multiple sub-table data tables, and provides batch saving, paging query and other functions in the form of interfaces. The database connection method is consistent with SpringBoot. The logic of mapping one entity to multiple sub-table data tables in this embodiment is implemented in the data access layer, which expands the SpringBoot JPA function and greatly facilitates system development.

[0057] In this embodiment, the entity class for sub-table uses annotations to write standard Entity class entities, and a JsonType annotation is extended in the code to mark the json field. The field type used is mapped to the field attributes of the data table through enumeration, including: String is mapped to varchar, int is mapped to int, Long is mapped to bigint, Double is mapped to double, Date is mapped to timestamp, LocalDateTime is mapped to datetime, Boolean is mapped to tinyint, and Json is mapped to json. Through the above mapping configuration, the sub-table attributes can be parsed through reflection to obtain the sub-table attributes, including: field attributes, primary key attributes, index attributes, and json attributes.

[0058] The data saving interface abstracts the batch saving save method into a public class. The interface has built-in independent saving threads, maximum number of saves, redis data queue, and batch saving method batchSave. batchSave listens to the redis data queue in the saving thread and executes batch writes to the database. When executing data saving, first determine the target entity class object, then read the target entity class sub-table attributes, and finally parse it into data saving SQL through reflection and submit it for saving. Before completing the save, determine whether the current sub-table has enough space to save the current data. If the number exceeds the preset upper limit, a new sub-table is created, and the newly created sub-table information SplitTableProperty is saved to the database through JPA; if the data does not reach the preset upper limit, continue to listen to the data queue and update the index field in SplitTableProperty.

[0059] In terms of split table data query, first obtain the target data table list from SplitTableProperty according to the query conditions, use a multi-threaded recursive algorithm in the page interface to query level by level, and end the query when the number of query results is met.

[0060] In another embodiment, the method specifically includes the following steps:

[0061] Define the data table property class TableProperty, index class IndexProperty, field class FieldProperty, and split table information class SplitTablePropertyEntity to provide corresponding SQL information for data saving and data query.

[0062] Before batch saving, read the data table properties to obtain the current data table properties and structure. Combined with the amount of data to be saved in batches, determine whether the current data table has enough space to save. If there is enough space, save the data to the current table. If there is not enough space, create a new data table, save the excess data to the new data table, and update the data table properties at the same time.

[0063] When saving in batches, first read the data table properties to obtain the current data table properties and structure, create a database insert SQL based on the batch real-time data, and then submit it to the Session to execute writing to the database, while updating the data table properties.

[0064] In the data table attributes in 1, the annotation mapping of the real-time data table attribute class automatically generates the SQL framework for inserting and reading the real-time data table.

[0065] Before batch saving in 1, the batch saving interface configures a real-time data queue to speed up the response of the interface, and the data is pushed into the head of the real-time data queue in real time.

[0066] When saving in batches in 1, use an independent thread to batch read the tail of the real-time data queue, combine the current data table attributes, generate batch SQL, and call the Session to execute batch writing to the database. After writing to the database, determine whether to create a new real-time data table and update the real-time data table attributes. Finally, repeat the execution.

[0067] During the paging query process, a multi-threaded recursive algorithm is used to quickly query real-time data.

[0068] In other embodiments, the present solution discloses a method for batch saving of data uploaded by an IoT device, including: encapsulating multiple tasks together into a batch saving interface, and abstractly implementing the batch saving interface;

[0069] According to the abstract implementation, inherit and generate specific implementation classes.

[0070] In other embodiments, after the generated data table is saved, it is determined whether the current sub-table is full. If the current sub-table is full, a new sub-table is created for storage, otherwise the data queue is continuously monitored. Since the sub-table attributes are obtained in advance, it is determined whether a new table needs to be created based on whether the current sub-table is full, so that a new sub-table is automatically created based on the business volume instead of a fixed time sub-table.

[0071] like Figure 2 As shown, in another embodiment, the solution includes the following steps: obtaining the data to be saved through the data receiving service, and then saving the data through the data saving business interface and the data saving transaction interface in sequence.

[0072] Wherein, the data receiving service obtains the data to be saved and submits the data saving instruction to the data saving business interface. The data saving business interface saves the internal queue, and then initiates a batch saving instruction to the data saving transaction interface. In the data saving transaction interface, after receiving the batch saving instruction, the data structure attributes of the data to be saved are first obtained, and then the data to be saved are batch SQL converted. After the conversion is completed, the saving instruction is determined, and it is determined whether the saving threshold is exceeded. When the saving threshold is exceeded, the data structure attributes of the file to be saved are updated. When the saving threshold is not exceeded, it is saved with the existing data structure attributes.

[0073] like Figure 3 As shown, in another embodiment, the scheme includes the following steps: first, a real-time data queue is obtained, wherein the implementation data queue includes data to be saved. Then, the length L of the real-time data queue is read to determine all data to be saved. Then, the real-time data is read in batches to read all real-time data to be saved.

[0074] According to the real-time data read in batches, the data table attributes of the real-time data are determined, and whether to create a new real-time data table is determined according to the saving threshold; when the saving threshold of the current data table is greater than the data to be saved, a new real-time data table is not established, and the corresponding SQL is directly generated for the batch of real-time data, and then Session is called to insert the real-time data into the current data table in batches; when the saving threshold of the current data table is less than the data to be saved, a new real-time data table is created, and the attributes of the real-time data table are the data table attributes of the current real-time data, and then the corresponding SQL is generated for the current batch of real-time data, and then Session is called to insert the current real-time data into the newly created real-time data table in batches. After the current real-time data is inserted in batches, the inserted real-time data table is updated.

[0075] like Figure 4 As shown, in one embodiment, the solution includes the following steps: when querying historical data, a front-end request is first made, indicating that the saved real-time data needs to be queried at this time, and after the front-end request, the data query logic is started.

[0076] Send the front-end request to the business interface, start requesting the business interface, and query the target data table attribute set for the real-time data attribute table at the business interface; the target data table attribute set is a set of data table attributes generated according to the queried data. At this time, the real-time data attribute table includes multiple tables. Query the target data table attribute set in each real-time data attribute table. When only one table is queried, generate a table logic; when multiple tables are queried, generate a logic spanning multiple tables; when no real-time data attribute table is queried, generate a no data logic. Collect the query results with the one table logic, the logic spanning multiple tables, and the no data logic, and finally return the query results.

[0077] In other embodiments, a sub-table data table attribute interface is provided in the batch saving interface of the present solution, and the sub-table data table attribute interface performs save, update and delete operations on the data table attributes of the sub-table. The sub-table data table attribute interface is connected to a sub-table data table attribute cache, and the sub-table data table attribute cache saves the sub-table data table attributes transmitted from the sub-table data table attribute interface. The sub-table data table attribute cache is connected to a sub-table data table attribute class, and the sub-table data table attribute class classifies the sub-table data table attributes of the sub-table data table attribute cache. The sub-table data table attribute class is connected to a sub-table data table attribute table, and the sub-table data table attribute table includes multiple real-time data tables.

[0078] In other embodiments, the sub-table information parsing logic is included. In the sub-table information parsing logic, the Entity entity class, the entity class attributes corresponding to the Entity entity class, and the entity annotations corresponding to the entity class attributes are first defined.

[0079] Then, the sub-table attributes are parsed from the real-time data through reflection, and the sub-table attributes include the field attributes of the real-time data, the primary key attributes in the real-time data, the index attributes of the real-time data, and the json attributes of the real-time data. After the sub-table attributes are parsed, the above sub-table attributes are further abstracted into entity class attributes.

[0080] Automatically generate insert SQL and query SQL based on entity class attributes generated by sub-table attributes.

[0081] In other embodiments, the present solution discloses a device for splitting the database of a wireless data acquisition system into separate libraries and tables, including a business layer, a data access layer, an entity mapping class, and a database connected in sequence. The device implements a method for batch saving of data uploaded by an IoT device as described in any other embodiment.

[0082] In other embodiments, the present solution discloses a storage medium, which includes a processor and a memory, the memory storing a program for implementing a method for batch saving of uploaded data by an IoT device as described in any of the above embodiments, and the processor runs the program on the memory.

[0083] These modifications or improvements made on the basis of the present invention without departing from the spirit of the present invention all fall within the scope of protection required by the present invention.

Claims

1. A method for batch storage of data uploaded by IoT devices, characterized in that: include: Encapsulate multiple tasks together into a batch saving interface, and annotate the entity class of the batch saving interface. The entity annotation includes defining the entity class, defining the entity class attributes and attribute annotations, and obtaining the mapping between data and sub-table attributes. A cache mapping is established in memory according to the entity annotation, and the data table is encapsulated as a transaction interface according to the batch save interface. The database is read and written in the transaction interface. A first-level cache mapping is established in memory, and the entity's batch save interface and the data table are encapsulated to obtain a dedicated transaction interface for each data table, so that the data table can complete the upload, reading and writing of the sub-table at the transaction interface. The properties and index information of the independent data table or cache record sub-table are set, the data table is sub-tableed according to the properties and index information of the independent data table or cache record sub-table, and the sub-tables are mapped and stored.

2. A method for batch storage of data uploaded by IoT devices according to claim 1, characterized in that: After the entity annotation is performed, a specific field is marked according to an annotation, a mapping relationship is established for the field type of the specific field, and a sub-table attribute is obtained.

3. The method for batch storage of data uploaded by IoT devices according to claim 2, characterized in that: The establishment of a mapping relationship for the field type of a specific field includes determining the field mapping relationship for the data table by enumeration; and automatically generating insert and query statements after obtaining the attributes of the sub-table.

4. A method for batch storage of data uploaded by an Internet of Things device according to claim 2 or 3, characterized in that: The batch saving interface includes an independent saving thread and a data queue. The saving thread monitors the data queue and executes batch writing into the database.

5. The method for batch storage of data uploaded by IoT devices according to claim 4 is characterized in that: In the batch saving interface, the target entity class object is first determined, and then the sub-table attributes of the entity class object are read; It is determined whether to save the data in the current data table or in a new data table, and finally a data table saving SQL is generated according to the mapping relationship. The current data table refers to a data table that is not full.

6. A method for batch storage of data uploaded by IoT devices according to claim 5, characterized in that: After the data table is generated and SQL is saved, the data access layer is called to execute the data saving operation.

7. A method for batch storage of data uploaded by an Internet of Things device according to claim 1, 2 or 3, characterized in that: When performing batch saving, first read the data table properties to obtain the current data table properties and structure, and then generate real-time database insert statements.

8. The method for batch storage of data uploaded by IoT devices according to claim 5, characterized in that: This includes saving data in the current data table or in a new data table, and saving data in succession when the number to be saved does not exceed the storable value of the current data table; When the amount of data to be saved exceeds the current data table, the data that does not exceed the storable value is saved to the current data table. When the amount of data to be saved exceeds the current data table, the data that exceeds the storable value is saved to the newly created data table.

9. The method for batch storage of data uploaded by IoT devices according to claim 7, characterized in that: This includes establishing a real-time rolling data queue in a batch saving interface, pushing data into the head of the data queue in real time, and reading data from the tail of the data queue in real time.

10. A method for batch storage of data uploaded by IoT devices according to claim 9, characterized in that: It includes reading the tail of the data queue in real time, writing the data into the database, and updating the data table after the data is written into the database.