Sensor upgrading method, device and equipment based on local Internet of Things networking and medium
By obtaining and analyzing the real -time, historical data and external environment data of the sensor, the best upgrade time is predicted, and the sensor data is used to update the sensor data to solve the problem of stability and efficiency during the upgrade process of the sensor, and achieve efficient and safe upgrade upgrades. manage.
Patent Information
- Application Number
- CN202411373947.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-28
AI Technical Summary
Existing sensor upgrade methods will affect the stability and efficiency of the sensor upgrade process.
By obtaining real -time data, historical data and external environmental data of the sensor, analyze and predict the best upgrade time, and use the specific area data of the partition table to update the sensor within this time to achieve efficient and safe upgrade management.
The efficient and secure upgrade management of the network sensor network of large -scale IoT sensors has been realized, artificial intervention is reduced, and the stability and efficiency of the upgrade process are guaranteed.
Smart Images

Figure CN119376775A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a sensor upgrading method, device, equipment and medium based on local Internet of Things networking. Background Art
[0002] The Internet of Things refers to connecting any object to the network through information sensing devices according to agreed protocols. Objects exchange and communicate information through information dissemination media to achieve intelligent identification, positioning, tracking, supervision and other functions.
[0003] At present, with the widespread application of Internet of Things technology, sensor devices play an increasingly important role in all walks of life. These sensor devices need to update software or upgrade regularly to fix vulnerabilities, improve performance or add new functions. Existing sensor upgrade methods usually adopt on-site upgrades or asynchronous remote upgrades. The on-site upgrade method is generally manual, and technicians go to the site where the sensor is set up to upgrade the sensor. This upgrade method is inefficient and wastes manpower. When upgrading the sensor, the asynchronous remote upgrade method usually involves a full update, that is, each upgrade requires replacing the entire firmware of the sensor. This upgrade method not only consumes a lot of network bandwidth, but also may cause long-term system interruptions. In addition, this upgrade method often lacks the ability to adapt to network changes and cannot be efficiently executed in a network environment with a large number of sensor nodes and a wide distribution, which will affect the stability and efficiency of the sensor upgrade process.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] Existing sensor upgrade methods will affect the smoothness and efficiency of the sensor upgrade process. Summary of the invention
[0006] The purpose of the present invention is to provide a sensor upgrade method, device, equipment and medium based on local Internet of Things networking, so as to solve the technical problem that the sensor upgrade method existing in the prior art will affect the stability and efficiency of the sensor upgrade process.
[0007] The various technical effects that can be produced by the preferred technical solutions among the various technical solutions provided by the present invention are described in detail below.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] In a first aspect, the present invention provides a sensor upgrade method based on local Internet of Things networking, comprising:
[0010] Acquire real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data;
[0011] Analyze and predict the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor;
[0012] Within the optimal upgrade time, the specific area corresponding to the sensor in the memory is determined according to the partition table, the data in the corresponding specific area is updated, and the sensor is upgraded.
[0013] Optionally, the analyzing and predicting the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor includes:
[0014] Preprocessing the real-time data, historical data and external environment data of the sensor to obtain preprocessed data;
[0015] extracting key data from the preprocessed data;
[0016] Using the key data as input to construct an autoregressive model, training the autoregressive model to obtain a trained autoregressive model, and generating multiple prediction times based on the trained autoregressive model;
[0017] An optimal upgrade time for the sensor is determined according to the multiple predicted times.
[0018] Optionally, the key data is used as input to construct an autoregressive model, the autoregressive model is trained to obtain a trained autoregressive model, and multiple prediction times are generated based on the trained autoregressive model, including:
[0019] Taking the key data as input, selecting the model order P, determining the lag order, and constructing the autoregressive model;
[0020] Using the historical data to train the autoregressive model to obtain a trained autoregressive model;
[0021] Use time series cross-validation or rolling validation to validate the trained autoregressive model. If the validation is successful, the validated autoregressive model is obtained.
[0022] Use the verified autoregressive model to predict future time points and obtain multiple prediction times.
[0023] Optionally, the model order P is selected using an autocorrelation graph and a partial autocorrelation graph; and the autoregressive model is constructed using a statsmodels library or a sklearn library.
[0024] Optionally, determining the optimal upgrade time of the sensor according to the multiple predicted times includes:
[0025] The multiple predicted times are combined with the historical data of the sensor, and the upgrade success rates of the sensors within the multiple predicted times are analyzed. The predicted time with the highest upgrade success rate is the optimal upgrade time.
[0026] Optionally, determining the optimal upgrade time of the sensor according to the multiple predicted times includes:
[0027] The multiple predicted times are combined with the real-time data of the sensor, and the predicted time when the CPU usage and memory usage of the sensor are lower than a threshold and the network status is stable is selected as the optimal upgrade time.
[0028] Optionally, the partition table is used to manage the functions and tasks of each of the sensors, and the functions and tasks corresponding to each of the sensors are mapped to specific areas in the memory, and each of the specific areas is indexed by the partition table.
[0029] In a second aspect, the present invention further provides a sensor upgrade device based on local Internet of Things networking, comprising:
[0030] An acquisition module, which acquires real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data;
[0031] An analysis and prediction module analyzes and predicts the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor;
[0032] The upgrade module determines the specific area corresponding to the sensor in the memory according to the partition table within the optimal upgrade time, updates the data in the corresponding specific area, and upgrades the sensor.
[0033] In a third aspect, the present invention further provides a sensor upgrading device, comprising:
[0034] one or more processors and memory;
[0035] The memory is used to store one or more computer programs, and the one or more processors are used to execute the one or more computer programs stored in the memory, so that the processor performs the steps of the sensor upgrade method based on local Internet of Things networking.
[0036] In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of a sensor upgrade method based on local Internet of Things networking are implemented.
[0037] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects:
[0038] The sensor upgrade method described in the present invention can analyze and predict the sensor's real-time data, historical data, and external environment data to obtain the optimal upgrade time for the sensor, automatically manage the entire upgrade process, and achieve efficient and safe upgrade management in a large-scale IoT sensor network, reducing manual intervention. In addition, during the upgrade process, a partition table is used to determine the specific area corresponding to the sensor in the memory, and the data that needs to be updated in the specific area is updated. Only part of the data in the sensor needs to be updated, which can reduce the amount of data transmission and ensure the stability and efficiency of the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. It is obvious that the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0040] Figure 1 It is a schematic diagram of the overall process of Embodiment 1 of the present invention;
[0041] Figure 2 is a flowchart of step S200 in the first embodiment of the present invention;
[0042] Figure 3 is a flowchart of step S210 in the first embodiment of the present invention;
[0043] Figure 4 is a flowchart of step S230 in the first embodiment of the present invention;
[0044] Figure 5 It is a structural diagram of a sensor upgrading device based on local Internet of Things networking in the second embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, wherein various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods, devices, etc. that are consistent with some aspects of the present disclosure as detailed in the attached claims, and other embodiments may also be used, or the embodiments listed herein may be modified in structure and function without departing from the scope and essence of the present invention.
[0046] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", etc. indicate the orientation or positional relationship based on the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the elements referred to must have a specific orientation, be constructed and operated in a specific orientation. The terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "multiple" means two or more. The terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0047] In order to illustrate the technical solution of the present invention, a specific embodiment is used for description below, and only the parts related to the embodiment of the present invention are shown.
[0048] Embodiment 1:
[0049] like Figure 1 As shown, the present invention provides a sensor upgrade method based on local Internet of Things networking, comprising:
[0050] S100, acquiring real-time data, historical data, and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data;
[0051] S200, analyzing and predicting the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor;
[0052] S300: within the optimal upgrade time, determine the specific area corresponding to the sensor in the memory according to the partition table, update the data in the corresponding specific area, and upgrade the sensor.
[0053] Next, combine Figure 1 The specific implementation steps of the sensor upgrade method based on local IoT networking are introduced in detail:
[0054] First, step S100 is executed to obtain real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data.
[0055] The sensor's real-time data, historical data, and external environment data are the basis for selecting the best upgrade time for the sensor. Real-time data includes real-time operation data and real-time network data. Real-time operation data refers to the current operation data of the sensor, including the current sensor operation status data, CPU usage, and memory usage. Real-time operation data can reflect the current operation load of the sensor. If the current CPU usage and memory usage are low, it means that upgrading at this time will have the least impact on the overall system, and this can be a suitable and optimal upgrade time. In addition to the above data, real-time operation data also includes the health status of the sensor, including battery power, power supply status, and temperature. When the battery power and power supply status are sufficient or powered by an external power supply, the upgrade process will not be interrupted due to insufficient power, which is a necessary condition for the upgrade; the operating temperature can avoid upgrading when the sensor temperature is high to prevent failures caused by overheating.
[0056] Real-time network data refers to the operating environment of the sensor, including bandwidth, latency, packet loss rate and other data. The size of the bandwidth directly affects the data transmission speed. If the network bandwidth is large, the upgrade can be completed faster. If the network has delays and jitters, low latency and a stable network environment can reduce packet loss and retransmission. A high packet loss rate means that the network quality is poor, which is not suitable for large data transmission and upgrades. Improve upgrade efficiency Real-time network data can reflect the network status of the sensor, which will directly affect the transmission efficiency and stability of data during the upgrade.
[0057] Historical data refers to historical upgrade data. It includes the start time, duration, end time, and past upgrade success rate of each sensor upgrade. The past upgrade success rate records that certain time periods (nighttime or when the network is idle) have higher upgrade success rates. These time periods can be used as the best upgrade time in the future. The start time, duration, and end time of each sensor upgrade reflect the average time required for the upgrade. The upgrade time can be estimated based on historical data to avoid upgrading sensors during periods when emergency tasks need to be handled.
[0058] External environment data includes time data and regional network load data. Time data determines the frequency of sensor usage based on the difference between day and night, weekdays, weekends, and holidays. Regional network load data records the network activities of other devices in the same local area network, which will also affect the selection of the best upgrade time.
[0059] The real-time data, historical data and external environment data of the sensors recorded above are all factors that need to be considered in the subsequent selection of the optimal upgrade time for the sensors. When selecting the optimal upgrade time for the sensors, the optimal upgrade time can be dynamically adjusted according to the various states of the sensors. The optimal upgrade time can be selected while ensuring the performance and stability of the upgrade system.
[0060] After acquiring the real-time data, historical data and external environment data of each sensor, step S200 is executed to analyze and predict the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor. The specific process steps for obtaining the optimal upgrade time of the sensor are as follows: Figure 2 shown.
[0061] S210, preprocessing the real-time data, historical data and external environment data of the sensor to obtain preprocessed data;
[0062] S220, extracting key data from the preprocessed data;
[0063] S230, using the key data as input to construct an autoregressive model, training the autoregressive model to obtain a trained autoregressive model, and generating multiple prediction times based on the trained autoregressive model;
[0064] S240: Determine an optimal upgrade time for the sensor according to the multiple predicted times.
[0065] When the optimal upgrade time of the sensor is obtained, step S210 is first performed to pre-process the real-time data, historical data and external environment data of the sensor. The process of pre-processing the data is as follows: Figure 3 As shown:
[0066] S211. Clean the real-time data, historical data and external environment data of the sensor to process missing values, abnormal values, and remove unreasonable data points.
[0067] S212, normalizing the cleaned data to standardize the data and ensure that data of different dimensions have the same importance in subsequent models.
[0068] S213, convert the normalized data into a time series. Since the autoregressive model (AR model) depends on the autocorrelation between time points in the time series data, after the data is normalized, it is necessary to convert the normalized data into a time series form, where each point in the time series represents the data state within a certain time interval. For example: every minute, every hour. Preprocessing the real-time data, historical data, and external environmental data of the sensor can exclude features that are not strongly time-dependent and can reduce the impact of noise on the model. Among them, when preprocessing the data, the data will be stabilized. If there is a trend or seasonality in the time series, the difference operation can be used to remove the trend and seasonality, so that the data is more suitable for the autoregressive model, which is convenient for the subsequent construction and verification of the autoregressive model.
[0069] After processing the real-time data, historical data and external environment data of the sensor, step S220 is executed to extract key data from the preprocessed data, and the extracted data is used as the input of the autoregressive model. Among them, the key data is the CPU usage, memory usage, bandwidth, delay, packet loss rate and other data of the preprocessed sensor, historical upgrade success rate, battery power and power supply status, operating temperature, time data, etc. The above key data are all time-dependent feature data, and the above feature data can directly affect the prediction effect of the model. Therefore, it is necessary to fully select and construct the key data.
[0070] Then, step S230 is executed to use the key data as input to construct an autoregressive model, train the autoregressive model to obtain a trained autoregressive model, and generate multiple prediction times based on the trained autoregressive model. The specific method steps are as follows Figure 4 shown.
[0071] S231, taking the key data as input, selecting the model order P, determining the lag order, and constructing the autoregressive model;
[0072] S232, using historical data to train an autoregressive model to obtain a trained autoregressive model;
[0073] S233, using a time series cross-validation method or a rolling validation method to validate the trained autoregressive model, and if the validation is successful, a validated autoregressive model is obtained;
[0074] S234. Use the trained and verified autoregressive model to predict future time points to obtain multiple predicted times.
[0075] In step S230, firstly, step S231 needs to be executed, key data is used as input, model order P is selected, lag order is determined, and autoregressive model is constructed. Specifically, after key data is input, autocorrelation graph (ACF, Autocorrelation Function) and partial autocorrelation graph (PACF, Partial Autocorrelation Function) need to be used to select model order P, autocorrelation graph and partial autocorrelation graph can identify significant autocorrelation in time series data, and can select appropriate lag order. Among them, lag order can be determined according to data such as bandwidth, delay, packet loss rate, etc., and lag feature data is determined to enhance the prediction ability of autoregressive model. For example, the network status at the current moment may depend on the status of the previous hour or the previous two hours, and its lag variables (such as Xt-1, Xt-2, ... X{t-1}, X{t-2}, \ldotsXt-1, Xt-2, ...) are used for autoregressive model.
[0076] For some sensor data, P=3 or P=5 may be selected to capture the impact of previous time points on the current time point. After determining the model order P and the lag order, the autoregressive model can be constructed. It should be noted that the autoregressive model is constructed using Python libraries such as statsmodels or sklearn. The following code can be used in Python:
[0077] from statsmodels.tsa.ar_model import AutoReg
[0078] #Assume that the data is stored in time_series_data
[0079] #The lag order is chosen as p
[0080] p=5
[0081] model=AutoReg(time_series_data,lags=p)
[0082] model_fit = model.fit()
[0083] After the autoregressive model is constructed, step S232 is executed, and the autoregressive model is trained using historical data to obtain a trained autoregressive model. When training the autoregressive model, the autoregressive model needs to learn the autocorrelation relationship between time points in the historical data and fit the optimal autoregressive coefficient. Among them, the autoregressive coefficient represents the linear relationship between the observation value at the current moment and the observation value at the past P moments, and the optimal autoregressive coefficient reflects the most consistent linear dependency relationship between the observation value at the current moment and the observation value at the past P time. Since the autoregressive model uses the values of the P moments before the current moment to predict the value at the current moment, it will predict the future based on the past observations. Therefore, it is necessary to use historical data to train the autoregressive model, and improve the accuracy of the prediction by optimizing the model parameters and verifying the model effect. When the autoregressive model is trained using historical data, the model will learn the autocorrelation relationship between the time points in the data to fit the optimal regression coefficient, which is helpful to understand the structure of the time series data and predict future data points.
[0084] Then, step S233 is executed; the trained autoregressive model is verified using a time series cross-validation method or a rolling validation method, and the prediction error of the autoregressive model is measured using indicators such as mean square error and mean absolute error. If the prediction error of the autoregressive model is within the corresponding threshold, the autoregressive model converges to obtain a verified autoregressive model. In this embodiment, the threshold is not limited and can be selected according to actual conditions.
[0085] After the autoregressive model is verified, step S234 is executed to use the verified autoregressive model to predict future time points to obtain multiple predicted times. Specifically, when predicting future time points, the load of sensors and changes in network status in the next few hours or more than ten hours can be predicted. The status of the next 10 time points can be predicted according to the situation. The code for predicting a time point in the future can be: predictions = model_fit.predict(start = len(time_series_data), end = len(time_series_data) + 10) print(predictions).
[0086] It should be noted that, in the process of executing step S200, the optimal upgrade time of the sensor is determined based on the real-time data, historical data and external environment data of the sensor. Therefore, the update time of the autoregressive model and the time for retraining the autoregressive model can be set according to the situation. Regular updates can be selected to continuously introduce new real-time data, historical data and external environment data to improve the accuracy of the autoregressive model. Continuous learning and optimization of the model can be achieved according to the automated process.
[0087] The above steps are the process steps of generating multiple predicted times, which are used to predict the upgrade time of the sensor, predict multiple time points, and provide nodes for the sensor upgrade. This embodiment uses an autoregressive model to predict the best time for sensor upgrades. The key is to effectively use historical data to capture time dependencies and dynamically adjust the upgrade tasks according to the real-time situation of the sensor, so as to achieve efficient and secure upgrade management in large-scale IoT sensor networks.
[0088] After obtaining multiple predicted time points, step S240 is executed to determine the optimal upgrade time of the sensor according to the multiple predicted times. Specifically, in order to ensure the accuracy of the upgrade and avoid repeated upgrades, it is necessary to select one of the multiple predicted time points as the optimal upgrade time, and upgrade the sensor within the optimal upgrade time.
[0089] There are two different situations for determining the best upgrade time for sensors within multiple prediction times. The first situation is to combine multiple prediction times with the historical data of the sensor, analyze the upgrade success rate of the sensor within multiple prediction times, and select the prediction time with the highest upgrade success rate as the best upgrade time. The second is to combine the multiple prediction times with the real-time data of the sensor, and select the prediction time when the CPU usage and memory usage of the sensor are lower than the threshold and the network status is stable as the best upgrade time. No matter which of the two methods is used, the best upgrade time can be selected to ensure the best time period for the sensor, reduce interference with the daily work of the sensor, and improve the success rate of the sensor upgrade while ensuring the stability of the sensor upgrade, and optimize the efficiency of the upgrade process.
[0090] Finally, step S300 is executed to determine the specific area corresponding to the sensor in the memory according to the partition table within the optimal upgrade time, update the data in the corresponding specific area, and upgrade the sensor. The partition table is used to manage the functions and tasks of each sensor, and the functions and tasks corresponding to each sensor are mapped to the specific area in the memory, and each specific area is indexed by the partition table.
[0091] Specifically, after determining the best upgrade time, the sensor is upgraded within the best upgrade time. The functions and tasks of each sensor are managed by the partition table, and the functions and tasks of each sensor are mapped to the characteristic area of the memory, and each area is indexed by the partition table. The partition table divides the firmware into multiple independent modules, each of which can be upgraded separately, which not only enables more refined control, but also allows customized upgrades according to the actual needs of each module. The use of the partition table can ensure that during the upgrade process, the sensor only needs to change the part of the code or data that needs to be changed in the corresponding sensor, without the need to rewrite the firmware of the entire system, thereby improving the upgrade efficiency of the sensor and reducing the interruption time of the system. In addition, the partition table can be dynamically adjusted and expanded according to the functional changes and requirements of the sensor, supporting future functional upgrades and expansions. The partition table used in this embodiment can easily cope with new requirements and the addition of new functions of the sensor through a flexible partition management mechanism.
[0092] When determining to upgrade the corresponding sensor, the upgrade manager is used for assistance. The calculation manager calculates the differences in the functions and tasks that need to be updated, and determines the specific area in the corresponding memory according to the partition table. Only the data in the specific area is downloaded and updated to ensure the integrity and correctness of the data during the upgrade. Specifically, the upgrade data adopts an efficient data verification mechanism during the transmission process to ensure the accuracy and reliability of data transmission. When a data transmission error is detected, the upgrade manager can automatically start the error recovery mechanism and retransmit the damaged data packet to ensure the smooth progress of the upgrade process. The upgrade manager also has a breakpoint resume function. If the network is interrupted or there is a problem with the sensor during the upgrade process, the system can save the current upgrade progress and continue to upgrade from the breakpoint after the network connection is restored or the problem is solved, avoiding repeated transmission and wasting time.
[0093] In addition, during the upgrade process, an adaptive upgrade algorithm is used to upgrade the sensor, which can intelligently adjust the upgrade task according to the network conditions and sensor device status, as well as the upgrade execution strategy of the adaptive network conditions to ensure the smoothness and efficiency of the upgrade process. Specifically, it can optimize data transmission and write operations according to network conditions and sensor status, speed up the upgrade speed when the network load is low, and automatically reduce the upgrade speed when the network condition is poor to ensure that the normal operation of the sensor is not affected. The adaptive upgrade algorithm also supports multi-task parallel processing, and can upgrade multiple sensors at the same time, and improve the overall upgrade efficiency by reasonably allocating network bandwidth and computing resources. The adaptive upgrade algorithm can also intelligently control network traffic to avoid large amounts of data transmission during network peak hours, thereby reducing the impact on other devices and applications. It can automatically identify network congestion and adjust the data transmission rate and transmission time to ensure the stability and reliability of the network.
[0094] The sensor upgrade method described in this embodiment can analyze and predict the best upgrade time of the sensor based on the real-time data, historical data and external environment data of the sensor, automatically manage the entire upgrade process, and realize efficient and safe upgrade management in a large-scale IoT sensor network, reducing manual intervention. In addition, during the upgrade process, the partition table is used to determine the specific area corresponding to the sensor in the memory, and the data that needs to be updated in the specific area is updated. Only part of the data in the sensor needs to be updated, avoiding updating the entire firmware, which can reduce the amount of data transmission and ensure the stability and efficiency of the upgrade process.
[0095] The embodiment is only a specific example and does not represent only one implementation mode of the present invention.
[0096] Embodiment 2:
[0097] Based on the same inventive concept, the second embodiment of the present invention also provides a sensor upgrade device based on local Internet of Things networking, such as Figure 5 As shown, including:
[0098] An acquisition module S10 acquires real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data;
[0099] The analysis and prediction module S20 analyzes and predicts the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor;
[0100] The upgrade module S30 determines the specific area corresponding to the sensor in the memory according to the partition table within the optimal upgrade time, updates the data in the corresponding specific area, and upgrades the sensor.
[0101] As an optional implementation, the real-time data, historical data and external environment data of the sensor are analyzed and predicted to obtain the optimal upgrade time of the sensor, including:
[0102] Preprocess the real-time data, historical data and external environment data of the sensor to obtain preprocessed data;
[0103] Extract key data from preprocessed data;
[0104] Using the key data as input to build an autoregressive model, training the autoregressive model to obtain a trained autoregressive model, and generating multiple prediction times based on the trained autoregressive model;
[0105] Determine the best time to upgrade the sensor based on multiple predicted times.
[0106] As an optional implementation, the key data is used as input to construct an autoregressive model, the autoregressive model is trained to obtain a trained autoregressive model, and multiple prediction times are generated based on the trained autoregressive model, including:
[0107] Take the key data as input, select the model order P, determine the lag order, and build the autoregressive model;
[0108] Use historical data to train the autoregressive model to obtain a trained autoregressive model;
[0109] Use time series cross-validation or rolling validation to validate the trained autoregressive model. If the validation is successful, the validated autoregressive model is obtained.
[0110] Use the verified autoregressive model to predict future time points and obtain multiple prediction times.
[0111] As an optional implementation, the model order P is selected using an autocorrelation plot and a partial autocorrelation plot; the autoregressive model is constructed using the statsmodels library or the sklearn library.
[0112] As an optional implementation, determining the optimal upgrade time of the sensor according to multiple predicted times includes:
[0113] The multiple prediction times are combined with the historical data of the sensor, and the upgrade success rate of the sensor within the multiple prediction times is analyzed. The prediction time with the highest upgrade success rate is the optimal upgrade time.
[0114] As an optional implementation, determining the optimal upgrade time of the sensor according to multiple predicted times includes:
[0115] Combine multiple prediction times with the real-time data of sensors, and select the prediction time when the CPU usage and memory usage of the sensor are lower than the threshold and the network status is stable as the optimal upgrade time.
[0116] As an optional implementation, the partition table is used to manage the functions and tasks of each sensor, and the functions and tasks corresponding to each sensor are mapped to specific areas in the memory, and each specific area is indexed by the partition table.
[0117] Since the sensor upgrade device based on local Internet of Things networking introduced in this embodiment is the device used to implement the sensor upgrade method based on local Internet of Things networking in Example 1 of this application, based on the sensor upgrade method based on local Internet of Things networking introduced in Example 1 of this application, the technical personnel in this field can understand the specific implementation method and various variations of the sensor upgrade device based on local Internet of Things networking in this embodiment, so how the sensor upgrade device based on local Internet of Things networking implements the method in Example 1 of this application is not introduced in detail here. As long as the technical personnel in this field implement the device used by the sensor upgrade method based on local Internet of Things networking in Example 1 of this application, it belongs to the scope of protection of this application.
[0118] Embodiment three:
[0119] Based on the same inventive concept, the third embodiment of the present invention also provides a terminal device, including one or more processors and a memory; wherein the memory is used to store one or more computer programs, and the one or more processors are used to execute one or more computer programs stored in the memory, so that the processor executes the features / steps of an embodiment of a sensor upgrade method based on local Internet of Things networking as described in Embodiment 1.
[0120] Those skilled in the art can understand that all or part of the features / steps of the above-mentioned method embodiments can be implemented by methods, data processing systems or computer programs, and these features can be implemented without hardware, entirely by software, or by a combination of hardware and software. The aforementioned computer program can be stored in one or more computer-readable storage media, and the storage medium stores a computer program. When the computer program is executed (such as by a processor), the steps of the sensor upgrade method embodiment based on local Internet of Things networking described in Example 1 are executed.
[0121] Embodiment 4:
[0122] Based on the same inventive concept, the fourth embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the sensor upgrade method based on local Internet of Things networking described in the first embodiment above are implemented.
[0123] The above description is only the preferred embodiment of the present invention. It is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the protection scope of the present invention.
Claims
1. A sensor upgrade method based on local Internet of Things networking, characterized in that: include: Acquire real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data; Analyze and predict the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor; Within the optimal upgrade time, the specific area corresponding to the sensor in the memory is determined according to the partition table, the data in the corresponding specific area is updated, and the sensor is upgraded.
2. The sensor upgrade method according to claim 1, characterized in that: The analyzing and predicting the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor includes: Preprocessing the real-time data, historical data and external environment data of the sensor to obtain preprocessed data; extracting key data from the preprocessed data; Using the key data as input to construct an autoregressive model, training the autoregressive model to obtain a trained autoregressive model, and generating multiple prediction times based on the trained autoregressive model; An optimal upgrade time for the sensor is determined according to the multiple predicted times.
3. The sensor upgrade method according to claim 2, characterized in that: The key data is used as input to construct an autoregressive model, the autoregressive model is trained to obtain a trained autoregressive model, and a plurality of prediction times are generated based on the trained autoregressive model, including: Taking the key data as input, selecting the model order P, determining the lag order, and constructing the autoregressive model; Using the historical data to train the autoregressive model to obtain the trained autoregressive model; The trained autoregressive model is verified by using a time series cross-validation method or a rolling validation method. If the verification is successful, a verified autoregressive model is obtained; The verified autoregressive model is used to predict future time points to obtain multiple predicted times.
4. The sensor upgrade method according to claim 3, characterized in that: The model order P is selected using an autocorrelation graph and a partial autocorrelation graph; the autoregressive model is constructed using a statsmodels library or a sklearn library.
5. The sensor upgrade method according to claim 2, characterized in that: Determining the optimal upgrade time of the sensor according to the multiple predicted times includes: The multiple predicted times are combined with the historical data of the sensor, and the upgrade success rates of the sensors within the multiple predicted times are analyzed. The predicted time with the highest upgrade success rate is the optimal upgrade time.
6. The sensor upgrade method according to claim 2, characterized in that: Determining the optimal upgrade time of the sensor according to the multiple predicted times includes: The multiple predicted times are combined with the real-time data of the sensor, and the predicted time when the CPU usage and memory usage of the sensor are lower than a threshold and the network status is stable is selected as the optimal upgrade time.
7. The sensor upgrading method according to claim 1, characterized in that: The partition table is used to manage the functions and tasks of each of the sensors, and the functions and tasks corresponding to each of the sensors are mapped to specific areas in the memory, and each of the specific areas is indexed by the partition table.
8. A sensor upgrade device based on local Internet of Things networking, characterized in that: include: An acquisition module, which acquires real-time data, historical data and external environment data of each sensor, wherein the real-time data includes real-time operation data and real-time network data, and the historical data includes historical upgrade data; An analysis and prediction module analyzes and predicts the real-time data, historical data and external environment data of the sensor to obtain the optimal upgrade time of the sensor; The upgrade module determines the specific area corresponding to the sensor in the memory according to the partition table within the optimal upgrade time, updates the data in the corresponding specific area, and upgrades the sensor.
9. A sensor upgrade device, characterized in that: include: one or more processors and memory; The memory is used to store one or more computer programs, and the one or more processors are used to execute one or more computer programs stored in the memory, so that the processor executes the steps of the sensor upgrade method based on local Internet of Things networking as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the sensor upgrade method based on local Internet of Things networking as described in any one of claims 1 to 7 are implemented.