Logistics site risk prediction method based on sequence anomaly judgment
The logistics site risk prediction method uses sequence anomaly judgment with outlier detection algorithms to automate risk assessment, enhancing accuracy and efficiency by identifying abnormal features in logistics site data, addressing the limitations of manual prediction.
Patent Information
- Application Number
- CN202111357655.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-11-16
AI Technical Summary
Current methods for predicting logistics site risks rely on manual prediction, which is inefficient and inaccurate, especially when dealing with large amounts of data, leading to delayed detection of site abnormalities.
A logistics site risk prediction method based on sequence anomaly judgment using outlier detection algorithms such as Boxplot, 3-sigma, combined Boxplot and 3-sigma, combined STL and ESD methods to analyze feature sequence data, determining abnormal features and their number relative to a preset threshold.
This method improves the accuracy and efficiency of site risk prediction, achieving over 90% prediction accuracy by automating the detection of site risks through machine learning, reducing human error and lag in identifying abnormalities.
Smart Images

Figure CN114049018B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of risk prediction, and in particular to a logistics site risk prediction method based on sequence anomaly judgment. Background Art
[0002] The sites in the logistics network are the logistics service agencies that we directly contact when picking up or sending parcels. They are the facade of the logistics network, both the front end and the end of the logistics network, and undertake the important work of collecting and delivering express parcels. The risk of logistics sites refers to the risk of paralysis of a certain area of the logistics network due to the site's inability to undertake the collection and delivery of express parcels for some reason. There are many reasons for site risks, such as poor site management, sudden increase in express parcel volume and failure to deliver in time, inability to recruit small parcel workers (couriers) and other human and market factors, or force majeure factors such as weather, epidemics, and natural disasters. The risk of sites will reduce the service quality of the logistics network. In severe cases, it will cause partial paralysis of the logistics network, and customers will be unable to send or pick up parcels in time. Therefore, it is necessary to predict and judge whether the operation of logistics sites is healthy, and intervene in time to mitigate the impact.
[0003] At present, the method of predicting logistics site risks generally adopts manual prediction. Experienced employees set risk assessment indicators and analyze some daily logistics data, such as the number of dispatches at the site, the amount of express delivery accumulation, etc., and obtain the corresponding indicator value through simple mathematical operations, and judge whether the indicator value exceeds the threshold set by humans. When it exceeds the threshold, the logistics site is judged to be abnormal and there is a risk. However, this method of manually predicting logistics site risks relies on human experience, which has great limitations, and the prediction results are not accurate, and the prediction efficiency is also very low. When the amount of data used for site risk prediction is too large, the manual prediction method is even more incapable, and the lag in discovering site abnormalities will be more obvious. Summary of the invention
[0004] The present invention aims to achieve machine prediction of logistics site risks and improve the accuracy and efficiency of site risk prediction, and provides a logistics site risk prediction method based on sequence anomaly judgment.
[0005] To achieve this object, the present invention adopts the following technical solutions:
[0006] A logistics site risk prediction method based on sequence anomaly judgment is provided, comprising the steps of:
[0007] S1, acquiring feature data for predicting logistics site risks and forming feature sequence data;
[0008] S2, for different types of characteristic sequence data, using any one or more outlier detection algorithms including Boxplot, 3-sigma, combined Boxplot and 3-sigma, combined STL and ESD methods to perform abnormal feature detection;
[0009] S3, determining whether the number of detected abnormal features exceeds a preset number threshold,
[0010] If yes, it is determined that the logistics site currently has risks;
[0011] If not, it is determined that there is no risk at the logistics site at present.
[0012] As a preferred solution of the present invention, the characteristic data used to predict the risk of a logistics site includes any one or more of the amount of express parcels piled up, the amount of express parcels signed for, and the number of small parcel handlers at the logistics site.
[0013] As a preferred solution of the present invention, in step S2, the method for detecting abnormal features of the feature sequence data by combining the outlier detection algorithm of Boxplot and 3-sigma comprises the following steps:
[0014] A1, calculating the hight value and low value of the characteristic sequence data;
[0015] A2, according to the data type of the feature sequence data, and based on the hight value and / or the low value, determine whether each data in the feature sequence data is an abnormal feature, and the specific determination method is as follows:
[0016] When the characteristic sequence data is the characteristic sequence data of the express delivery accumulation quantity, it is determined whether the value of each data in the sequence is greater than the hight value.
[0017] If so, the data is determined to be an abnormal feature;
[0018] If not, the data is judged to be a non-abnormal feature;
[0019] When the characteristic sequence data is the characteristic sequence data of the express delivery receipt quantity, it is determined whether the value of each data in the sequence is greater than the hight value or less than the low value,
[0020] If so, the data is determined to be an abnormal feature;
[0021] If not, the data is judged to be a non-abnormal feature;
[0022] When the characteristic sequence data is the characteristic sequence data of the number of small item personnel, it is determined whether the value of each data in the sequence is less than the low value.
[0023] If so, the data is determined to be an abnormal feature;
[0024] If not, the data is determined to be a non-abnormal feature.
[0025] As a preferred solution of the present invention, in step A1, the hight value of the characteristic sequence data is calculated by the following formula (1):
[0026] hight=(μ+3σ)*r+max*(1-r) Formula (1)
[0027] In formula (1), μ represents the mean value of the distribution of the sequence of the characteristic sequence data;
[0028] σ represents the standard deviation of the sequence distribution of the characteristic sequence data;
[0029] r is the introduced weight coefficient, r∈[0,1];
[0030] max is calculated by the following formula (2):
[0031] max=Q3+1.5IQR formula (2)
[0032] In formula (2), Q3 represents the upper quartile of the characteristic sequence data in Boxplot;
[0033] IQR stands for the middle quartile range and is calculated using the following formula (3):
[0034] IQR=Q3-Q1 Formula (3)
[0035] In formula (3), Q1 represents the lower quartile of the characteristic sequence data in Boxplot.
[0036] As a preferred solution of the present invention, in step A1, the low value of the characteristic sequence data is calculated by the following formula (4):
[0037] low=(μ-3σ)*r+min*(1-r) Formula (4)
[0038] In formula (4), μ represents the mean value of the distribution of the sequence of the characteristic sequence data;
[0039] σ represents the standard deviation of the sequence distribution of the characteristic sequence data;
[0040] r is the introduced weight coefficient, r∈[0,1];
[0041] min is calculated by the following formula (5):
[0042] min=Q1-1.5IQR formula (5)
[0043] In formula (5), Q1 represents the lower quartile of the characteristic sequence data in Boxplot;
[0044] IQR stands for the middle quartile range and is calculated using the following formula (6):
[0045] IQR=Q3-Q1 Formula (6)
[0046] In formula (6), Q3 represents the upper quartile of the characteristic sequence data in Boxplot.
[0047] As a preferred solution of the present invention, r=0.3.
[0048] As a preferred solution of the present invention, in step S2, the method steps of performing abnormal feature detection on the feature sequence data by combining the STL and ESD methods specifically include:
[0049] B1, using the STL method to decompose the characteristic sequence data arranged in chronological order into a period component, a trend component, and a residual component;
[0050] B2, using the ESD algorithm to perform abnormal feature detection on the residual component.
[0051] As a preferred solution of the present invention, the median of the characteristic sequence data is used as the trend component and the residual component is calculated.
[0052] As a preferred solution of the present invention, the absolute median difference calculated by the following formula (7) replaces the median and is used as the trend component to calculate the residual component of the characteristic sequence data:
[0053] MAD=median(|X i -median(X)|) Formula (7)
[0054] In formula (7), MAD represents the absolute median difference to be solved;
[0055] X represents the characteristic sequence data;
[0056] median(X) represents the median of the feature sequence data;
[0057] X i Represents the value of the i-th data in X;
[0058] |X i -median(X)| is the new sequence obtained by subtracting the absolute value of the difference between each value in the original sequence and the median;
[0059] median(|X i -median(X)|) represents the median of the new sequence.
[0060] As a preferred solution of the present invention, in step B2, the residual component of the characteristic sequence data is calculated by the following formula (8):
[0061]
[0062] In formula (8), R X is the remainder component to be calculated;
[0063] X represents the characteristic sequence data;
[0064] S X Representing the periodic component of the characteristic sequence data;
[0065] Represents the median of the feature sequence data or the absolute median difference that replaces the median.
[0066] The present invention utilizes any one or more outlier detection algorithms such as Boxplot, 3-sigma, combined Boxplot and 3-sigma, and combined with STL and ESD methods to perform abnormal feature detection on feature data for predicting logistics site risks, thereby realizing machine prediction of logistics site risks and overcoming the technical problems of low efficiency and low accuracy of previous manual prediction methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] 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 embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0068] Figure 1 It is a diagram of implementation steps of a logistics site risk prediction method based on sequence anomaly judgment provided by an embodiment of the present invention;
[0069] Figure 2 It is a method step diagram for detecting abnormal features of feature sequence data by combining Boxplot and 3-sigma outlier detection algorithm;
[0070] Figure 3 It is a method step diagram for detecting abnormal features of feature sequence data by combining STL and ESD methods;
[0071] Figure 4It is a schematic diagram showing the change of the number of express parcels signed for at a logistics station over time within a certain period of time;
[0072] Figure 5 It is a schematic diagram showing the periodic changes in the number of express delivery receipts at a logistics station within a certain period of time;
[0073] Figure 6 It is a schematic diagram of the periodic components decomposed from the characteristic sequence data by the STL method. DETAILED DESCRIPTION
[0074] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0075] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on this patent; in order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0076] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "inner", "outer", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as a limitation on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0077] In the description of the present invention, unless otherwise clearly specified and limited, if the term "connection" or the like appears to indicate the connection relationship between components, the term should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two components or the interaction relationship between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0078] The logistics site risk prediction method based on sequence anomaly judgment provided by the embodiment of the present invention is as follows: Figure 1 As shown, it includes 3 steps, specifically:
[0079] Step S1, obtain the characteristic data used to predict the risk of the logistics site and form it into characteristic sequence data, which is time series data arranged in chronological order; the characteristic data mainly includes the daily express delivery receipt volume, express delivery accumulation volume, and the number of small parcel workers (the number of personnel receiving and delivering parcels) of the logistics site within a certain period of time (for example, from 2021-06-01 to 2021-09-01). The storage format of the obtained characteristic data is shown in Table 1 below:
[0080]
[0081] Table 1
[0082] Step S2, for different types of feature sequence data, using any one or more outlier detection algorithms among Boxplot, 3-sigma, combined Boxplot and 3-sigma, combined STL and ESD methods to perform abnormal feature detection;
[0083] Finally, the number of abnormal features detected is used to determine whether the logistics site currently has risks, namely:
[0084] Step S3, determining whether the number of detected abnormal features exceeds a preset number threshold,
[0085] If yes, it is determined that the logistics site currently has risks;
[0086] If not, it is determined that there is no risk at the logistics site at present.
[0087] The following describes how the abnormal feature detection method used in the present invention performs abnormal feature detection on feature sequence data one by one:
[0088] 1. Boxplot for sequence abnormality feature judgment
[0089] Boxplot is a chart that directly reflects the center and dispersion of a sequence. It consists of five numerical points: minimum value (min), lower quartile (Q1), median (median), upper quartile (Q3), and maximum value (max). When using a boxplot to determine outliers, the maximum and minimum values are set to be 1.5 IQR (interquartile range) away from the quartile values, that is:
[0090] IQR=Q3-Q1
[0091] min=Q1-1.5IQR
[0092] max=Q3+1.5IQR
[0093] If there is a value in the feature sequence data that is greater than max or less than min, the value is determined to be an abnormal value (i.e., an abnormal feature in the sequence).
[0094] 2. 3-sigma for sequence abnormality feature judgment
[0095] When the characteristic sequence data follows a normal distribution, the 3-sigma principle can be used to determine the abnormal characteristics in the sequence. The 3-sigma principle is also known as the Laida criterion. It assumes that the sequence contains only random errors and calculates the mean of the sequence. and standard deviation , the mean is considered to be the mean μ of the distribution in which the sequence belongs, and the standard deviation It is considered to be the standard deviation σ of the distribution of the sequence, and then an interval is determined according to a probability, and values exceeding this interval are considered to be outliers.
[0096] The numerical distribution interval and probability under the 3-sigma principle are shown in Table 2:
[0097] Numerical distribution Probability (μ-σ, μ+σ) 0.6827 (μ-2σ, μ+2σ) 0.9545 (μ-3σ, μ+3σ) 0.9973
[0098] Table 2
[0099] From Table 2, we can conclude that the values of the sequence are almost all concentrated in the interval (μ-3σ, μ+3σ), and the probability of exceeding this range is less than 0.3%. Therefore, the values in the sequence that are not in this interval are considered abnormal features.
[0100] 3. Boxplot and 3-sigma combined to judge abnormal characteristics of sequence
[0101] In order to combine the anomaly detection advantages of Boxplot and 3-sigma, the present invention innovatively proposes an outlier detection algorithm that combines Boxplot and 3-sigma, which analyzes the data characteristics of logistics sites from three dimensions: the number of express delivery receipts, the amount of express delivery accumulation, and the number of small parcel handlers, to comprehensively judge whether there is any risk in the logistics site.
[0102] The technical core of the abnormal feature detection algorithm combining Boxplot and 3-sigma is to obtain a new interval (low, hight), and the data values in the feature sequence data outside this interval are identified as abnormal features. Specifically, Figure 2 As shown in FIG. 1 , the method of combining the outlier detection algorithm of Boxplot and 3-sigma to detect abnormal features of feature sequence data includes:
[0103] Step A1, calculating the hight value and low value of the characteristic sequence data;
[0104] Step A2: According to the data type of the feature sequence data, and based on the hight value and / or low value, determine whether each data in the feature sequence is an abnormal feature. The specific determination method is as follows:
[0105] When the characteristic sequence data is the characteristic sequence data of the express delivery accumulation quantity, it is determined whether the value of each data in the sequence is greater than the hight value.
[0106] If so, the data is determined to be an abnormal feature;
[0107] If not, the data is judged to be a non-abnormal feature;
[0108] When the feature sequence data is the feature sequence data of the express delivery receipt quantity, determine whether the value of each data in the sequence is greater than the hight value or less than the low value.
[0109] If so, the data is determined to be an abnormal feature;
[0110] If not, the data is judged to be a non-abnormal feature;
[0111] When the feature sequence data is the feature sequence data of the number of small items, it is determined whether the value of each data in the sequence is less than the low value.
[0112] If so, the data is determined to be an abnormal feature;
[0113] If not, the data is determined to be a non-abnormal feature.
[0114] The outlier detection algorithm combining Boxplot and 3-sigma calculates the hight value and low value respectively through the following formula (1) and formula (2):
[0115] hight=(μ+3a)*r+max*(1-r) Formula (1)
[0116] low=(μ-3σ)*r+min*(1-r) Formula (2)
[0117] In formulas (1)-(2), μ represents the mean of the distribution of the sequence of feature sequence data;
[0118] σ represents the standard deviation of the sequence distribution of the characteristic sequence data;
[0119] r is the introduced weight coefficient, and r is preferably 0.3;
[0120] max and min are calculated by the following formula (3) and formula (4) respectively:
[0121] max=Q3+1.5IQR formula (3)
[0122] min=Q1-1.5IQR formula (4)
[0123] In formulas (3)-(4), Q3 represents the upper quartile of the characteristic sequence data in Boxplot;
[0124] Q1 represents the lower quartile of the characteristic sequence data in Boxplot;
[0125] IQR stands for the middle quartile range and is calculated using the following formula (5):
[0126] IQR=Q3-Q1 Formula (5)
[0127] The following combination Figure 4 The following example illustrates the method of combining Boxplot and 3-sigma to detect abnormal features in a sequence:
[0128] Figure 4 The following diagram shows the change in the number of express delivery receipts at a logistics station in Hangzhou from 2021-06-01 to 2021-08-31. Figure 4 The sequence length of the express delivery receipt quantity feature sequence data shown in is 93 (assuming that June, July and August are all 31 days). Its lower quartile Q1 and upper quartile Q3 in Boxplot are the 24th number (value is 11698) and the 70th number (value is 15369) in the sequence, namely Q1=11698, Q3=15369. According to formula (5), IQR=15369-11698=3671 can be obtained. Furthermore, according to formula (3) and formula (4), the maximum boundary value of Boxplot max=Q3+1.5IQR=20875.5 and the minimum boundary value min=Q1-1.5IQR=6191.5 can be obtained.
[0129] Then calculate the mean of the series and standard deviation As the mean μ and standard deviation σ of the sequence distribution, we can calculate: Taking r = 0.3, and according to formula (1)-(2), we can calculate hight = 21276.1, low = 5929.6, and thus get the interval (low, hight) as (5292.6, 21276.1). We regard the data values in the express delivery receipt feature sequence data outside this interval as abnormal features, that is, Figure 4 In the graph, points below the low line and above the hight line are considered abnormal features.
[0130] 4. S-ESD and SH-ESD are used to judge the abnormal characteristics of time series.
[0131] The S-ESD (Seasonal ESD) and SH-ESD (Seasonal Hybrid ESD) algorithms extend the ESD (Extreme Studentized Deviate test) algorithm to time series data. The ESD algorithm is a generalized version of the Grubbs' Test method. Grubbs' Test is a hypothesis testing method that is often used to test a single outlier in a univariate data set Y that follows a normal distribution. If there is an outlier, it must be the maximum or minimum value in the data set. The null hypothesis and alternative hypothesis are as follows:
[0132] H 0 : There are no outliers in the dataset
[0133] H 1 : There is an outlier in the data set
[0134] The test statistic used in the Grubbs'Test test hypothesis is:
[0135]
[0136] in, is the mean and s is the standard deviation.
[0137] When the statistic meets the following conditions, the null hypothesis is rejected, that is, there are outliers in the sequence:
[0138]
[0139] In the above formula, N is the number of samples in the data set. The significance is equal to The critical value of the t-distribution with N-2 degrees of freedom.
[0140] The method of extending 6rubbs' Test to k outlier detection is called ESD (Extreme Studentized Deviate test). This method requires gradually deleting the values that deviate the most from the mean (the maximum or minimum value) in the data set, and synchronously updating the corresponding t distribution critical value to test whether the original hypothesis is true.
[0141] Calculate the residual R that deviates the most from the mean j :
[0142]
[0143] The data sequence used to calculate the mean should be the data after deleting the largest residual sample in the previous round.
[0144] Calculate the critical value λ j :
[0145]
[0146] When this test is a two-way outlier test, both large and small outliers are tested. When only one-way outliers are tested, that is, only outliers that are too large or too small are detected, α is the significance level, which is generally taken as 0.05.
[0147] Compare the statistic to the critical value. If R j >λ j , then the original hypothesis is not true and the sample point is an abnormal feature.
[0148] Repeat the above steps k times until the algorithm ends.
[0149] Figure 5 The following is a schematic diagram showing the changes in the number of express delivery receipts at a logistics station in Changzhi from 2021-08-06 to 2021-08-21. Figure 5 We can see that the number of express delivery receipts from 2021-08-07 to 2021-08-13 and from 2021-08-14 to 2021-08-20 showed periodicity and trend characteristics. Given that time series data has periodicity and trend characteristics, it cannot be treated as an isolated sample point during anomaly detection. Therefore, we use the STL method to decompose it, remove the periodicity and trend characteristics of the original time series, and then use the ESD method to detect abnormal features on the residual components of the time series data.
[0150] STL is a common time series decomposition method that uses robust local weighted regression as a smoothing method. It decomposes the data at a certain moment into periodic components, trend components, and residual components based on local weighted average. By applying ESD to the residual components of STL decomposition, the abnormal features on the time series can be obtained. However, this method will have some false abnormal features and reduce the accuracy of anomaly detection. Therefore, in the S-ESD algorithm, we use the median of the time series as the trend component, and the residual component is calculated by the following formula (6):
[0151]
[0152] In formula (6), R X is the remainder component to be calculated;
[0153] X represents time series data;
[0154] S X Represents the periodic component of time series data;
[0155] Represents the median of time series data.
[0156] However, the median fails to reflect the sample deviation well, which leads to the failure of S-ESD to capture some abnormal features well and the low recall rate. To solve this problem, SH-ESD uses the more robust Median Absolute Deviation (MAD) to replace the median in formula (6). The calculation formula of MAD is as follows:
[0157] MAD=median(|X i -median(X)|) Formula (7)
[0158] In formula (7), MAD represents the absolute median difference to be solved;
[0159] X represents the characteristic sequence data;
[0160] median(X) represents the median of the characteristic sequence data, and its specific solution method is as follows:
[0161] We arrange the sequence X in ascending order as X (1) , ...X (N) , when N is an odd number, median(X)=X (N+1) / 2 , when N is an even number
[0162] X i Represents the value of the i-th data in X;
[0163] |X i -median(X)| is the new sequence obtained by subtracting the absolute value of the difference between each value in the original sequence and the median
[0164] median(|X i -median(X)|) represents the median of the above new sequence.
[0165] After substitution, the remainder component R X The calculation formula is changed to:
[0166] R X =XS X -MAD formula(8)
[0167] Finally, the remainder sequence is used as the abnormality test sequence, the maximum number of abnormal features is set to k, and the ESD algorithm is used to determine the abnormal features.
[0168] In practical applications, we select characteristic data with time series, such as the number of express parcels signed for on the same day, and transform the characteristic data into corresponding time series data for each logistics station. For each time series, we first apply the STL method and the absolute median difference MAD to calculate the residual component of the time series (the calculation method is shown in formula (8)). Then, we apply the ESD algorithm to detect abnormal characteristics in the residual component.
[0169] Since some logistics data have obvious weekly correlation, taking the same-day receipt volume as an example, it is affected by customer orders and merchant shipments, and customer orders and merchant shipments are generally on weekdays, so the same-day receipt volume will also show a certain periodicity. We randomly intercepted some data from the time series of express delivery receipt volume with periodic hot certificates, and the intercepted express delivery receipt volume time series is as follows: Figure 5 As shown, Figure 5 There is a periodic pattern between the period from 2021-08-06 to 2021-08-13 and the period from 2021-08-14 to 2021-08-20.
[0170] Therefore, for Figure 5 For the time series data of express delivery receipt volume shown in , we determine the data period to be 7 days, and then apply the STL method to decompose the data in time series to obtain the period component, trend component and residual component of the series. Then, we calculate the absolute median difference MAD to replace the decomposed trend component, and then use formula (8) to solve the residual component of the series. Then, we determine the maximum abnormal feature number threshold, which is generally set to a certain proportion of the total amount of sequence data, such as 10%. That is, for the sequence data of a certain period of time, the maximum number of abnormal features of each sequence is 10% of the length of the time period. Finally, the ESD algorithm is applied to determine the abnormal features in the time series.
[0171] The following Figure 4 Taking the express delivery receipt volume time series formed by the daily express delivery receipt volume of a logistics station in Hangzhou from 2021-06-01 to 2021-08-31 as an example, the method of the present invention combining the STL and ESD methods to detect abnormal features in the sequence is specifically described:
[0172] First, the STL method is used to decompose the periodic components of the sequence. The periodic components obtained are as follows: Figure 6 As shown. Figure 6 It can be seen that the number of express parcels signed for at this logistics station shows a cyclical characteristic with a cycle of 7 days.
[0173] Then, calculate the median of the series According to formula (7), MAD=1555 is obtained, and then according to formula (8), the remainder component of the sequence can be calculated. The mean of the remainder component is 12210.2 and the standard deviation is 2791.9. Since the length of the sequence is 93, we set the maximum number of abnormal features to 10% of the sequence length. Since it is necessary to use the ESD method for abnormal feature detection 9 times, we only give an example of the first use of the ESD method for abnormal feature detection in the sequence. ESD first selects the feature point with the largest deviation from the mean in the remainder component, such as the point corresponding to 2021-06-05 in the sequence, whose value is 19588.7, from which we can obtain its test statistic R 1 =2.6, and then obtain its critical value λ by querying the t distribution table and calculating 1 =3.6, due to R 1 <λ 1 , then the null hypothesis holds and the data point is not an abnormal feature.
[0174] After completing the abnormal feature detection for all feature sequence data, we determine whether the site is abnormal on that day based on the abnormal feature detection results. For example, when the number of abnormal features in the feature data such as the express delivery accumulation quantity feature, the express delivery receipt quantity feature, and the number of small parcel workers exceeds the allowed abnormal feature quantity threshold, the machine determines that the logistics site is abnormal on that day. The judgment results can be expressed in the following Table 3:
[0175]
[0176] Table 3
[0177] The site risk is determined by the machine detection sequence abnormal feature method provided by the present invention, and then human assistance is used to confirm whether the site is actually abnormal. We found that the prediction accuracy of the logistics site risk prediction method provided by the present invention is above 90%.
[0178] It should be noted that the above specific implementations are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art should understand that various modifications, equivalent substitutions, changes, etc. can be made to the present invention. However, as long as these changes do not deviate from the spirit of the present invention, they should be within the scope of protection of the present invention. In addition, some terms used in the specification and claims of this application are not restrictive, but are only for the convenience of description.
Claims
1. A logistics site risk prediction method based on sequence anomaly judgment, characterized in that: Includes steps: S1, acquiring feature data for predicting logistics site risks and forming feature sequence data; S2, for different types of characteristic sequence data, using any one or more outlier detection algorithms including Boxplot, 3-sigma, combined Boxplot and 3-sigma, combined STL and ESD methods to perform abnormal feature detection; S3, determining whether the number of detected abnormal features exceeds a preset number threshold, If yes, it is determined that the logistics site currently has risks; If not, it is determined that the logistics site currently does not have any risk; In step S2, the method for detecting abnormal features of the feature sequence data by combining the outlier detection algorithm of Boxplot and 3-sigma comprises the following steps: A1, calculating the hight value and low value of the characteristic sequence data; A2, according to the data type of the feature sequence data, and based on the hight value and / or the low value, determine whether each data in the feature sequence data is an abnormal feature, and the specific determination method is as follows: When the characteristic sequence data is the characteristic sequence data of the express delivery accumulation quantity, it is determined whether the value of each data in the sequence is greater than the hight value. If so, the data is determined to be an abnormal feature; If not, the data is judged to be a non-abnormal feature; When the characteristic sequence data is the characteristic sequence data of the express delivery receipt quantity, it is determined whether the value of each data in the sequence is greater than the hight value or less than the low value, If so, the data is determined to be an abnormal feature; If not, the data is judged as a non-abnormal feature; When the characteristic sequence data is the characteristic sequence data of the number of small item personnel, it is determined whether the value of each data in the sequence is less than the low value. If so, the data is determined to be an abnormal feature; If not, the data is judged as a non-abnormal feature; In step A1, the hight value of the characteristic sequence data is calculated by the following formula (1): hight=(μ+3σ)* +max*(1- ) Formula (1) In formula (1), μ represents the mean value of the distribution of the sequence of the characteristic sequence data; σ represents the standard deviation of the sequence distribution of the characteristic sequence data; r is the introduced weight coefficient, r∈[0,1]; max is calculated by the following formula (2): max=Q3+1.5IQR formula (2) In formula (2), Q3 represents the upper quartile of the characteristic sequence data in Boxplot; IQR stands for the middle quartile range and is calculated using the following formula (3): IQR=Q3-Q1 Formula (3) In formula (3), Q1 represents the lower quartile of the characteristic sequence data in Boxplot; In step A1, the low value of the characteristic sequence data is calculated by the following formula (4): low=(μ-3σ)* +min*91- ) Formula (4) In formula (4), μ represents the mean value of the distribution of the sequence of the characteristic sequence data; σ represents the standard deviation of the sequence distribution of the characteristic sequence data; r is the introduced weight coefficient, r∈[0,1]; min is calculated by the following formula (5): min=Q1-1.5IQR formula (5) In formula (5), Q1 represents the lower quartile of the characteristic sequence data in Boxplot; IQR stands for the middle quartile range and is calculated using the following formula (6): IQR=Q3-Q1 Formula (6) In formula (6), Q3 represents the upper quartile of the characteristic sequence data in Boxplot; r=0.3; In step S2, the method steps of performing abnormal feature detection on the feature sequence data by combining the STL and ESD methods specifically include: B1, using the STL method to decompose the characteristic sequence data arranged in chronological order into a period component, a trend component, and a residual component; B2, using the ESD algorithm to detect abnormal features of the residual components; The absolute median difference calculated by the following formula (7) replaces the median and is used as the trend component to calculate the residual component of the characteristic sequence data: MAD=median(|X i - edian(X)| Formula (7) In formula (7), MAD represents the absolute median difference to be solved; X represents the characteristic sequence data; median(X) represents the median of the feature sequence data; X i Represents the value of the i-th data in X; |X i -edian(X)| is the new sequence obtained by subtracting the absolute value of the difference between each value in the original sequence and the median; median(|X i -edian(X)| represents the median of the new sequence; In step B2, the remainder component of the characteristic sequence data is calculated by the following formula (8): In formula (8), R X is the remainder component to be calculated; X represents the characteristic sequence data; S X Representing the periodic component of the characteristic sequence data; Represents the median of the feature sequence data or the absolute median difference that replaces the median.
2. The logistics site risk prediction method based on sequence anomaly judgment according to claim 1 is characterized in that: The characteristic data used to predict the risk of a logistics site include any one or more of the amount of express parcels piled up at the logistics site, the amount of express parcels signed for, and the number of small parcel handlers.
3. The method for predicting logistics site risks based on sequence anomaly judgment according to claim 1 is characterized in that: The median of the characteristic sequence data is used as the trend component and the residual component is calculated.
