Abnormality detection method, device, computer equipment and storage medium
By obtaining the store traffic and historical transaction behavior data to calculate the probability distribution characteristics of predicted transaction resource data, the data loss problem caused by the single acquisition method of smart terminals is solved, and the complete collection and abnormal judgment of store transaction data is achieved.
Patent Information
- Application Number
- CN202210059717.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-01-19
AI Technical Summary
In the prior art, the acquisition method of smart terminals is relatively single, resulting in a high missing rate of sales resource data and poor accuracy in finding abnormal stores.
By obtaining the customer flow, historical transaction behavior data of the target store and reporting transaction resource data, the probability distribution characteristics of the predicted transaction resource data are calculated, and whether the store is abnormal is determined based on the abnormal probability.
We have implemented a variety of methods to collect transaction data, the data is relatively complete, we can accurately grasp the transaction data of the store, and use statistical distribution methods to promptly determine whether there are any abnormalities in the store.
Smart Images

Figure CN114429367B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an anomaly detection method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the rapid development of internet technology, various internet-related payment methods are becoming increasingly popular. Related technologies can collect sales resource data from each store through smart terminals, compare it with the sales resource data proactively reported by the store, and identify stores with abnormal sales resource data.
[0003] In related technologies, smart terminals are connected between POS (Point of Sales) terminals and printers. When a customer requests a receipt, the smart terminal automatically captures consumption data and completes sales statistics. However, with the increasing number of payment methods and the limited collection methods of smart terminals, sales data is often missing, resulting in poor accuracy in identifying abnormal stores. Summary of the Invention
[0004] Based on this, it is necessary to provide an anomaly detection method, device, computer equipment, computer-readable storage medium and computer program product that can accurately find abnormal stores in response to the above technical problems.
[0005] In a first aspect, the present application provides an anomaly detection method. The method comprises:
[0006] Obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data;
[0007] Calculating probability distribution characteristics of predicted transaction resource data of the target store based on the store customer flow and the historical transaction behavior data;
[0008] Calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data;
[0009] If the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store.
[0010] In one embodiment, when the historical transaction behavior data includes a probability distribution function of the conversion rate of the target store and a probability distribution function of average consumption resources, calculating the probability distribution characteristics of the predicted transaction resource data of the target store based on the store traffic and the historical transaction behavior data includes:
[0011] Based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution function, the expectation, and the variance are the probability distribution characteristics.
[0012] In one embodiment, when the historical transaction behavior data includes the behavior data of the store-entering customer flow in a target area and a probability distribution function of the average consumption resources of the store-entering customer flow, and the target area includes multiple stores, calculating the probability distribution characteristics of the predicted transaction resource data of the target store based on the store-entering customer flow and the historical transaction behavior data includes:
[0013] Inputting the customer flow into the target store and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store;
[0014] According to the probability distribution function of the predicted consumption quantity and the average consumption resources, the probability distribution function, expectation and variance of the predicted transaction resource data of the target store are calculated, and the probability distribution function, the expectation and the variance are the probability distribution characteristics.
[0015] In one embodiment, the store customer flow includes at least one target object;
[0016] Inputting the target store's customer flow and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store includes:
[0017] Input the target store's customer flow and the customer flow's behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption probability of each target object in the store's customer flow;
[0018] The predicted consumption probabilities of the target objects in the store flow are summed up to obtain the predicted consumption quantity of the target store.
[0019] In one embodiment, when the historical transaction behavior data includes the probability distribution function of the conversion rate of the target store, the probability distribution function of the average consumption resources, and the behavior data of the in-store customer flow in the target area, the probability distribution characteristics of the predicted transaction resource data of the target store include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resources, and a second probability distribution characteristic obtained based on the behavior data of the in-store customer flow in the target area and the probability distribution function of the average consumption resources.
[0020] In one embodiment, the calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data includes:
[0021] Performing weighted calculation on the first probability distribution feature and the second probability distribution feature to obtain a combined probability distribution feature;
[0022] The abnormal probability of the target store is calculated based on the combined probability distribution characteristics and the reported transaction resource data.
[0023] In one embodiment, the abnormal probability includes a first abnormal probability corresponding to the first probability distribution feature and a second abnormal probability corresponding to the second probability distribution feature; if the abnormal probability satisfies a preset abnormal condition, determining that the target store is an abnormal store includes:
[0024] If the first abnormality probability meets a preset abnormality condition, and the second abnormality probability meets a preset abnormality condition, the target store is determined to be an abnormal store.
[0025] In one embodiment, the method further comprises:
[0026] Acquire training data, the training data including sample behavioral feature data of sample in-store customer flow of the target store and sample consumption annotation data of the sample in-store customer flow;
[0027] Inputting the sample behavior feature data of the sample store traffic into the consumption prediction model to be trained to obtain the predicted consumption data corresponding to the sample store traffic;
[0028] Calculate the loss value based on the sample consumption labeling data and the predicted consumption data;
[0029] The network parameters of the consumption prediction model to be trained are updated according to the loss value, and the step of obtaining the training data is returned to be executed until the loss value meets the preset training completion condition, thereby obtaining a trained consumption prediction model.
[0030] In one embodiment, before the step of obtaining training data, the method further includes:
[0031] Obtaining behavioral data of the sample store traffic in the target area and sample video data of the sample store traffic in the target store;
[0032] Performing feature extraction processing on the behavior data of the sample store-entering customer flow in the target area to obtain sample behavior feature data corresponding to the sample store-entering customer flow;
[0033] The sample video data of the sample store-entering customer flow in the target store is labeled to obtain sample consumption labeling data of the sample store-entering customer flow.
[0034] In a second aspect, the present application further provides an anomaly detection device. The device comprises:
[0035] The acquisition module is used to obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data;
[0036] A first calculation module is used to calculate the probability distribution characteristics of the predicted transaction resource data of the target store based on the store customer flow and the historical transaction behavior data;
[0037] a second calculation module, configured to calculate an abnormality probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data;
[0038] A determination module is configured to determine that the target store is an abnormal store if the abnormal probability meets a preset abnormal condition.
[0039] In one embodiment, when the historical transaction behavior data includes a probability distribution function of the conversion rate of the target store and a probability distribution function of average consumption resources, the first calculation module is specifically configured to:
[0040] Based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution function, the expectation, and the variance are the probability distribution characteristics.
[0041] In one embodiment, when the historical transaction behavior data includes behavior data of the store traffic in a target area and a probability distribution function of average consumption resources of the store traffic, and the target area includes multiple stores, the first calculation module is further specifically configured to:
[0042] Inputting the customer flow into the target store and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store;
[0043] According to the probability distribution function of the predicted consumption quantity and the average consumption resources, the probability distribution function, expectation and variance of the predicted transaction resource data of the target store are calculated, and the probability distribution function, the expectation and the variance are the probability distribution characteristics.
[0044] In one embodiment, the store customer flow includes at least one target object;
[0045] The first calculation module is further specifically configured to:
[0046] Input the target store's customer flow and the customer flow's behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption probability of each target object in the store's customer flow;
[0047] The predicted consumption probabilities of the target objects in the store flow are summed up to obtain the predicted consumption quantity of the target store.
[0048] In one embodiment, when the historical transaction behavior data includes the probability distribution function of the conversion rate of the target store, the probability distribution function of the average consumption resources, and the behavior data of the in-store customer flow in the target area, the probability distribution characteristics of the predicted transaction resource data of the target store include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resources, and a second probability distribution characteristic obtained based on the behavior data of the in-store customer flow in the target area and the probability distribution function of the average consumption resources.
[0049] In one embodiment, the second calculation module is specifically configured to:
[0050] Performing weighted calculation on the first probability distribution feature and the second probability distribution feature to obtain a combined probability distribution feature;
[0051] The abnormal probability of the target store is calculated based on the combined probability distribution characteristics and the reported transaction resource data.
[0052] In one embodiment, the abnormality probability includes a first abnormality probability corresponding to the first probability distribution feature and a second abnormality probability corresponding to the second probability distribution feature; the determining module is specifically configured to:
[0053] If the first abnormality probability meets a preset abnormality condition, and the second abnormality probability meets a preset abnormality condition, the target store is determined to be an abnormal store.
[0054] In one embodiment, the apparatus further comprises:
[0055] A training module, configured to obtain training data, wherein the training data includes sample behavioral feature data of sample in-store customer flows of the target store and sample consumption annotation data of the sample in-store customer flows;
[0056] An input module, configured to input the sample behavior feature data of the sample store-entering customer flow into the consumption prediction model to be trained, and obtain predicted consumption data corresponding to the sample store-entering customer flow;
[0057] A loss value calculation module, configured to calculate a loss value based on the sample consumption annotation data and the predicted consumption data;
[0058] An updating module is used to update the network parameters of the consumption prediction model to be trained according to the loss value, and return to execute the step of obtaining training data until the loss value meets the preset training completion condition, thereby obtaining a trained consumption prediction model.
[0059] In one embodiment, the apparatus further comprises:
[0060] A sample data module is used to obtain behavioral data of the sample store traffic in the target area and sample video data of the sample store traffic in the target store;
[0061] A feature extraction module is used to perform feature extraction processing on the behavior data of the sample store-entering customer flow in the target area to obtain sample behavior feature data corresponding to the sample store-entering customer flow;
[0062] The labeling module is used to label the sample video data of the sample store-entering customer flow in the target store to obtain the sample consumption labeling data of the sample store-entering customer flow.
[0063] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0064] Obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data;
[0065] Calculating probability distribution characteristics of predicted transaction resource data of the target store based on the store customer flow and the historical transaction behavior data;
[0066] Calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data;
[0067] If the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store.
[0068] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0069] Obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data;
[0070] Calculating probability distribution characteristics of predicted transaction resource data of the target store based on the store customer flow and the historical transaction behavior data;
[0071] Calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data;
[0072] If the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store.
[0073] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0074] Obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data;
[0075] Calculating probability distribution characteristics of predicted transaction resource data of the target store based on the store customer flow and the historical transaction behavior data;
[0076] Calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data;
[0077] If the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store.
[0078] The above-mentioned anomaly detection method, apparatus, computer equipment, storage medium and computer program product obtain the target store's in-store customer flow, historical transaction behavior data and reported transaction resource data; calculate the probability distribution characteristics of the target store's predicted transaction resource data based on the in-store customer flow and historical transaction behavior data; calculate the target store's abnormal probability based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data; if the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store. The method provided by the embodiment of the present invention can collect the transaction data of the store through various means, and the data is relatively complete. The transaction data of the store can be accurately grasped, and the abnormal probability of the store can be estimated by statistical distribution to promptly determine whether the store has an abnormality. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 1 is a flow chart of an anomaly detection method according to an embodiment;
[0080] Figure 2A flowchart of the steps for calculating predicted transaction resource data in one embodiment;
[0081] Figure 3 A flowchart of the step of calculating predicted transaction resource data in another embodiment;
[0082] Figure 4 Schematic diagram of a flow chart of the step of calculating abnormality probability in one embodiment;
[0083] Figure 5 Schematic diagram of a flow chart of model training steps in one embodiment;
[0084] Figure 6 Schematic diagram of a process for obtaining training data in one embodiment;
[0085] Figure 7 is a schematic diagram of an anomaly detection system in one embodiment;
[0086] Figure 8 is a structural block diagram of an abnormality detection device in one embodiment;
[0087] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0088] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0089] Auditing transaction resource data for each project has always been a key focus for commercial management groups. However, the inability to accurately control store transaction resource data impacts the collection of commission-based rent within target areas, a long-standing pain point for urban management companies. Effectively monitoring stores, especially those primarily relying on commission-based rent, has become a high-priority business requirement.
[0090] Currently, there are three major pain points in the audit of transaction resource data: first, the audit method is single, and it is mainly based on manual reporting by merchants and manual auditing by operations, which results in a large workload and a relatively extensive management method; second, the audit accuracy is not high: due to the diversity and dispersion of payment methods, it is difficult to identify merchant account problems by relying solely on the POS cash register system, and a combination of multiple means of cross-verification is required; finally, it is difficult to obtain evidence: with only POS and reported data, and the lack of key data, it is difficult to have complete evidence as a strong support for the game.
[0091] Smart terminals are connected between POS (Point of Sales) terminals and printers. When a customer requests a receipt, they automatically capture consumption data and complete sales statistics. However, with the increasing number of payment methods, the limited collection methods of smart terminals have led to a high rate of missing sales data and poor accuracy in identifying abnormal stores.
[0092] In one embodiment, Figure 1 As shown, an anomaly detection method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The above-mentioned terminals can be, but are not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the anomaly detection method includes the following steps:
[0093] Step 102: Obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data.
[0094] Specifically, the target store can be any type of store; the store traffic is the total number of people who have visited the target store. The terminal can obtain the store traffic through the business intelligence system (Business Intelligence, BI), for example, the total number of people who have visited the target store within the target time period can be obtained. The terminal can determine the specific duration of the target time period based on the needs of the actual application scenario. Historical transaction behavior data is data related to transactions conducted by users at the target store within a preset time period, including transaction data of the target store and behavior data of users at the target store and the target area to which the target store belongs. The preset time period can be a specified time period, for example, within a specified 24 hours, within a specified month, within a specified quarter, or within a specified year, etc. Reported transaction resource data is the transaction resource data (sales) of the target store reported to the terminal by the manager of the target store.
[0095] Optionally, the preset time period is earlier than the target time period.
[0096] Step 104 : Calculate the probability distribution characteristics of the target store's predicted transaction resource data based on the store's customer flow and historical transaction behavior data.
[0097] Specifically, the historical transaction behavior data includes data used to calculate the predicted number of transactions among the target store's in-store customer flow and the probability distribution function of the target store's average consumer resources. In this way, the terminal can calculate the probability distribution characteristics of the target store's predicted transaction resource data based on the predicted number of transactions among the target store's in-store customer flow and the probability distribution function of the target store's average consumer resources. The probability distribution function of the average consumer resources is price~N(u2,σ2), where u2 represents the target store's average consumer resources and σ2 represents the standard deviation of the target store's average consumer resources. The target store's average consumer resources fluctuate within a certain range.
[0098] Optionally, the data used to calculate the predicted number of transactions in the target store's in-store customer flow may include the probability distribution function of the target store's conversion rate. In this way, the terminal can calculate the predicted number of transactions in the target store's in-store customer flow through the target store's in-store customer flow and the probability distribution function of the target store's conversion rate. In this way, the terminal calculates the probability distribution characteristics of the target store's predicted transaction resource data based on the probability distribution function of the target store's in-store customer flow and the target store's average consumption resources. The probability distribution function of the target store's conversion rate is rate~N(u1,σ1), where u1 represents the target store's conversion rate, σ1 represents the standard deviation of the target store's conversion rate, and the target store's conversion rate varies within a certain range.
[0099] Optionally, the data used to calculate the predicted number of transactions in the target store's in-store customer flow may include behavioral data of the in-store customer flow in a target area, where the target area may include multiple target stores, and the in-store customer flow may include multiple target objects. The in-store customer flow behavioral data in the target area is the behavioral data of each target object in the in-store customer flow within the target area.
[0100] In this way, the terminal calculates the predicted number of transactions among the target store's inbound customers based on the behavioral data of inbound customers in the target area, the pre-trained consumption prediction model, and the target store's inbound customer flow. In this way, the terminal calculates the probability distribution characteristics of the target store's predicted transaction resource data based on the predicted number of transactions among the target store's inbound customer flow and the probability distribution function of the target store's average consumption resources.
[0101] Step 106 , calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data.
[0102] Specifically, the probability distribution characteristics of the predicted transaction resource data include the probability distribution function, expectation, and variance of the predicted resource transaction data. Using a preset probability calculation algorithm, the terminal can determine the probability that the predicted transaction resource data for the target store is consistent with the reported transaction resource data, i.e., the anomaly probability, based on the probability distribution characteristics of the preset transaction resource data and the target store's reported transaction resource data.
[0103] For example, the standard deviation could be 10. Using a pre-set probability calculation algorithm, the theoretical predicted transaction resource data fluctuates between 80 and 120. If a customer's reported transaction resource data is 50, the terminal can calculate the probability of gmv <= 50 under the (100, 10) parameter using a probability table and Python's cipy.stats calculation method. If this probability is very low, below the pre-set probability threshold (meeting the pre-set abnormality criteria), the reported transaction resource data is significantly low, and the target store can be determined to be an abnormal store.
[0104] Step 108: If the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store.
[0105] Specifically, the preset abnormality condition can be that the abnormality probability is less than a preset probability threshold. The preset probability threshold can be determined by the terminal based on the actual application scenario. In this way, the terminal can identify a target store with an abnormality probability less than the preset probability threshold as an abnormal store, that is, an abnormal store whose reported transaction resource count does not match the store's actual transaction resource data, posing a risk of concealment or omission.
[0106] In the above-mentioned anomaly detection method, the target store's customer flow, historical transaction behavior data, and reported transaction resource data are obtained in combination; based on the customer flow and historical transaction behavior data, the probability distribution characteristics of the target store's predicted transaction resource data are calculated; based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data, the abnormal probability of the target store is calculated; if the abnormal probability meets the preset abnormal condition, the target store is determined to be an abnormal store. The method provided by the embodiment of the present invention can collect the transaction data of the store through various means, and the data is relatively complete. The transaction data of the store can be accurately grasped, and the abnormal probability of the store can be estimated by statistical distribution to promptly determine whether the store has an abnormality.
[0107] In one embodiment, when the historical transaction behavior data includes a probability distribution function of the conversion rate of the target store and a probability distribution function of the average consumption resources, the specific processing of step 104, "calculating the probability distribution characteristics of the target store's predicted transaction resource data based on the store traffic and historical transaction behavior data," includes:
[0108] Based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution function, expectation, and variance are probability distribution characteristics.
[0109] Specifically, the probability distribution function of the conversion rate of each target store can be obtained based on the in-store customer flow of each target store in the historical time period and the number of people who conducted transactions in the historical time period obtained by statistics. The distribution function of the conversion rate of the target store in different time periods may also be different, such as the morning time period and the afternoon time period, the weekday time period and the non-workday time period, etc. The terminal can determine the probability distribution function of the conversion rate in the time period consistent with the statistical time period based on the statistical time period corresponding to the in-store customer flow of the target store. The probability distribution function of the average consumption resources is similar to the probability distribution function of the conversion rate, and will not be repeated here.
[0110] Specifically, the conversion rate is the proportion of customers entering a target store who will conduct a transaction. The probability distribution function for the conversion rate is rate~N(u1, σ1), where u1 represents the target store's conversion rate and σ1 represents the standard deviation of the target store's conversion rate. The average consumption resource is the average transaction resource value for each target object in the target store during the statistical time period. The probability distribution function for the average consumption resource is price~N(u2, σ2), where u2 represents the target store's average consumption resource and σ2 represents the standard deviation of the target store's average consumption resource.
[0111] Optionally, the store traffic is obtained through a pre-set BI system in the target area or a third-party BI system or other number counting methods.
[0112] Specifically, based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution characteristics of the target store's predicted transaction resource data include the probability distribution function, expectation, and variance.
[0113] For example, the predicted transaction resource data (gmv) can be calculated by the following formula:
[0114] GMV = store traffic x conversion rate x average consumption resources.
[0115] For example, the expected E(gmv) and variance Var(gmv) of the target store's predicted transaction resource data (Gross Merchandise Volume, gmv) can be calculated using the following formula:
[0116] E(gmv)=traffic*u1*u2,
[0117]
[0118] Where E(gmv) is the expected value of the target store's predicted transaction resource data, Var(gmv) is the variance of the target store's predicted transaction resource data, traffic is the target store's in-store traffic, i.e., the actual number of people entering the target store, u1 is the conversion rate, u2 is the target store's average consumption resource (i.e., average customer spending). σ1 is the standard deviation of the conversion rate, and σ2 is the standard deviation of the average customer spending.
[0119] In this embodiment, the probability distribution function of the conversion rate of the target store, the probability distribution function of the average consumption resources, and the store flow can be used to accurately calculate the probability distribution characteristics of the predicted transaction resource data of the target store.
[0120] In one embodiment, when the historical transaction behavior data includes the behavior data of the store flow in the target area and the probability distribution function of the average consumption resources of the store flow, and the target area includes multiple stores, specifically, for each target object, the behavior data of the store flow in the target area includes the target object's residence time data in each store in the target area, data on whether the target object has entered the target store multiple times (e.g., 2 times), data on the distance between the time period when the target object enters the target store and the closing time of the store, data on the target object's visiting time in the target area, and data on whether the target object has visited other stores of the same business format as the target store, etc.
[0121] Accordingly, if Figure 2 As shown, the specific processing process of step 104 "calculating the probability distribution characteristics of the target store's predicted transaction resource data based on the store's customer flow and historical transaction behavior data" includes:
[0122] In step 202, the customer flow into the target store and the behavior data of the customer flow in the target area are input into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store.
[0123] Specifically, the behavioral data of in-store customer traffic in the target area is a collection of behavioral data of each target object in the in-store customer traffic in the target area. The terminal can input the behavioral data of each target object in the in-store customer traffic of the target store in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the in-store customer traffic in the target store, that is, the predicted number of consumers.
[0124] Step 204 : Calculate the probability distribution function, expectation, and variance of the predicted transaction resource data of the target store based on the predicted consumption quantity and the probability distribution function of the average consumption resources.
[0125] Among them, the probability distribution function, expectation and variance are probability distribution characteristics.
[0126] Specifically, based on the target store's in-store customer flow, the target store's predicted consumption quantity, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated.
[0127] For example, the predicted transaction resource data (gmv) of the target store can be calculated using the following formula:
[0128] GMV = predicted consumption quantity * average consumption resources.
[0129] For example, the expected E(gmv) and variance Var(gmv) of the target store's predicted transaction resource data (Gross Merchandise Volume, gmv) can be calculated using the following formula:
[0130] E(gmv)=u3*u2
[0131]
[0132] Where u3 is the expected amount of consumption, u2 is the average consumption resource, σ3 is the standard deviation of the predicted consumption, and σ2 is the standard deviation of the average consumption resource.
[0133] In one embodiment, since the customer flow statistics of the target store are the number of people entering the target store within a period of time, the customer flow of the target store includes at least one target object. Figure 3 As shown, step 202, "inputting the target store's customer flow and the customer flow behavior data in the target area into the pre-trained consumption prediction model to obtain the predicted consumption amount of the target store," includes:
[0134] In step 302, the customer flow into the target store and the behavior data of the customer flow in the target area are input into a pre-trained consumption prediction model to obtain the predicted consumption probability of each target object in the customer flow into the store.
[0135] Specifically, the pre-trained consumption prediction model outputs the probability value that each target object in the store flow will consume in the target store, that is, the predicted consumption probability.
[0136] Step 304 : summing the predicted consumption probabilities of the target objects in the store flow to obtain the predicted consumption quantity of the target store.
[0137] Specifically, the terminal may sum the predicted consumption probabilities of each target object in the store customer flow output by the consumption prediction model to obtain the predicted consumption quantity of the target store.
[0138] In one embodiment, when the historical transaction behavior data includes the probability distribution function of the conversion rate of the target store, the probability distribution function of the average consumption resources, and the behavior data of the in-store customer flow in the target area, the probability distribution characteristics of the predicted transaction resource data of the target store include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resources, and a second probability distribution characteristic obtained based on the behavior data of the in-store customer flow in the target area and the probability distribution function of the average consumption resources.
[0139] In one embodiment, Figure 4 As shown, the specific processing process of step 106 "calculating the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data" includes:
[0140] Step 402: Perform weighted calculation on the first probability distribution feature and the second probability distribution feature to obtain a combined probability distribution feature.
[0141] Specifically, the first probability distribution feature includes a first probability distribution function, a first expectation, and a first variance of the first predicted transaction resource data. The first probability distribution feature is obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resource. The second probability distribution feature includes a second probability distribution function, a second expectation, and a second variance of the second predicted transaction resource data. The second probability distribution feature is obtained based on the behavioral data of in-store customer flow in the target area, a pre-trained consumption prediction model, and the probability distribution function of the average consumption resource.
[0142] The terminal can perform weighted calculations on the first probability distribution function and the second probability distribution function based on the first weight corresponding to the first probability distribution feature and the second weight corresponding to the second probability distribution feature to obtain a combined probability distribution function. The terminal obtains the combined expectation and combined variance, i.e., the combined probability distribution feature, through a similar process. For example, it can be expressed by the following formula:
[0143] gmv(strategy i)~N(u i , σ i ).
[0144] Where strategy i represents the predicted transaction resource data calculated using the i-th strategy. ui represents the expected value of the predicted transaction resource data obtained using the i-th strategy. σi represents the standard deviation of the predicted transaction resource data obtained using the i-th strategy.
[0145] Step 404 : Calculate the abnormal probability of the target store based on the combined probability distribution characteristics and the reported transaction resource data.
[0146] Specifically, the combined probability distribution characteristics of the predicted transaction resource data include the combined probability distribution function, combined expectation, and combined variance of the predicted resource transaction data. Using a preset probability calculation algorithm, the terminal can determine the probability that the predicted transaction resource data for the target store is consistent with the reported transaction resource data, i.e., the anomaly probability, based on the combined probability distribution characteristics of the preset transaction resource data and the target store's reported transaction resource data.
[0147] In one embodiment, the abnormality probability includes a first abnormality probability corresponding to the first probability distribution feature and a second abnormality probability corresponding to the second probability distribution feature.
[0148] Accordingly, the specific processing process of step 108 "If the abnormal probability meets the preset abnormal condition, determine the target store as an abnormal store" includes: if the first abnormal probability meets the preset abnormal condition, and the second abnormal probability meets the preset abnormal condition, determine the target store as an abnormal store.
[0149] In this embodiment, the predicted transaction resource data of the target store is calculated separately by different methods, and multiple methods are used to simultaneously determine whether the target store is an abnormal store, which can achieve the effect of double verification of the target store, making the abnormality detection results more accurate and more reliable.
[0150] In one embodiment, Figure 5 As shown, the anomaly detection method further includes:
[0151] Step 502: Obtain training data.
[0152] The training data includes sample behavioral feature data of sample in-store customer flow and sample consumption annotation data of sample in-store customer flow of the target store.
[0153] Specifically, the terminal can obtain sample behavioral feature data and sample consumption annotation data of sample in-store customer flows for a target store within a historical time period. The sample in-store customer flows can be target objects that visited the target store within a historical time period. The sample consumption annotation data of the sample in-store customer flows can be an identifier, determined based on video image data within the historical time period, indicating whether each target object in the sample in-store customer flows made a purchase after exiting the target store. For example, this can be determined by whether the target object carried a bag.
[0154] That is, the terminal obtains sample behavioral feature data for each target object in the in-store customer flow that visited the target store during a historical time period. This sample behavioral feature data includes the target object's dwell time in each store within the target area, whether the target object entered the target store multiple times (e.g., twice), the distance between the target object's entry time and the store's closing time, the target object's visit time in the target area, and whether the target object visited other stores in the same business format as the target store. The sample consumption annotation data for the sample in-store customer flow is identification information on whether each target object in the sample in-store customer flow made any purchases.
[0155] Step 504 : Input the sample behavior feature data of the sample store-entering customer flow into the consumption prediction model to be trained to obtain the predicted consumption data corresponding to the sample store-entering customer flow.
[0156] Step 506: Calculate the loss value based on the sample consumption labeling data and the predicted consumption data.
[0157] Step 508: Update the network parameters of the consumption prediction model to be trained according to the loss value, and return to the step of obtaining training data until the loss value meets the preset training completion condition, thereby obtaining a trained consumption prediction model.
[0158] In this embodiment, by training consumption prediction models for different target stores respectively, a consumption prediction model that reflects the actual transaction behavior of offline store traffic can be obtained, which conforms to the actual transaction conditions of various business formats, and the output results of the model are more realistic and accurate.
[0159] In one embodiment, Figure 6 As shown, the anomaly detection method further includes:
[0160] Step 602: Obtain behavioral data of sample store traffic in a target area and sample video data of sample store traffic in a target store.
[0161] Step 604 : performing feature extraction processing on the behavior data of the sample store-entering customer flow in the target area to obtain sample behavior feature data corresponding to the sample store-entering customer flow.
[0162] Step 606: label the sample video data of the sample in-store customer flow in the target store to obtain sample consumption labeling data of the sample in-store customer flow.
[0163] The following, such as Figure 7 As shown, in combination with a detailed embodiment, the specific implementation process of the above-mentioned abnormality detection method is described in detail:
[0164] The main modules involved in the anomaly identification system include: input module, strategy estimation module, business rule module and output module. The input module is the transaction data reported by the target store, that is, the transaction data reported by the customer. The strategy estimation module includes GMV estimation units corresponding to multiple estimation strategies, including:
[0165] The GMV estimation unit corresponding to the first estimation strategy can be: GMV = store traffic x conversion rate x average order value.
[0166] Specifically, the store traffic can be obtained through the BI system to accurately determine the number of people entering the store. The conversion rate indicates the proportion of people entering the store who make transactions, and the average customer spending is a measure of the average transaction price per person in the store over a period of time. The store traffic can be obtained through a BI system pre-set in the target area, a third-party BI system, or other number counting methods. Assume that the customer flow within the statistical time range is traffic. The conversion rate of the target store will fluctuate within a rough range. The probability distribution function of the conversion rate in the historical time period corresponding to the statistical time range can be rate~N(u1, σ1); the average consumption resources (customer spending) are affected by factors such as the number of people entering the store or time, and vary within a certain range. The probability distribution function of the average consumption resources in the historical time period corresponding to the statistical time range can be price~N(u2, σ2).
[0167] In this way, the probability distribution function, expectation, and variance of the predicted transaction resource data of the target store are calculated using the following formula:
[0168] GMV = store traffic x conversion rate x average order value,
[0169] E(gmv)=troffic*u1*u2
[0170]
[0171] In this way, based on the probability distribution function of the target store's predicted transaction resource data, the terminal can perform anomaly detection on the transaction amount reported by the customer. The terminal can calculate the probability that the predicted transaction resource data is less than or equal to the reported transaction resource data under the given expectation and variance of the predicted transaction resource data. That is:
[0172] P(gmv<=actual amount reported by the user|E(gmv),Var(gmv)).
[0173] That is, the terminal can calculate the probability that the reported transaction resource data conforms to the probability distribution function of the predicted transaction resource data based on the probability distribution function of the predicted transaction resource data.
[0174] The GMV estimation unit corresponding to the second estimation strategy can be: GMV = estimated number of bags * average order value.
[0175] The probability distribution function, expectation and variance of the predicted transaction resource data of the target store are calculated using the following formula:
[0176] E(gmv)=u3*u2
[0177]
[0178] Where u3 is the expected number of bags picked up (predicted consumption quantity), u2 is the average order value, σ3 is the standard deviation of the estimated number of bags picked up, and σ2 is the standard deviation of the average order value.
[0179] In this way, based on the probability distribution function of the target store's predicted transaction resource data, the terminal can perform anomaly detection on the transaction amount reported by the customer. The terminal can calculate the probability that the predicted transaction resource data is less than or equal to the reported transaction resource data under the given expectation and variance of the predicted transaction resource data. That is:
[0180] P(gmv<=actual amount reported by the user|E(gmv),Var(gmv)).
[0181] For example, the terminal might obtain a target store's predicted transaction resource data with an expected value of 100 and a standard deviation of 10. Using a pre-set probability calculation algorithm, the theoretical predicted transaction resource data fluctuates between 80 and 120. If the customer's reported transaction resource data is 50, the terminal can calculate the probability of gmv <= 50 under the (100, 10) parameter using a probability table and Python's cipy.stats calculation method. If this probability is very low, less than the pre-set probability threshold (meeting the pre-set abnormality condition), the reported transaction resource data is significantly undervalued, and the target store can be determined to be an abnormal store.
[0182] Among them, the estimated number of bags is obtained based on the consumption prediction model (machine learning model).
[0183] Specifically, the labeling personnel can use the video information on the terminal to mark whether each target object carries a bag after leaving the store, and obtain the labeling data; construct the behavioral characteristics based on the customer flow data (the target object's behavior data in the offline shopping mall), including the target object's residence time data in each store in the target area, whether the target object has entered the target store multiple times (such as twice), the distance data between the time period when the target object enters the target store and the store's closing time, the target object's visiting time in the target area, and whether the target object visits other stores in the same business format as the target store, etc. The sample consumption labeling data of the sample store flow is the identification information of whether each target object in the sample store flow has made any consumption; the terminal can perform data preprocessing through the above-mentioned customer flow data to extract its behavioral characteristic data.
[0184] The labeled data and behavioral feature data are merged to construct a training set. The task is set to predict whether the target object entering each store will pick up a bag. Then, the machine learning model is used for training. When the preset training completion conditions are met, a trained consumption prediction model (bag picking prediction model) is obtained.
[0185] During the prediction, the consumption prediction model (bag picking estimation model) outputs the probability value of each target object picking up a bag when entering the store, and the probability values are added together to obtain the predicted consumption quantity (estimated number of bags picked up) of the target store.
[0186] The anomaly detection system also includes a strategy fusion module that can merge the predicted transaction resource data of the target store obtained through different strategies.
[0187] Optionally, the terminal may take the intersection of the identification results of each strategy by voting on the results, that is, the target store is determined to be an abnormal store only when multiple strategies all consider the target store to be an abnormal store.
[0188] Optionally, the terminal can determine whether a target store is an abnormal store by using a model fusion strategy. The terminal obtains the expectation and variance of the target store's predicted transaction resource data corresponding to each strategy. The terminal can perform a weighted average calculation on the expectation and variance of the target store's predicted transaction resource data corresponding to each strategy, respectively, to obtain the expectation and variance of the weighted distribution of the combined strategy. Based on the expectation and variance of the weighted distribution, the terminal calculates the abnormal probability of the target store and determines whether the abnormal probability meets the preset abnormality condition.
[0189] The anomaly detection system also includes a business rule module.
[0190] Among them, it is possible to determine whether the target store is an abnormal store by comparing the reported data with the detailed data.
[0191] GMV = sum (detailed summary),
[0192] Since all POS transactions within the target area are directly recorded in the CRM system, the store's total transaction volume for a specific period can be calculated by aggregating the detailed transaction data in the CRM system and comparing it with the reported GMV. If the reported GMV is less than the aggregated transaction amount, the store is considered an abnormal store.
[0193] In addition, you can also determine whether the target store is an outlier by comparing its costs. Cost comparison mainly involves calculating the minimum sales volume required to ensure a break-even store revenue by looking at the store's rent, utilities, taxes, and labor costs.
[0194] In addition, some stores agree on a minimum guaranteed sales volume when signing a lease contract with a shopping mall. The store can also be judged as an abnormal store by failing to reach the guaranteed sales volume for multiple consecutive times.
[0195] That is to say, the anomaly detection system can output auxiliary judgment data such as the stores that may have abnormalities in the target area during the year and the confidence level of the abnormal stores through the output module.
[0196] The anomaly detection method described in this embodiment uses both policy identification and business rules for dual verification, making identification results more reliable. Policy identification relies on unsupervised results, leaving the actual transaction volume unknown. Identification is performed by estimating risk rates through statistical distribution. At the model level, the actual behavior of offline customers, such as length of stay and number of store visits, is considered, and separate modeling is performed for different business formats, resulting in more accurate model output.
[0197] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0198] Based on the same inventive concept, embodiments of the present application also provide an anomaly detection device for implementing the anomaly detection method described above. The solution provided by this device is similar to the solution described in the method described above. Therefore, the specific limitations in one or more of the anomaly detection device embodiments provided below can be found in the limitations of the anomaly detection method described above and will not be further elaborated here.
[0199] In one embodiment, Figure 8 As shown, an abnormality detection device 700 is provided, comprising: an acquisition module 701, a first calculation module 702, a second calculation module 703 and a determination module 704, wherein:
[0200] The acquisition module 701 is used to obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data.
[0201] The first calculation module 702 is used to calculate the probability distribution characteristics of the predicted transaction resource data of the target store based on the store customer flow and historical transaction behavior data.
[0202] The second calculation module 703 is used to calculate the abnormal probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data.
[0203] The determination module 704 is configured to determine that the target store is an abnormal store if the abnormal probability meets a preset abnormal condition.
[0204] In one embodiment, when the historical transaction behavior data includes a probability distribution function of the conversion rate of the target store and a probability distribution function of average consumption resources, the first calculation module is specifically configured to:
[0205] Based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution function, the expectation, and the variance are the probability distribution characteristics.
[0206] In one embodiment, when the historical transaction behavior data includes behavior data of the store traffic in a target area and a probability distribution function of average consumption resources of the store traffic, and the target area includes multiple stores, the first calculation module is further specifically configured to:
[0207] Inputting the customer flow into the target store and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store;
[0208] According to the probability distribution function of the predicted consumption quantity and the average consumption resources, the probability distribution function, expectation and variance of the predicted transaction resource data of the target store are calculated, and the probability distribution function, the expectation and the variance are the probability distribution characteristics.
[0209] In one embodiment, the store customer flow includes at least one target object;
[0210] The first calculation module is further specifically configured to:
[0211] Input the target store's customer flow and the customer flow's behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption probability of each target object in the store's customer flow;
[0212] The predicted consumption probabilities of the target objects in the store flow are summed up to obtain the predicted consumption quantity of the target store.
[0213] In one embodiment, when the historical transaction behavior data includes the probability distribution function of the conversion rate of the target store, the probability distribution function of the average consumption resources, and the behavior data of the in-store customer flow in the target area, the probability distribution characteristics of the predicted transaction resource data of the target store include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resources, and a second probability distribution characteristic obtained based on the behavior data of the in-store customer flow in the target area and the probability distribution function of the average consumption resources.
[0214] In one embodiment, the second calculation module is specifically configured to:
[0215] Performing weighted calculation on the first probability distribution feature and the second probability distribution feature to obtain a combined probability distribution feature;
[0216] The abnormal probability of the target store is calculated based on the combined probability distribution characteristics and the reported transaction resource data.
[0217] In one embodiment, the abnormality probability includes a first abnormality probability corresponding to the first probability distribution feature and a second abnormality probability corresponding to the second probability distribution feature; the determining module is specifically configured to:
[0218] If the first abnormality probability meets a preset abnormality condition, and the second abnormality probability meets a preset abnormality condition, the target store is determined to be an abnormal store.
[0219] In one embodiment, the apparatus further comprises:
[0220] A training module, configured to obtain training data, wherein the training data includes sample behavioral feature data of sample in-store customer flows of the target store and sample consumption annotation data of the sample in-store customer flows;
[0221] An input module, configured to input the sample behavior feature data of the sample store-entering customer flow into the consumption prediction model to be trained, and obtain predicted consumption data corresponding to the sample store-entering customer flow;
[0222] A loss value calculation module, configured to calculate a loss value based on the sample consumption annotation data and the predicted consumption data;
[0223] An updating module is used to update the network parameters of the consumption prediction model to be trained according to the loss value, and return to execute the step of obtaining training data until the loss value meets the preset training completion condition, thereby obtaining a trained consumption prediction model.
[0224] In one embodiment, the apparatus further comprises:
[0225] A sample data module is used to obtain behavioral data of the sample store traffic in the target area and sample video data of the sample store traffic in the target store;
[0226] A feature extraction module is used to perform feature extraction processing on the behavior data of the sample store-entering customer flow in the target area to obtain sample behavior feature data corresponding to the sample store-entering customer flow;
[0227] The labeling module is used to label the sample video data of the sample store-entering customer flow in the target store to obtain the sample consumption labeling data of the sample store-entering customer flow.
[0228] Each module in the above-mentioned anomaly detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0229] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data for determining whether it is an abnormal store. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an abnormality detection method is implemented.
[0230] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0231] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0232] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0233] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0234] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0235] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0236] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting anomalies, characterized in that: The method comprises: Obtaining the target store's customer flow, historical transaction behavior data, and reported transaction resource data, wherein the historical transaction behavior data includes the target store's conversion rate probability distribution function, the probability distribution function of average consumption resources, and the customer flow behavior data in the target area; Calculating probability distribution characteristics of the target store's predicted transaction resource data based on the store's inbound customer flow and the historical transaction behavior data; the probability distribution characteristics of the target store's predicted transaction resource data include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resource, and a second probability distribution characteristic obtained based on the behavior data of the store's inbound customer flow in the target area and the probability distribution function of the average consumption resource; Calculating an abnormality probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data; the abnormality probability includes a first abnormality probability corresponding to the first probability distribution characteristics and a second abnormality probability corresponding to the second probability distribution characteristics, the abnormality probability representing a probability that the predicted transaction data of the target store is consistent with the reported transaction resource data; If the first abnormality probability satisfies a preset abnormality condition, and the second abnormality probability satisfies a preset abnormality condition, the target store is determined to be an abnormal store.
2. The method according to claim 1, characterized in that In a case where the historical transaction behavior data includes a probability distribution function of the conversion rate of the target store and a probability distribution function of average consumption resources, the calculation of the probability distribution characteristics of the predicted transaction resource data of the target store based on the store traffic and the historical transaction behavior data includes: Based on the probability distribution function of the target store's customer flow, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated, and the calculated probability distribution function, expectation, and variance are the probability distribution characteristics.
3. The method according to claim 1, characterized in that When the historical transaction behavior data includes behavior data of the store-entering customer flow in a target area and a probability distribution function of average consumption resources of the store-entering customer flow, and the target area includes multiple stores, calculating the probability distribution characteristics of the predicted transaction resource data of the target store based on the store-entering customer flow and the historical transaction behavior data includes: Inputting the customer flow into the target store and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store; According to the probability distribution function of the predicted consumption quantity and the average consumption resources, the probability distribution function, expectation and variance of the predicted transaction resource data of the target store are calculated, and the calculated probability distribution function, expectation and variance are the probability distribution characteristics.
4. The method according to claim 3, characterized in that The customer flow entering the store includes at least one target object; Inputting the target store's customer flow and the customer flow behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption amount of the target store includes: Input the target store's customer flow and the customer flow's behavior data in the target area into a pre-trained consumption prediction model to obtain the predicted consumption probability of each target object in the store's customer flow; The predicted consumption probabilities of the target objects in the store flow are summed up to obtain the predicted consumption quantity of the target store.
5. The method according to claim 1, wherein The calculating the abnormal probability of the target store according to the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data includes: Performing weighted calculation on the first probability distribution feature and the second probability distribution feature to obtain a combined probability distribution feature; The abnormal probability of the target store is calculated based on the combined probability distribution characteristics and the reported transaction resource data.
6. The method according to claim 3, characterized in that The method further comprises: Acquire training data, the training data including sample behavioral feature data of sample in-store customer flow of the target store and sample consumption annotation data of the sample in-store customer flow; Inputting the sample behavior feature data of the sample store traffic into the consumption prediction model to be trained to obtain the predicted consumption data corresponding to the sample store traffic; Calculate the loss value based on the sample consumption labeling data and the predicted consumption data; The network parameters of the consumption prediction model to be trained are updated according to the loss value, and the step of obtaining the training data is returned to be executed until the loss value meets the preset training completion condition, thereby obtaining a trained consumption prediction model.
7. The method according to claim 6, characterized in that Before the step of obtaining training data, the method further includes: Obtaining behavioral data of the sample store traffic in the target area and sample video data of the sample store traffic in the target store; Performing feature extraction processing on the behavior data of the sample store-entering customer flow in the target area to obtain sample behavior feature data corresponding to the sample store-entering customer flow; The sample video data of the sample store-entering customer flow in the target store is labeled to obtain sample consumption labeling data of the sample store-entering customer flow.
8. An abnormality detection device, characterized in that: The device comprises: An acquisition module is used to obtain the target store's customer flow, historical transaction behavior data, and reported transaction resource data. The historical transaction behavior data includes the probability distribution function of the target store's conversion rate, the probability distribution function of average consumption resources, and the behavior data of the customer flow in the target area; a first calculation module, configured to calculate probability distribution characteristics of the target store's predicted transaction resource data based on the store's customer flow and the historical transaction behavior data; the probability distribution characteristics of the target store's predicted transaction resource data include a first probability distribution characteristic obtained based on the probability distribution function of the conversion rate and the probability distribution function of the average consumption resource, and a second probability distribution characteristic obtained based on the behavior data of the store's customer flow in a target area and the probability distribution function of the average consumption resource; a second calculation module, configured to calculate an abnormality probability of the target store based on the probability distribution characteristics of the predicted transaction resource data and the reported transaction resource data; the abnormality probability includes a first abnormality probability corresponding to the first probability distribution characteristics and a second abnormality probability corresponding to the second probability distribution characteristics, the abnormality probability representing a probability that the predicted transaction data of the target store is consistent with the reported transaction resource data; A determination module is configured to determine that the target store is an abnormal store if the first abnormality probability satisfies a preset abnormality condition and the second abnormality probability satisfies a preset abnormality condition.
9. The device according to claim 8, characterized in that When the historical transaction behavior data includes a probability distribution function of a conversion rate of the target store and a probability distribution function of average consumption resources, the first calculation module is specifically configured to: Based on the probability distribution function of the target store's in-store traffic, the target store's conversion rate, and the probability distribution function of the average consumption resources, the probability distribution function, expectation, and variance of the target store's predicted transaction resource data are calculated. The probability distribution function, the expectation, and the variance are the probability distribution characteristics.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Marketing value estimation method for flash store
CN112966223A
Data processing method and device, equipment and computer readable storage medium
CN113762569A