Data storage method, data acquisition equipment and readable storage medium
By generating storage instructions and determining storage policies in the data acquisition device, data loss caused by network exceptions is solved, data storage in the case of disconnection and secure upload after reconnection is achieved, ensuring the security of important data.
Patent Information
- Application Number
- CN202411344494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In remote areas or outdoor environments, the data collector cannot be sent to the server in a timely manner due to unstable or unavailable network connections, which may lead to the loss of important data.
When the data acquisition device is disconnected from the server, a storage instruction is generated, the storage policy is determined based on the type attributes of the device data, and the cache-level storage is performed, and the stored data is sent to the server after the connection is re-established.
Store device data in a timely manner when the network is disconnected, avoid data loss, and safely upload important data after reconnection to ensure the integrity and reliability of the data.
Smart Images

Figure CN119166073A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of data storage, and in particular, relates to a data storage method, a data acquisition device, and a readable storage medium. Background Art
[0002] In the modern energy storage industry, real-time monitoring and data collection are key links to ensure the efficiency and stability of equipment operation. Especially for energy storage systems that integrate components such as battery management systems, inverters, and photovoltaic panels, it is particularly important to be able to capture and analyze the operating parameters of these devices in real time; to achieve this goal, a dedicated data collector is usually deployed, which is responsible for collecting key operating data and uploading it to the cloud server in real time. In this way, maintenance personnel and system administrators can understand the working status of the equipment at any time and make remote adjustments or troubleshooting when necessary.
[0003] However, in actual applications, especially in remote areas or outdoor environments, network connections are often unstable or completely unavailable, resulting in the data collector being unable to send its own device data to the server in a timely manner, which may cause the loss of important device data in the data collector. Summary of the invention
[0004] The purpose of the present application is to provide a data storage method, a data acquisition device and a readable storage medium, aiming to solve the problem that the existing data collector cannot send its own device data to the server in time, which may cause the loss of important device data in the data collector.
[0005] A first aspect of an embodiment of the present application provides a data storage method, which is applied to a data acquisition device. The data storage method includes:
[0006] After the data acquisition device is disconnected from the server, generating a first storage instruction;
[0007] Receive device data information, determine a storage strategy for the device data information according to the first storage instruction, and save the device data information according to the storage strategy; wherein the storage strategy includes detecting a type attribute of the device data information, determining a cache level corresponding to the device data information based on the type attribute, and adding the device data information to a corresponding storage area for storage according to the cache level;
[0008] After the data acquisition device re-establishes the connection with the server, the saved device data information is sent to the server.
[0009] By adopting the above technical solution, when the data acquisition device disconnects the communication connection with the server, the data acquisition device continues to receive the device data sent by the smart device based on the communication connection, and determines the storage strategy of the device data information based on the first storage instruction, thereby achieving the technical effect of storing the device data of the smart device in time when the network is disconnected; at the same time, after the data acquisition device re-establishes the communication connection with the server, the device data of the stored smart device is sent to the server, further avoiding the loss of important device data information in the smart device and ensuring the security of important data.
[0010] A second aspect of an embodiment of the present application provides a data acquisition device, which includes a processor and a memory, and the processor is used to execute a computer program stored in the memory to implement the data storage method as described in any one of the above.
[0011] A second aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the data storage method as described in any one of the above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 Schematic diagram of an application scenario of a data storage method provided in an embodiment of the present application Figure 1 ;
[0013] Figure 2 Schematic diagram of an application scenario of a data storage method provided in an embodiment of the present application Figure 2 ;
[0014] Figure 3 A schematic diagram of a data storage method provided by an embodiment of the present application;
[0015] Figure 4 A schematic diagram of the structure of a data storage device provided by an embodiment of the present application;
[0016] Figure 5 A schematic diagram of the structure of a data acquisition device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] It should be noted that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish similar objects rather than to describe a specific order or sequence.
[0019] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0020] It should also be noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchangeable with each other, and some of the steps can also be deleted.
[0021] Some embodiments will be described below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0022] In the modern energy storage industry, real-time monitoring and data collection are key links to ensure the efficiency and stability of equipment operation. Especially for energy storage systems that integrate components such as battery management systems, inverters, and photovoltaic panels, it is particularly important to be able to capture and analyze the operating parameters of these devices in real time; to achieve this goal, a dedicated data collector is usually deployed, which is responsible for collecting key operating data and uploading it to the cloud server in real time. In this way, maintenance personnel and system administrators can understand the working status of the equipment at any time and make remote adjustments or troubleshooting when necessary.
[0023] However, in actual applications, especially in remote areas or outdoor environments, network connections are often unstable or completely unavailable, resulting in the data collector being unable to send its own device data to the server in a timely manner, which may cause the loss of important device data in the data collector.
[0024] Figure 1 This is a schematic diagram of an application scenario of a data storage method provided by this application. Figure 1 As shown, the application scenario includes a data acquisition device 40, a server 50, and multiple smart devices (eg Figure 1 The electronic device 10, the electronic device 20, and the electronic device 30 are shown).
[0025] The data acquisition device 40 can be a terminal device such as a programmable logic controller (PLC), a switch, a human-machine interface, a central control screen, a tablet computer, a personal computer or a computer, as long as it can receive and send data.
[0026] The data acquisition device 40 may be a device that provides a wireless network function, and may realize a network communication connection with the server 50. In a specific application scenario, the data acquisition device 40 may also include a network switching device such as a switch, and the present application does not limit this.
[0027] The server 50 may be a single server, or a server cluster or a cloud server.
[0028] Smart devices (such as electronic device 10, electronic device 20, electronic device 30, etc.) may include, but are not limited to, inverters, generators, smart sockets, electric curtains, cameras, thermostats, air conditioners, televisions, electronic door locks, water heaters, smart switches, air purifiers, humidifiers, lawn mowers, sweepers, mobile energy storage devices, household energy storage devices and other electronic devices.
[0029] The process of uploading device data information by a smart device can be illustrated by taking the electronic device 10 as an example. The electronic device 10 can achieve communication connection between the electronic device 10 and the server 50 through the first wireless communication link established between the data acquisition device 40 and the server 50. When the communication between the data acquisition device 40 and the server 50 is not disconnected, that is, when the data acquisition device 40 is in a networked state (such as Figure 1 As shown in FIG. 1 ), the electronic device 10 can send its own device data information to the server 50 through the first wireless communication link, so that the server 50 stores the received device data information. However, when the communication between the data acquisition device 40 and the server 50 is disconnected, that is, when the data acquisition device 40 is in an offline state (such as Figure 2 As shown), the electronic device 10 cannot send its own device data information to the server 50 through the first wireless communication link, so the server 50 cannot store the device data information of the electronic device 10, which may cause the loss of important device data information in the electronic device 10.
[0030] In order to solve the above network anomaly that causes the smart device to be unable to send device data information to the server 50 in time (such as Figure 2In order to solve the technical problem that important device data information in smart devices is lost due to the application scenario shown in the figure), an embodiment of the present application provides a data storage method. When the data acquisition device 40 and the server 50 are disconnected from the communication connection, that is, when the data acquisition device 40 is disconnected from the network, a first storage instruction is generated, and the data acquisition device 40 determines the storage strategy of the device data information according to the first storage instruction, thereby achieving the technical effect of storing the device data information of the smart device in time when the data acquisition device 40 is disconnected from the network, and to a certain extent avoids the situation that the smart device cannot send the device data information to the server 50 in time due to network anomalies, resulting in the loss of important device data information in the smart device; at the same time, after the data acquisition device 40 re-establishes the communication connection with the server 50, the data acquisition device 40 can also send the stored device data information of the smart device to the server 50, further avoiding the loss of important device data information in the smart device and ensuring the security of important data.
[0031] In order to better understand the data storage method, data acquisition device 40 and storage medium provided in the embodiment of the present application, the application scenario of the data storage method of the present application is first described below.
[0032] Figure 2 This is a schematic diagram of an application scenario of a data storage method provided in an embodiment of the present application. The data storage method is applied in Figure 2 In the data acquisition device 40 shown. Figure 2 As shown, after the data acquisition device 40 disconnects the communication connection with the server 50, the data acquisition device 40 can still establish communication connections with the electronic device 10, the electronic device 20, and the electronic device 30 respectively.
[0033] The data acquisition device 40 establishes a communication connection with the smart device. For example, the data acquisition device 40 can establish a communication connection with the electronic device through a preset communication method such as Bluetooth, WiFi, ZigBee, or a network cable.
[0034] Below, the establishment of a communication connection between the data acquisition device 40 and the electronic device 10 is used as an example for explanation. After the data acquisition device 40 disconnects the communication connection with the server 50, although the data acquisition device 40 cannot access the Internet, the electronic device 10 can still send its own device data information to the data acquisition device 40, and the data acquisition device 40 stores the received device data information. However, sometimes the network disconnection time is long, the data is large, and all the data cannot be saved (or is limited by storage space). After the data acquisition device 40 receives the device data information sent by the electronic device 10, it determines the storage strategy of the device data information according to the first storage instruction, and stores the device data information of the electronic device 10 based on the storage strategy. After the data acquisition device 40 re-establishes the communication connection with the server 50, the data acquisition device 40 can send the device data information of the electronic device 10 stored by the data acquisition device 40 to the server 50, so that the server 50 stores the device data information of the electronic device 10.
[0035] The data storage method provided in the embodiment of the present application enables the data acquisition device 40 to receive and store the device data information of the electronic device 10 in the scenario where the communication connection between the data acquisition device 40 and the server 50 is disconnected; and after the data acquisition device 40 and the server 50 re-establish the communication connection, the stored device data information of the electronic device 10 is sent to the server 50. In the case where the data acquisition device 40 is disconnected from the network, the device data information of the smart device can be stored in time according to the corresponding storage strategy, thereby avoiding the situation where the smart device cannot send the device data information to the server 50 in time due to network anomalies, resulting in the loss of important data acquisition devices 40 in the smart device.
[0036] Figure 2 This is only an example of an application scenario provided by the embodiment of the present application, and does not constitute a limitation. In other embodiments, the data acquisition device 40 and the server 50 may be connected to more devices, for example, the data acquisition device 40 may be connected to more communication devices. Alternatively, in the application scenarios provided by other embodiments, there may be more than Figure 2 The scenarios shown may include more or fewer devices. For example, in some application scenarios, the data acquisition device 40 may create a local area network by itself, connect with multiple electronic devices, etc. The present application does not limit the specific application scenarios of the data storage method described below.
[0037] Figure 3 is a flow chart of a data storage method provided in an embodiment of the present application. The data storage method provided in an embodiment of the present application is applied in the following manner: Figure 2 The data acquisition device 40. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0038] refer to Figure 3 As shown, the data storage method includes steps S100 to S300.
[0039] Step S100: after the data acquisition device 40 is disconnected from the server 50, a first storage instruction is generated.
[0040] Step S200: Receive device data information, determine a storage strategy for the device data information according to a first storage instruction, and save the device data information according to the storage strategy; wherein the storage strategy includes detecting a type attribute of the device data information, and determining a cache level corresponding to the device data information based on the type attribute, and adding the device data information to a corresponding storage area for storage according to the cache level.
[0041] Step S300 : After the data acquisition device 40 re-establishes the connection with the server 50 , the saved device data information is sent to the server 50 .
[0042] In this embodiment, in step S100, after the data acquisition device 40 is disconnected from the server 50, a first storage instruction is generated. Specifically, under normal working conditions, the data acquisition device 40 establishes a communication connection with the server 50. If the communication connection between the data acquisition device 40 and the server 50 is disconnected, it means that the smart device is also disconnected from the network. At this time, the smart device (i.e. Figure 2 The electronic device 10, etc. cannot send its own device data information to the server 50.
[0043] In this embodiment, when the data acquisition device 40 detects that the communication connection between itself and the server 50 is disconnected, the first storage instruction is generated, which indicates that the data acquisition device 40 not only receives the device data information of the smart device, but also saves the device data information of the smart device. It can be understood that the first storage instruction is generated only after the data acquisition device 40 is disconnected from the server 50. When it is not disconnected, the data acquisition device 40 generally directly uploads the device data information to the cloud without storage. Therefore, when the first storage instruction is generated, it also indicates that the data acquisition device 40 is disconnected from the server 50, and the device data information needs to be stored at this time.
[0044] In this embodiment, in step S200, the data acquisition device 40 can receive device data information in real time. When the first storage instruction is received, it indicates that the data acquisition device 40 is disconnected from the server 50. At this time, the data acquisition device 40 needs to save the received device data information. However, if the received device data information is saved directly, there may be a lot of device data information, some of which have a high priority, and some of which have a general priority. If all the device data information is to be saved directly, on the one hand, it is unclear which part of the device data information is the key information, which will result in the key information and non-key information being uploaded to the server 50 together after the connection is re-established, resulting in too long a time to upload the device data information and increased communication pressure. Moreover, when some key device data information is urgently needed, the waiting time is too long, which may affect the user's use.
[0045] In this embodiment, in step S200, the present application determines the storage strategy of the device data information according to the first storage instruction, and saves the device data information according to the storage strategy. When storing the device data information, the present application does not directly store it, but first determines the storage strategy when determining that the device data information needs to be stored, and saves the device data information according to the storage strategy, which includes detecting the type attribute of the device data information, and the type attribute may include: error type, warning type, reminder type, normal type, etc., which are not limited here. Then, the corresponding cache level is determined based on the type attribute, for example, the error type can be set to the first cache level, the warning type can be set to the second cache level, and the reminder type and normal type can be set to the third cache level (the error type and the warning type can also be set to the first cache level, etc., which are not limited here). Then, the device data information of different cache levels is added to the corresponding storage area, for example, the device data information of the first cache level is saved in the first storage area, and the device data information of the second cache level is saved in the second storage area, and so on.
[0046] In step S200, after determining that the data acquisition device 40 is disconnected from the server 50, the device data information is not saved immediately, but a storage strategy is first determined, and then the device data information is saved according to the storage strategy. In this way, the device data information can be classified, which makes it convenient to upload certain device data information to the server 50 first after the connection is re-established, thereby improving the user experience.
[0047] In this embodiment, in step S300 , if the data acquisition device 40 re-establishes the communication connection with the server 50 , it means that the other smart devices have restored the communication connection with the server 50 .
[0048] In one embodiment, when the data acquisition device 40 is in a networked state, the smart device can directly send real-time device data information to the server 50 through the data acquisition device 40 based on the communication connection with the server 50 .
[0049] In one embodiment, after the data acquisition device 40 re-establishes the communication connection with the server 50, the data acquisition device 40 sends the saved device data to the server 50, so that the server 50 stores the device data during the network disconnection period.
[0050] In the above-mentioned implementation mode, when the data acquisition device 40 and the server 50 are disconnected from the communication connection, that is, when the smart device is disconnected from the network, the smart device can continue to send device data to the data acquisition device 40; the data acquisition device 40 receives the device data sent by the smart device based on the communication connection, and determines the storage strategy of the device data information based on the first storage instruction, thereby achieving the technical effect of storing the device data of the smart device in time when the network is disconnected, and to a certain extent avoids the situation where the smart device cannot send the device data to the server 50 in time due to network anomalies, resulting in the loss of important device data information in the smart device; at the same time, after the data acquisition device 40 re-establishes the communication connection with the server 50, it sends the stored device data of the smart device to the server 50, further avoiding the loss of important device data information in the smart device and ensuring the security of important data.
[0051] In the above embodiment, the present application determines the storage strategy based on the first storage instruction, and the device data information can be classified according to the storage strategy, so that certain device data information can be uploaded to the server 50 first after the connection is re-established, thereby improving the user experience.
[0052] In one embodiment, the device data information of the device data may include one or more of the electronic device's power generation, cumulative power generation, remaining power, input power, output power, device error, device warning, device reminder, etc.
[0053] In one embodiment, the smart device may actively send device data information to the data collection device 40 .
[0054] In one embodiment, the data collection device 40 may register and subscribe in the smart device, so that after the data collection device 40 establishes a communication connection with the smart device, the smart device sends device data to the data collection device 40 .
[0055] In one embodiment, after the data acquisition device 40 establishes a communication connection with the smart device, the data acquisition device 40 may send a data acquisition instruction to the smart device. The data acquisition instruction is used to acquire device data information of the smart device. After receiving the data acquisition instruction, the smart device sends the device data information to the data acquisition device 40.
[0056] In one embodiment, there is no restriction on the method of triggering the smart device to send device data information, and any triggering method can be used to enable the smart device to send device data information to the data acquisition device 40 after establishing a communication connection with the data acquisition device 40.
[0057] In one embodiment, the data storage method further includes: dividing the storage space of the data acquisition device 40 into a plurality of storage areas according to the first storage instruction; wherein each storage area is used to store device data information of a corresponding cache level.
[0058] Specifically, after the first storage instruction is generated, it means that the data acquisition device 40 is disconnected from the server 50, and the device data information on the smart device cannot be sent to the server 50. The data acquisition device 40 needs to save the device data information. At this time, the storage space of the data acquisition device 40 will be divided into multiple storage areas according to the first storage instruction. For example, the storage space of the data acquisition device 40 can be divided into 90 parts, divided into three storage areas (for example, the first storage area, the second storage area, and the third storage area), and the capacity of each storage area can be equal to 30 parts.
[0059] In this embodiment, the storage area is used to store the device data information of the corresponding cache level. For example, the cache level includes: a first cache level, a second cache level, and a third cache level. The multiple storage areas include: a first storage area, a second storage area, and a third storage area; then the first storage area can be set to store the device data information identified as the first cache level, the second storage area can be set to store the device data information identified as the second cache level, and the third storage area can be set to store the device data information identified as the third cache level. In this way, device data information of different types of attributes can be stored in different storage areas, so that the device data information can be classified, and the capacity of the first storage area can be set to be larger, so as to ensure that important device data information can be saved first.
[0060] In one embodiment, after the data acquisition device 40 re-establishes the connection with the server 50, the device data information saved in the preset storage area (e.g., the first storage area) can be preferentially sent to the server 50. Specifically, if the data acquisition device 40 is disconnected from the server 50 for a long time, the data acquisition device 40 may store a large amount of device data information locally, which cannot be uploaded to the server 50 in a short time after reconnection. However, there may be some relatively important device data information that is urgently needed by the server 50. By dividing the storage space of the data acquisition device 40 into multiple storage areas, device data information of different types of attributes are stored in different areas. In this way, after the connection is re-established, the device data information of certain storage areas (e.g., the first storage area) can be preferentially uploaded to the server 50, so that important information can be preferentially uploaded to the server.
[0061] In one embodiment, a storage strategy for device data information is determined according to a first storage instruction, and the device data information is saved according to the storage strategy, including: determining the cache level with the highest priority in the cache level as the first cache level according to the first storage instruction; performing a first index processing on the device data information in the first cache level; performing a second index processing on the cache levels other than the first cache level in the cache level in sequence according to the first index processing; and saving the device data information after the first index processing and the second index processing are completed.
[0062] Specifically, the priority order of the first cache level, the second cache level, and the third cache level is: the first cache level> the second cache level> the third cache level, so the first cache level has the highest priority, and the cache level with the highest priority is determined as the first cache level, the cache level with the second highest priority is determined as the second cache level, and the cache level with the lowest priority is determined as the third cache level. For example, the first cache level includes device data information of error types of different smart devices, and the device data information of error types of different smart devices can be indexed one by one. For example, the device data information of the error type of electronic device 10 can be preferentially indexed as 11, 12, 13 (wherein electronic device 10 may report device data information of multiple error types), etc., and then the device data information of the error type of electronic device 20 can be indexed as 21, 22, 23 (wherein electronic device 20 may report device data information of multiple error types), etc., and the first indexing process is gradually completed.
[0063] In this embodiment, after the first index processing is completed, the second cache level and the third cache level are subjected to the second index processing. The second index processing is related to the first index processing, and the second index processing is completed according to the first index processing. Specifically, when the second index processing is required, it indicates that the first index processing has been completed. At this time, all index numbers for which the first index processing has been completed are sorted in sequence (for example, according to 11, 12, 13, ..., 21, 22, 23, ...), and then the device data information of the warning type related to the index number 11 (because sometimes a device data information of an error type will be accompanied by a related warning) is also indexed as 11 (indexed as 11 in the second cache level) in the second cache level according to the sorted index numbers, and then the device data information of the warning type related to the index number 11 is searched in the third cache level (because sometimes a device data information of an error type will be accompanied by a related warning) is also indexed as 11, and so on, which will not be repeated here, until the device data information in the second cache level and the third cache level completes the second index processing.
[0064] In this embodiment, the device data information after the first index processing and the second index processing are completed is saved, so that after the data acquisition device 40 and the server 50 are flushed and connected at a later time, the saved device data information can be uploaded to the server 50. For example, after the first index processing and the second index processing are completed, when uploading to the server, all device data information with an index of 11 in the first cache level, the second cache level, and the third cache level can be packaged together and uploaded to the server in priority, so that all device data information related to an event can be uploaded to the server at the same time.
[0065] In the above embodiment, by performing the first index processing on the device data information in the first cache level, the device data information in the first cache level can be stored more neatly and regularly. When specific device data information is needed, the relevant index number can be directly searched. The second index processing is completed based on the first index processing, so that the error, alarm, and reminder index numbers belonging to the same event can be consistent. When the user needs the relevant device data information at a certain time, all relevant device data information can be found by directly searching the index number and uploaded to the server. This can make the device data information neater and improve the efficiency of data upload.
[0066] In one embodiment, after the data acquisition device 40 re-establishes the connection with the server 50, the saved device data information is sent to the server 50, including: after the data acquisition device 40 re-establishes the connection with the server 50, the device data information saved after completing the first index processing and the second index processing is sent to the server 50 according to the first preset rule.
[0067] Specifically, after the device data information of all cache levels (including the first cache level, the second cache level, and the third cache level) has undergone the first index processing and the second index processing respectively, the data saved in the package is sent to the server 50 according to the first preset rule, wherein the first preset rule may be to send the device data information of the first cache level to the server 50 first, and then send the second cache level, and so on. This helps to prioritize the sending of key information to the server 50, thereby improving the user experience.
[0068] In one embodiment, the first preset rule can send device data information with the same index number to the server 50 together according to the index number. For example, the device data information with index number 11 is sent first, and then the device data information with index number 12, and so on. That is, all device data information with index 11 in the first cache level, the second cache level, and the third cache level can be packaged together and uploaded to the server, so that all device data information related to an event can be uploaded to the server at the same time; this helps to give priority to sending device data information of the same event to the server 50, which helps the server 50 to analyze and process the time later.
[0069] In one embodiment, the data storage method further includes: there are priorities between multiple storage areas; when the storage area with a high priority meets the first storage condition and the storage area with a low priority meets the second storage condition, the storage area with a low priority is divided twice to expand the storage area with a high priority.
[0070] Specifically, there are priorities among the multiple storage areas. For example, the multiple storage areas include the first storage area, the second storage area, and the third storage area. The priority order of the multiple storage areas is: the first storage area> the second storage area> the third storage area. It can be seen that the first storage area has the highest priority, and the first storage area stores the device data information of the first cache level. When the storage area with a high priority meets the first storage condition, for example, the first storage condition may be that the capacity of the first storage area has been used up (or is less than the first preset capacity), and the storage area with a low priority meets the second storage condition, for example, the second storage condition may be that the capacity of the second storage area is still remaining (or greater than the second preset capacity), the second storage area will be divided twice. For example, before the second division, the second storage area occupies 30 parts of the total storage space capacity of the data acquisition device 40. These 32 parts can be divided into 10 parts and 20 parts, and 10 parts can be divided from the second storage area (provided that the remaining capacity of the second storage area is greater than 10 parts) and distributed to the first storage area for use. At this time, the capacity of the first storage area is 40 parts, the capacity of the second storage area is 20 parts, and the capacity of the third storage area is 30 parts. In this way, the storage area with high priority can be expanded so that the storage area with high priority can have a larger storage area, and the storage area with low priority can be appropriately reduced, which can further ensure that important device data information can have a larger space for storage, and more important device data information can be saved, which helps to improve the user experience.
[0071] In one embodiment, when a low-priority storage area meets the first storage condition and there is new device data information of the cache level that needs to be saved, the previous device data information of the storage area is directly overwritten. It is understandable that when the capacity of the low-priority storage area is used up, other storage areas will not be divided for the second time. At this time, the device data information corresponding to the cache level saved in the low-priority storage area directly overwrites the previous data. This method can ensure that the low-priority storage area will not squeeze the high-priority storage area, ensure that important device data information can have a larger space for storage, and can save more important device data information, which helps to improve the user experience.
[0072] In one embodiment, the data storage method further includes: the capacity of each storage area is greater than the first capacity and less than the second capacity. For example, when the total storage space is divided into 90 parts, the first capacity can be set to 20 parts and the second capacity can be set to 40 parts, that is, the capacity of each storage area cannot be less than 20 parts and cannot be greater than 40 parts. By setting the capacity of each storage area within a preset range, it can be ensured that even low-priority storage areas can have a certain storage capacity to save device data information, avoiding the situation where high-priority storage areas seriously squeeze low-priority storage areas, and improving user experience.
[0073] In one embodiment, performing a first index processing on the device data information in the first cache level includes: when the device data information in the first cache level is greater than a first data volume, performing a first index processing on the device data information in the first cache level.
[0074] In this embodiment, when the device data information in the first cache level is less than or equal to the first data volume (for example, the first data volume can be 100 events), it indicates that the device data information in the first cache level is relatively small at this time, and after reconnection, the device data information can be quickly uploaded to the server 50. When the device data information in the first cache level is greater than the first data volume, it indicates that the network disconnection time is too long at this time, and the device data information cannot be uploaded to the server 50 in a short time after reconnection, and only then is the first index processing performed on the device data information in the first cache level. Through the above method, the problem of indexing when the device data information is relatively small can be avoided, and the process can be simplified.
[0075] In one embodiment, the data storage method further includes: when the multiple storage areas meet the third storage condition, the device data information can be transmitted and stored between the multiple storage areas.
[0076] In this embodiment, when multiple storage areas meet the third storage condition, the third storage condition can be that the capacity of any one of the storage areas has been used up, and the capacity of at least one storage area has not been used up, that is, there is still storage space. At this time, the device data information can be transferred from the storage area with used up capacity to the storage area with unused capacity for storage, so that all device data information can be saved, which can increase the application scenarios of data storage and improve user experience.
[0077] For example, if the capacity of the first storage area has been used up, but the capacity of the second storage area has not been used up, the device data information can be transferred from the first storage area to the second storage area for storage, so that all device data information can be saved. This can increase the application scenarios of data storage and improve user experience.
[0078] In one embodiment, corresponding time policies may be formulated for device data information of different cache levels stored in multiple storage areas, that is, the device data information in different storage areas will be automatically cleared after exceeding the corresponding set time.
[0079] For example, the first storage area stores device data information of the first cache level. When the device data information in the first storage area exceeds the first set time, the device data information exceeding the first set time will be deleted. The second storage area stores device data information of the second cache level. When the device data information in the second storage area exceeds the second set time, the device data information exceeding the second set time will be deleted. The third storage area stores device data information of the third cache level. When the device data information in the third storage area exceeds the second set time, the device data information exceeding the second set time will be deleted. Among them, the first set time, the second set time and the third set time can be different. For example, the first set time>the second set time>the third set time can be set. In this way, it can be ensured that the device data information of the first cache level in the first storage area can be stored for a longer time, and it is also more conducive to the automatic deletion of the device data information in the third storage area after reaching the third set time. Reserving a larger storage area can facilitate the use of the first storage area later.
[0080] In one embodiment, sending the device data information after the data collection device 40 re-establishes the connection with the server 50 further includes: sorting the device data information, and preferentially sending the high-priority device data information to the server.
[0081] In one embodiment, the device data information includes sensor data, device status information, and device log information; wherein the sensor data includes environmental parameters such as temperature, humidity, and pressure, which are not limited here.
[0082] In one embodiment, before sending the stored device data information to the server 50, the method further includes compressing the stored device data information to reduce bandwidth consumption of network transmission, and decompressing the compressed data and restoring the original information according to the instruction of the server 50. Compression processing can not only reduce the space occupation of the corresponding storage area, but also save more device data information, and on the other hand, it can reduce bandwidth consumption of network transmission and improve transmission efficiency.
[0083] The present application also provides a data storage device 100, referring to Figure 4 As shown, the data storage device 100 can be divided into a plurality of functional modules according to the functions it performs, and may include: a communication detection module 110 , a data receiving module 120 and a data sending module 130 .
[0084] The communication detection module 110 is used to generate a first storage instruction after the data acquisition device 40 is disconnected from the server 50.
[0085] The data receiving module 120 is used to receive device data information, determine a storage strategy for the device data information according to a first storage instruction, and save the device data information according to the storage strategy; wherein the storage strategy includes detecting a type attribute of the device data information, and determining a cache level corresponding to the device data information based on the type attribute, and adding the device data information to a corresponding storage area for storage according to the cache level.
[0086] The data sending module 130 is used to send the stored device data information to the server 50 after the data acquisition device 40 re-establishes the connection with the server 50 .
[0087] The data storage device 100 provided in this embodiment can execute the above method embodiments, and its implementation principle is similar to some specific implementation methods and technical effects of the data storage method in the above embodiments, which will not be repeated here.
[0088] The present application embodiment also provides a data acquisition device 40, referring to Figure 5 As shown, the data acquisition device 40 includes a processor 403 and a memory 402, and the processor 403 is used to execute the computer program stored in the memory 402 to implement any one of the data storage methods described above.
[0089] In one embodiment, reference Figure 5 As shown, the data acquisition device 40 may include, but is not limited to, a communication module 401, a memory 402, a processor 403, an input / output (I / O) interface 404, and a bus 405. The processor 403 is coupled to the communication module 401, the memory 402, and the I / O interface 404 via the bus 405.
[0090] The communication module 401 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as Universal Serial Bus (USB), Controller Area Network (CAN), etc. The wireless communication module may provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, Frequency Modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0091] The memory 402 can be used to store computer-readable instructions and / or modules. The processor 403 implements various functions of the data acquisition device 40 by running or executing the computer-readable instructions and / or modules stored in the memory 402 and calling the data stored in the memory 402. The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the data acquisition device 40, etc. The memory 402 can include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other storage devices.
[0092] The memory 402 may be an external memory and / or an internal memory of the data acquisition device 40. Furthermore, the memory 402 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.
[0093] The processor 403 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 403 is the computing core and control center of the data acquisition device 40, and uses various interfaces and lines to connect various parts of the entire data acquisition device 40, and execute the operating system of the data acquisition device 40 and various installed applications, program codes, etc.
[0094] Exemplarily, the computer-readable instructions may be divided into one or more modules / sub-modules / units, one or more modules / sub-modules / units are stored in the memory 402 and executed by the processor 403 to complete the present application. One or more modules / sub-modules / units may be a series of computer-readable instruction segments capable of completing a specific function, and the computer-readable instruction segments are used to describe the execution process of the computer-readable instructions in the data acquisition device 40.
[0095] If the module / unit integrated in the data acquisition device 40 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and the computer-readable instructions that can be completed by instructing the relevant hardware through computer-readable instructions can be stored in a computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0096] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable files, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction codes, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM).
[0097] The memory 402 in the data acquisition device 40 stores computer-readable instructions, and the processor 403 can execute the computer-readable instructions stored in the memory 402 to implement the transportation path planning method in the above embodiment.
[0098] Specifically, the specific implementation method of the processor 403 for the above-mentioned computer-readable instructions can refer to the description of the relevant steps in the above-mentioned embodiments, which will not be repeated here.
[0099] The I / O interface 404 is used to provide a channel for user input or output. For example, the I / O interface 404 can be used to connect various input and output devices, such as a controller, an inverter, a storage device, a smart device, a mouse, a keyboard, a touch device, a display screen, etc., so that the user can enter information or visualize the information.
[0100] The bus 405 is at least used to provide a channel for mutual communication among the communication module 401 , the memory 402 , the processor 403 , and the I / O interface 404 in the data acquisition device 40 .
[0101] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the data acquisition device 40. In other embodiments of the present application, the data acquisition device 40 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0102] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction. When the at least one instruction is executed by a processor, it implements any one of the data storage methods described above.
[0103] The computer-readable storage medium may be the internal memory of the data acquisition device 40 of the above-mentioned embodiment, such as the hard disk or memory of the data acquisition device 40. The computer-readable storage medium may also be an external storage device of the data acquisition device 40, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the data acquisition device 40.
[0104] In one embodiment, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the data acquisition device 40, etc.
[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0106] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0108] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0109] Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Claims
1. A data storage method, characterized in that: Applied to data acquisition equipment, the data storage method includes: After the data acquisition device is disconnected from the server, generating a first storage instruction; Receive device data information, determine a storage strategy for the device data information according to the first storage instruction, and save the device data information according to the storage strategy; wherein the storage strategy includes detecting a type attribute of the device data information, determining a cache level corresponding to the device data information based on the type attribute, and adding the device data information to a corresponding storage area for storage according to the cache level; After the data acquisition device re-establishes the connection with the server, the saved device data information is sent to the server.
2. The data storage method according to claim 1, characterized in that: The data storage method further comprises: The storage space of the data acquisition device is divided into a plurality of storage areas according to the first storage instruction; wherein each storage area is used to store the device data information of the corresponding cache level.
3. The data storage method according to claim 1, characterized in that: Determining a storage strategy for the device data information according to the first storage instruction, and saving the device data information according to the storage strategy, includes: Determine, according to the first storage instruction, that the cache level with the highest priority among the cache levels is the first cache level; performing a first indexing process on the device data information in the first cache level; According to the first index processing, sequentially performing a second index processing on other cache levels in the cache level except the first cache level; The device data information after the first index processing and the second index processing are completed is saved.
4. The data storage method according to claim 3, characterized in that: After the data acquisition device re-establishes a connection with the server, sending the saved device data information to the server includes: After the data acquisition device re-establishes a connection with the server, the device data information saved after completing the first index processing and the second index processing is sent to the server according to a first preset rule.
5. The data storage method according to claim 2, characterized in that: The data storage method further comprises: There are priorities among the plurality of storage areas; When the storage area with a high priority satisfies a first storage condition and the storage area with a low priority satisfies a second storage condition, the storage area with a low priority is divided twice to expand the storage area with a high priority.
6. The data storage method according to claim 2, characterized in that: The data storage method further comprises: The capacity of each storage area is greater than the first capacity and less than the second capacity.
7. The data storage method according to claim 3, characterized in that: The performing a first index processing on the device data information in the first cache level includes: When the device data information in the first cache level is greater than a first data amount, the first index processing is performed on the device data information in the first cache level.
8. The data storage method according to claim 2, characterized in that: The data storage method further comprises: When the plurality of storage areas satisfy a third storage condition, the device data information can be transmitted and stored between the plurality of storage areas.
9. A data acquisition device, characterized in that: The data acquisition device comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the data storage method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the data storage method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Flow control system and method for vehicle safety detection and log data reporting and computing equipment
CN121239632A
