Temperature-based data storage method and device, equipment and storage medium

By detecting the SD card temperature in real time in embedded devices and switching the storage mode, the problem of degradation of SD card read and write performance at high temperatures is solved, and the secure storage and high reliability of data are achieved.

CN119576251APending Publication Date: 2025-03-07SHENZHEN WATER WORLD INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411379625.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In high temperature environments, the read and write performance of the SD card will decline, resulting in data loss or damage, affecting the normal operation of the device and the security of the data.

Method used

By detecting the temperature of the SD card in real time, when the temperature rises to the first temperature threshold, switch to the cloud storage mode, uploading the data to the cloud for storage; when the temperature drops to the second temperature threshold, switch to the local storage mode, and writing the data to the SD card.

Benefits of technology

It improves the problem of poor reading and writing efficiency of SD cards in high temperature states, reduces the risk of data corruption or loss, and ensures the security and integrity of monitoring data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576251A_ABST
    Figure CN119576251A_ABST
Patent Text Reader

Abstract

The invention provides a temperature-based data storage method. The temperature-based data storage method comprises the following steps: detecting the current temperature of an SD (Secure Digital) card in real time; when it is detected that the current temperature of the SD card rises to a first temperature threshold value, switching the data storage mode into a cloud storage mode, and uploading the to-be-stored data to a cloud for storage through the cloud storage mode; when it is detected that the current temperature of the SD card drops to a second temperature threshold value, the data storage mode is switched to a local storage mode, and the to-be-stored data is written into the SD card to be stored through the local storage mode. By introducing a temperature detection mechanism and a storage mode switching strategy, the reliability and stability of data storage are improved, and the risk of data damage is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data storage technology, and in particular to a temperature-based data storage method, device, equipment and storage medium. Background Art

[0002] With the continuous development of network technology, embedded devices have been widely used in various practical scenarios. Embedded devices are usually equipped with SD cards as local storage media to store key data such as device acquisition data and device operation data. However, in actual use, the working performance of the SD card will be significantly affected by the ambient temperature. Especially in high temperature environments, the read and write performance of the SD card will drop significantly, and abnormal situations such as read and write failures, freezes, and data loss will occur, and even serious problems such as data corruption or loss may occur. Therefore, if the existing device is in a high temperature state, the speed of reading and writing data by the internal SD card will decrease, and data may be corrupted due to overheating, seriously affecting the normal operation of the device and the security of the data. Summary of the invention

[0003] The embodiment of the present invention provides a temperature-based data storage method, which aims to solve the problem that the read and write performance of the SD card decreases under high temperature conditions, affecting the normal operation of the device and the security of the data. When it is detected that the current temperature of the SD card exceeds the first temperature threshold, the data to be stored can be uploaded to the cloud for storage through the cloud storage mode, which improves the problem of poor read and write efficiency and possible data damage or loss when continuing to write data to the SD card under high temperature conditions, thereby ensuring the security and integrity of the monitoring data. After detecting that the temperature of the SD card drops to a safe range, the data to be stored is written to the SD card for storage through the local storage mode. By introducing a temperature detection mechanism and a storage mode switching strategy, the reliability and stability of data storage are improved, and the risk of data damage is reduced.

[0004] In a first aspect, an embodiment of the present invention provides a temperature-based data storage method, the method comprising:

[0005] Real-time detection of the current temperature of the SD card;

[0006] When it is detected that the current temperature of the SD card rises to a first temperature threshold, the data storage mode is switched to a cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode;

[0007] When it is detected that the current temperature of the SD card drops to a second temperature threshold, the data storage mode is switched to a local storage mode, and the data to be stored is written into the SD card for storage through the local storage mode.

[0008] Optionally, after the step of detecting that the current temperature of the SD card rises to a first temperature threshold, the method further includes:

[0009] Determine the current region of the SD card;

[0010] Obtaining weather forecast information for the current area and the current time of the current temperature;

[0011] Based on the weather forecast information and the current time, predict whether the temperature of the SD card will rise to a third temperature threshold, where the third temperature threshold is determined according to a third critical temperature that causes data loss on the SD card;

[0012] If it is predicted that the temperature of the SD card will rise to the third temperature threshold, the first stored data in the SD card is uploaded to the cloud for storage through the cloud storage mode before the temperature of the SD card rises to the third temperature threshold.

[0013] Optionally, the step of predicting whether the temperature of the SD card will rise to a third temperature threshold based on the weather forecast information and the current time includes:

[0014] Based on the weather forecast information, determining a first temperature change trend in a future time period;

[0015] Taking the current moment as a starting prediction time point, based on the first temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0016] Optionally, the step of determining a first temperature change trend in a future time period based on the weather forecast information includes:

[0017] Obtaining a trained prediction model, wherein the prediction model is obtained by training a time series model using a training data set, wherein the training data set includes historical weather forecast data;

[0018] The weather forecast information is predicted and processed by the prediction model to obtain a first temperature change trend in a future time period.

[0019] Optionally, the step of taking the current moment as the starting prediction time point and predicting whether the temperature of the SD card will rise to a third temperature threshold based on the first temperature change trend includes:

[0020] Based on the weather forecast information, determining the forecast temperature at the current moment;

[0021] Calculating a temperature difference between the current temperature and the forecast temperature;

[0022] Superimposing the temperature difference on the basis of the first temperature change trend, to obtain a second temperature change trend corresponding to the SD card;

[0023] Taking the current moment as a starting prediction time point, based on the second temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0024] Optionally, after the step of switching the data storage mode to the cloud storage mode, the method further includes:

[0025] Stop real-time detection of the current temperature of the SD card;

[0026] After the step of obtaining the weather forecast information of the current area and the current time of the current temperature, the method further includes:

[0027] Based on the weather forecast information, predict a predicted time period in which the temperature of the SD card drops to the second temperature threshold;

[0028] When the current moment reaches the predicted time period, real-time detection of the current temperature of the SD card is started.

[0029] Optionally, after the step of switching the data storage mode to the local storage mode, the method includes:

[0030] Downloading second stored data from the cloud, and writing the second stored data into the SD card for storage;

[0031] In the SD card, merging the second stored data with the first stored data in the SD card;

[0032] Alternatively, in the SD card, the second stored data and the first stored data in the SD card are marked in the original time sequence of data acquisition to obtain stored data with marks, and the marks are used to splice the stored data according to the marks when the response data is exported.

[0033] In a second aspect, an embodiment of the present invention further provides a temperature-based data storage device, the temperature-based data storage device comprising:

[0034] Detection module, used to detect the current temperature of the SD card in real time;

[0035] A first storage module, configured to switch the data storage mode to a cloud storage mode when it is detected that the current temperature of the SD card rises to a first temperature threshold, and upload the data to be stored to the cloud for storage through the cloud storage mode;

[0036] The second storage module is used to switch the data storage mode to the local storage mode when it is detected that the current temperature of the SD card drops to a second temperature threshold and the current temperature is a temperature in a temperature decline trend, and write the data to be stored into the SD card through the local storage mode for storage.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the temperature-based data storage method provided in an embodiment of the present invention when executing the computer program.

[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the temperature-based data storage method provided in the embodiment of the invention are implemented.

[0039] In the embodiment of the present invention, the current temperature of the SD card is detected in real time; when it is detected that the current temperature of the SD card rises to the first temperature threshold, the data storage mode is switched to the cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode; when it is detected that the current temperature of the SD card drops to the second temperature threshold, the data storage mode is switched to the local storage mode, and the data to be stored is written to the SD card for storage through the local storage mode. The present invention can upload the data to be stored to the cloud for storage through the cloud storage mode when it is detected that the current temperature of the SD card reaches the first temperature threshold, thereby improving the problem of poor read and write efficiency and possible data damage or loss when continuing to write data to the SD card under high temperature conditions, thereby ensuring the security and integrity of the monitoring data. After detecting that the temperature of the SD card drops to a safe range, the data to be stored is written to the SD card for storage through the local storage mode. By introducing a temperature detection mechanism and a storage mode switching strategy, the reliability and stability of data storage are improved, and the risk of data damage is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 is a flow chart of a temperature-based data storage method provided by an embodiment of the present invention;

[0042] Figure 2 is a schematic structural diagram of a temperature-based data storage device provided by an embodiment of the present invention;

[0043] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] like Figure 1 As shown, Figure 1 1 is a method flow chart of a temperature-based data storage method provided by an embodiment of the present invention. The temperature-based data storage method comprises the steps of:

[0046] 101. Detect the current temperature of the SD card in real time.

[0047] In an embodiment of the present invention, the temperature-based data storage method is applied to an embedded device, which may be an embedded IPC (network camera) device or the like. A microprocessor (single-chip microcomputer) and a temperature sensor are integrated in the embedded device, and the temperature sensor may be installed near the SD card slot. The temperature sensor may be a high-precision temperature sensor for real-time monitoring of the operating temperature of the SD card. A temperature sensor suitable for the working environment of the embedded device may be selected to ensure its stability and accuracy. The data of the temperature sensor is read in real time through the file system interface of the microprocessor to obtain the current temperature of the SD card.

[0048] 102. When it is detected that the current temperature of the SD card rises to a first temperature threshold, the data storage mode is switched to a cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode.

[0049] In an embodiment of the present invention, the above embedded device is provided with two data storage modes, namely, a cloud storage mode and a local storage mode. The execution programs corresponding to the two data storage modes are written into the microprocessor memory, and the two data storage modes are switched by the current temperature of the SD card detected.

[0050] The cloud storage mode is used to upload the stored data to the cloud for storage, and the cloud can be built based on a server or a distributed server. The cloud storage mode requires a communication connection between the embedded device and the cloud, and the communication connection can be a wireless communication connection, such as a communication connection through a wireless communication protocol such as 3G / 4G / 5G.

[0051] The local storage mode is used to write the stored data into the SD card for storage. The local storage mode can be set as the default storage mode. When the current temperature of the SD card does not reach the first temperature threshold, the data to be stored is written into the SD card for storage only through the local storage mode.

[0052] The first temperature threshold can be stored in the memory of the microprocessor, and the first temperature threshold is determined according to the first critical temperature that affects the reading and writing of the SD card. It is understandable that when the current temperature of the SD card is above the first temperature threshold, the reading and writing speed of the SD card will be affected, and even the data to be recorded may be lost.

[0053] After obtaining the current temperature of the SD card, the current temperature of the SD card is compared with the first temperature threshold. If the current temperature of the SD card rises to the first temperature threshold, it can be determined that the current temperature of the SD card reaches the first temperature threshold, indicating that the current temperature of the SD card is high, which may affect the speed of the SD card reading and writing, and may even lose the data to be recorded. At this time, you can switch to the cloud storage mode and stop the reading and writing of the SD card. In the cloud storage mode, the data collected by the embedded device (i.e., the data to be stored) can be uploaded to the cloud through the communication connection between the embedded device and the cloud, and the data collected by the embedded device is stored in the cloud.

[0054] In a possible embodiment, the cloud stores the data collected by the embedded device, and can mark the data collected by the embedded device according to the device number and the collection time, so that the data collected by the embedded device can be accurately downloaded from the cloud. The above device number is the number of the embedded device, and the above collection time is the timestamp of the embedded device collecting the data.

[0055] 103. When it is detected that the current temperature of the SD card drops to a second temperature threshold, the data storage mode is switched to a local storage mode, and the data to be stored is written into the SD card for storage through the local storage mode.

[0056] In the embodiment of the present invention, the second temperature threshold is a critical value of the temperature that does not affect the operation of the SD card.

[0057] When it is detected that the current temperature of the SD card reaches the second temperature threshold, and the current temperature is the temperature detected in the temperature drop trend, it means that the current temperature of the SD card is detected to drop to the second temperature threshold, and the SD card is reduced from a higher temperature to a safe temperature. At this time, the data storage mode will be switched from the cloud storage mode to the local storage mode.

[0058] It should be noted that the above-mentioned temperature decrease trend refers to the trend of temperature decreasing with time.

[0059] In a possible embodiment, after switching to the cloud storage mode, a test detection may be performed in real time or periodically to detect whether a temperature decrease trend has occurred. When a temperature decrease trend has been detected, the comparison of the second temperature threshold is activated.

[0060] The temperature change trend can be predicted using a time series analysis algorithm (ARIMA model) to predict the temperature change trend in the future. The temperature change trend can include a temperature increase trend and a temperature decrease trend. Specifically, the temperature data before the current moment can be input into the ARIMA model for prediction processing to obtain the temperature change trend in the future.

[0061] In a possible embodiment, when it is detected that the current temperature of the SD card drops to a first temperature threshold, the high-load task in the embedded device may be postponed to a period with a lower temperature for execution.

[0062] The first temperature threshold and the second temperature threshold may be equal or unequal. Further, the second temperature threshold may be slightly lower than the first temperature threshold, so that detection errors during temperature detection can be avoided and the SD card can be further ensured to enter a safe working temperature range.

[0063] In the embodiment of the present invention, the current temperature of the SD card is detected in real time; when it is detected that the current temperature of the SD card rises to the first temperature threshold, the data storage mode is switched to the cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode; when it is detected that the current temperature of the SD card drops to the second temperature threshold, the data storage mode is switched to the local storage mode, and the data to be stored is written to the SD card for storage through the local storage mode. The present invention can upload the data to be stored to the cloud for storage through the cloud storage mode when it is detected that the current temperature of the SD card reaches the first temperature threshold, thereby improving the problem of poor read and write efficiency and possible data damage or loss when continuing to write data to the SD card under high temperature conditions, thereby ensuring the security and integrity of the monitoring data. After detecting that the temperature of the SD card drops to a safe range, the data to be stored is written to the SD card for storage through the local storage mode. By introducing a temperature detection mechanism and a storage mode switching strategy, the reliability and stability of data storage are improved, and the risk of data damage is reduced.

[0064] It is understandable that in the specific implementation of this application, it involves data to be stored, device temperature data and other related data. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data, as well as model training, deployment and use, must comply with relevant laws, regulations and standards of relevant countries and regions.

[0065] Optionally, after the step of detecting that the current temperature of the SD card rises to the first temperature threshold, the current area where the SD card is located can also be determined; the weather forecast information of the current area and the current time of the current temperature are obtained; based on the weather forecast information and the current time, it is predicted whether the temperature of the SD card will rise to a third temperature threshold, and the third temperature threshold is determined according to the third critical temperature that causes data loss on the SD card; if it is predicted that the temperature of the SD card will rise to the second temperature threshold, then before the temperature of the SD card rises to the second temperature threshold, the first stored data in the SD card is uploaded to the cloud for storage through the cloud storage mode.

[0066] In an embodiment of the present invention, a weather forecast API (such as OpenWeatherMap) may be integrated into the above-mentioned embedded device, and the above-mentioned weather forecast API is integrated into the embedded system. Real-time and predicted weather data are obtained, and the weather forecast information may include temperature, humidity, etc. A positioning system may also be integrated into the above-mentioned embedded device, and the current position of the embedded device is determined by the positioning system. According to the current position, the weather forecast information of the area where the SD card (i.e., the embedded device) is located is requested through the weather forecast API. The weather data returned by the API can be converted into a format recognizable by the system through the data parsing module, and the parsed data can be stored for subsequent temperature trend prediction.

[0067] The above temperature change trend can be obtained based on weather forecast information. Specifically, since the weather preset information includes weather data for all times of the day, weather data for a period of time in the future can be directly intercepted from the weather forecast information to obtain the temperature change trend for a period of time in the future.

[0068] In a possible embodiment, the temperature change trend can be predicted using a time series analysis algorithm (ARIMA model) to predict the temperature change trend in the future, and the temperature change trend can include a temperature rise trend and a temperature drop trend. Specifically, when it is detected that the current temperature of the SD card rises to the first temperature threshold, the temperature data before the current moment can be input into the ARIMA model for prediction processing to obtain the temperature change trend in the future.

[0069] After obtaining the temperature change trend, determine whether there is a predicted temperature greater than or equal to the third temperature threshold in the temperature change trend from the current moment to a period of time in the future. If there is a predicted temperature greater than or equal to the third temperature threshold in the temperature change trend, it can be determined that the temperature of the SD card will rise to the third temperature threshold.

[0070] In the case where it is predicted that the temperature of the SD card will rise to the third temperature threshold, the SD card may be damaged. Therefore, this embodiment proposes to upload the first stored data in the SD card to the cloud for storage through the cloud storage mode before the temperature of the SD card rises to the third temperature threshold, so as to further ensure the security of the data. It should be noted that the first stored data is the data that has been stored in the SD card before the current moment.

[0071] Optionally, in the step of predicting whether the temperature of the SD card will rise to a third temperature threshold based on weather forecast information and the current moment, a first temperature change trend in the future time period can be determined based on the weather forecast information; taking the current moment as the starting prediction time point, based on the first temperature change trend, it is predicted whether the temperature of the SD card will rise to a third temperature threshold.

[0072] In an embodiment of the present invention, after obtaining the weather forecast information of the current area, the weather data for a period of time in the future can be directly read from the weather forecast information of the current area, and the time-temperature distribution or time-temperature curve of the weather data is determined as the first temperature change trend in the future period of time. At this time, the third temperature threshold can be a temperature threshold based on the weather forecast temperature system, that is, the temperature system of the SD card is converted into the weather forecast temperature system.

[0073] In a possible embodiment, considering that weather forecast is a fuzzy prediction for a larger area, this embodiment can use a time series analysis algorithm, such as an ARIMA model, to predict the temperature change trend in the future. The model is trained based on historical weather forecast data to improve the accuracy of weather forecast data. Specifically, the input of the ARIMA model is the weather forecast information of the current area. Using the weather forecast information, the prediction accuracy of the temperature trend can be further improved.

[0074] In a possible embodiment, considering the influence of the internal operating temperature of the embedded device, the weather forecast information of the current area and the historical temperature information before the current moment can also be obtained, and the weather forecast information of the current area and the historical temperature information before the current moment are converted into a format recognizable by the system, and these data are stored for subsequent temperature trend prediction.

[0075] Specifically, time series analysis algorithms, such as the ARIMA model, can be used to predict the temperature trend in the future. The model is trained based on historical data to improve the accuracy of the prediction. Specifically, the input of the ARIMA model is the weather forecast information of the current area and the historical temperature information before the current moment. Using the weather forecast information and the historical temperature information in the embedded device can further improve the accuracy of the temperature trend prediction.

[0076] After predicting the first temperature change trend, in the first temperature change trend, a temperature comparison is performed backward with the current moment as the starting prediction time point. If a temperature value greater than the third temperature threshold is compared, it can be predicted that the temperature of the SD card will rise to the third temperature threshold.

[0077] Optionally, in the step of determining the first temperature change trend in a future time period based on the weather forecast information, a trained prediction model can be obtained, the prediction model being obtained by training a time series model using a training data set, the training data set including historical weather forecast data; the weather forecast information is predicted and processed by the prediction model to obtain the first temperature change trend in the future time period.

[0078] In an embodiment of the present invention, the upper prediction model may be a time series analysis algorithm model, such as an ARIMA model, or other time series analysis algorithm models, such as an algorithm model based on a recurrent neural network RNN ​​or a long short-term memory network LSTM.

[0079] In the process of training the algorithm model, it is necessary to collect a training data set, which includes historical weather forecast data. The historical weather forecast data can be divided into two time periods, the former time period as sample input, and the latter time period as label output after high-precision processing. In this way, the label output can guide the prediction model to output more accurate prediction data. The high-precision processing can include linear interpolation processing or quadratic interpolation processing.

[0080] The above training can adopt supervised training, and the parameters of the prediction model are adjusted by the error back propagation algorithm, so that after the training is completed, a trained prediction model is obtained. After the trained prediction model is obtained, the trained prediction model can be used to predict the first temperature change trend. Specifically, the weather forecast information is input into the prediction model, and the first temperature change trend is output.

[0081] In a possible embodiment, the prediction model can be trained simultaneously with the temperature data of the embedded device. In this case, the training data set can include historical weather forecast data and historical device temperature data. The historical weather forecast data and the historical device temperature data are synchronized in time and have the same time length. In the historical device temperature data, with 24:00 on the day as the end point or with another time point as the end point, historical device temperature data of the same length as the future time is divided from the back to the front as the label output, and the historical device temperature data and historical weather forecast data divided in the historical device temperature data are combined into sample inputs. Supervised training is adopted, and the parameters of the prediction model are adjusted through the error back propagation algorithm, so that after the training is completed, a trained prediction model is obtained.

[0082] After the trained prediction model is obtained, the trained prediction model can be used to predict the first temperature change trend. Specifically, weather forecast information and historical temperature data are input into the prediction model, and the first temperature change trend is output.

[0083] Optionally, in the step of predicting whether the temperature of the SD card will rise to a third temperature threshold based on the first temperature change trend with the current moment as the starting prediction time point, the forecast temperature at the current moment can be determined based on weather forecast information; the temperature difference between the current temperature and the forecast temperature can be calculated; the temperature difference can be superimposed on the first temperature change trend to obtain a second temperature change trend corresponding to the SD card; and with the current moment as the starting prediction time point, based on the second temperature change trend, it can be predicted whether the temperature of the SD card will rise to a third temperature threshold.

[0084] In the embodiment of the present invention, considering that a certain amount of heat will be generated during the operation of the embedded device, so that there may be an error between the forecast temperature and the device temperature detected by the temperature sensor, the temperature difference between the current temperature and the forecast temperature can be calculated. The above-mentioned current temperature is the temperature detected by the temperature sensor in the embedded device at the current moment, and the forecast temperature is the temperature reported in the weather forecast at the current moment. By calculating the temperature difference between the current temperature and the forecast temperature, the temperature difference between the ambient temperature and the device temperature can be obtained.

[0085] After obtaining the first temperature change trend, the temperature difference can be superimposed on the first temperature change trend to obtain a new temperature change trend. The new temperature change trend is the temperature change trend near the SD card in the embedded device, which can represent the second temperature change trend corresponding to the SD card.

[0086] After predicting the second temperature change trend, in the second temperature change trend, a temperature comparison is performed backward with the current moment as the starting prediction time point. If a temperature value greater than the third temperature threshold is compared, it can be determined that the temperature of the SD card will rise to the third temperature threshold.

[0087] Optionally, after the step of switching the data storage mode to the cloud storage mode, the real-time detection of the current temperature of the SD card may also be stopped.

[0088] After obtaining the weather forecast information of the current area and the current temperature at the current time, the predicted time period for the temperature of the SD card to drop to the second temperature threshold can be predicted based on the weather forecast information; when the current time reaches the predicted time period, real-time detection of the current temperature of the SD card is started.

[0089] In an embodiment of the present invention, after the step of switching the data storage mode to the cloud storage mode, stopping the real-time detection of the current temperature of the SD card can reduce the detection workload of the embedded device and reduce the temperature rise rate of the embedded device.

[0090] After obtaining the weather forecast information, the first temperature change trend or the second temperature change trend can be predicted according to the weather forecast information, and on the basis of the first temperature change trend or the second temperature change trend, the predicted time period in which the temperature of the SD card drops to the second temperature threshold is predicted. The above-mentioned second temperature threshold is the upper limit temperature of the safe operation of the SD card. In the weather temperature data such as the first temperature change trend or the second temperature change trend, the temperature drop trend is determined, and the time point corresponding to the second temperature threshold is found in the temperature drop trend, and the time point corresponding to the second temperature threshold is extended forward and backward to obtain the predicted time period.

[0091] In a possible embodiment, based on the first temperature change trend or the second temperature change trend, if there is no predicted time period in which the temperature of the SD card drops to the second temperature threshold, the predicted future time length can be increased, or the current moment can be moved backward to obtain the first temperature change trend or the second temperature change trend at a more distant time.

[0092] Determine whether the current time has reached the predicted time period [EF]. If the current time has reached the predicted time period [EF], perform real-time detection of the current temperature of the SD card. It should be noted that the temperature of the embedded device has a rising and falling process, which corresponds to a long period of time. During this time, there is no need to spend computing power to calculate and identify the current temperature and perform data comparison. This is equivalent to obtaining a rough restart time period based on the weather forecast when the SD card is no longer reading and writing, and it is also the time period for real-time temperature detection again. In this way, it can reduce the waste of resources and reduce the computing workload of the machine that is already overheated due to work.

[0093] Optionally, after the step of switching the data storage mode to the local storage mode, second stored data can be downloaded from the cloud and written to an SD card for storage; in the SD card, the second stored data is merged with the first stored data in the SD card; or, in the SD card, the second stored data and the first stored data in the SD card are marked in the original time sequence of data collection to obtain marked stored data, and the mark is used to splice the stored data according to the mark when the response data is exported.

[0094] In the embodiment of the present invention, the data stored in the cloud is the second stored data, and the data stored in the SD card is the first stored data. When it is detected that the current temperature of the SD card reaches the second temperature threshold, and the current temperature is the temperature detected in the temperature decline trend, the data storage mode is switched to the local storage mode, and the second stored data in the cloud can be downloaded to the SD card for local storage.

[0095] After the second stored data is downloaded to the SD card, the second stored data can be merged with the first stored data in the SD card to form complete collected data (monitoring data). Alternatively, the downloaded data and the data in the SD card are numbered in paragraph order (for example, in the order of formation time), and when the data in the SD card needs to be exported, the monitoring information can be spliced ​​through an external device according to its number to form complete collected data (monitoring data).

[0096] like Figure 2 As shown, an embodiment of the present invention provides a temperature-based data storage device, the temperature-based data storage device comprising:

[0097] The detection module 201 is used to detect the current temperature of the SD card in real time;

[0098] The first storage module 202 is used to switch the data storage mode to the cloud storage mode when it is detected that the current temperature of the SD card rises to a first temperature threshold, and upload the data to be stored to the cloud for storage through the cloud storage mode;

[0099] The second storage module 203 is used to switch the data storage mode to the local storage mode when it is detected that the current temperature of the SD card drops to a second temperature threshold, and write the data to be stored into the SD card for storage through the local storage mode.

[0100] Optionally, the device further comprises:

[0101] A first processing module, used for determining the current area of ​​the SD card;

[0102] An acquisition module, used to acquire the weather forecast information of the current area and the current time of the current temperature;

[0103] A second processing module is used to predict whether the temperature of the SD card will rise to a third temperature threshold based on the weather forecast information and the current time, where the third temperature threshold is determined according to a third critical temperature that causes data loss on the SD card;

[0104] The third processing module is used to upload the first stored data in the SD card to the cloud for storage through the cloud storage mode before the temperature of the SD card rises to the third temperature threshold if it is predicted that the temperature of the SD card will rise to the third temperature threshold.

[0105] Optionally, the second processing module is also used to determine a first temperature change trend in a future time period based on the weather forecast information; taking the current moment as the starting prediction time point, and based on the first temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0106] Optionally, the second processing module is also used to obtain a trained prediction model, which is obtained by training a time series model using a training data set, and the training data set includes historical weather forecast data; the weather forecast information is predicted and processed by the prediction model to obtain a first temperature change trend in a future time period.

[0107] Optionally, the second processing module is also used to determine the forecast temperature at the current moment based on the weather forecast information; calculate the temperature difference between the current temperature and the forecast temperature; superimpose the temperature difference on the basis of the first temperature change trend to obtain a second temperature change trend corresponding to the SD card; take the current moment as the starting prediction time point, and based on the second temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0108] Optionally, the device further comprises:

[0109] Stop module, used to stop real-time detection of the current temperature of the SD card;

[0110] A prediction module, configured to predict, based on the weather forecast information, a predicted time period in which the temperature of the SD card drops to the second temperature threshold;

[0111] The start module is used to start real-time detection of the current temperature of the SD card when the current moment reaches the predicted time period.

[0112] Optionally, the device comprises:

[0113] A download module, used for downloading the second stored data from the cloud, and writing the second stored data into the SD card for storage;

[0114] The fourth processing module is used to merge the second stored data with the first stored data in the SD card in the SD card; or, in the SD card, mark the second stored data and the first stored data in the SD card in the original time sequence of data acquisition to obtain stored data with marks, and the marks are used to splice the stored data according to the marks when the response data is exported.

[0115] It should be noted that the temperature-based data storage device provided in the embodiment of the present invention can be applied to atomization equipment (such as electronic cigarettes), smart phones, tablets, computers, servers and other devices that can perform temperature-based data storage methods.

[0116] The temperature-based data storage device provided in the embodiment of the present invention can implement each process implemented by the temperature-based data storage method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0117] See also Figure 3 , Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, it includes: a memory 302, a processor 301, and a computer program of a temperature-based data storage method stored in the memory 302 and executable on the processor 301, wherein:

[0118] The processor 301 is used to call the computer program stored in the memory 302 and execute the following steps:

[0119] Real-time detection of the current temperature of the SD card;

[0120] When it is detected that the current temperature of the SD card rises to a first temperature threshold, the data storage mode is switched to a cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode;

[0121] When it is detected that the current temperature of the SD card drops to a second temperature threshold, the data storage mode is switched to a local storage mode, and the data to be stored is written into the SD card for storage through the local storage mode.

[0122] Optionally, after the step of detecting that the current temperature of the SD card rises to a first temperature threshold, the method executed by the processor 301 further includes:

[0123] Determine the current region of the SD card;

[0124] Obtaining weather forecast information for the current area and the current time of the current temperature;

[0125] Based on the weather forecast information and the current time, predict whether the temperature of the SD card will rise to a third temperature threshold, where the third temperature threshold is determined according to a third critical temperature that causes data loss on the SD card;

[0126] If it is predicted that the temperature of the SD card will rise to the third temperature threshold, the first stored data in the SD card is uploaded to the cloud for storage through the cloud storage mode before the temperature of the SD card rises to the third temperature threshold.

[0127] Optionally, the step of predicting whether the temperature of the SD card will rise to a third temperature threshold based on the weather forecast information and the current moment, performed by the processor 301, includes:

[0128] Based on the weather forecast information, determining a first temperature change trend in a future time period;

[0129] Taking the current moment as a starting prediction time point, based on the first temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0130] Optionally, the step of determining a first temperature change trend in a future time period based on the weather forecast information performed by the processor 301 includes:

[0131] Obtaining a trained prediction model, wherein the prediction model is obtained by training a time series model using a training data set, wherein the training data set includes historical weather forecast data;

[0132] The weather forecast information is predicted and processed by the prediction model to obtain a first temperature change trend in a future time period.

[0133] Optionally, the step of taking the current moment as the starting prediction time point and predicting whether the temperature of the SD card will rise to a third temperature threshold based on the first temperature change trend, performed by the processor 301, includes:

[0134] Based on the weather forecast information, determining the forecast temperature at the current moment;

[0135] Calculating a temperature difference between the current temperature and the forecast temperature;

[0136] The temperature difference is superimposed on the first temperature change trend to obtain a second temperature change trend corresponding to the SD card;

[0137] Taking the current moment as a starting prediction time point, based on the second temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

[0138] Optionally, after the step of switching the data storage mode to the cloud storage mode, the method executed by the processor 301 further includes:

[0139] Stop real-time detection of the current temperature of the SD card;

[0140] After the step of obtaining the weather forecast information of the current area and the current time of the current temperature, the method executed by the processor 301 further includes:

[0141] Based on the weather forecast information, predict a predicted time period in which the temperature of the SD card drops to the second temperature threshold;

[0142] When the current moment reaches the predicted time period, real-time detection of the current temperature of the SD card is started.

[0143] Optionally, after the step of switching the data storage mode to the local storage mode, the method executed by the processor 301 includes:

[0144] Downloading second stored data from the cloud, and writing the second stored data into the SD card for storage;

[0145] In the SD card, merging the second stored data with the first stored data in the SD card;

[0146] Alternatively, in the SD card, the second stored data and the first stored data in the SD card are marked in the original time sequence of data acquisition to obtain stored data with marks, and the marks are used to splice the stored data according to the marks when the response data is exported.

[0147] It should be noted that the electronic device provided in the embodiment of the present invention can be applied to atomization devices (such as electronic cigarettes), smart phones, tablets, computers, servers and other devices that can perform temperature-based data storage methods.

[0148] The electronic device provided in the embodiment of the present invention can implement each process implemented by the temperature-based data storage method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0149] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the temperature-based data storage method provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0150] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0151] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A temperature-based data storage method, characterized in that: The method comprises the following steps: Real-time detection of the current temperature of the SD card; When it is detected that the current temperature of the SD card rises to a first temperature threshold, the data storage mode is switched to a cloud storage mode, and the data to be stored is uploaded to the cloud for storage through the cloud storage mode; When it is detected that the current temperature of the SD card drops to a second temperature threshold, the data storage mode is switched to a local storage mode, and the data to be stored is written into the SD card for storage through the local storage mode.

2. The temperature-based data storage method according to claim 1, characterized in that: After the step of detecting that the current temperature of the SD card rises to a first temperature threshold, the method further includes: Determine the current region of the SD card; Obtaining weather forecast information for the current area and the current time of the current temperature; Based on the weather forecast information and the current time, predict whether the temperature of the SD card will rise to a third temperature threshold, where the third temperature threshold is determined according to a third critical temperature that causes data loss on the SD card; If it is predicted that the temperature of the SD card will rise to the third temperature threshold, the first stored data in the SD card is uploaded to the cloud for storage through the cloud storage mode before the temperature of the SD card rises to the third temperature threshold.

3. The temperature-based data storage method according to claim 2, characterized in that: The step of predicting whether the temperature of the SD card will rise to a third temperature threshold based on the weather forecast information and the current time includes: Based on the weather forecast information, determining a first temperature change trend in a future time period; Taking the current moment as a starting prediction time point, based on the first temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

4. The temperature-based data storage method according to claim 3, characterized in that: The step of determining a first temperature change trend in a future time period based on the weather forecast information includes: Obtaining a trained prediction model, wherein the prediction model is obtained by training a time series model using a training data set, wherein the training data set includes historical weather forecast data; The weather forecast information is predicted and processed by the prediction model to obtain a first temperature change trend in a future time period.

5. The temperature-based data storage method according to claim 3, characterized in that: The step of taking the current moment as the starting prediction time point and predicting whether the temperature of the SD card will rise to a third temperature threshold based on the first temperature change trend comprises: Based on the weather forecast information, determining the forecast temperature at the current moment; Calculating a temperature difference between the current temperature and the forecast temperature; Superimposing the temperature difference on the basis of the first temperature change trend, to obtain a second temperature change trend corresponding to the SD card; Taking the current moment as a starting prediction time point, based on the second temperature change trend, predict whether the temperature of the SD card will rise to a third temperature threshold.

6. The temperature-based data storage method according to any one of claims 2 to 5, characterized in that: After the step of switching the data storage mode to the cloud storage mode, the method further includes: Stop real-time detection of the current temperature of the SD card; After the step of obtaining the weather forecast information of the current area and the current time of the current temperature, the method further includes: Based on the weather forecast information, predict a predicted time period in which the temperature of the SD card drops to the second temperature threshold; When the current moment reaches the predicted time period, real-time detection of the current temperature of the SD card is started.

7. The temperature-based data storage method according to claim 1, characterized in that: After the step of switching the data storage mode to the local storage mode, the method includes: Downloading second stored data from the cloud, and writing the second stored data into the SD card for storage; In the SD card, merging the second stored data with the first stored data in the SD card; Alternatively, in the SD card, the second stored data and the first stored data in the SD card are marked in the original time sequence of data acquisition to obtain stored data with marks, and the marks are used to splice the stored data according to the marks when the response data is exported.

8. A temperature-based data storage device, characterized in that: The temperature-based data storage device comprises: Detection module, used to detect the current temperature of the SD card in real time; A first storage module, configured to switch the data storage mode to a cloud storage mode when it is detected that the current temperature of the SD card rises to a first temperature threshold, and upload the data to be stored to the cloud for storage through the cloud storage mode; The second storage module is used to switch the data storage mode to the local storage mode when it is detected that the current temperature of the SD card drops to a second temperature threshold, and write the data to be stored into the SD card through the local storage mode for storage.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the temperature-based data storage method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the temperature-based data storage method according to any one of claims 1 to 7 are implemented.