Anomaly detection methods, apparatus, equipment and computer-readable storage media
By combining a time-series anomaly prediction model and a neural network model, the historical trend of packaging material redemption rate and high-dimensional features of waybill information are extracted, solving the problem of inaccurate detection of packaging material redemption anomalies in existing technologies and achieving more accurate cost control.
Patent Information
- Application Number
- CN202211254682.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-10-13
AI Technical Summary
Existing methods for detecting anomalies in packaging material verification are not accurate enough, leading to misjudgments and affecting cost control effectiveness.
By acquiring the packaging material redemption rate and historical redemption rate sequence of the object to be detected, as well as waybill information, and combining a time-series anomaly prediction model and a neural network model, the trend of the historical redemption rate and the high-dimensional features of the waybill information are extracted, and the anomaly detection results of packaging material redemption are comprehensively determined.
This improved the accuracy of anomaly detection and ensured the cost control effect of packaging material write-off.
Smart Images

Figure CN117933436B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics management technology, specifically to an anomaly detection method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] With the rapid development of the logistics industry and the increasing demands of consumers, the volume of express deliveries is growing exponentially, leading to a rapid increase in the consumption of packaging materials. However, due to the flexible and varied scenarios and incomplete information involved in packaging material verification, unnecessary packaging material costs can arise for logistics companies. Therefore, it is necessary to detect anomalies in express delivery packaging material verification to promptly reduce the costs associated with such verification for businesses.
[0003] Currently, anomaly detection for packaging material verification is typically achieved by setting verification thresholds. However, this method is not accurate enough and often leads to misjudgments, impacting subsequent cost reduction efforts. Summary of the Invention
[0004] This application provides an anomaly detection method, apparatus, device, and computer-readable storage medium, aiming to solve the problem that existing anomaly detection methods for packaging material verification are not accurate enough.
[0005] On one hand, embodiments of this application provide an anomaly detection method, including:
[0006] Obtain the packaging material redemption rate and historical redemption rate sequence of the object to be tested, as well as the waybill information corresponding to the packaging material redemption rate;
[0007] The historical write-off rate sequence is input into a preset time-series anomaly prediction model, and the first predicted write-off rate is output.
[0008] The waybill information is input into a trained neural network model, which outputs a second predicted redemption rate.
[0009] Based on the packaging material write-off rate, the first predicted write-off rate, and the second predicted write-off rate, the abnormal detection result of the packaging material write-off of the object to be detected is determined.
[0010] As another optional embodiment of this application, before inputting the waybill information into the trained neural network model and outputting the second predicted redemption rate, the method includes:
[0011] Obtain the sample redemption rate sequence and the sample waybill information corresponding to the sample redemption rate sequence;
[0012] The sample write-off rate sequence is input into the time series anomaly prediction model, and the risk write-off rate is output.
[0013] Based on the risk write-off rate and the sample waybill information, the preset initial network model is trained to obtain a trained neural network model.
[0014] As another optional embodiment of this application, the step of training a preset initial network model based on the risk write-off rate and the sample waybill information to obtain a trained neural network model includes:
[0015] The sample waybill information is input into a preset initial network model to obtain the training redemption rate;
[0016] The residual write-off rate is obtained by calculating the difference between the risk write-off rate and the label write-off rate corresponding to the sample write-off rate sequence.
[0017] The parameters in the initial network model are updated based on the difference between the training write-off rate and the residual write-off rate to obtain the updated network model.
[0018] The updated network model is determined as a trained neural network model when the updated training redemption rate obtained by inputting the sample waybill information into the updated network model meets the preset requirements.
[0019] As another optional embodiment of this application, after training a preset initial network model based on the risk write-off rate and the sample waybill information to obtain a trained neural network model, the method includes:
[0020] The trained neural network model and the object type corresponding to the sample redemption rate sequence are associated and stored in a preset database;
[0021] The step of inputting the waybill information into a trained neural network model and outputting a second predicted redemption rate includes:
[0022] Based on the target object type of the object to be detected, a preset database is queried to obtain an association network model stored in association with the target object type;
[0023] The waybill information is input into the associated network model, and the second predicted redemption rate is output.
[0024] As another optional embodiment of this application, the step of inputting the waybill information into a trained neural network model and outputting a second predicted redemption rate includes:
[0025] A first feature vector is generated based on the express delivery attribute information in the waybill information; the express delivery attribute information includes at least one of the following: express delivery type, express delivery volume, and express delivery weight.
[0026] A second feature vector is generated based on the address information in the waybill information;
[0027] The first feature vector and the second feature vector are input into the trained neural network model to output the second predicted write-off rate.
[0028] As another optional embodiment of this application, before obtaining the packaging material redemption rate and historical redemption rate sequence of the object to be detected, and the waybill information corresponding to the packaging material redemption rate, the method includes:
[0029] Obtain historical waybill information corresponding to the preset detection object;
[0030] The packaging personnel information in the historical waybill information is statistically analyzed to obtain the frequency information of each packaging personnel corresponding to the preset detection object;
[0031] The objects to be detected are selected from the preset detection objects based on the frequency information.
[0032] As another optional embodiment of this application, determining the abnormal detection result of the packaging material verification of the object to be tested based on the packaging material verification rate, the first predicted verification rate, and the second predicted verification rate includes:
[0033] Based on the weights corresponding to the object type information of the object to be detected, the first predicted write-off rate and the second predicted write-off rate are weighted to obtain the final predicted write-off rate.
[0034] Based on the relationship between the packaging material redemption rate and the final predicted redemption rate, the abnormal detection result of the packaging material redemption of the object to be detected is determined.
[0035] On the other hand, embodiments of this application also provide an anomaly detection device, including:
[0036] The acquisition module is used to acquire the packaging material redemption rate and historical redemption rate sequence of the object to be detected, as well as the waybill information corresponding to the packaging material redemption rate;
[0037] The first prediction module is used to input the historical write-off rate sequence into a preset time-series anomaly prediction model and output the first predicted write-off rate.
[0038] The second prediction module is used to input the waybill information into the trained neural network model and output the second predicted redemption rate.
[0039] The detection module is used to determine the abnormal detection result of the packaging material verification of the object to be detected based on the packaging material verification rate, the first predicted verification rate, and the second predicted verification rate.
[0040] On the other hand, embodiments of this application also provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor executing the computer program to implement the steps in the above-described anomaly detection method.
[0041] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is executed by a processor to implement the steps in the above-described anomaly detection method.
[0042] The anomaly detection method provided in this application extracts the historical redemption rate sequence and waybill information of the object to be detected, and uses a time-series anomaly prediction model to predict the historical redemption rate sequence, fully considering the trend of packaging material redemption rate. At the same time, a neural network model is used to further extract high-dimensional features from waybill information, fully considering the implicit correlation between packaging material redemption rate and waybill. Finally, the anomaly detection result of packaging material redemption is determined by combining the two aspects, ensuring the accuracy of the anomaly detection result. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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 effort.
[0044] Figure 1 This is a flowchart illustrating the steps of an anomaly detection method provided in an embodiment of this application;
[0045] Figure 2 This application provides a schematic diagram of the structure of a commonly used convolutional neural network model.
[0046] Figure 3 This application provides a schematic flowchart illustrating the steps involved in training a neural network model.
[0047] Figure 4 This application provides a schematic flowchart illustrating the steps for training a neural network model based on the difference in packaging material write-off rates.
[0048] Figure 5 This application provides a schematic flowchart illustrating the steps for processing waybill information based on object type in an embodiment of the present application.
[0049] Figure 6 This is a schematic diagram of a step-by-step process for extracting feature vectors, provided in an embodiment of this application.
[0050] Figure 7 This application provides a schematic flowchart of a step for screening out objects to be detected.
[0051] Figure 8 This application provides a schematic flowchart of a procedure for determining anomaly detection results based on packaging material write-off rate.
[0052] Figure 9 A complete architecture diagram for fusing a time-series anomaly prediction model and a neural network model is provided in this application embodiment;
[0053] Figure 10 This is a schematic diagram of the structure of an anomaly detection device provided in an embodiment of this application;
[0054] Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of the present invention.
[0056] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to implement and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in the embodiments of this application.
[0057] This application provides an anomaly detection method, apparatus, device, and computer-readable storage medium, which will be described in detail below.
[0058] like Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of an anomaly detection method provided in an embodiment of this application. The anomaly detection method in this embodiment includes steps 101 to 104:
[0059] 101. Obtain the packaging material redemption rate and historical redemption rate sequence of the object to be detected, as well as the waybill information corresponding to the packaging material redemption rate.
[0060] In this embodiment, the object to be detected typically refers to the enterprise customer of the logistics company, but it can also be the packaging staff of the logistics company. The following explanation will primarily focus on the enterprise customer as an example. Specifically, after completing the daily data statistics, logistics staff will integrate all the data into the logistics system. At this time, the anomaly detection device will retrieve all waybill data for that enterprise customer from the logistics system, using the enterprise customer as the query object. The user packaging material redemption rate is generally obtained by dividing the quantity of packaging materials used by the enterprise customer that day by the number of waybills for that day. The historical redemption rate sequence consists of the packaging material redemption rates of the enterprise customer over a previous period. The waybill information includes the waybill weight, waybill volume, sender / recipient, sender / recipient address, contact information, packer, packaging material consumption, and other information for each waybill.
[0061] Furthermore, considering the large number of corporate clients of logistics companies, those with a high risk of abnormal packaging material verification rates can be pre-screened as the targets for this application. Specifically, given that in reality, the packaging of waybills for corporate clients is usually done by randomly assigned personnel, the screening of high-risk corporate clients can be achieved by statistically analyzing the packaging personnel for each waybill. Specific implementation details can be found in subsequent sections. Figure 7 And its explanations and descriptions.
[0062] Of course, if the object to be detected is a packaging employee, the anomaly detection device will retrieve all waybill data of the packaging employee that day from the logistics system, using the packaging employee as the query object, and obtain the packaging material write-off rate, which is the ratio of the quantity of packaging materials used by the packaging employee to the number of waybill items, historical write-off rate sequence and waybill information in a similar manner. This application embodiment will not be described in detail here.
[0063] 102. Input the historical write-off rate sequence into the preset time series anomaly prediction model and output the first predicted write-off rate.
[0064] In this embodiment, the preset time-series anomaly prediction model typically refers to a model that predicts the trend of data sequence changes. Common examples include time-series anomaly prediction models based on the Prophet algorithm and ARIMA (Autoregressive Integrated Moving Average) models. This embodiment will not elaborate on the specific form of the time-series anomaly prediction model. Specifically, taking the Prophet algorithm as an example, the time-series anomaly prediction model based on the Prophet algorithm consists of a trend term, a periodic term, a holiday term, and a noise term. These are used to fit the non-periodic trend changes of the time series, fit the periodic trends of weeks, months, and quarters, fit the impact of potential jump points on the prediction, and fit unpredicted random fluctuations, respectively. Therefore, by inputting the historical write-off rate sequence into the preset time-series anomaly prediction model, the model can output a first predicted write-off rate based on the trend of the historical write-off rate sequence.
[0065] 103. Input the waybill information into the trained neural network model and output the second predicted redemption rate.
[0066] In this embodiment of the application, the neural network model refers to a model trained using a large number of training samples based on a supervised machine learning algorithm, used to describe the relationship between the packaging material redemption rate and the implicit high-dimensional features in the waybill information. Therefore, by inputting the waybill information corresponding to the packaging material redemption rate into the trained neural network model, the neural network model can extract the high-dimensional features affecting the packaging material redemption rate from the waybill information and output the corresponding second predicted redemption rate.
[0067] Specifically, the neural network model here can adopt the commonly used CNN (Convolutional Neural Network) structure. Of course, using other neural network structures, such as DNN (Deep-Learning Neural Network), is also feasible. This application does not limit the specific structure of the neural network model in its embodiments. For ease of understanding, as follows... Figure 2 As shown, a schematic diagram of a commonly used convolutional neural network model is presented.
[0068] Specifically, such as Figure 2As shown, this convolutional neural network model consists of two convolutional layers (Conv), two max-pooling layers, and two fully connected layers (FC) connected in series. After the waybill information is input into the convolutional neural network model in the form of feature vectors, the feature vectors are compressed through two convolutional-pooling layers to extract high-dimensional features, and then processed through two fully connected layers to output the final result.
[0069] In this embodiment, the specific implementation process of obtaining a neural network model based on a supervised machine learning algorithm and using a large number of training samples can be found in the following sections. Figure 3 And its explanations and descriptions.
[0070] Furthermore, as a feasible embodiment of this application, considering that different information in waybill information often exists in different data formats, a scheme for encoding waybill information and generating feature vectors based on different methods is proposed. Specific implementation steps can be found in the following sections. Figure 6 And its explanations and descriptions.
[0071] 104. Based on the packaging material write-off rate, the first predicted write-off rate, and the second predicted write-off rate, determine the abnormal detection result of the packaging material write-off of the object to be detected.
[0072] In this embodiment of the application, as described above, the first predicted redemption rate is predicted based on the trend of the historical redemption rate sequence, while the second predicted redemption rate is predicted based on the high-dimensional hidden features of the waybill information. Therefore, by fusing the first and second predicted redemption rates, a standard value for the packaging material redemption rate used for anomaly detection can be predicted based on two different dimensions: the trend of the historical redemption rate sequence and the high-dimensional hidden features of the waybill information. Furthermore, by comparing the actual packaging material redemption rate of the enterprise customer on that day with the predicted standard value, for example, if the actual packaging material redemption rate of the enterprise customer on that day is higher than the predicted standard value, or higher than the predicted standard value by a certain percentage, it can be considered that the packaging material redemption rate of the enterprise customer is abnormal; otherwise, it can be considered that the packaging material redemption rate of the enterprise customer is normal.
[0073] Furthermore, as an optional embodiment of this application, the fusion of the first predicted write-off rate and the second predicted write-off rate can be based on the object type of the object to be detected, such as the enterprise type of an enterprise customer object. This will not be elaborated further in this embodiment. Specific implementation schemes can be found in subsequent articles. Figure 8 And its explanations and descriptions.
[0074] The anomaly detection method provided in this application extracts the historical redemption rate sequence and waybill information of the object to be detected, and uses a time-series anomaly prediction model to predict the historical redemption rate sequence, fully considering the trend of packaging material redemption rate. At the same time, a neural network model is used to further extract high-dimensional features from waybill information, fully considering the implicit correlation between packaging material redemption rate and waybill. Finally, the anomaly detection result of packaging material redemption is determined by combining the two aspects, ensuring the accuracy of the anomaly detection result.
[0075] like Figure 3 As shown, Figure 3 This application provides a flowchart illustrating the steps for training a neural network model, specifically including steps 301 to 303:
[0076] 301. Obtain the sample verification rate sequence and the sample waybill information corresponding to the sample verification rate sequence.
[0077] As described above, the neural network model is primarily used to describe the correlation between the packaging material redemption rate and the hidden high-dimensional features in the waybill information. Therefore, the neural network model is mainly trained using the sample packaging material redemption rate as a label and its corresponding sample waybill information. However, to better integrate the neural network model and the aforementioned time-series anomaly prediction model, in this embodiment, the result obtained by inputting the sample redemption rate sequence into the time-series anomaly prediction model is used as the sample packaging material redemption rate for training. Therefore, the anomaly detection device extracts a sample redemption rate sequence from the historical packaging material redemption rates and correlates it with the sample waybill information corresponding to that sequence.
[0078] 302. Input the sample write-off rate sequence into the time series anomaly prediction model and output the risk write-off rate.
[0079] In this embodiment of the application, the sample redemption rate sequence is input into the aforementioned preset time series anomaly prediction model. The time series anomaly prediction model will output the corresponding risk redemption rate according to the changing trend of the sample redemption rate sequence. The risk redemption rate can be regarded as the packaging material redemption rate corresponding to the sample waybill information as a label.
[0080] 303. Based on the risk write-off rate and the sample waybill information, the preset initial network model is trained to obtain a trained neural network model.
[0081] In this embodiment of the application, by using the risk redemption rate as a label and the sample waybill information to update the parameters of each network layer in the initial network model, such as the convolutional layer, pooling layer and the aforementioned CNN model, the updated neural network model can accurately obtain the risk redemption rate as a label when processing the sample waybill information. At this point, the training process of the neural network model can be regarded as complete, and the updated neural network model can be regarded as a trained neural network model.
[0082] Building upon this, considering that the sample redemption rate sequence itself can be regarded as carrying labeled redemption rates—for example, the last redemption rate in the sample redemption rate sequence can be regarded as the label corresponding to the first few redemption rates in the sequence—the model can be trained using the difference between the risk redemption rate output by the time-series anomaly prediction model and the labeled redemption rate carried by the sample redemption rate sequence itself. The trained neural network model can effectively fit the difference between the true redemption rate and the redemption rate processed by the time-series anomaly prediction model, thereby further improving the accuracy of anomaly detection. Specific implementation schemes can be found in subsequent sections. Figure 4 And its explanations and descriptions.
[0083] like Figure 4 As shown, Figure 4 This application provides a flowchart illustrating the steps for training a neural network model based on the difference in packaging material write-off rates, specifically including steps 401 to 404:
[0084] 401. Input the sample waybill information into the preset initial network model to obtain the training redemption rate.
[0085] In this embodiment of the application, the sample waybill information is input into the initial network model. Since the parameters of each network layer in the initial network model are randomly initialized, the initial network model will output a prediction result with a large error when processing the sample waybill information, which is the training redemption rate.
[0086] 402. Calculate the difference between the risk write-off rate and the label write-off rate corresponding to the sample write-off rate sequence to obtain the residual write-off rate.
[0087] In this embodiment of the application, by comparing the prediction results with large errors obtained from the initial network model processing with the sample write-off rate sequence, the residual write-off rate, which describes the difference between the prediction results obtained from the time series anomaly prediction model processing and the actual results, can be obtained.
[0088] 403. Update the parameters in the initial network model based on the difference between the training write-off rate and the residual write-off rate to obtain the updated network model.
[0089] In this embodiment, since the neural network model is used to fit the difference between the actual redemption rate and the redemption rate obtained by the time series anomaly prediction model, that is, to make the difference between the training redemption rate and the residual redemption rate obtained by inputting the sample waybill information into the preset initial network model as small as possible, the parameters in the initial network model can be updated based on the idea of backpropagation and the difference between the training redemption rate and the residual redemption rate, so that the training redemption rate obtained by inputting the sample waybill information into the updated network model gradually approaches the residual redemption rate.
[0090] 404, until the updated training redemption rate obtained by inputting the sample waybill information into the updated network model meets the preset requirements, the updated network model is determined as the trained neural network model.
[0091] In this embodiment of the application, the updated network model can be determined as a trained neural network model only when the difference between the updated training redemption rate and the residual redemption rate obtained by inputting the sample waybill information into the updated network model after a certain update is less than a preset difference threshold.
[0092] Based on this, considering that the impact of waybill information corresponding to different object types on the redemption rate varies, i.e., different network models need to be trained for different object types, as an optional embodiment of this application, when determining the neural network model, the neural network model is associated and stored with the object type corresponding to the sample redemption rate sequence. Thus, when it is necessary to process the waybill information of the object to be detected using the neural network model, the anomaly detection device will obtain the corresponding neural network model based on the object type of the object to be detected for processing. Specific implementation details can be found in the subsequent sections. Figure 5 And its explanations and descriptions.
[0093] like Figure 5 As shown, Figure 5 This application provides a flowchart illustrating steps for processing waybill information based on object type, specifically including steps 501-503:
[0094] 501. The trained neural network model and the object type corresponding to the sample redemption rate sequence are associated and stored in a preset database.
[0095] In this embodiment, after obtaining the trained neural network model through the aforementioned steps, the neural network model and the object types corresponding to the sample redemption rate sequences are associated and stored in a preset database. Thus, neural network models corresponding to different object types can be trained using sample redemption rate sequences for different object types. Specifically, taking enterprise customer objects as an example, the object type at this time is the type of enterprise customer object, such as manufacturing enterprises, sales enterprises, etc.
[0096] 502. Query the preset database according to the target object type of the object to be detected to obtain the association network model stored in association with the target object type.
[0097] 503. Input the waybill information into the associated network model and output the second predicted redemption rate.
[0098] After the aforementioned neural network model corresponding to different object types can be trained by using sample redemption rate sequences corresponding to different object types, when it is necessary to detect the object to be detected, the anomaly detection device will query the preset database based on the target object type of the object to be detected to obtain the associated network model stored with the target object type. The associated network model can effectively perform anomaly detection processing on the waybill information of the object to be detected of the target object type and output the corresponding second predicted redemption rate.
[0099] like Figure 6 As shown, Figure 6 This application provides a flowchart illustrating a step for extracting feature vectors, specifically including steps 601 to 603:
[0100] 601. Generate a first feature vector based on the express delivery attribute information in the waybill information.
[0101] In this embodiment of the application, the express delivery attribute information includes at least one of the following: express delivery type, express delivery volume, and express delivery weight. Of course, it may also include more information, such as express delivery value. This information is usually present in the form of data in the waybill information. Therefore, by concatenating these express delivery attribute information in sequence, the corresponding first feature vector can be obtained.
[0102] 602. Generate a second feature vector based on the address information in the waybill information.
[0103] In this embodiment of the application, the address information in the waybill information is usually in the form of text. Therefore, by performing text encoding processing on the address information, the corresponding second feature vector can be obtained.
[0104] 603, input the first feature vector and the second feature vector into the trained neural network model, and output the second predicted redemption rate.
[0105] In this embodiment, after obtaining the first feature vector and the second feature vector through different processing methods, the first feature vector and the second feature vector are concatenated and fused, and then input into the trained neural network model. After the neural network model completes the processing of the feature vector, it will output the corresponding second predicted write-off rate.
[0106] like Figure 7 As shown, Figure 7 This application provides a flowchart illustrating the steps for screening objects to be detected, specifically including steps 701 to 703:
[0107] 701, retrieve historical waybill information corresponding to the preset detection object.
[0108] In this embodiment, the anomaly detection device reads all historical waybill information from the logistics system, which includes the packaging personnel information and enterprise customer information corresponding to each waybill.
[0109] 702, Statistically analyze the packaging personnel information in the historical waybill information to obtain the frequency information of each packaging personnel corresponding to the preset detection object.
[0110] In this embodiment of the application, the historical waybill information is statistically processed based on the packaging personnel information and enterprise customer information to obtain the frequency information of each packaging personnel corresponding to the preset detection object, that is, the number of waybills of packaging personnel a corresponding to detection object A, the number of waybills of packaging personnel b corresponding to detection object A, the number of waybills of packaging personnel a corresponding to detection object B, the number of waybills of packaging personnel b corresponding to detection object B, etc. This embodiment of the application will not be described in detail here.
[0111] 703, Select the target to be detected from the preset detection targets based on the frequency information.
[0112] In this embodiment of the application, by analyzing the frequency information of each packaging personnel corresponding to the preset detection object, the object to be detected can be screened from the preset detection objects. For example, when the frequency of a certain detection object corresponding to a certain packaging personnel is much higher than the frequency of other packaging personnel, it can be considered that the preset detection object has a high risk of being abnormal. Therefore, the preset detection object can be identified as the object to be detected.
[0113] like Figure 8 As shown, Figure 8 This application provides a flowchart illustrating the steps for determining anomaly detection results based on packaging material write-off rates, specifically including steps 801-802:
[0114] 801. Based on the weights corresponding to the object type information of the object to be detected, the first predicted write-off rate and the second predicted write-off rate are weighted to obtain the final predicted write-off rate.
[0115] In this embodiment, the final predicted reimbursement rate is typically obtained by adding the first and second predicted reimbursement rates. However, considering that the results predicted based on time series and those predicted based on waybill features have different impacts on the packaging material reimbursement rate in practice, different weights can be used to weight the first and second predicted reimbursement rates to obtain the final predicted reimbursement rate. For example, if the results predicted by the time series are more accurate, the weight of the first predicted reimbursement rate can be increased; conversely, the weight of the first predicted reimbursement rate can be decreased. Specifically, the weights can be set based on the object type information of the object to be detected.
[0116] 802. Based on the relationship between the packaging material write-off rate and the final predicted write-off rate, determine the abnormal detection result of the packaging material write-off of the object to be detected.
[0117] In this embodiment of the application, by comparing the packaging material write-off rate and the final predicted write-off rate, if the actual packaging material write-off rate is higher than the final predicted write-off rate, or a certain percentage of the final predicted write-off rate, it can be considered that the packaging material write-off rate of the object to be tested is abnormally high, and it can be considered that the packaging material write-off of the object to be tested is abnormal.
[0118] To facilitate understanding of the complete implementation scheme of the anomaly detection method provided in the embodiments of this application, the following will be combined with Figures 1 to 8 The provided embodiments offer a complete implementation process for an anomaly detection method, detailed below.
[0119] Specifically, the complete implementation process of anomaly detection methods mainly includes two stages: model training and model application. Model training includes:
[0120] 1) Extract historical packaging material verification data and corresponding waybill data from the logistics system to obtain sample verification rate sequence and sample waybill information, and mark the last item in the sample verification rate sequence as the label verification rate;
[0121] 2) Input the sample write-off rate sequence into the preset time series anomaly prediction model based on the Prophet algorithm, and output the risk write-off rate;
[0122] 3) Perform feature extraction processing on the sample waybill information to obtain the sample feature vector, and input it into the preset initial network model based on CNN architecture to obtain the training redemption rate;
[0123] 4) Calculate the difference between the risk write-off rate and the label write-off rate to obtain the residual write-off rate;
[0124] 5) The difference between the residual write-off rate and the training write-off rate is used as the loss value, and the parameters of the network layers in the initial network model are updated based on the backpropagation idea until the difference between the updated training write-off rate and the residual write-off rate obtained by inputting the sample waybill information into the updated network model is less than the preset difference threshold. The network model can be considered to have been trained, and the current updated network model is used as the trained neural network model.
[0125] 6) Associate the neural network model with the object type corresponding to the sample redemption rate sequence and store them in a preset database, and train different neural network models by using sample redemption rate sequences corresponding to different object types;
[0126] After model training is complete, when it is necessary to perform anomaly detection on packaging material redemption rates, the following steps will be taken:
[0127] 1) Extract historical waybill information for different detection objects from the logistics system;
[0128] 2) Statistically analyze the packaging personnel information in the historical waybill information to obtain the frequency information of each packaging personnel corresponding to each preset detection object, and select the objects to be detected from the preset detection objects based on the frequency information;
[0129] 3) Extract the packaging material redemption rate, historical redemption rate sequence, and corresponding waybill information of the object to be tested from the logistics system;
[0130] 4) Input the historical write-off rate sequence into the preset time series anomaly prediction model based on the Prophet algorithm, and output the first prediction result;
[0131] 5) Obtain the corresponding neural network model from the preset database based on the object type of the object to be detected;
[0132] 6) Perform feature extraction processing on the waybill information to obtain feature vectors, and input them into the aforementioned neural network model to obtain the second prediction result;
[0133] 7) Based on the weights corresponding to the object types of the objects to be detected, the first prediction result and the second prediction result are weighted to obtain the final predicted write-off rate;
[0134] 8) Compare the packaging material write-off rate with the final predicted write-off rate. If the actual packaging material write-off rate is greater than the final predicted write-off rate or greater than the final predicted write-off rate by a certain percentage, then it is determined that the object to be tested has packaging material write-off abnormalities. Otherwise, the object to be tested does not have packaging material write-off abnormalities.
[0135] Furthermore, Figure 9A complete architecture diagram integrating a time-series anomaly prediction model and a neural network model is presented. Where x t-n x t-n+1 , ..., x t-1 This is the write-off rate sequence. This refers to the first prediction result obtained from the time-series anomaly prediction model, which is the risk write-off rate. The second prediction result obtained through processing by a neural network model is the residual write-off rate. This is the final predicted write-off rate.
[0136] To better implement the anomaly detection method in the embodiments of this application, an anomaly detection device is also provided in the embodiments of this application, based on the anomaly detection method. For example... Figure 10 As shown, Figure 10 This is a schematic diagram of an anomaly detection device provided in an embodiment of this application. Specifically, the anomaly detection device includes:
[0137] The acquisition module 1001 is used to acquire the packaging material redemption rate and historical redemption rate sequence of the object to be detected, as well as the waybill information corresponding to the packaging material redemption rate;
[0138] The first prediction module 1002 is used to input the historical write-off rate sequence into a preset time series anomaly prediction model and output the first predicted write-off rate.
[0139] The second prediction module 1003 is used to input the waybill information into a trained neural network model and output a second predicted redemption rate.
[0140] The detection module 1004 is used to determine the abnormal detection result of the packaging material verification of the object to be detected based on the packaging material verification rate, the first predicted verification rate and the second predicted verification rate.
[0141] In some embodiments of this application, before the second prediction module inputs the waybill information into the trained neural network model and outputs the second predicted write-off rate, it is further configured to obtain a sample write-off rate sequence and sample waybill information corresponding to the sample write-off rate sequence; input the sample write-off rate sequence into the time series anomaly prediction model and output the risk write-off rate; and train a preset initial network model based on the risk write-off rate and the sample waybill information to obtain a trained neural network model.
[0142] In some embodiments of this application, the second prediction module is further configured to input the sample waybill information into a preset initial network model to obtain a training redemption rate; calculate the difference between the risk redemption rate and the tag redemption rate corresponding to the sample redemption rate sequence to obtain a residual redemption rate; update the parameters in the initial network model according to the difference between the training redemption rate and the residual redemption rate to obtain an updated network model; and determine the updated network model as a trained neural network model when the updated training redemption rate obtained by inputting the sample waybill information into the updated network model meets a preset requirement.
[0143] In some embodiments of this application, the second prediction module is further configured to associate the trained neural network model with the object type corresponding to the sample redemption rate sequence and store it in a preset database; query the preset database according to the target object type of the object to be detected to obtain the associated network model associated with the target object type; input the waybill information into the associated network model and output the second predicted redemption rate.
[0144] In some embodiments of this application, the second prediction module is further configured to generate a first feature vector based on the express delivery attribute information in the waybill information; the express delivery attribute information includes at least one of express delivery type, express delivery volume, and express delivery weight; generate a second feature vector based on the address information in the waybill information; input the first feature vector and the second feature vector into a trained neural network model, and output a second predicted redemption rate.
[0145] In some embodiments of this application, before acquiring the packaging material redemption rate and historical redemption rate sequence of the object to be tested, and the waybill information corresponding to the packaging material redemption rate, the acquisition module is further used to acquire historical waybill information corresponding to the preset object to be tested; to statistically analyze the packaging personnel information in the historical waybill information to obtain the frequency information of each packaging personnel corresponding to the preset object to be tested; and to select the object to be tested from the preset object to be tested based on the frequency information.
[0146] In some embodiments of this application, the detection module is further configured to weight the first predicted write-off rate and the second predicted write-off rate according to the weight corresponding to the object type information of the object to be detected, so as to obtain the final predicted write-off rate; and to determine the abnormal detection result of the packaging material write-off of the object to be detected according to the relationship between the packaging material write-off rate and the final predicted write-off rate.
[0147] This application also provides a computer device, such as... Figure 11 As shown, Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application.
[0148] The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the anomaly detection method provided in any embodiment of this application.
[0149] Specifically, a computer device may include components such as a processor 1101 with one or more processing cores, a memory 1102 with one or more storage media, a power supply 1103, and an input unit 1104. Those skilled in the art will understand that... Figure 11 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0150] The processor 1101 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1102, and by calling data stored in the memory 1102, thereby providing overall monitoring of the computer device. Optionally, the processor 1101 may include one or more processing cores; preferably, the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1101.
[0151] The memory 1102 can be used to store software programs and modules. The processor 1101 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102. The memory 1102 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1102 may also include a memory controller to provide the processor 1101 with access to the memory 1102.
[0152] The computer device also includes a power supply 1103 that supplies power to the various components. Preferably, the power supply 1103 can be logically connected to the processor 1101 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1103 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0153] The computer device may also include an input unit 1104, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0154] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1101 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 1102 according to the following instructions, and the processor 1101 runs the applications stored in the memory 1102, thereby implementing the steps in the anomaly detection method provided in any embodiment of this application.
[0155] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc. A computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps in the anomaly detection method provided in any embodiment of this application.
[0156] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0157] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0158] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0159] The above provides a detailed description of an anomaly detection method provided by the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. An anomaly detection method, characterized in that, include: Obtain the packaging material redemption rate and historical redemption rate sequence of the object to be tested, as well as the waybill information corresponding to the packaging material redemption rate; The waybill information includes express delivery attribute information and address information. The express delivery attribute information includes at least one of express delivery type, express delivery volume, and express delivery weight. The historical write-off rate sequence is input into a preset time-series anomaly prediction model, and the first predicted write-off rate is output. The waybill information is input into a trained neural network model, which outputs a second predicted redemption rate. Based on the packaging material write-off rate, the first predicted write-off rate, and the second predicted write-off rate, the abnormal detection result of the packaging material write-off of the object to be detected is determined; The trained neural network model is obtained by training an initial network model with sample waybill information, which serves as a label for risk write-off rate and sample write-off rate sequence. The risk write-off rate is obtained by inputting the sample write-off rate sequence into the time series anomaly prediction model. The risk write-off rate is used to indicate the packaging material write-off rate corresponding to the sample waybill information.
2. The anomaly detection method according to claim 1, characterized in that, Before inputting the waybill information into the trained neural network model and outputting the second predicted redemption rate, the method includes: Obtain the sample redemption rate sequence and the sample waybill information corresponding to the sample redemption rate sequence; The sample write-off rate sequence is input into the time series anomaly prediction model, and the risk write-off rate is output. Based on the risk write-off rate and the sample waybill information, the preset initial network model is trained to obtain a trained neural network model.
3. The anomaly detection method according to claim 2, characterized in that, The step of training a preset initial network model based on the risk write-off rate and the sample waybill information to obtain a trained neural network model includes: The sample waybill information is input into a preset initial network model to obtain the training redemption rate; The residual write-off rate is obtained by calculating the difference between the risk write-off rate and the label write-off rate corresponding to the sample write-off rate sequence. The parameters in the initial network model are updated based on the difference between the training write-off rate and the residual write-off rate to obtain the updated network model. The updated network model is determined as a trained neural network model when the updated training redemption rate obtained by inputting the sample waybill information into the updated network model meets the preset requirements.
4. The anomaly detection method according to claim 2, characterized in that, After training a preset initial network model based on the risk write-off rate and the sample waybill information to obtain a trained neural network model, the method includes: The trained neural network model and the object type corresponding to the sample redemption rate sequence are associated and stored in a preset database; The step of inputting the waybill information into a trained neural network model and outputting a second predicted redemption rate includes: Based on the target object type of the object to be detected, a preset database is queried to obtain an association network model stored in association with the target object type; The waybill information is input into the associated network model, and the second predicted redemption rate is output.
5. The anomaly detection method according to claim 1, characterized in that, The step of inputting the waybill information into a trained neural network model and outputting a second predicted redemption rate includes: A first feature vector is generated based on the express delivery attribute information in the waybill information; A second feature vector is generated based on the address information in the waybill information; The first feature vector and the second feature vector are input into the trained neural network model to output the second predicted write-off rate.
6. The anomaly detection method according to claim 1, characterized in that, Before obtaining the packaging material redemption rate and historical redemption rate sequence of the object to be detected, and the waybill information corresponding to the packaging material redemption rate, the method includes: Obtain historical waybill information corresponding to the preset detection object; The packaging personnel information in the historical waybill information is statistically analyzed to obtain the frequency information of each packaging personnel corresponding to the preset detection object; The objects to be detected are selected from the preset detection objects based on the frequency information.
7. The anomaly detection method according to any one of claims 1 to 6, characterized in that, The step of determining the abnormal detection result of the packaging material verification of the object to be tested based on the packaging material verification rate, the first predicted verification rate, and the second predicted verification rate includes: Based on the weights corresponding to the object type information of the object to be detected, the first predicted write-off rate and the second predicted write-off rate are weighted to obtain the final predicted write-off rate. Based on the relationship between the packaging material redemption rate and the final predicted redemption rate, the abnormal detection result of the packaging material redemption of the object to be detected is determined.
8. An anomaly detection device, characterized in that, include: The acquisition module is used to acquire the packaging material redemption rate and historical redemption rate sequence of the object to be detected, as well as the waybill information corresponding to the packaging material redemption rate; The waybill information includes express delivery attribute information and address information. The express delivery attribute information includes at least one of express delivery type, express delivery volume, and express delivery weight. The first prediction module is used to input the historical write-off rate sequence into a preset time-series anomaly prediction model and output the first predicted write-off rate. The second prediction module is used to input the waybill information into the trained neural network model and output the second predicted redemption rate. The detection module is used to determine the abnormal detection result of the packaging material verification of the object to be detected based on the packaging material verification rate, the first predicted verification rate and the second predicted verification rate; The trained neural network model is obtained by training an initial network model with sample waybill information, which serves as a label for risk write-off rate and sample write-off rate sequence. The risk write-off rate is obtained by inputting the sample write-off rate sequence into the time series anomaly prediction model. The risk write-off rate is used to indicate the packaging material write-off rate corresponding to the sample waybill information.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor executing the computer program to implement the steps of the anomaly detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the steps of the anomaly detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Expense account risk prediction method and device, terminal equipment and storage medium
CN108364106A
Data exception detection method and device
CN110874744A
