Smart city distribution monitoring system based on the Internet of Things
By analyzing the fluctuations and distribution deviations of historical temperature data and adjusting the weight of data points, the problem of inaccurate temperature prediction by SMA moving average method under abnormal data is solved, and more reliable temperature monitoring and safe distribution are achieved.
Patent Information
- Application Number
- CN202510146272.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-02-10
AI Technical Summary
In the prior art, the temperature prediction method based on the SMA moving average method cannot be effectively smoothed when facing abnormal data, resulting in low accuracy of the temperature prediction value, which in turn affects distribution safety.
By analyzing the fluctuations of historical temperature data and the distribution deviation of data points, we determine suspected abnormal points, and adjust the weight of the data points in the preset moving average window, and update the data values in combination with the moving average method to obtain more accurate temperature prediction values.
Improve the accuracy of temperature prediction and monitoring reliability, ensuring the safety of the distribution process.
Smart Images

Figure CN120069703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of temperature monitoring, and in particular to a smart city distribution monitoring system based on the Internet of Things. Background Art
[0002] A smart city's central kitchen is a model for the catering industry. It utilizes a vast operation room, with dedicated personnel responsible for each step, including procurement, selection, cutting, and seasoning. Semi-finished products and prepared seasonings are delivered to branch locations via a unified transportation method within a specified timeframe. With increasing demand for central kitchens, minimizing the risk of spoilage during delivery and ensuring food safety are key research areas.
[0003] Because delivery uses a unified transportation method, the temperature of refrigerated trucks during future food delivery can be predicted by analyzing the relationship between historical delivery temperatures and delivery times. However, since historical temperature data may contain certain anomalies, these anomalies will affect the prediction. The SMA (Simple Moving Average) method is commonly used to smooth abnormal data based on trends. However, the SMA method uses the same weight to average all data in the moving average window. When the anomalies are complex, it cannot effectively smooth the data in the historical time period. This leads to low accuracy of the temperature prediction value, insufficient monitoring reliability, and ultimately, unsafe delivery. Summary of the Invention
[0004] In order to solve the technical problems in the prior art of low accuracy of temperature prediction values, insufficient reliability of monitoring, and thus inability to ensure delivery safety, the present invention aims to provide a smart city delivery monitoring system based on the Internet of Things. The technical solutions adopted are as follows:
[0005] The present invention provides a smart city distribution monitoring system based on the Internet of Things, the system comprising:
[0006] A historical data acquisition module is used to obtain a preset number of historical temperature time series data segments;
[0007] The module for acquiring the data segment to be detected is used to obtain the abnormality of each data point in each historical temperature time series data segment based on the fluctuation change distribution of each data fluctuation and the distribution deviation of each data point in the corresponding data fluctuation; determine the suspected abnormal point based on the abnormality of the data point in each historical temperature time series data segment; and update the data value of each suspected abnormal point in each historical temperature time series data segment based on the abnormality distribution ratio of all data points in the corresponding preset moving average window, using the moving average method, to obtain the data segment to be detected;
[0008] The temperature monitoring module is used to obtain the abnormality of each data point in each data segment to be detected; obtain the predicted value at each moment based on the data values and abnormality distribution of the data points in all data segments to be detected at each moment; and perform temperature monitoring based on the predicted value at each moment.
[0009] Furthermore, obtaining the abnormality of each data point includes:
[0010] Each historical temperature time series data segment is sequentially used as a target data segment to obtain a temperature data curve in the target data segment; extreme points in the temperature data curve are obtained, and the curve between each two adjacent extreme points is used as data fluctuation;
[0011] According to the degree of change of the data points in each data fluctuation, the fluctuation degree of each data fluctuation is obtained; the average fluctuation degree of all data fluctuations in the target data segment is calculated to obtain the average fluctuation degree of the target data segment; the difference between the fluctuation degree of each data fluctuation and the average fluctuation degree is normalized to obtain the abnormality index of each data fluctuation;
[0012] Calculate the average value of the data points in the target data segment to obtain the average data value of the target data segment; for any data point in the target data segment, normalize the difference between the data value of the data point and the average data value to obtain the abnormal probability of the data point;
[0013] The abnormal probability of the data point is multiplied by the abnormal index of the data fluctuation where the data point is located to obtain the abnormal degree of the data point.
[0014] Furthermore, obtaining the degree of fluctuation of each data fluctuation according to the degree of change of the data points in each data fluctuation includes:
[0015] For any data fluctuation, calculate the difference in data values between the two extreme points corresponding to the data fluctuation to obtain the extreme value difference of the data fluctuation; calculate the difference in time between the two extreme points corresponding to the data fluctuation to obtain the time difference of the data fluctuation;
[0016] The ratio of the extreme value difference of the data fluctuation to the time difference is taken as the volatility of the data fluctuation.
[0017] Furthermore, the method for obtaining the suspected abnormal points includes:
[0018] The average value of all abnormalities in each historical temperature time series data segment is used as the abnormality evaluation index of each historical temperature time series data segment;
[0019] When the difference between the abnormality of a data point and the abnormality evaluation index of the historical temperature time series data is greater than the preset abnormality threshold, the corresponding data point is regarded as a suspected abnormal point.
[0020] Furthermore, the method for acquiring the data segment to be detected includes:
[0021] For any suspected abnormal point in any historical temperature time series data segment, the preset moving average window corresponding to the suspected abnormal point is used as the detection window;
[0022] Calculate the cumulative value of the abnormality of all data points in the detection window and the sum of the abnormality of the suspected abnormal point to obtain the total abnormality value of the suspected abnormal point; calculate the ratio of the abnormality of each data point in the detection window to the total abnormality value, perform negative correlation mapping and normalization processing to obtain the distribution weight of each data point in the detection window;
[0023] In the detection window, the SMA moving average method is used to obtain the new data value of the suspected abnormal point according to the assigned weight of each data point; the historical temperature time series data segment in which the data values of all suspected abnormal points are updated is used as the data segment to be detected.
[0024] Furthermore, performing the SMA moving average method according to the assigned weight of each data point in the detection window to obtain a new data value of the suspected outlier includes:
[0025] Based on the SMA moving average method, the moving average value in the detection window is obtained according to the assigned weight and data value of each data point in the detection window; the average value of the difference between the data value of the data point in the detection window and the moving average value is calculated to obtain the adjustment value of the detection window;
[0026] The sum of the moving average and the adjusted value is used as the new data value corresponding to the suspected abnormal point.
[0027] Furthermore, the method for obtaining the predicted value includes:
[0028] For any moment, the sum of the abnormality of all data points corresponding to the data segments to be detected at that moment is calculated as the detection sum value; the ratio of the abnormality of the data point corresponding to each data segment to be detected at that moment to the detection sum value is negatively correlated and normalized to obtain the prediction weight of the data point corresponding to each data segment to be detected at that moment;
[0029] Calculate the product of the prediction weight and the corresponding data value of each data point corresponding to each data segment to be detected at that moment to obtain the adjusted prediction value of each data point corresponding to the data segment to be detected at that moment; calculate the average of all adjusted prediction values at that moment to obtain the prediction value corresponding to that moment.
[0030] Furthermore, the temperature monitoring according to the predicted value at each moment includes:
[0031] Obtain the actual value corresponding to the temperature data at the current moment, and use the numerical difference between the actual value at the current moment and the predicted value at the current moment as the monitoring evaluation value;
[0032] When the monitoring evaluation value of the preset monitoring number of moments before the current moment is greater than the preset monitoring threshold, the monitoring state at the current moment is recorded as an abnormal state; otherwise, the monitoring state is a normal state.
[0033] Furthermore, obtaining the temperature data curve in the target data segment includes:
[0034] The temperature data curve is obtained by polynomial fitting using the least squares method for the target data segment.
[0035] Furthermore, the method for obtaining the extreme points in the temperature data curve adopts Newton's method.
[0036] The present invention has the following beneficial effects:
[0037] The present invention analyzes the abnormality of each fluctuation by analyzing the degree of fluctuation in the historical data segment, and combines the distribution deviation of each data point in the fluctuation to obtain the abnormality of each data point by combining the deviation of the data point itself and the abnormality of the fluctuation. This determines the suspected abnormal point where abnormality may occur, so that more accurate smoothing can be performed later. Further, the data value of each suspected abnormal point is smoothed. By presetting the abnormality distribution of the data points in the moving average window, that is, using the abnormality of each data point in the window as a weighted analysis trend, the data value at the suspected abnormal point is predicted. The data value of the suspected abnormal point is updated, and a more accurate representation of the historical relationship between the delivery temperature and delivery time is obtained for the data segment to be detected, so that the predicted value of the subsequent prediction is more accurate. Further, the abnormality of each data point in each data segment to be detected is obtained. The abnormality at this time represents the credibility of each data point in the corresponding data segment to be detected. Combined with the data values and abnormality distribution corresponding to all data segments to be detected at each moment, a more accurate predicted value corresponding to each moment is finally obtained for temperature monitoring. The present invention adjusts the abnormal data in the historical data and obtains a more accurate temperature prediction value in combination with the abnormal situation, so that the temperature monitoring process is more reliable and the safety of distribution is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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 any creative work.
[0039] Figure 1 A structural diagram of a smart city distribution monitoring system based on the Internet of Things provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0040] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of an IoT-based smart city distribution monitoring system proposed by the present invention. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0041] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0042] The following describes in detail a specific solution of a smart city distribution monitoring system based on the Internet of Things provided by the present invention with reference to the accompanying drawings.
[0043] See also Figure 1 , which shows a structural diagram of a smart city distribution monitoring system based on the Internet of Things provided by an embodiment of the present invention. The system includes: a historical data acquisition module 101, a data segment acquisition module 102 to be detected, and a temperature monitoring module 103.
[0044] The historical data acquisition module 101 is used to acquire a preset number of historical temperature time series data segments.
[0045] The meals produced in the central kitchen are delivered by refrigerated trucks, and the monitoring is also based on the temperature obtained in the refrigerated trucks to prevent problems such as bacterial growth and food spoilage due to abnormal temperature control, which may bring quality and safety risks. In an embodiment of the present invention, the temperature time series data of the refrigerated truck during the entire transportation process is collected by an on-board temperature sensor, and the collection frequency is set to once every 3 minutes, wherein the temperature time series data is all the collected temperature data mapped into the time series space, and the time series space is a time series coordinate system, the horizontal axis represents time, and the vertical axis represents the data value corresponding to the temperature. It should be noted that the specific data collection process is a data means well known to those skilled in the art and will not be elaborated here.
[0046] Since in the embodiment of the present invention, the daily delivery process of the refrigerated truck is a unified delivery process, the temperature time series data within the corresponding time period of one day is taken as a historical temperature time series data segment, and a preset number of historical temperature time series data segments are obtained. In the embodiment of the present invention, the preset number is set to 7, that is, the temperature time series data of 7 days from the day to be predicted is obtained for prediction. The specific sampling frequency, preset number and time period selection can be adjusted by the implementer according to the specific implementation situation, and there is no restriction here.
[0047] The data segment acquisition module 102 to be detected is used to obtain the abnormality of each data point in each historical temperature time series data segment based on the fluctuation change distribution of each data fluctuation and the distribution deviation of each data point in the corresponding data fluctuation; determine the suspected abnormal point through the abnormality of the data point in each historical temperature time series data segment; update the data value of each suspected abnormal point in combination with the moving average method based on the abnormality distribution proportion of all data points in the corresponding preset moving average window in each historical temperature time series data segment to obtain the data segment to be detected.
[0048] Because refrigerated truck temperature time series data can contain abnormally low or high temperatures due to factors such as ambient temperature fluctuations, such as door opening and closing during unloading, external temperature fluctuations, or refrigeration unit failures, abnormal temperatures can occur during actual delivery. Therefore, it is necessary to correct the data in the historical temperature time series data segment. First, the abnormality of the data points in the historical temperature time series data segment is analyzed and obtained.
[0049] In each historical temperature time series data segment, the degree of abnormality of each data point is obtained based on the fluctuation change distribution of each data fluctuation and the distribution deviation of each data point in the corresponding data fluctuation. Preferably, each historical temperature time series data segment is sequentially used as a target data segment, and the same analysis is performed on each historical temperature time series data to obtain a temperature data curve in the target data segment. In an embodiment of the present invention, the target data segment can be subjected to a least squares method to perform polynomial fitting to obtain the temperature data curve. The method of performing a polynomial fitting curve using the least squares method is a technical means well known to those skilled in the art and will not be described in detail here.
[0050] Furthermore, Newton's method is used to obtain extreme points in the temperature data curve. In other embodiments of the present invention, gradient descent or derivative methods may also be used to obtain extreme points. Newton's method, gradient descent, or derivative methods are all well-known technical means to those skilled in the art and are not limited here. The curve between each two adjacent extreme points is regarded as data fluctuation, and the data fluctuation reflects the abnormality of the data change.
[0051] Under normal circumstances, the temperature inside a refrigerated truck is usually stable, and the curve will show relatively stable fluctuations. Abnormal data will cause more changes in data fluctuations. For example, during the door opening and closing process, when the door is open for a short time, the temperature increase caused by heat exchange may not be particularly obvious, and the fluctuation changes shown in the curve are smaller than normal fluctuations. However, when the door is open for a long time, the heat exchange may be more intense, causing a significant increase in the temperature inside the refrigerated truck, and the fluctuation changes shown in the curve are larger than normal fluctuations. In addition, if the refrigerated truck is running a refrigeration unit while the door is open, the temperature inside the car may rise even higher due to the loss of cold air, and the fluctuation changes shown in the curve will also vary greatly compared to normal fluctuations.
[0052] Furthermore, based on the degree of change of the data points in each data fluctuation, the degree of fluctuation of each data fluctuation is obtained. The degree of fluctuation reflects the degree of change of each data fluctuation. In one embodiment of the present invention, for any data fluctuation, the difference in data values between two extreme points corresponding to the data fluctuation is calculated to obtain the extreme value difference of the data fluctuation. The difference in time between the two extreme points corresponding to the data fluctuation is calculated to obtain the time difference of the data fluctuation. The difference between the data values and the time change difference reflect the overall degree of change. The ratio of the extreme value difference of the data fluctuation to the time difference is used as the degree of fluctuation of the data fluctuation. In this embodiment of the present invention, the specific expression of the degree of fluctuation is:
[0053]
[0054] Where μ n Expressed as the fluctuation of the nth data fluctuation, h n1 It is expressed as the data value of the first extreme point corresponding to the nth data fluctuation, h n2 It is expressed as the data value of the second extreme point corresponding to the nth data fluctuation, t n1 It is expressed as the time when the nth data fluctuation corresponds to the first extreme point, t n2 It is expressed as the time when the nth data fluctuation corresponds to the second extreme point, and || is expressed as the absolute value extraction function.
[0055] Among them, |h n1 -h n2 | represents the extreme value difference of the nth data fluctuation, |t n1 -t n2| represents the time difference of the nth data fluctuation. Since time differences are always present, this ratio will not have a denominator of zero, rendering the formula meaningless. A greater degree of fluctuation indicates a greater degree of overall data variation within the data fluctuation. In other embodiments of the present invention, the average slope of all data points within each data fluctuation can be calculated as the fluctuation to reflect the data variation within the data fluctuation. This is not a limitation here.
[0056] Furthermore, the average value of the fluctuations of all data fluctuations in the target data segment is calculated to obtain the average fluctuation of the target data segment. The average fluctuation reflects the overall fluctuation change in the target data segment. The difference between the fluctuation of each data fluctuation and the average fluctuation is normalized to obtain the abnormal index of each data fluctuation. The greater the difference, the greater the difference, the greater the difference, the fluctuation corresponding to the data fluctuation has produced a large difference relative to the overall fluctuation change, and the higher the abnormality of the data fluctuation.
[0057] Furthermore, the average of the data values of all data points in the target data segment is calculated to obtain the average data value of the target data segment, and each data point is analyzed using the average data value. For any data point in the target data segment, the analysis method for each data point is the same. The difference between the data value of the data point and the average data value is normalized to obtain the abnormal probability of the data point. The larger the difference, the less similar the data value of the data point is to the overall data value, and the greater the possibility that the data point itself is abnormal, and therefore the higher the abnormal probability.
[0058] Taking into account the abnormality of the data fluctuation of the data point itself, the abnormal possibility of the data point is multiplied by the abnormal index of the data fluctuation of the data point to obtain the abnormality degree of the data point. In this embodiment of the present invention, the specific expression of the abnormality degree is:
[0059]
[0060] Where, P i Expressed as the abnormality of the i-th data point, h i is the data value of the i-th data point, M is the total number of data points in the target data segment, μ i,n Expressed as the fluctuation of the nth data point where the i-th data point is located, μ n It represents the volatility of the nth data fluctuation, N represents the total number of data fluctuations in the target data segment, || represents the absolute value extraction function, and norm() represents the normalization function. It should be noted that normalization is a technical means well known to those skilled in the art. The normalization function can be linear normalization or standard normalization, etc. The specific normalization method is not limited here.
[0061] in, Expressed as the average data value of the target data segment, Expressed as the abnormal probability of the i-th data point, Expressed as the average fluctuation of the target data segment, It is expressed as the anomaly index of the nth data fluctuation of the i-th data point. The larger the anomaly index of the data fluctuation of the data point, the greater the possibility of anomaly of the data point, and the more likely the data point is an abnormal data point, so the anomaly degree is greater.
[0062] After obtaining the abnormality of each data point, the data points with a larger abnormality are screened out for smoothing, that is, the suspected abnormal points are determined by the abnormality of the data points in each historical temperature time series data segment. Preferably, the average value of all abnormalities in each historical temperature time series data segment is used as the abnormality evaluation index of each historical temperature time series data segment. Since abnormal fluctuations will cause a certain abnormal impact on all data points, the data points with a large abnormality are screened out by the abnormality evaluation index. When the difference between the abnormality of a data point and the abnormality evaluation index of the historical temperature time series data is greater than the preset abnormality threshold, it means that the abnormal change of the data point in the historical temperature time series data is more obvious, and the corresponding data point is regarded as a suspected abnormal point. In the embodiment of the present invention, the preset abnormality threshold is set to 0.5. The specific numerical value implementer can perform screening according to the specific implementation situation, which will not be elaborated here.
[0063] In other embodiments of the present invention, the abnormality of the data point may be directly compared with the threshold to screen out suspected abnormal points, which is not limited here.
[0064] Furthermore, the suspected outliers can be smoothed according to the data trend by using the SMA moving average method. The SMA moving average method is a method for analyzing data trends and can also be used for data prediction. That is, the true data value of the suspected outlier can be predicted based on the changes in the preceding data points of the suspected outlier. The specific process of using the SMA moving average method for prediction includes: calculating the moving average value, that is, using the SMA moving average method to obtain the moving average value in the moving average window. Calculating the deviation, that is, calculating the difference between the data value of each data point in the moving average window and the moving average value. Calculating the average deviation, that is, calculating the average value of all deviations in the moving average window. Obtaining the predicted value, that is, adding the average deviation to the moving average value to obtain the predicted value of the current data point. It should be noted that the SMA moving average method is a technical means well known to those skilled in the art and will not be described in detail here.
[0065] Among them, since the SMA moving average method uses the same weight for all data points during calculation, it does not take into account the existence of certain abnormalities in the data points. The data points with greater abnormality are less credible. Therefore, the weights of different data points during calculation are adjusted by the obtained abnormality to obtain a more accurate prediction value for each suspected abnormal point, thereby forming a data segment to be detected for temperature prediction. That is, according to the abnormality distribution ratio of each suspected abnormal point in all data points in the corresponding preset moving average window in each historical temperature time series data segment, the data value of each suspected abnormal point is updated in combination with the moving average method to obtain the data segment to be detected. In an embodiment of the present invention, the preset moving average window is set to the window size composed of the first 7 data points of the data point in the time series. The specific window size can be adjusted by the implementer according to the specific implementation situation.
[0066] Preferably, for any suspected abnormal point in any historical temperature time series data segment, the preset moving average window corresponding to the suspected abnormal point is used as the detection window, the cumulative value of the abnormality of all data points in the detection window and the sum of the abnormality of the suspected abnormal point are calculated to obtain the total abnormal value of the suspected abnormal point, the ratio of the abnormality of each data point in the detection window to the total abnormality is calculated, negative correlation mapping is performed and normalization is performed to obtain the distribution weight of each data point in the detection window, and the degree of credibility is reflected by the proportion of the abnormality. In an embodiment of the present invention, the expression for the distribution weight is:
[0067]
[0068] Where Q t,h It is expressed as the weight assigned to the hth data point in the preset moving average window corresponding to the tth suspected abnormal point, P h Expressed as the abnormality of the h-th data point, H t It is expressed as the total number of data points in the preset moving average window corresponding to the tth suspected abnormal point, P t It is expressed as the abnormality degree of the t-th suspected abnormal point, and exp is expressed as an exponential function with a natural constant as the base.
[0069] in, It is expressed as the total abnormal value corresponding to the t-th suspected abnormal point. When the abnormality ratio of a data point is larger, it means that the abnormality of the data point is more likely to occur than other data points, and its credibility is lower than other data points, so it is given a smaller allocation weight.
[0070] In the detection window, based on the assigned weight of each data point, the SMA moving average method is performed to obtain the new data value of the suspected outlier. In an embodiment of the present invention, based on the SMA moving average method, the moving average value in the detection window is obtained according to the assigned weight and data value of each data point in the detection window. The moving average value represents the data trend corresponding to the suspected outlier. The average value of the difference between the data value of the data point in the detection window and the moving average value is calculated to obtain the adjustment value of the detection window. The sum of the moving average value and the adjustment value is used as the new data value corresponding to the suspected outlier. It should be noted that the calculation of the moving average value is a well-known calculation method in the SMA moving average method, and the process of obtaining the new data value is the above-mentioned process of prediction based on the SMA moving average method, which will not be described in detail here.
[0071] The historical temperature time series data segments after updating the data values of all suspected abnormal points are used as the data segments to be detected, and a preset number of data segments to be detected are obtained. At this time, the abnormal data in the data segments to be detected are all smoothed, and their credibility and accuracy in reflecting the relationship between temperature and time changes are high, so further data prediction and monitoring are carried out.
[0072] The temperature monitoring module 103 is used to obtain the abnormality of each data point in each data segment to be detected; obtain the predicted value at each moment based on the data values and abnormality distribution of the data points in all data segments to be detected at each moment; and perform temperature monitoring based on the predicted value at each moment.
[0073] Since the data values of the data points in the data points to be detected are updated, the abnormality of each data point is recalculated. The calculation method is the same as the method of obtaining the abnormality of each data point in the data segment acquisition module 102 to be detected. At this time, the abnormality of the data point reflects the credibility of each data point. The larger the abnormality, the lower the credibility of the data point.
[0074] The predicted value at each moment is obtained based on the data values and anomaly distribution of the data points in all the data segments to be detected at each moment. Since the distribution links are unified in the distribution process, the data values corresponding to the same moment in each data segment have the same distribution, and the prediction is made by combining the data values of all the data segments to be detected at the same moment.
[0075] Preferably, for any moment, the sum of the abnormality degrees of the data points corresponding to all the data segments to be detected at that moment is calculated as the detection sum value, and the ratio of the abnormality degree of the data point corresponding to each data segment to be detected at that moment to the detection sum value is negatively correlated and normalized to obtain the prediction weight of the data point corresponding to each data segment to be detected at that moment, that is, at the same moment, the prediction weight is obtained according to the proportion of the corresponding abnormality degrees of the data points. The smaller the abnormality degree, the greater the credibility and the corresponding prediction weight.
[0076] The product of the prediction weight and the corresponding data value of each data point corresponding to each data segment to be detected at that moment is calculated to obtain the adjusted prediction value of each data point corresponding to the data segment to be detected at that moment. The average of all adjusted prediction values at that moment is calculated to obtain the prediction value corresponding to that moment. That is, the data values of the data points at the same moment are weighted and averaged according to the prediction weights to obtain the prediction value at each moment. In this embodiment of the present invention, the expression of the prediction value is:
[0077]
[0078] Where Y v It is represented as the predicted value corresponding to the vth moment, S is represented as the total number of data segments to be detected, and h c,v It is expressed as the data value of the corresponding data point of the cth data segment to be detected at the vth time, P c,v It is expressed as the abnormality of the data point corresponding to the cth data segment to be detected at the vth time, and exp is expressed as an exponential function with a natural constant as the base.
[0079] in, Expressed as the detection and value corresponding to the vth moment, It is expressed as the prediction weight of the data point corresponding to the cth data segment to be detected at the vth moment, It is expressed as the adjusted predicted value of the corresponding data point of the cth data segment to be tested at the vth time. Combining different weights and considering the impact of the abnormality of each data point at the same time, we can finally get a more accurate prediction value for each time.
[0080] Since monitoring is timely, temperature monitoring is performed through the predicted value at each moment after the prediction. Preferably, the actual value corresponding to the temperature data at the current moment is obtained, that is, the temperature data collected by the on-board temperature sensor at the current moment, and the numerical difference between the actual value at the current moment and the predicted value at the current moment is used as the monitoring evaluation value, and monitoring is performed through the difference between the actual collected value and the predicted value.
[0081] In this embodiment of the present invention, the preset number of monitoring times is set to 3, and the preset monitoring threshold is set to 5. The specific values can be adjusted by the implementer according to the specific implementation situation. When the monitoring evaluation value of the preset number of monitoring moments before the current moment is greater than the preset monitoring threshold, that is, when the monitoring evaluation value of the three consecutive moments before the current moment is greater than 5, it indicates that the temperature is abnormal. The monitoring status at the current moment is recorded as abnormal. In the abnormal state, an early warning is issued to the monitoring personnel to implement temperature control to ensure the quality and safety of the delivered food. Otherwise, the monitoring status is normal and monitoring can continue.
[0082] In summary, the present invention analyzes the abnormality of each fluctuation by analyzing the degree of fluctuation in the historical data segment, and combines the distribution deviation of each data point in the fluctuation to obtain the abnormality of each data point by combining the deviation of the data point itself and the abnormality of the fluctuation, and determines the suspected abnormal point where abnormality may occur, so as to perform more accurate smoothing later. Further, the data value of each suspected abnormal point is smoothed, and the abnormality distribution of the data point in the preset moving average window is used, that is, the abnormality of each data point in the window is used as a weight analysis trend to predict the data value at the suspected abnormal point. The data value of the suspected abnormal point is updated, and a more accurate representation of the historical relationship between delivery temperature and delivery time is obtained for the data segment to be detected, so that the prediction value of the subsequent prediction is more accurate. Further, the abnormality of each data point in each data segment to be detected is obtained. The abnormality at this time represents the credibility of each data point in the corresponding data segment to be detected. Combined with the data values and abnormality distribution corresponding to all data segments to be detected at each moment, a more accurate prediction value corresponding to each moment is finally obtained for temperature monitoring. The present invention adjusts the abnormal data in the historical data and obtains a more accurate temperature prediction value in combination with the abnormal situation, so that the temperature monitoring process is more reliable and the safety of distribution is improved.
[0083] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0084] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A smart city distribution monitoring system based on the Internet of Things, characterized by: The system comprises: A historical data acquisition module is used to obtain a preset number of historical temperature time series data segments; The module for acquiring the data segment to be detected is used to obtain the abnormality of each data point in each historical temperature time series data segment based on the fluctuation change distribution of each data fluctuation and the distribution deviation of each data point in the corresponding data fluctuation; determine the suspected abnormal point based on the abnormality of the data point in each historical temperature time series data segment; and update the data value of each suspected abnormal point in each historical temperature time series data segment based on the abnormality distribution ratio of all data points in the corresponding preset moving average window, using the moving average method, to obtain the data segment to be detected; The temperature monitoring module is used to obtain the abnormality of each data point in each data segment to be detected; obtain the predicted value at each moment based on the data value and abnormality distribution of all data points in the data segments to be detected at each moment; and perform temperature monitoring based on the predicted value at each moment; The method for acquiring the data segment to be detected includes: For any suspected abnormal point in any historical temperature time series data segment, the preset moving average window corresponding to the suspected abnormal point is used as the detection window; Calculate the cumulative value of the abnormality of all data points in the detection window and the sum of the abnormality of the suspected abnormal point to obtain the total abnormality value of the suspected abnormal point; calculate the ratio of the abnormality of each data point in the detection window to the total abnormality value, perform negative correlation mapping and normalization processing to obtain the distribution weight of each data point in the detection window; In the detection window, the SMA moving average method is used to obtain the new data value of the suspected abnormal point according to the assigned weight of each data point; the historical temperature time series data segment in which the data values of all suspected abnormal points are updated is used as the data segment to be detected; The method for obtaining the predicted value includes: For any moment, the sum of the abnormality of all data points corresponding to the data segments to be detected at that moment is calculated as the detection sum value; the ratio of the abnormality of the data point corresponding to each data segment to be detected at that moment to the detection sum value is negatively correlated and normalized to obtain the prediction weight of the data point corresponding to each data segment to be detected at that moment; Calculate the product of the prediction weight and the corresponding data value of each data point corresponding to each data segment to be detected at that moment to obtain the adjusted prediction value of each data point corresponding to the data segment to be detected at that moment; calculate the average of all adjusted prediction values at that moment to obtain the prediction value corresponding to that moment.
2. The smart city distribution monitoring system based on the Internet of Things according to claim 1 is characterized in that: Obtaining the abnormality of each data point includes: Each historical temperature time series data segment is sequentially used as a target data segment to obtain a temperature data curve in the target data segment; extreme points in the temperature data curve are obtained, and the curve between each two adjacent extreme points is used as data fluctuation; According to the degree of change of the data points in each data fluctuation, the fluctuation degree of each data fluctuation is obtained; the average fluctuation degree of all data fluctuations in the target data segment is calculated to obtain the average fluctuation degree of the target data segment; the difference between the fluctuation degree of each data fluctuation and the average fluctuation degree is normalized to obtain the abnormality index of each data fluctuation; Calculate the average value of the data points in the target data segment to obtain the average data value of the target data segment; for any data point in the target data segment, normalize the difference between the data value of the data point and the average data value to obtain the abnormal probability of the data point; The abnormal probability of the data point is multiplied by the abnormal index of the data fluctuation where the data point is located to obtain the abnormal degree of the data point.
3. The smart city distribution monitoring system based on the Internet of Things according to claim 2 is characterized in that: Obtaining the fluctuation degree of each data fluctuation according to the degree of change of the data points in each data fluctuation includes: For any data fluctuation, calculate the difference in data values between the two extreme points corresponding to the data fluctuation to obtain the extreme value difference of the data fluctuation; calculate the difference in time between the two extreme points corresponding to the data fluctuation to obtain the time difference of the data fluctuation; The ratio of the extreme value difference of the data fluctuation to the time difference is taken as the volatility of the data fluctuation.
4. The smart city distribution monitoring system based on the Internet of Things according to claim 1 is characterized in that: The method for obtaining the suspected abnormal point includes: The average value of all abnormalities in each historical temperature time series data segment is used as the abnormality evaluation index of each historical temperature time series data segment; When the difference between the abnormality of a data point and the abnormality evaluation index of the historical temperature time series data is greater than the preset abnormality threshold, the corresponding data point is regarded as a suspected abnormal point.
5. The smart city distribution monitoring system based on the Internet of Things according to claim 1 is characterized in that: The method of performing the SMA moving average method according to the weight assigned to each data point in the detection window to obtain a new data value of the suspected outlier includes: Based on the SMA moving average method, the moving average value in the detection window is obtained according to the assigned weight and data value of each data point in the detection window; the average value of the difference between the data value of the data point in the detection window and the moving average value is calculated to obtain the adjustment value of the detection window; The sum of the moving average and the adjusted value is used as the new data value corresponding to the suspected abnormal point.
6. The smart city distribution monitoring system based on the Internet of Things according to claim 1 is characterized in that: The temperature monitoring according to the predicted value at each moment includes: Obtain the actual value corresponding to the temperature data at the current moment, and use the numerical difference between the actual value at the current moment and the predicted value at the current moment as the monitoring evaluation value; When the monitoring evaluation value of the preset monitoring number of moments before the current moment is greater than the preset monitoring threshold, the monitoring state at the current moment is recorded as an abnormal state; otherwise, the monitoring state is a normal state.
7. The smart city distribution monitoring system based on the Internet of Things according to claim 2 is characterized in that: The step of obtaining a temperature data curve in a target data segment includes: The temperature data curve is obtained by polynomial fitting using the least squares method for the target data segment.
8. The smart city distribution monitoring system based on the Internet of Things according to claim 2 is characterized in that: The method for obtaining the extreme points in the temperature data curve adopts Newton's method.
Citation Information
Patent Citations
Equipment data intelligent management method and system based on industrial Internet of Things
CN117370329A
Early warning method for abnormal operation of wind turbine generator based on time sequence prediction
CN117390573A