Data storage method and device, storage medium and electronic device

By filtering and reducing redundancy in the equipment's operating data, the problem of high server storage pressure was solved, achieving efficient data storage and reducing the consumption of computing resources.

CN115878030BActive Publication Date: 2025-12-30HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211482545.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2025-12-30
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

The server directly stores all status data reported by the device, resulting in significant data storage pressure, and existing technologies have not been able to effectively solve this problem.

Method used

By acquiring the operating data of the target device within a preset time period, the required data is filtered out, and redundancy reduction is performed based on the duration of different attribute values ​​of each status attribute to obtain the data to be stored, which is then finally stored on the server.

Benefits of technology

It reduces the data storage pressure on the server, improves data storage efficiency, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878030B_ABST
    Figure CN115878030B_ABST
Patent Text Reader

Abstract

The application discloses a data storage method and device, a storage medium and an electronic device, relates to the technical field of smart homes, and comprises the following steps: acquiring running data of a target device in a preset time period, wherein the running data comprises a plurality of pieces of working state data, the plurality of pieces of working state data correspond to a plurality of time points included in the preset time period in a one-to-one manner, and any working state data of the plurality of pieces of working state data comprises attribute values of different state attributes reported at a corresponding time point; filtering demand data from the running data, and performing redundancy reduction processing on the demand data according to the duration corresponding to different attribute values of each state attribute in the demand data, to obtain to-be-stored data; and storing the to-be-stored data to a server. By adopting the technical scheme, the problem that the server directly stores all the state data reported by the device and causes great data storage pressure of the server is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the advent of smart devices, more and more smart devices are appearing in users' homes. Typically, smart devices report their status data attributes to cloud servers. However, the data reported by devices has an escalating nature, and the frequency of data reporting by devices is also high (commonly at the millisecond or second level). That is, devices may report thousands to tens of thousands of data points to the server every day. After receiving this data, the server will store it in the order it was reported for subsequent data analysis. However, storing this data requires a lot of storage space, which leads to a large data storage pressure on the server.

[0003] There is currently no effective solution to the problem that servers directly store all status data reported by devices, resulting in high data storage pressure on the servers.

[0004] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention

[0005] This invention provides a data storage method and apparatus, storage medium and electronic device to at least solve the problem of excessive data storage pressure on servers caused by servers directly storing all status data reported by devices.

[0006] According to one aspect of the present invention, a data storage method is provided, comprising: acquiring operational data of a target device within a preset time period, wherein the operational data includes multiple operational status data, the multiple operational status data corresponding one-to-one with multiple times included in the preset time period; each operational status data includes attribute values ​​of different status attributes reported at the corresponding times; filtering demand data from the operational data, and performing redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each status attribute in the demand data, to obtain data to be stored; and storing the data to be stored in a server.

[0007] In an exemplary embodiment, filtering demand data from the operational data includes: obtaining data storage requirements corresponding to the target device, wherein the data storage requirements include at least one of the following: a first requirement for indicating attribute values ​​to be stored, and a second requirement for indicating state data to be stored; and filtering demand data from the operational data according to the data storage requirements.

[0008] In an exemplary embodiment, when the data storage requirement includes the first requirement, obtaining the data storage requirement corresponding to the target device includes: determining a first state attribute; and determining a second state attribute and a target attribute value corresponding to the second state attribute, wherein the state attribute includes: the first state attribute and the second state attribute; determining the first requirement based on the first state attribute and the target attribute value corresponding to the second state attribute; wherein the first requirement includes: storing all attribute values ​​of the first state attribute and storing only the target attribute value among a plurality of attribute values ​​of the second state attribute.

[0009] In an exemplary embodiment, when the data storage requirement includes the second requirement, obtaining the data storage requirement corresponding to the target device includes: obtaining the target working state corresponding to the target device, and determining the second requirement based on the target working state, wherein the second requirement includes: storing all working state data of the target device in the target working state.

[0010] In an exemplary embodiment, the redundancy reduction process of the demand data is performed according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data to obtain the data to be stored. This includes: determining an attribute value in the demand data that is equal to each attribute value in the attribute value set corresponding to each state attribute, and deleting the remaining multiple attribute values ​​that are equal to each attribute value within the duration corresponding to each attribute value in the demand data from the demand data, wherein the different attribute values ​​of each state attribute constitute the attribute value set; adding corresponding target data to the demand data for an attribute value that is equal to each attribute value to obtain the data to be stored, wherein the target data includes: the start time and end time of the duration corresponding to each attribute value.

[0011] In an exemplary embodiment, before performing redundancy reduction processing on the demand data according to the duration corresponding to different attribute values ​​of each state attribute in the demand data to obtain the data to be stored, the method further includes: determining an attribute value set corresponding to each state attribute according to the demand data; wherein, the demand data includes attribute values ​​reported by each state attribute at different times, and the attribute values ​​in the attribute value set are different; and determining the duration of each attribute value according to multiple reporting times corresponding to each attribute value in the attribute value set.

[0012] In an exemplary embodiment, determining the duration of each attribute value based on multiple reporting times corresponding to each attribute value in the attribute value set includes: classifying the multiple reporting times corresponding to each attribute value to obtain a time period set, wherein the multiple reporting times included in each time period set are consecutive; determining the difference between the first reporting time and the second reporting time in each time period as the duration of each time period, wherein the duration of each attribute value includes the duration of each time period, wherein the first reporting time is the latest time in each time period, and the second reporting time is the earliest time in each time period.

[0013] According to another aspect of the present invention, a data storage device is also provided, comprising: an acquisition module, configured to acquire operating data of a target device within a preset time period, wherein the operating data includes multiple working status data, the multiple working status data corresponding one-to-one with multiple times included in the preset time period; each of the multiple working status data includes: attribute values ​​of different status attributes reported at the corresponding times; a processing module, configured to filter out demand data from the operating data, and perform redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each status attribute in the demand data, to obtain data to be stored; and a storage module, configured to store the data to be stored in a server.

[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described data storage method at runtime.

[0015] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the data storage method described above through the computer program.

[0016] This invention, upon obtaining the operating data of the target device, filters out the required data from the operating data, and performs redundancy reduction processing on the required data according to the duration corresponding to the different attribute values ​​of each status attribute in the required data. Finally, the data to be stored after redundancy reduction is stored in the server. This solves the problem that the server directly stores all the status data reported by the device, resulting in a large data storage pressure on the server, and achieves the technical effect of reducing the data storage pressure on the server. Attached Figure Description

[0017] 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.

[0018] 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.

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

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

[0021] Figure 3 It is an architecture diagram of data storage methods for related technologies;

[0022] Figure 4 This is an architecture diagram of a data storage method according to an embodiment of the present invention;

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

[0024] 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.

[0025] 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.

[0026] 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.

[0027] 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.

[0028] To address the aforementioned issues, this embodiment provides a data storage method, including but not limited to applications in servers. Figure 2 This is a flowchart of a data storage method according to an embodiment of the present invention, which includes the following steps:

[0029] Step S202: Obtain the operating data of the target device within a preset time period, wherein the operating data includes multiple working status data, and the multiple working status data corresponds one-to-one with multiple times included in the preset time period; each of the multiple working status data includes: attribute values ​​of different status attributes reported at the corresponding times.

[0030] It should be noted that the status attributes include, but are not limited to: power on / off attributes, temperature attributes, mode attributes, etc.; the attribute values ​​corresponding to the power on / off attributes include: on, off; the attribute values ​​corresponding to the temperature attributes include: specific temperature values ​​(e.g., 30℃, etc.); the attribute values ​​corresponding to the mode attributes include, but are not limited to: heating mode, etc.

[0031] It should be noted that if the format of the working status data reported by the target device to the server is fixed, that is, the multiple fields in the working status data have been predetermined to represent what status attributes, then the working status data can only include the attribute values ​​reported at the corresponding time for different status attributes. However, if the format of the working status data reported by the target device to the server is not fixed, then the working status data must also include status attributes.

[0032] For example, the target device described above can be the terminal device 102 described above.

[0033] Step S204: Filter out the demand data from the running data, and perform redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data, to obtain the data to be stored.

[0034] It's important to note that the operational data includes all operational status data of the target device within the target time period, and each operational status data entry includes the attribute values ​​of all status attributes of the target device. However, since the required status data and attribute values ​​differ for different devices and in different scenarios, to avoid storing unnecessary data, the required data can be filtered from the operational data. This reduces the data storage pressure on the server.

[0035] It should be noted that each status attribute has multiple different attribute values, and each attribute value has a corresponding duration. For example, taking the status attribute as on / off, the corresponding different attribute values ​​are: On and Off.

[0036] Step S206: Store the data to be stored in the server.

[0037] For example, the data to be stored is stored in the server's memory.

[0038] The above steps, after obtaining the operating data of the target device, filter out the required data from the operating data, and perform redundancy reduction processing on the required data according to the duration corresponding to the different attribute values ​​of each status attribute in the required data. Finally, the data to be stored after redundancy reduction is stored in the server. This solves the problem that the server directly stores all the status data reported by the device, resulting in a large data storage pressure on the server, and achieves the technical effect of reducing the data storage pressure on the server.

[0039] It should be noted that the above steps can be used to store data on different devices, meaning that the above method is a universal data storage method, which can unify data definitions and standards and reduce the difficulty of data quality management.

[0040] In an exemplary embodiment, the above-mentioned filtering of demand data from the operational data can be achieved through the following steps S11-S12:

[0041] Step S11: Obtain the data storage requirements corresponding to the target device, wherein the data storage requirements include at least one of the following: a first requirement for indicating attribute values ​​to be stored, and a second requirement for indicating state data to be stored;

[0042] It should be noted that the first requirement is used to indicate which status attribute values ​​are needed from the work status data, and which status attribute target values ​​are needed from the work status data; the second requirement is used to indicate which work status data are needed from the running data.

[0043] In an exemplary embodiment, when the data storage requirement includes the first requirement, obtaining the data storage requirement corresponding to the target device can be achieved by: determining a first state attribute; and determining a second state attribute and a target attribute value corresponding to the second state attribute, wherein the state attribute includes: the first state attribute and the second state attribute; determining the first requirement based on the target attribute value corresponding to the first state attribute and the second state attribute; wherein the first requirement includes: storing all attribute values ​​of the first state attribute and storing only the target attribute value among multiple attribute values ​​of the second state attribute.

[0044] It should be noted that since each piece of work status data includes the attribute values ​​of all status attributes of the target device, but some attribute values ​​will not be used in subsequent data calculations, the work status data can be filtered according to the first requirement to avoid excessive data storage pressure on the server caused by storing redundant status attribute values.

[0045] Furthermore, since the status attributes reported by different devices are inconsistent, the attribute values ​​of the required stored status attributes also differ. Therefore, the runtime data can be filtered and selected based on the primary requirement. That is, for different devices, only the primary requirement needs to be determined, and the calculation logic code for filtering and redundancy reduction does not need to be changed. It should be noted that the primary requirement can be reflected through a configuration table.

[0046] In an exemplary embodiment, when the data storage requirement includes the second requirement, obtaining the data storage requirement corresponding to the target device can be achieved by: obtaining the target working state corresponding to the target device, and determining the second requirement based on the target working state, wherein the second requirement includes: storing all working state data of the target device in the target working state.

[0047] It should be noted that in some cases, only the operating status data of the target device in the target working state (e.g., power-on state, heating state (the target device has a heating function)) may be needed. In this case, the operating data can be filtered through the second requirement, avoiding excessive data storage pressure on the server caused by storing unnecessary operating status data.

[0048] Step S12: Filter the required data from the running data according to the data storage requirements.

[0049] In this embodiment, the required data is filtered out from the running data based on data storage needs, thus avoiding the storage of unnecessary data and preventing excessive data storage pressure on the server.

[0050] Optionally, before performing redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data to obtain the data to be stored, the following steps S21-S22 are also included:

[0051] Step S21: Determine the set of attribute values ​​corresponding to each state attribute based on the demand data; wherein, the demand data includes the attribute values ​​reported by each state attribute at different times, and the attribute values ​​in the set of attribute values ​​are different;

[0052] It should be noted that if a power on / off attribute exists among multiple status attributes, the corresponding attribute value set is {on, off}; if a temperature attribute exists among multiple status attributes, the corresponding attribute value set includes different temperatures reported in the temperature attribute of the demand data (such as {10℃, 15℃, 17℃, 20℃...}).

[0053] Step S22: Determine the duration of each attribute value based on the multiple reporting times corresponding to each attribute value in the attribute value set.

[0054] In an exemplary embodiment, step S22 above can be implemented as follows: classify the multiple reporting times corresponding to each attribute value to obtain a time period set, wherein the multiple reporting times included in each time period set are consecutive; determine the difference between the first reporting time and the second reporting time in each time period as the duration of each time period, wherein the duration of each attribute includes the duration of each time period, wherein the first reporting time is the latest time in each time period, and the second reporting time is the earliest time in each time period.

[0055] To better understand, let's take the power on / off attribute as an example, with the corresponding attribute value set being {On, Off}. Between 10:01 and 10:10, the multiple reporting times corresponding to "Off" are "10:01, 10:02, 10:03, 10:04, 10:08, 10:09, 10:10", and the multiple reporting times corresponding to "On" are "10:05, 10:06, 10:07". Furthermore, we can categorize the multiple reporting times corresponding to the attribute values ​​"Off" and "On" to determine... The time period set corresponding to "Closed" is {[10:01, 10:02, 10:03, 10:04], [10:08, 10:09, 10:10]}, and the time period set corresponding to "Opened" is {[10:05, 10:06, 10:07]}. Therefore, the duration of "Closed" is determined to be {4 minutes: from 10:01 to 10:04, 3 minutes: from 10:08 to 10:10}, and the duration of "Opened" is determined to be {3 minutes: from 10:05 to 10:07}.

[0056] By using the above method, the duration corresponding to different attribute values ​​of each state attribute in the demand data can be accurately determined.

[0057] In an exemplary embodiment, the redundancy reduction process is performed on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data to obtain the data to be stored. This can be achieved through the following steps S31-S32:

[0058] Step S31: In the demand data, determine an attribute value that is equal to each attribute value in the attribute value set corresponding to each state attribute, and delete the remaining multiple attribute values ​​that are equal to each attribute value within the duration corresponding to each attribute value in the demand data from the demand data, wherein the different attribute values ​​of each state attribute constitute the attribute value set;

[0059] Taking the power on / off status attribute as an example, assuming the power on / off attribute in the requirement data for 10:01-10:10 has the value [OFF, OFF, OFF, OFF, ON, ON, ON, OFF, OFF, OFF]. The set of attribute values ​​corresponding to the power on / off status attribute is [ON, OFF]. Therefore, in the requirement data, only one attribute value corresponding to the power on / off attribute needs to be retained that is equal to both "ON" and "OFF".

[0060] Step S32: Add corresponding target data to the requirement data for an attribute value that is equal to each attribute value, to obtain the data to be stored, wherein the target data includes: the start time and end time of the duration corresponding to each attribute value.

[0061] It should be noted that, taking the above example, the target data "10:05-10:07" needs to be added to the demand data for "On" and "10:01-10:04; 10:08-10:10" needs to be added to "Off". This method transforms the demand data from one-dimensional data into two-dimensional data with reporting durations, removing a large amount of redundant data with the same attribute values, thereby reducing the data storage pressure on the server.

[0062] Obviously, the embodiments described above are merely some embodiments of the present invention, and not all embodiments. To better understand the above method, the following description, in conjunction with embodiments, illustrates the process, but is not intended to limit the technical solutions of the embodiments of the present invention. Specifically:

[0063] In the early stages of a smart home appliance company's development, the amount of data requiring processing is relatively small due to the low penetration and usage rates of smart devices (equivalent to the aforementioned target devices). Furthermore, to quickly respond to market feedback, data development is often demand-driven, leading to numerous fragmented, siloed, and independent small data warehouses within the company. This results in redundant development of many systems, functions, and applications, and a waste of computing, storage, and human resources. However, as whole-house smart home appliance systems become increasingly prevalent, the interconnectivity and number of smart devices have increased dramatically. Along with the increase in hardware, the data reported by these devices has also exploded. Traditional data storage and modeling methods are no longer suitable for cost and quality control in data development.

[0064] Currently, the traditional method for statistically analyzing the status data reported by network devices involves collecting all reported status data, with each type of device being developed separately. This results in significant data and code redundancy. Taking the power-on / off status of a network device as an example, the power-on / off status is an enumeration of true and false values. For a kitchen appliance like a range hood, the daily status report volume is approximately several thousand. If a user turns the device on and off for all three meals a day, the power-on / off status field will be true for those three usage periods and false for the rest. In traditional data processing, all records contain and store thousands of data entries, a large portion of which are redundant values ​​representing status continuity. The traditional architecture for processing network device status reporting data is as follows: Figure 3 As shown, all detailed data reported by the network device is obtained. If there is a usage period requirement, all detailed data is filtered by using periodic data to obtain all detailed data within the usage period. All detailed data is stored for subsequent data calculation.

[0065] Furthermore, since each device forms a separate business line, this will result in too many business lines in the later stages of the company's development, consuming a significant amount of time and effort from data development personnel for maintenance and development. Moreover, because each business line is isolated, it is not conducive to unifying data definitions and standards, leading to a significant increase in manpower costs during later upgrades and iterations. In short, the existing device status reporting data model architecture has the following drawbacks:

[0066] 1) Since each type of network device is a business line, the business lines are naturally isolated from each other. Each business line has its own set of code, which not only generates code redundancy, but also increases the difficulty of unifying data standards and data interpretation, and increases the difficulty of data quality management.

[0067] 2) Since data storage retains all the data, there are a lot of redundant values ​​in this data, which will cause a lot of data storage pressure and consume a lot of computing resources.

[0068] 3) Since each data statistics logic for each type of network device is independent, a lot of time will be spent understanding the code when iterating and upgrading the requirements.

[0069] To address the aforementioned issues, this application provides a general data storage method that improves the efficiency of data development, consolidates data outputs, facilitates data quality management, reduces data storage pressure, standardizes data, reduces feedback time to market demands, and makes network device data services more competitive in the industry.

[0070] Based on the characteristics of device status reporting data, this application simplifies data storage while meeting data processing requirements. By abstracting and summarizing commonly used industrial calculation processes, configuring the variable parts, and normalizing reusable and unified calculation logic, a general data storage model for device reporting data is formed, reducing the difficulty of unifying data standards and reducing data quality management costs.

[0071] Specifically, Figure 4 The diagram illustrates the general model architecture of the data storage method in this application. This design meets the data statistical calculation needs of most network devices in current industrial applications. The technology used is HiveSQL. All network devices share a single set of computational processing logic code, and the differences and customization requirements between network devices are addressed by pluggable dimension tables (…). Figure 4 The field configuration attribute dimension table and period configuration dimension table are used to control and implement the configuration.

[0072] The main optimizations of this architecture are twofold. First, after storing all detailed data (equivalent to the aforementioned operational data), it adds filtering for required fields and removes a large amount of redundant data that has not undergone state changes. Second, it abstracts the computational processing logic of the network devices through two dimension tables (equivalent to the aforementioned data storage requirements), while also satisfying the issues of different network device attribute values ​​and different network device computational requirements.

[0073] It should be noted that the complete detailed data of a device includes all reported data of the device (equivalent to the aforementioned working status data). Devices include, but are not limited to, range hoods, stoves, ovens, and air conditioners. The reported data is in wide table format, meaning that at a given point in time, all device status attributes will be reported as a single data entry. To remove redundant status data and ensure the accuracy of device status, the data needs to be converted into a single value with a start reporting time, an end reporting time, and a reported value. This transforms one-dimensional data into two-dimensional data with a reporting duration. Within a given period, if reported values ​​are identical, only one record needs to be retained. The actual reporting duration is defined based on the start and end reporting times. Since most devices only change during use, this processing removes a large amount of redundant data with identical values ​​while still fully reflecting the actual reported status of the device. For example, the data size before processing was 10GB, and after processing, the average data size is approximately 0.1GB, a reduction of 100 times. Taking the power on / off status attribute of the network device as an example, some data before processing is shown in Table 1 below, and the data after processing is shown in Table 2 below:

[0074] Table 1

[0075]

[0076] Table 2

[0077]

[0078] Given the current comprehensive coverage of networked devices in industry, by abstracting and unifying the computational processing logic of these devices into a single, usable codebase, we can reduce the development costs of individual device production lines, strengthen the standardization of data output, and effectively enhance data quality management. Since there are inconsistencies in the attribute reporting fields of various networked devices, filtering and selection are performed using a required field attribute dimension table (equivalent to the first requirement mentioned above). Each networked device needs to define its own required field values. If a networked device requires the addition or removal of required attribute fields, only the attributes in the required field dimension table need to be added or removed; the computational logic code for filtering and removing redundant data remains unchanged. Specifically, the field attribute dimension table is shown in Table 3 below:

[0079] Table 3

[0080]

[0081] Each network device has its own set of calculation logic for determining the network device's usage cycle. The start and end conditions of the cycle need to be defined in the cycle configuration dimension table. The detailed data is then filtered based on this dimension table. If a network device wants to add a new usage cycle, only the cycle judgment logic needs to be added. The calculation and processing logic for generating detailed network device status data reporting within the cycle does not need to be changed. Example of cycle configuration dimensions is shown in Table 4 below:

[0082] Table 4

[0083]

[0084] It should be noted that this invention constructs a general architecture for statistical analysis of network device status reporting data: it abstracts and unifies computational logic, forming fixed computational code. Increases or decreases in requirements will not affect the computational code, making it suitable for the statistical needs of most network device status reporting data. The data computation code remains fixed, and data filtering is controlled through configurable dimension tables to meet the computational needs of different network devices with different attributes and at different time periods. By changing the data structure to remove redundant data, the amount of data storage and computational resources consumed are greatly reduced. Flexible custom configuration significantly reduces the workload of data development, improves the efficiency of data feedback cycles, facilitates the standardization of data definitions and data quality management, greatly reduces data storage pressure and computational resource consumption, and simplifies repetitive, siloed code.

[0085] It's important to note that since all network devices utilize a single data model for computation, the computational logic is already fixed, reducing data development workload and minimizing subsequent iteration and maintenance costs. The standardized data output from different network device types also aligns with this unified model, facilitating data quality management. Different network devices inevitably have different field attributes and periodic statistical requirements. Flexible configurable dimension tables control and manage these differentiated needs, enhancing the compatibility and applicability of the general model. By transforming the data structure from one-dimensional attributes to a two-dimensional attribute-time structure, a significant amount of redundant data was eliminated. Practical testing has shown that this reduces data volume by a factor of 100, substantially reducing data storage pressure and computational resource consumption.

[0086] 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 of the various embodiments of the present invention.

[0087] 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 devices described in the following embodiments are preferably implemented in software, hardware implementations, or a combination of software and hardware, are also possible and contemplated.

[0088] Figure 5 This is a structural block diagram of a data storage device according to an embodiment of the present invention, the device comprising:

[0089] The acquisition module 52 is used to acquire the operating data of the target device within a preset time period. The operating data includes multiple working status data, which correspond one-to-one with multiple times included in the preset time period. Each working status data includes attribute values ​​reported by different status attributes at the corresponding times.

[0090] The processing module 54 is used to filter out the demand data from the running data, and perform redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data, to obtain the data to be stored.

[0091] Storage module 56 is used to store the data to be stored to the server.

[0092] The aforementioned device, upon acquiring the operating data of the target device, filters out the required data from the operating data, and performs redundancy reduction processing on the required data according to the duration corresponding to the different attribute values ​​of each state attribute in the required data. Finally, the data to be stored after redundancy reduction is stored in the server. This solves the problem that the server directly stores all the state data reported by the device, resulting in a large data storage pressure on the server, and achieves the technical effect of reducing the data storage pressure on the server.

[0093] In an exemplary embodiment, the processing module 54 is further configured to obtain data storage requirements corresponding to the target device, wherein the data storage requirements include at least one of the following: a first requirement for indicating attribute values ​​to be stored, a second requirement for indicating state data to be stored; and filter the required data from the running data according to the data storage requirements.

[0094] In an exemplary embodiment, the processing module 54 is further configured to, when the data storage requirement includes the first requirement, obtain the data storage requirement corresponding to the target device by: determining a first state attribute; and determining a second state attribute and a target attribute value corresponding to the second state attribute, wherein the state attribute includes: the first state attribute and the second state attribute; determining the first requirement based on the first state attribute and the target attribute value corresponding to the second state attribute; wherein the first requirement includes: storing all attribute values ​​of the first state attribute and storing only the target attribute value among a plurality of attribute values ​​of the second state attribute.

[0095] In an exemplary embodiment, the processing module 54 is further configured to, when the data storage requirement includes the second requirement, obtain the data storage requirement corresponding to the target device by: obtaining the target working state corresponding to the target device, and determining the second requirement based on the target working state, wherein the second requirement includes: storing all working state data of the target device in the target working state.

[0096] In an exemplary embodiment, the processing module 54 is further configured to determine, in the demand data, an attribute value that is equal to each attribute value in the attribute value set corresponding to each state attribute, and delete the remaining multiple attribute values ​​that are equal to each attribute value within the duration corresponding to each attribute value in the demand data from the demand data, wherein the different attribute values ​​of each state attribute constitute the attribute value set; and add corresponding target data to the demand data for an attribute value that is equal to each attribute value to obtain the data to be stored, wherein the target data includes: the start time and end time of the duration corresponding to each attribute value.

[0097] In an exemplary embodiment, the processing module 54 is further configured to determine a set of attribute values ​​corresponding to each state attribute before performing redundancy reduction processing on the demand data according to the duration corresponding to different attribute values ​​of each state attribute in the demand data to obtain the data to be stored; wherein, the demand data includes attribute values ​​reported by each state attribute at different times, and the attribute values ​​in the set of attribute values ​​are different; and determine the duration of each attribute value according to multiple reporting times corresponding to each attribute value in the set of attribute values.

[0098] In an exemplary embodiment, the processing module 54 is further configured to determine the duration of each attribute value based on the multiple reporting times corresponding to each attribute value in the attribute value set by: classifying the multiple reporting times corresponding to each attribute value to obtain a time period set, wherein the multiple reporting times included in each time period set are consecutive; determining the difference between the first reporting time and the second reporting time in each time period as the duration of each time period, wherein the duration of each attribute value includes: the duration of each time period, wherein the first reporting time is the latest time in each time period, and the second reporting time is the earliest time in each time period.

[0099] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0100] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0101] S1, acquire the operating data of the target device within a preset time period, wherein the operating data includes multiple working status data, and the multiple working status data corresponds one-to-one with multiple times included in the preset time period; each of the multiple working status data includes: attribute values ​​of different status attributes reported at the corresponding times.

[0102] S2, filter out the demand data from the running data, and perform redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data, to obtain the data to be stored;

[0103] S3, store the data to be stored in the server.

[0104] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0105] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0106] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0107] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0108] S1, acquire the operating data of the target device within a preset time period, wherein the operating data includes multiple working status data, and the multiple working status data corresponds one-to-one with multiple times included in the preset time period; each of the multiple working status data includes: attribute values ​​of different status attributes reported at the corresponding times.

[0109] S2, filter out the demand data from the running data, and perform redundancy reduction processing on the demand data according to the duration corresponding to the different attribute values ​​of each state attribute in the demand data, to obtain the data to be stored;

[0110] S3, store the data to be stored in the server.

[0111] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0112] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0113] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0114] 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, The method comprises the following steps: acquiring running data of a target device within a preset time period, wherein the running data comprises a plurality of pieces of working state data corresponding to a plurality of time points included in the preset time period; any piece of working state data comprises attribute values of different state attributes reported at a corresponding time point; filtering demand data from the running data, and performing de-redundancy processing on the demand data according to a duration corresponding to different attribute values of each state attribute in the demand data, to obtain to-be-stored data; storing the to-be-stored data to a server; performing de-redundancy processing on the demand data according to a duration corresponding to different attribute values of each state attribute in the demand data, to obtain to-be-stored data, comprising: determining one attribute value equal to each attribute value in a set of attribute values corresponding to each state attribute in the demand data, and deleting a plurality of attribute values equal to the each attribute value from the demand data within a duration corresponding to the each attribute value, wherein different attribute values of each state attribute constitute the set of attribute values; adding corresponding target data to one attribute value equal to the each attribute value in the demand data to obtain the to-be-stored data, wherein the target data comprises a start time and an end time of a duration corresponding to the each attribute value.

2. The method of claim 1, wherein, filtering demand data from the running data, comprising: acquiring data storage requirements corresponding to the target device, wherein the data storage requirements comprise at least one of the following: a first requirement for indicating to-be-stored attribute values, and a second requirement for indicating to-be-stored state data; filtering demand data from the running data according to the data storage requirements.

3. The method of claim 2, wherein, In a case where the data storage requirements comprise the first requirement, acquiring data storage requirements corresponding to the target device, comprising: determining a first state attribute; and determining a second state attribute and a target attribute value corresponding to the second state attribute, wherein the state attributes comprise the first state attribute and the second state attribute; determining the first requirement according to the target attribute value corresponding to the first state attribute and the second state attribute, wherein the first requirement comprises storing all attribute values of the first state attribute and only storing the target attribute value in a plurality of attribute values of the second state attribute.

4. The method of claim 2, wherein, In a case where the data storage requirements comprise the second requirement, acquiring data storage requirements corresponding to the target device, comprising: acquiring a target working state of the target device, and determining the second requirement according to the target working state, wherein the second requirement comprises storing all working state data of the target device in the target working state.

5. The method of claim 1, wherein, Before performing de-redundancy processing on the demand data according to a duration corresponding to different attribute values of each state attribute in the demand data to obtain to-be-stored data, the method further comprises: The attribute value set corresponding to each state attribute is determined according to demand data; wherein the demand data includes attribute values reported by the each state attribute at different time points, and attribute values in the attribute value set are different; The duration of each attribute value in the attribute value set is determined according to a plurality of reporting time points corresponding to each attribute value.

6. The method of claim 5, wherein, The duration of each attribute value in the attribute value set is determined according to a plurality of reporting time points corresponding to each attribute value, including: The plurality of reporting time points corresponding to each attribute value are classified to obtain a time period set, wherein each time period in the time period set includes a plurality of continuous reporting time points; The difference between the first reporting time point and the second reporting time point in each time period is determined as the duration of each time period, wherein the duration of each attribute includes the duration of each time period, wherein the first reporting time point is the latest time point in each time period, and the second reporting time point is the earliest time point in each time period.

7. A data storage device, characterized by Including: The acquisition module is configured to acquire running data of a target device within a preset time period, wherein the running data includes a plurality of working state data, the plurality of working state data correspond one-to-one to a plurality of time points included in the preset time period, and any working state data of the plurality of working state data includes attribute values reported by different state attributes at a corresponding time point; The processing module is configured to filter demand data from the running data, and perform de-redundancy processing on the demand data according to a duration of each attribute value of each state attribute, to obtain to-be-stored data; The storage module is configured to store the to-be-stored data to a server; The processing module is further configured to determine one attribute value equal to each attribute value in an attribute value set corresponding to each state attribute in the demand data, and delete a plurality of attribute values equal to the each attribute value in the duration of the each attribute value in the demand data from the demand data, wherein different attribute values of each state attribute constitute the attribute value set; The target data corresponding to the one attribute value equal to each attribute value is added in the demand data to obtain the to-be-stored data, wherein the target data includes a start time point and an end time point of the duration of the each attribute value.

8. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 6 when running. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 6 by the computer program.

Citation Information

Patent Citations

  • Method, device and equipment for data acquisition

    CN111597241A

  • Data storage method and device, computer equipment and storage medium

    CN115373581A