Data storage method, device, storage medium and electronic device

By determining the attribute update frequency of IoT devices and processing the data, only the changing data is stored, which solves the problem of repetitive data storage in IoT devices, achieving savings in storage space and improved data storage efficiency.

CN116049278BActive Publication Date: 2026-04-17HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD
Filing Date
2022-12-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

There is a lot of duplicate data in the data reported by sensors in IoT devices, which leads to a waste of storage space.

Method used

By acquiring the operating data of the target device, the data update frequency of each attribute is determined, and the data is processed according to the attribute type, storing only the changed data and deleting the unchanged data.

Benefits of technology

It reduces redundant data storage, saves storage space, and improves data storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049278B_ABST
    Figure CN116049278B_ABST
Patent Text Reader

Abstract

This application discloses a data storage method, apparatus, storage medium, and electronic device, relating to the field of smart home technology. The data storage method includes: acquiring operating data of a target device, wherein the operating data includes data corresponding to N attributes of the target device, where N is a natural number greater than or equal to 1; determining the attribute type of each attribute, wherein the attribute type is used to indicate the update frequency of the attribute data; processing the data corresponding to the N attributes according to the attribute type of each attribute to obtain target data; and storing the target data in a database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a data storage method, apparatus, storage medium, and electronic device. Background Technology

[0002] IoT devices typically have multiple sensors. When a sensor detects a change in the device's attribute values, it reports the latest data to the cloud. When data from multiple sensors is stored in the same JSON map, a large amount of duplicate data occurs. For example, if an air conditioner's temperature accuracy is 0.1℃, and only the temperature changes within 7 seconds while other data remains unchanged, each reported data point would contain all attributes. Since these attributes are stored in a single JSON map, there is significant data duplication, wasting disk space.

[0003] In existing technologies, devices define data with different update frequencies or different business characteristics into different categories and use different interfaces for reporting. However, using different interfaces leads to an increased number of interfaces, requires separate attribute configuration for each interface, and necessitates re-adaptation of interfaces for different devices. Summary of the Invention

[0004] This invention provides a data storage method, apparatus, storage medium, and electronic device to at least solve the problem of storing duplicate data and wasting storage space in related technologies.

[0005] According to an embodiment of the present invention, a data storage method is provided, comprising: acquiring operating data of a target device, wherein the operating data includes data corresponding to N attributes of the target device, wherein N is a natural number greater than or equal to 1; determining the attribute type of each attribute, wherein the attribute type is used to represent the update frequency of the data of the attribute; processing the data corresponding to the N attributes according to the attribute type of each attribute to obtain target data; and storing the target data in a database.

[0006] According to another embodiment of the present invention, a data storage device is provided, comprising: a first acquisition module, configured to acquire operating data of a target device, wherein the operating data includes data corresponding to N attributes of the target device, wherein N is a natural number greater than or equal to 1; a first determination module, configured to determine the attribute type of each of the aforementioned attributes, wherein the attribute type is used to represent the update frequency of the data of the aforementioned attribute; a first processing module, configured to process the data corresponding to the N aforementioned attributes according to the attribute type of each of the aforementioned attributes to obtain target data; and a first storage module, configured to store the target data in a database.

[0007] In an exemplary embodiment, the first processing module includes: a first processing unit, configured to determine the first data and the second data as target data when the first data of the first attribute type at a first time point is different from the second data at a second time point, wherein the first time point and the second time point are adjacent time points, and the first time point is after the second time point; a second processing unit, configured to delete the first data and determine the second data as target data when the first data and the second data are the same; a third processing unit, configured to determine the third data and the fourth data as target data when the third data of the second attribute type at the first time point is different from the fourth data at the second time point, wherein the third data is stored in association with the first data, and the fourth data is stored in association with the second data; a fourth processing unit, configured to delete the third data and determine the fourth data as target data when the third data of the second attribute type at the first time point is the same as the fourth data at the second time point, wherein the fourth data is stored in association with the second data; wherein the update frequency of the data of the first attribute type is greater than the update frequency of the data of the second attribute type.

[0008] In one exemplary embodiment, the apparatus further includes: a second acquisition module, configured to acquire historical operating data of the target device within a preset time period before determining the data update frequency of each of the above attributes and determining the attribute type of each of the above attributes, wherein the historical operating data includes multiple historical time information and historical data of M of the above attributes corresponding to the multiple historical time information; a second determination module, configured to determine the attributes in the historical data of the M of the above attributes whose change frequency is greater than the first preset threshold as a first attribute type; and a third determination module, configured to determine the attributes in the historical data of the M of the above attributes whose change frequency is less than or equal to the first preset threshold as a second attribute type.

[0009] In one exemplary embodiment, the first acquisition module includes one of the following: a first acquisition unit, configured to acquire the operating data sent by the target device at a preset time interval; and a second acquisition unit, configured to acquire the operating data sent by the target device when the operating data of the target device changes.

[0010] In one exemplary embodiment, the apparatus further includes: a first receiving module, configured to receive a first data query instruction after storing the target data in a database, wherein the first query instruction is configured to query first operating data of the target device occurring at a first time point corresponding to a first attribute; a first searching module, configured to search for a first adjacent time point of the first time point in the database when it is determined that the database does not include the first operating data, wherein the first adjacent time point is earlier than the first time point; and a fourth determining module, configured to determine the data corresponding to the first adjacent time point as the second operating data, wherein the data corresponding to the first adjacent time point has the same attribute as the first operating data.

[0011] In one exemplary embodiment, the apparatus further includes: a second receiving module, configured to receive a second data query instruction after storing the target data in a database, wherein the second query instruction is configured to query second operating data of the target device occurring at a second time point corresponding to a second attribute; a second searching module, configured to search for the time interval in the database where the second time point is located if it is determined that the database does not include the second operating data; and a fifth determining module, configured to determine the data corresponding to a third time point within the time interval as the second operating data, wherein the second operating data has the same attribute as the data corresponding to the third time point, the third time point is earlier than the second time point, and all other data with the same attribute as the second operating data at other times between the second time point and the third time point are empty.

[0012] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when it is run.

[0013] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0014] This invention obtains operational data of a target device, including data corresponding to N attributes of the target device, where N is a natural number greater than or equal to 1; determines the attribute type of each attribute, where the attribute type indicates the update frequency of the attribute data; processes the data corresponding to the N attributes according to the attribute type of each attribute to obtain target data; and stores the target data in a database. In this method, processing the data according to the update frequency of the target device attributes reduces the storage of duplicate data in the database, thereby reducing storage space. Therefore, it solves the problem of storing duplicate data and wasting storage space in related technologies. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the hardware environment for a data storage method according to an embodiment of this application;

[0018] Figure 2 This is a flowchart of a data storage method according to an embodiment of the present invention;

[0019] Figure 3 This is information reported by the device according to an embodiment of the present invention;

[0020] Figure 4 This is an algorithm for reporting data in the related technology according to embodiments of the present invention;

[0021] Figure 5 This refers to the data after processing redundancy according to an embodiment of the present invention;

[0022] Figure 6 This is an algorithm for reporting data according to an embodiment of the present invention;

[0023] Figure 7 This is an overall schematic diagram of frequency division according to an embodiment of the present invention;

[0024] Figure 8 This is a schematic diagram of attribute frequency division according to an embodiment of the present invention;

[0025] Figure 9 This is a structural block diagram of a data storage device according to an embodiment of the present invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] According to one aspect of the embodiments of this application, a data storage method is provided. This data storage method is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligencehouse ecosystems. Optionally, in this embodiment, the above-mentioned data storage method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0029] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0030] This embodiment provides a data storage method. Figure 2 This is a flowchart of a data storage method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0031] Step S202: Obtain the operating data of the target device, wherein the operating data includes data corresponding to N attributes of the target device, where N is a natural number greater than or equal to 1;

[0032] Step S204: Determine the attribute type for each attribute, where the attribute type indicates the update frequency of the attribute's data;

[0033] Step S206: Process the data corresponding to the N attributes according to the attribute type of each attribute to obtain the target data;

[0034] Step S208: Store the target data in the database.

[0035] In this embodiment, the value of N can be flexibly set based on the actual application scenario or image requirements. For example, the attributes of an air conditioner include temperature, fan speed, and spin speed. The attributes of a washing machine include temperature, water volume, and mode.

[0036] Optionally, the target device can be various home appliances, and the operating data can be data sensed by sensors during the operation of the home appliance, or other attribute data of the home appliance, such as temperature data obtained by temperature sensor, wind speed data obtained by wind speed sensor, cooling mode data, heating data, etc. of air conditioner during operation.

[0037] Optionally, the update frequency includes the frequency with which the attribute changes within a preset time period. The attribute type includes multiple levels of update frequency. For example, if the temperature of an air conditioner changes frequently, the temperature attribute is defined as a high-frequency attribute; if the fan speed setting remains relatively constant, the fan speed setting attribute is defined as a low-frequency attribute.

[0038] Optionally, data processing includes deleting data that is repeated at consecutive time points, keeping only one data point, and retaining constantly changing data.

[0039] Optionally, all the target data to be retained can be uploaded to the database for storage through a single interface, without needing to change the number of interfaces.

[0040] The entity performing the above steps can be a server or a specific processor set in the server, or a processor or processing device set up relatively independently of the server, but is not limited to these.

[0041] Through the above steps, the operating data of the target device is obtained, including data corresponding to N attributes of the target device, where N is a natural number greater than or equal to 1; the attribute type of each attribute is determined, where the attribute type indicates the update frequency of the attribute data; the data corresponding to the N attributes is processed according to the attribute type of each attribute to obtain the target data; and the target data is stored in a database. In this method, processing the data according to the update frequency of the target device attributes can reduce the storage of duplicate data in the database, thereby reducing storage space. Therefore, this solves the problem of storing duplicate data and wasting storage space in related technologies.

[0042] In one exemplary embodiment, the data corresponding to N attributes are processed according to the attribute type of each attribute to obtain target data, including:

[0043] S1, if the first data of the first attribute type at the first time point is different from the second data at the second time point, the first data and the second data are determined as the target data, wherein the first time point and the second time point are adjacent time points, and the first time point is after the second time point;

[0044] S2, if the first data and the second data are the same, delete the first data and determine the second data as the target data;

[0045] S3, if the third data of the second attribute type at the first time point is different from the fourth data at the second time point, the third data and the fourth data are determined as target data, wherein the third data is stored in association with the first data and the fourth data is stored in association with the second data.

[0046] S4, if the third data of the second attribute type at the first time point is the same as the fourth data at the second time point, delete the third data and determine the fourth data as the target data, wherein the fourth data is stored in association with the second data;

[0047] Among them, the data update frequency of the first attribute type is greater than that of the second attribute type.

[0048] Optionally, the first attribute type can be an attribute with a relatively high update frequency, such as the ambient temperature attribute; the second attribute type can be an attribute with a relatively low update frequency, such as the windshield attribute. Figure 3 The image shows the attribute information of the air conditioner over a period of time. Ambient temperature is a high-frequency attribute, while the other attributes are low-frequency attributes. Figure 4 It is storage Figure 3 The code for the attribute data in the Json_map. The air conditioner sends all the data, including a large amount of duplicate data; storing all of it in the same Json_map would waste a lot of storage space. For example... Figure 5 As shown, the ambient temperature attribute updates data relatively quickly, so all data that has changed is placed in one column. Other attributes update data more slowly, so each attribute is placed in the same column, and data with the same update time is deleted, keeping only the most recent record. If a change occurs, it is then stored in the changed data. This significantly reduces storage space. One cell represents one storage space, according to... Figure 3 Storage will consume 40 storage units, according to Figure 5 Storage consumes only 11 units of storage space (in actual production, data can be compressed to around 70GB). Figure 6 It is storage Figure 4 The code for the attribute data in the [reference]. Optionally, the time point in this embodiment is the moment at the smallest division. For example, such as... Figure 3 As shown, the time can be 00:01:00 or 00:01:01, then 00:01:00 and 00:01:01 are adjacent time points. This embodiment deletes identical data and associates the remaining data, which not only allows for quick retrieval of attribute data but also saves storage space.

[0049] In one exemplary embodiment, before determining the data update frequency of each attribute and the attribute type of each attribute, the method further includes:

[0050] S1, Obtain historical operating data of the target device within a preset time period, wherein the historical operating data includes multiple historical time information and historical data of M attributes corresponding to the multiple historical time information;

[0051] S2, determine the attribute with a change frequency greater than the first preset threshold in the historical data of M attributes as the first attribute type;

[0052] S3, determine the attributes in the historical data of M attributes whose change frequency is less than or equal to the first preset threshold as the second attribute type.

[0053] Optionally, historical execution data can be data already stored in the database or cached data. Historical execution data can be, for example... Figure 3 The original data shown. Figure 7 As shown, devices report various types of data (e.g., attribute data, alarm data, event data). The service cluster retains the original data, and a classifier categorizes the original data into high-frequency attribute data and low-frequency attribute data. Redundant data is removed from the big data cluster. Figure 8 The diagram illustrates the classification process of the classifier. By statistically analyzing the average update frequency of a single attribute and comparing it to a threshold, it categorizes data into high-frequency and low-frequency categories. This embodiment achieves rapid classification of attribute types by classifying attributes from historical operational data.

[0054] In one exemplary embodiment, acquiring operational data of the target device includes one of the following:

[0055] S1, acquire the operation data sent by the target device according to the preset time interval;

[0056] S2: When the operating data of the target device changes, acquire the operating data sent by the target device.

[0057] Optionally, the preset time interval can be 5 minutes, for example, the refrigerator reports complete attribute data every 5 minutes. Alternatively, it can report as soon as attribute data changes, for example, reporting completed attribute data when the refrigerator's temperature changes. It can also combine time intervals and real-time reporting; for example, if the refrigerator door is opened after the refrigerator reports every 5 minutes (i.e., the refrigerator door attribute has changed), the changed refrigerator door attribute data can be reported again, even though data has already been reported. It should be noted that the device reports complete attribute data each time, i.e., all attribute data. This example effectively saves storage space by only acquiring data that has changed during operation and not acquiring data that has not changed.

[0058] In one exemplary embodiment, after storing the target data in a database, the method further includes:

[0059] S1, receive a first query instruction for data, wherein the first query instruction is used to query the first running data of the target device corresponding to the first attribute at a first time point;

[0060] S2, if it is determined that the database does not include the first running data, search the database for the first adjacent time point of the first time point, wherein the first adjacent time point is earlier than the first time point;

[0061] S3, determine the data corresponding to the first adjacent time point as the second running data, wherein the data corresponding to the first adjacent time point has the same attributes as the first running data.

[0062] Optionally, the first query command can be device-triggered, for example, querying the refrigerator temperature at 10:10 via a mobile phone. If there is no data in the storage space corresponding to 10:00 in the database, the temperature read at 9:59 is determined as the temperature at 10:00. If there is data in the storage space corresponding to 10:00 in the database, the temperature at 10:00 is read. This embodiment can quickly find the device's operating data by searching data at adjacent time points.

[0063] In one exemplary embodiment, after storing the target data in a database, the method further includes:

[0064] S1, receive a second data query instruction, wherein the second query instruction is used to query the second operating data of the target device corresponding to the second attribute that occurred at the second time point;

[0065] S2, if it is determined that the database does not contain the second running data, search the database for the time interval where the second time point is located;

[0066] S3, the data corresponding to the third time point within the time interval is determined as the second running data. The second running data has the same attributes as the data corresponding to the third time point. The third time point is earlier than the second time point. All other data with the same attributes as the second running data between the second and third time points are empty.

[0067] Optionally, the second query command can be device-triggered, for example, sending a query via mobile phone to check the refrigerator temperature at 10:10. For instance, if there is no data in the storage space corresponding to 10:00 in the database, a data range containing data prior to 10:00 is determined, and the temperature data closest to 10:00 is selected from this range as the temperature data for 10:00. This embodiment can quickly determine the device's operating data by searching data at adjacent time points.

[0068] In summary, this embodiment splits semi-structured data in JSON format into frequently updated and infrequently updated attributes based on data characteristics. Only changed data is retained in the database; unchanged data is not retained. Because the amount of stored data is reduced, the amount of data involved in computation is also reduced, making statistical analysis of this data more efficient. Furthermore, the reduced storage volume results in less disk space usage, extending the data lifecycle; the same data can be retained for a longer period.

[0069] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0070] This embodiment also provides a data storage device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0071] Figure 9 This is a structural block diagram of a data storage device according to an embodiment of the present invention, such as... Figure 9 As shown, the device includes:

[0072] The first acquisition module 92 is used to acquire the operating data of the target device, wherein the operating data includes data corresponding to N attributes of the target device, and N is a natural number greater than or equal to 1.

[0073] The first determining module 94 is used to determine the attribute type of each of the above attributes, wherein the attribute type is used to indicate the update frequency of the data of the above attributes;

[0074] The first processing module 96 is used to process the data corresponding to the N attributes according to the attribute type of each of the above attributes to obtain the target data;

[0075] The first storage module 98 is used to store the aforementioned target data in the database.

[0076] In one exemplary embodiment, the first processing module described above includes:

[0077] The first processing unit is configured to determine the first data and the second data as the target data when the first data at the first time point and the second data at the second time point are different for the data of the first attribute type, wherein the first time point and the second time point are adjacent time points, and the first time point is after the second time point.

[0078] The second processing unit is configured to delete the first data and determine the second data as the target data when the first data and the second data are the same.

[0079] The third processing unit is configured to determine the third data and the fourth data as the target data when the third data at the first time point of the second attribute type is different from the fourth data at the second time point, wherein the third data is stored in association with the first data and the fourth data is stored in association with the second data.

[0080] The fourth processing unit is configured to delete the third data and determine the fourth data as the target data when the third data at the first time point is the same as the fourth data at the second time point, wherein the fourth data is stored in association with the second data.

[0081] Among them, the data update frequency of the first attribute type is greater than that of the second attribute type.

[0082] In one exemplary embodiment, the above-described apparatus further includes:

[0083] The second acquisition module is used to determine the data update frequency of each of the above attributes and, before determining the attribute type of each of the above attributes, acquire the historical operating data of the target device within a preset time period, wherein the historical operating data includes multiple historical time information and M historical data of the above attributes corresponding to the multiple historical time information.

[0084] The second determining module is used to determine the attribute whose change frequency is greater than the first preset threshold in the historical data of the M attributes as the first attribute type.

[0085] The third determining module is used to determine the attributes whose change frequency is less than or equal to the first preset threshold in the historical data of the M attributes as the second attribute type.

[0086] In one exemplary embodiment, the first acquisition module described above includes one of the following:

[0087] The first acquisition unit is used to acquire the operation data sent by the target device at preset time intervals;

[0088] The second acquisition unit is used to acquire the operating data sent by the target device when the operating data of the target device changes.

[0089] In one exemplary embodiment, the above-described apparatus further includes:

[0090] The first receiving module is used to receive a first data query instruction after storing the target data in the database, wherein the first query instruction is used to query the first operating data of the target device corresponding to the first attribute at a first time point;

[0091] The first search module is used to search for a first adjacent time point in the database when it is determined that the first running data is not included in the database, wherein the first adjacent time point is earlier than the first time point.

[0092] The fourth determining module is used to determine the data corresponding to the first adjacent time point as the second running data, wherein the data corresponding to the first adjacent time point has the same attributes as the first running data.

[0093] In one exemplary embodiment, the above-described apparatus further includes:

[0094] The second receiving module is used to receive a second data query instruction after storing the target data in the database, wherein the second query instruction is used to query the second operating data of the target device corresponding to the second attribute at a second time point;

[0095] The second search module is used to search for the time interval where the second time point is located in the database when it is determined that the database does not contain the second running data.

[0096] The fifth determining module is used to determine the data corresponding to the third time point within the above time interval as the second running data, wherein the second running data has the same attributes as the data corresponding to the third time point, the third time point is earlier than the second time point, and all other data with the same attributes as the second running data between the second time point and the third time point are empty.

[0097] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A data storage method, characterized by, include: Obtain the operating data of the target device, wherein the operating data includes data corresponding to N attributes of the target device, where N is a natural number greater than or equal to 1; Determine the attribute type for each attribute, wherein the attribute type is used to represent the update frequency of the attribute's data, and the update frequency includes the frequency at which the data changes within a preset time period; The data corresponding to the N attributes are processed according to the attribute type of each attribute to obtain the target data; The target data is stored in the database; Specifically, the data corresponding to the N attributes are processed according to the attribute type of each attribute to obtain the target data, including: If the first data of the first attribute type at the first time point is different from the second data at the second time point, the first data and the second data are determined as the target data, wherein the first time point and the second time point are adjacent time points, and the first time point is after the second time point; If the first data and the second data are the same, delete the first data and determine the second data as the target data; If the third data of the second attribute type is different from the fourth data at the first time point compared to the fourth data at the second time point, the third data and the fourth data are determined as the target data, wherein the third data is stored in association with the first data and the fourth data is stored in association with the second data; If the third data of the second attribute type is the same as the fourth data at the second time point in the first time point, the third data is deleted and the fourth data is determined as the target data, wherein the fourth data is stored in association with the second data; Wherein, the data update frequency of the first attribute type is greater than the data update frequency of the second attribute type, and the associated storage refers to storing at least two data to be associated in the same storage space at the same point in time.

2. The method of claim 1, wherein, Before determining the data update frequency of each attribute and the attribute type of each attribute, the method further includes: Obtain historical operating data of the target device within a preset time period, wherein the historical operating data includes multiple historical time information and historical data of M attributes corresponding to the multiple historical time information; The attribute whose change frequency is greater than a first preset threshold in the historical data of the M attributes is determined as the first attribute type; The attributes whose change frequency is less than or equal to the first preset threshold in the historical data of the M attributes are determined as the second attribute type.

3. The method according to claim 1, characterized in that, Obtain operational data from the target device, including one of the following: The operating data sent by the target device is acquired at preset time intervals; If the operating data of the target device changes, the operating data sent by the target device is acquired.

4. The method of claim 1, wherein, After storing the target data in the database, the method further includes: Receive a first query instruction for data, wherein the first query instruction is used to query the first operating data of the target device corresponding to the first attribute at a first time point; If it is determined that the database does not contain the first running data, the database is searched for a first adjacent time point of the first time point, wherein the first adjacent time point is earlier than the first time point; The data corresponding to the first adjacent time point is determined as the second running data, wherein the data corresponding to the first adjacent time point has the same attributes as the first running data.

5. The method of claim 1, wherein, After storing the target data in the database, the method further includes: Receive a second query instruction, wherein the second query instruction is used to query the second operating data of the target device that occurred at a second time point and corresponds to the second attribute; If it is determined that the database does not contain the second running data, the time interval in which the second time point is located is searched in the database; The data corresponding to the third time point within the time interval is determined as the second running data. The second running data has the same attributes as the data corresponding to the third time point. The third time point is earlier than the second time point, and the data with the same attributes as the second running data at other times between the second time point and the third time point are all empty.

6. A data storage device, characterized by include: The first acquisition module is used to acquire the operating data of the target device, wherein the operating data includes data corresponding to N attributes of the target device, and N is a natural number greater than or equal to 1; The first determining module is used to determine the attribute type of each attribute, wherein the attribute type is used to represent the update frequency of the data of the attribute, and the update frequency includes the frequency of data changes within a preset time period; The first processing module is used to process the data corresponding to the N attributes according to the attribute type of each attribute to obtain the target data; The first storage module is used to store the target data in the database; The first processing module includes: a first processing unit, configured to determine the first data and the second data as the target data when the first data of the first attribute type at a first time point is different from the second data at a second time point, wherein the first time point and the second time point are adjacent time points, and the first time point is after the second time point; a second processing unit, configured to delete the first data and determine the second data as the target data when the first data and the second data are the same; a third processing unit, configured to determine the third data and the fourth data as the target data when the third data of the second attribute type at the first time point is different from the fourth data at the second time point, wherein the third data is associated with the first data and the fourth data is associated with the second data; and a fourth processing unit, configured to delete the third data and determine the fourth data as the target data when the third data of the second attribute type at the first time point is the same as the fourth data at the second time point, wherein the fourth data is associated with the second data, wherein the update frequency of the first attribute type data is greater than the update frequency of the second attribute type data, and the associated storage refers to storing at least two data to be associated in the same storage space at the same time point.

7. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 5. 8.An electronic device comprising a memory and a processor, the electronic device comprising: The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 5 through the computer program.

Citation Information

Patent Citations

  • Sensor running control method and apparatus, computer device, and storage medium

    WO2021098773A1