Self-service vending machine point location alarm method and system based on Flink + Dores multi-dimensional statistical analysis
Through the multi-dimensional statistical analysis and dynamic threshold algorithm of the Flink+Doris architecture, the real-time and accuracy issues of the unmanned vending machine monitoring and alarm system were solved, and real-time monitoring and accurate alarms of equipment status were achieved, reducing operation and maintenance costs.
Patent Information
- Application Number
- CN202510895278.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-17
AI Technical Summary
The existing unmanned vending machine monitoring and alarm system has the defects of insufficient real-time performance, single dimension, and static threshold, resulting in high false alarm rate, delayed response, inability to accurately identify equipment anomalies, and lack of dynamic adaptability.
Adopting the Flink+Doris stream-batch collaborative architecture, through real-time multi-dimensional analysis and dynamic threshold algorithm, combined with intelligent alarm suppression and classification mechanism, it realizes real-time monitoring of equipment status and accurate alarm.
It has improved the accuracy of anomaly detection by 40%-60%, reduced invalid alarms by more than 70%, lowered operation and maintenance costs, and improved equipment operating efficiency.
Smart Images

Figure CN120808487A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data computing and analysis, and particularly relates to a vending machine point alarm method and system based on Flink+Doris multidimensional statistical analysis. BACKGROUND
[0002] The current monitoring and alarm system of the vending machine relies on offline batch statistics and static rule engines. The mainstream implementation scheme is usually based on traditional databases (such as MySQL) or Hadoop ecological batch processing frameworks (such as Hive), which summarize and analyze the device transaction data and inventory status every day or every hour, and generate alarm information through preset fixed thresholds (such as triggering a restocking alarm when the inventory is less than 20%). Some systems introduce a basic event-driven mechanism to respond to single events such as network interruption and hardware failure in real time. In terms of data analysis dimensions, the existing technology focuses on the core indicators of the device itself (such as sales and inventory), and a small number of schemes attempt to adjust the threshold in combination with basic period division (such as peak and off-peak periods).
[0003] At present, although the existing technology has achieved the monitoring of the device status to some extent, its core defects lie in the lack of real-time performance, dimension correlation and dynamic adaptability. The offline batch statistics mode leads to a high alarm response delay of several hours, which cannot capture transient abnormalities (such as transaction interruption caused by network interruption), and the rule engine triggered by a single indicator lacks multidimensional cross-analysis (such as geographic location, device model and external environment), which is prone to false positives or false negatives. For example, static thresholds cannot distinguish the difference in sales fluctuations between holidays and weekdays, resulting in the misjudgment of the reasonable transaction surge of commercial area points during the promotion period as an abnormality. In addition, the traditional scheme lacks a dynamic compensation mechanism for external factors such as network quality and weather, and when the device deviates from the indicator due to environmental interference (such as a decrease in customer flow caused by heavy rain), it is difficult to accurately identify real abnormalities, ultimately leading to waste of operation and maintenance resources and a decrease in operation efficiency.
[0004] Therefore, how to invent and develop a vending machine point alarm method that can solve the problems of lack of real-time performance, single dimension and static threshold defects in the prior art has become a problem to be solved. SUMMARY
[0005] Therefore, the present application provides a vending machine point alarm method and system based on Flink+Doris multidimensional statistical analysis, which realizes the real-time performance and accuracy of vending machine abnormal alarm through the Flink+Doris stream batch collaborative architecture; solves the problems of slow response and high false positive rate of traditional schemes through real-time multidimensional analysis and dynamic threshold algorithm; at the same time, combined with intelligent alarm suppression and hierarchical mechanism, reduces invalid alarms, and automatically triggers a fault handling closed loop, significantly reduces operation and maintenance costs, and improves device operation efficiency.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis, comprising:
[0007] Use Flink to collect device transaction stream data, sensor data stream, and external data stream in real time to generate real-time data streams;
[0008] Based on the real-time data stream, minute-level statistical indicators of each point are generated through Flink window calculation; based on the minute-level statistical indicators, the device ID and the point metadata stored in Doris are associated in real time through the Flink-Doris Connector to generate a multi-dimensional real-time data stream;
[0009] Based on the fact table and dimension table, a star model is constructed in Doris; historical data is multi-dimensionally sorted using the star model to obtain multi-dimensional historical data; the multi-dimensional historical data is pre-aggregated using RollUp to obtain hourly and daily statistical data of the multi-dimensional historical data, thereby obtaining multi-dimensional standardized historical data;
[0010] Based on the multidimensional standardized historical data and the multidimensional real-time data stream, a dynamic threshold is calculated by a spatiotemporal dynamic weight algorithm;
[0011] An alarm decision is generated according to the dynamic threshold; and a corresponding alarm action is executed according to the alarm decision.
[0012] As a preferred solution of the vending machine point alarm method based on Flink+Doris multidimensional statistical analysis, the sensor data stream includes: temperature and network status data;
[0013] The external data stream includes weather, holidays and geographic location data.
[0014] As a preferred solution for the vending machine point alarm method based on Flink+Doris multi-dimensional statistical analysis, the minute-level statistical indicators include: transaction volume and inventory consumption rate;
[0015] The point location metadata includes: geographic location, device model and historical network quality data.
[0016] As a preferred solution of the vending machine location alarm method based on Flink+Doris multidimensional statistical analysis, the calculation formula of the dynamic threshold is:
[0017] Threshold = α·Historical mean for the same period + β·Recent trend slope + γ·External factor correction
[0018] Where Threshold is the dynamic threshold; α, β, and γ are all weights, and α + β + γ = 1.
[0019] As a preferred solution of the vending machine location alarm method based on Flink+Doris multi-dimensional statistical analysis, in the process of generating the alarm decision according to the dynamic threshold:
[0020] Define cross-dimensional alarm rules using SQL-like syntax and trigger compound conditional alarms based on the alarm rules; the alarm rules associate time period, geographic location, sales drop rate, and network status;
[0021] An alarm suppression strategy is used to avoid false alarms caused by network jitter. The strategy is as follows: if the historical network fluctuation rate of a device point exceeds a set threshold, the alarm is delayed and a health check is initiated. If the anomaly persists for longer than a set period, the alarm level is automatically upgraded and an operation and maintenance work order is issued.
[0022] The present invention also provides an unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis, including:
[0023] The data collection module is used to collect device transaction stream data, sensor data streams, and external data streams in real time through Flink to generate real-time data streams;
[0024] The data processing module is used to generate minute-level statistical indicators for each point through Flink window calculation based on the real-time data stream; based on the minute-level statistical indicators, the Flink-Doris Connector is used to associate the device ID with the point metadata stored in Doris in real time to generate a multi-dimensional real-time data stream;
[0025] The star model construction and RollUp pre-aggregation module is used to construct a star model in Doris based on the fact table and dimension table; multi-dimensionally organize historical data using the star model to obtain multi-dimensional historical data; and pre-aggregate the multi-dimensional historical data through RollUp to obtain hourly and daily statistical data of the multi-dimensional historical data, thereby obtaining multi-dimensional standardized historical data.
[0026] A dynamic threshold calculation module, configured to calculate a dynamic threshold based on the multidimensional standardized historical data and the multidimensional real-time data stream using a spatiotemporal dynamic weight algorithm;
[0027] The alarm decision generation and execution module is used to generate an alarm decision according to the dynamic threshold; and execute a corresponding alarm action according to the alarm decision.
[0028] As the preferred scheme of the unmanned vending machine point position alarm system based on Flink+Doris multidimensional statistical analysis, in the data acquisition module, the sensor data stream includes temperature and network status data.
[0029] The external data stream includes weather, holiday and geographic location data.
[0030] As the preferred scheme of the unmanned vending machine point position alarm system based on Flink+Doris multidimensional statistical analysis, in the data processing module, the minute-level statistical indicators include transaction volume and inventory consumption rate.
[0031] The point position metadata includes geographic location, device model and historical network quality data.
[0032] As the preferred scheme of the unmanned vending machine point position alarm system based on Flink+Doris multidimensional statistical analysis, in the dynamic threshold calculation module, the calculation formula of the dynamic threshold is:
[0033] Threshold=α·history same period mean+β·recent trend slope+γ·external factor correction
[0034] In the formula, Threshold is the dynamic threshold; α, β and γ are weights, and α+β+γ=1.
[0035] As the preferred scheme of the unmanned vending machine point position alarm system based on Flink+Doris multidimensional statistical analysis, in the alarm decision generation and execution module, in the process of generating the alarm decision according to the dynamic threshold:
[0036] Cross-dimension alarm rules are defined through SQL-like syntax, and composite condition alarms are triggered according to the alarm rules; the alarm rules are associated with time period, geographic location, sales drop rate and network status;
[0037] Through the alarm suppression strategy, false alarms caused by network jitter are avoided; the alarm suppression strategy is: if the historical network fluctuation rate of the device point position exceeds the set threshold, the alarm is delayed and the health check is started; if the anomaly lasts for more than a set time, the alarm level is automatically upgraded and the operation and maintenance work order is dispatched.
[0038] The application has the following advantages: the application collects device transaction stream data, sensor data stream and external data stream in real time through Flink to generate real-time data stream; based on the real-time data stream, minute-level statistical indicators of each point are generated through Flink window calculation; based on the minute-level statistical indicators, device ID is associated with point metadata stored in Doris in real time through Flink-Doris Connector to generate multi-dimensional real-time data stream; a star model is constructed in Doris based on fact tables and dimension tables; multi-dimensional historical data is obtained by performing multi-dimensional arrangement on historical data through the star model; the multi-dimensional historical data is pre-aggregated through RollUp to obtain hour-level and day-level statistical data of the multi-dimensional historical data, and multi-dimensional standardized historical data is obtained; a dynamic threshold is obtained by calculating based on the multi-dimensional standardized historical data and the multi-dimensional real-time data stream through a time-space dynamic weight algorithm; an alarm decision is generated according to the dynamic threshold; and corresponding alarm actions are executed according to the alarm decision. The application realizes minute-level data pre-aggregation and complex dimension association analysis by deep fusion of Flink real-time stream processing and Doris OLAP engine, solves the problem of split between real-time statistics and offline analysis in traditional solutions, and improves response speed by more than 90%. The application innovatively proposes a time-space dynamic weight threshold algorithm, combines time decay factor, adjacent point space similarity and external variables such as weather / holidays, constructs an adaptive threshold model, increases the accuracy of anomaly detection by 40%-60%, and effectively avoids false positives caused by static thresholds. The application supports flexible configuration of rules across time periods, geographic locations and device states through a multi-dimensional composite alarm engine and intelligent suppression strategy, delays or upgrades alarms based on network quality perception, reduces more than 70% of invalid alarms in complex scenarios, and realizes hierarchical closed-loop disposal of hardware failure, inventory shortage and other problems, thereby greatly reducing operation and maintenance costs and improving device availability. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed in the following embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only exemplary, and those skilled in the art can also obtain other implementation drawings according to the provided drawings without creating any creative labor.
[0040] The structures, proportions, sizes, etc. shown in the specification are only used to cooperate with the content disclosed in the specification for understanding and reading by those skilled in the art, and do not define the limiting conditions for implementing the application, so they do not have technical significance. Any modification of structure, change of proportion relationship or adjustment of size, which does not affect the effects and purposes that can be achieved by the application, should still fall within the scope of the technical content disclosed by the application.
[0041] Figure 1 A flowchart of the vending machine point alarm method based on Flink+Doris multidimensional statistical analysis provided in Embodiment 1 of the present application is shown in the figure;
[0042] Figure 2 A schematic diagram of the architecture of the vending machine point alarm system based on Flink+Doris multidimensional statistical analysis provided in Embodiment 2 of the present application is shown in the figure. DETAILED DESCRIPTION
[0043] The embodiments of the present application are described below by specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in the specification. Obviously, the described embodiments are part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0044] Embodiment 1
[0045] Reference Figure 1 , Embodiment 1 of the present application provides a vending machine point alarm method based on Flink+Doris multidimensional statistical analysis, comprising the following steps:
[0046] S1, collecting equipment transaction stream data, sensor data stream and external data stream in real time through Flink, and generating real-time data stream;
[0047] S2, based on the real-time data stream, generating minute-level statistical indicators of each point through Flink window calculation; based on the minute-level statistical indicators, associating equipment ID with point metadata stored in Doris in real time through Flink-Doris Connector, and generating multidimensional real-time data stream;
[0048] S3, constructing a star model in Doris based on fact table and dimension table; obtaining multidimensional historical data by multidimensionally arranging historical data through the star model; obtaining hour-level and day-level statistical data of the multidimensional historical data by RollUp pre-aggregation, and obtaining multidimensional standardized historical data;
[0049] S4, based on the multidimensional standardized historical data and the multidimensional real-time data stream, calculating a dynamic threshold value through a spatio-temporal dynamic weight algorithm;
[0050] S5, generating an alarm decision according to the dynamic threshold value; and executing a corresponding alarm action according to the alarm decision.
[0051] In this embodiment, in step S1, device transaction stream data, sensor data stream and external data stream are collected in real time by Flink to generate a real-time data stream;
[0052] In this embodiment, in step S1, device transaction stream data, sensor data stream and external data stream are collected in real time by Flink to generate a real-time data stream;
[0053] In this embodiment, in step S2, based on the real-time data stream, Flink window calculation is used to generate minute-level statistical indicators of each point; based on the minute-level statistical indicators, Flink-Doris Connector is used to associate device ID with point metadata stored in Doris in real time to generate multi-dimensional real-time data stream;
[0054] Specifically, based on the real-time data stream, Flink first uses a time window operator (TumblingWindow) to slice the original data by 1 minute granularity to calculate minute-level statistical indicators of each point, such as transaction volume sum, inventory consumption rate and network fluctuation frequency, and uses event time and watermark mechanism to process out-of-order data to output structured window results (such as {point ID, timestamp, transaction volume = 50}). Then, Flink-Doris Connector is used to associate device ID in the window aggregation result with dimension tables in Doris (such as point metadata table and business dimension table) in real time to dynamically supplement multi-dimensional attributes such as device model, installation location and maintenance person, and generate multi-dimensional real-time data stream containing complete business context (such as "commercial district A-entrance_V2 model_Operating group 1" label) to provide rich dimension support for OLAP layer analysis.
[0055] In this embodiment, in step S3, a star model is constructed in Doris based on the fact table and the dimension table; multi-dimensional historical data is obtained by multi-dimensionally organizing the historical data through the star model; the multi-dimensional historical data is pre-aggregated through RollUp to obtain hour-level and day-level statistical data of the multi-dimensional historical data, and multi-dimensional standardized historical data is obtained;
[0056] Specifically, in Doris, a star model is constructed, taking the transaction event fact table as the core, and associating the time, location, and device attribute dimension tables to establish a foreign key mapping relationship (e.g., fact table. location_id = location table. id) to achieve efficient correlation query of multi-dimensional data. Based on this model, the RollUp function of Doris is used to pre-aggregate key indicators (such as hourly transaction amount total and daily peak transaction volume) by hour and day granularity, generating multi-dimensional standardized historical data to directly serve dynamic threshold calculation.
[0057] In this embodiment, the pre-aggregation table is automatically maintained through the materialized view, and the aggregation result is hit first during query to avoid full table scanning, improving the efficiency of historical data analysis by more than 80%.
[0058] In step S4, based on the multi-dimensional standardized historical data and the multi-dimensional real-time data stream, a dynamic threshold is calculated through a spatio-temporal dynamic weight algorithm.
[0059] Specifically, the spatio-temporal dynamic weight algorithm is used to generate an adaptive threshold by combining Doris pre-aggregated historical data (such as historical same period average) and Flink real-time stream data (current minute-level indicators and associated dimensions).
[0060] The calculation formula of the dynamic threshold is:
[0061] Threshold = a * historical same period average + β * recent trend slope + γ * external factor correction
[0062] In the formula, Threshold is the dynamic threshold; a, β, and γ are weights, and a + β + γ = 1.
[0063] The historical same period average is the statistical average of the same time, location, and device attribute from the Doris pre-aggregated historical data.
[0064] The recent trend slope is the linear change trend of the recent (e.g., past 1 hour) indicators based on the Flink real-time stream data.
[0065] The external factor correction is the dynamic correction of the threshold by integrating external data such as weather, holidays, and promotional activities. The correction rule is:
[0066] Weather impact: reduce expected sales by 20% in rainy and snowy weather;
[0067] Holiday correction: increase transaction amount threshold by 30% during the National Day holiday;
[0068] Network fluctuation compensation: based on the historical network quality of the point, reduce the false positive rate caused by network packet loss.
[0069] In this embodiment, the weights of a, b, and g are dynamically adjusted based on time decay factor and dimension heat, with higher weight for recent data.
[0070] In one possible embodiment, the dynamic threshold calculation example is provided as follows:
[0071] Example scenario: sales warning of shopping mall vending machine in rainy days
[0072] Input data:
[0073] Historical same period average (sunny day): 100 orders / hour;
[0074] Recent trend slope: due to the influence of rainy days, the sales decline rate b = -0.5;
[0075] External correction: rainy day coefficient is -0.2.
[0076] Weight distribution: a = 0.6, b = 0, g = 0.1 (recent trend is important).
[0077] Dynamic threshold calculation:
[0078] Threshold = 0.6 x 100 + 0.3 x (-0.5 x 60) + 0.1 x (100 x -0.2) = 60 - 9 - 2 = 49
[0079] Alarm triggering: if the real-time sales < 49 orders / hour, trigger the "rainy day sales anomaly" alarm.
[0080] In this embodiment, in step S5, an alarm decision is generated according to the dynamic threshold; and a corresponding alarm action is performed according to the alarm decision.
[0081] Specifically, based on the dynamic threshold, a multi-dimensional composite alarm condition (such as "traffic hub point + peak period + transaction volume less than 60% of threshold") is defined through a SQL-like rule engine, and an alarm event (such as "severe level - operation and maintenance group 1") is generated after the rule is hit.
[0082] In this embodiment, through the alarm suppression strategy, false alarms caused by network jitter are avoided; the alarm suppression strategy is: if the historical network fluctuation rate of the device point exceeds the set threshold, the alarm is delayed and the health check is started; if the anomaly lasts for more than a set time, the alarm level is automatically upgraded and the operation and maintenance work order is dispatched.
[0083] Specifically, if the point history network volatility rate exceeds 30%, delay the alarm and trigger health check (such as Ping detection), and exclude network jitter interference; if the abnormality lasts more than 30 minutes, upgrade the alarm level and automatically dispatch a work order, forming a "detection-suppression-upgrade-disposal" closed-loop process. The alarm results are fed back in real time through visual boards and message push, realizing rapid response and precise operation and maintenance of abnormal events.
[0084] In one possible embodiment, the point sudden out-of-stock early warning example and device abnormal offline detection example are as follows:
[0085] I. Point sudden out-of-stock early warning example:
[0086] Data flow:
[0087] Flink real-time calculation of the inventory decline rate of 10 vending machines in a certain business district.
[0088] Doris pre-aggregates the historical same-period sales data of the region.
[0089] Dynamic threshold:
[0090] Combined with today's weather (rainy day), reduce the expected sales volume by 20%.
[0091] Alarm triggering:
[0092] Detecting that the inventory of 3 devices will be exhausted within 1 hour, triggering an "urgent restocking" alarm.
[0093] II. Device abnormal offline detection example:
[0094] Multi-dimensional association:
[0095] Device offline event (Flink stream) + point network quality historical data (Doris table).
[0096] Intelligent suppression:
[0097] If the number of network fluctuations of this point in the past 24 hours is > 5, do not trigger the alarm, but record the log instead.
[0098] Upgrade mechanism:
[0099] After being offline for 30 minutes, automatically upgrade to "hardware failure" alarm and dispatch a work order.
[0100] In summary, the present application generates real-time data stream by Flink real-time collection of equipment transaction stream data, sensor data stream and external data stream; generates minute-level statistical indicators of each point based on the real-time data stream through Flink window calculation; generates multi-dimensional real-time data stream by real-time association of equipment ID and point metadata stored in Doris based on the minute-level statistical indicators through Flink-Doris Connector; constructs a star model in Doris based on fact table and dimension table; obtains multi-dimensional historical data by multi-dimensional arrangement of historical data through the star model; obtains hour-level and day-level statistical data of the multi-dimensional historical data by RollUp pre-aggregation, and obtains multi-dimensional standardized historical data; obtains a dynamic threshold value by time-space dynamic weight algorithm based on the multi-dimensional standardized historical data and the multi-dimensional real-time data stream; generates an alarm decision according to the dynamic threshold value; and executes corresponding alarm action according to the alarm decision. The present application realizes minute-level data pre-aggregation and complex dimension association analysis by deep fusion of Flink real-time stream processing and Doris OLAP engine, solves the problem of split between real-time statistics and offline analysis in traditional solutions, and improves response speed by more than 90%. The present application innovatively proposes a time-space dynamic weight threshold algorithm, combines time decay factor, adjacent point space similarity and external variables such as weather / holiday, constructs an adaptive threshold model, increases abnormal detection accuracy by 40%-60%, and effectively avoids false positives caused by static threshold. The present application supports flexible configuration of rules across time periods, geographical locations and equipment states through a multi-dimensional composite alarm engine and intelligent suppression strategy, delays or upgrades alarms based on network quality perception, reduces more than 70% of invalid alarms in complex scenarios, and realizes hierarchical closed-loop disposal of hardware failure, inventory shortage and other problems, thereby greatly reducing operation and maintenance cost and improving equipment availability.
[0101] It should be noted that the method of the present embodiment can be executed by a single device, such as a computer or a server. The method of the present embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only execute one or more steps in the method of the present embodiment, and the multiple devices can interact with each other to complete the method.
[0102] It is to be understood that the foregoing description is directed to some embodiments of the disclosure. Other embodiments fall within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0103] Embodiment 2
[0104] Referring to Figure 2 Embodiment 2 of the present application also provides an unmanned vending machine point alarm system based on Flink+Doris multi-dimensional statistical analysis, comprising:
[0105] A data acquisition module 001 is configured to acquire equipment transaction stream data, sensor data stream and external data stream in real time through Flink, and generate a real-time data stream;
[0106] A data processing module 002 is configured to generate minute-level statistical indicators of each point based on the real-time data stream through Flink window calculation; and generate a multi-dimensional real-time data stream by real-time association of equipment ID and point metadata stored in Doris based on the minute-level statistical indicators through Flink-Doris Connector.
[0107] A star model construction and RollUp pre-aggregation module 003 is configured to construct a star model in Doris based on fact tables and dimension tables; perform multi-dimensional arrangement on historical data through the star model to obtain multi-dimensional historical data; and obtain hour-level and day-level statistical data of the multi-dimensional historical data through RollUp pre-aggregation of the multi-dimensional historical data to obtain multi-dimensional standardized historical data.
[0108] A dynamic threshold calculation module 004 is configured to calculate a dynamic threshold through a spatio-temporal dynamic weight algorithm based on the multi-dimensional standardized historical data and the multi-dimensional real-time data stream.
[0109] An alarm decision generation and execution module 005 is configured to generate an alarm decision according to the dynamic threshold; and execute corresponding alarm actions according to the alarm decision.
[0110] In the present embodiment, the sensor data stream in the data acquisition module 001 comprises temperature and network status data.
[0111] The external data stream comprises weather, holiday and geographic location data.
[0112] In the data processing module 002, the minute-level statistical indicators include transaction volume and inventory consumption rate.
[0113] The point metadata includes geographic location, device model, and historical network quality data.
[0114] In the dynamic threshold calculation module 004, the calculation formula of the dynamic threshold is:
[0115] Threshold=α·history same period mean+β·recent trend slope+γ·external factor correction
[0116] In the formula, Threshold is the dynamic threshold; alpha, beta, and gamma are weights, and alpha+beta+gamma=1.
[0117] In the alarm decision generation and execution module 005, in the process of generating the alarm decision according to the dynamic threshold:
[0118] Cross-dimension alarm rules are defined through SQL-like syntax, and composite condition alarms are triggered according to the alarm rules; the alarm rules are associated with time period, geographic location, sales drop rate, and network state.
[0119] Through an alarm suppression strategy, false alarms caused by network jitter are avoided; the alarm suppression strategy is: if the historical network fluctuation rate of a device point exceeds a set threshold, the alarm is delayed and health check is started; if the anomaly lasts for more than a set time length, the alarm level is automatically upgraded and an operation and maintenance work order is dispatched.
[0120] It is explained that the information interaction and execution process between the modules of the system, and the like, are based on the same concept as the method embodiment in Embodiment 1 of the application, and bring the same technical effects as the method embodiment, and the specific content can be referred to the description in the method embodiment described above, which will not be repeated here.
[0121] Embodiment 3
[0122] Embodiment 3 of the application provides a non-transitory computer-readable storage medium, which stores program code of an unmanned vending machine point alarm method based on Flink+Doris multi-dimensional statistical analysis, and the program code includes instructions for executing the unmanned vending machine point alarm method based on Flink+Doris multi-dimensional statistical analysis of embodiment 1 or any possible implementation manner thereof.
[0123] The computer-readable storage medium can be any available medium or data storage that can be accessed by a computer and can be integral to or external to a server, data center, etc. data storage device that includes one or more of the available media. The available medium can be a magnetic medium, (e.g., a floppy diskette, a hard disk drive, a magnetic tape), an optical medium, (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), etc.
[0124] Embodiment 4
[0125] Embodiment 4 of the present application provides an electronic device, comprising a memory and a processor;
[0126] The processor and the memory complete the communication between each other through a bus; the memory stores program instructions that can be executed by the processor, and the processor calling the program instructions can execute the unmanned vending machine point alarm method based on Flink+Doris multi-dimensional statistical analysis of embodiment 1 or any possible implementation manner thereof.
[0127] Specifically, the processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which realizes by reading software codes stored in a memory. The memory can be integrated in the processor or exist independently outside the processor.
[0128] In the above embodiments, all or part of them can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of them can be realized in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer instructions produce the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable systems. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode.
[0129] It should be apparent to those skilled in the art that the modules or steps of the application described above can be implemented with a general purpose computing system, which can be centralized on a single computing system or distributed over a network of multiple computing systems, and optionally implemented with program code executable by a computing system, which can be stored in a storage system and executed by a computing system, and in some cases, the steps shown or described can be performed in a different order than shown or described, or made into individual integrated circuit modules or multiple modules or steps made into a single integrated circuit module. Thus, the application is not limited to any particular combination of hardware and software.
[0130] While the application has been described in detail and with reference to specific embodiments thereof, it will be apparent to one skilled in the art that various modifications or changes can be made therein without departing from the spirit and scope of the application. Accordingly, it is intended that all such modifications and changes be included within the scope of the application as claimed.
Claims
1. The unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis is characterized by: include: Use Flink to collect device transaction stream data, sensor data stream, and external data stream in real time to generate real-time data streams; Based on the real-time data stream, minute-level statistical indicators of each point are generated through Flink window calculation; based on the minute-level statistical indicators, the device ID and the point metadata stored in Doris are associated in real time through the Flink-Doris Connector to generate a multi-dimensional real-time data stream; Based on the fact table and dimension table, a star model is constructed in Doris; historical data is multi-dimensionally sorted using the star model to obtain multi-dimensional historical data; the multi-dimensional historical data is pre-aggregated using RollUp to obtain hourly and daily statistical data of the multi-dimensional historical data, thereby obtaining multi-dimensional standardized historical data; Based on the multidimensional standardized historical data and the multidimensional real-time data stream, a dynamic threshold is calculated by a spatiotemporal dynamic weight algorithm; generating an alarm decision according to the dynamic threshold; According to the alarm decision, a corresponding alarm action is executed.
2. The unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis according to claim 1 is characterized in that: The sensor data stream includes: temperature and network status data; The external data stream includes weather, holidays and geographic location data.
3. The unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis according to claim 2 is characterized in that: The minute-level statistical indicators include: transaction volume and inventory consumption rate; The point location metadata includes: geographic location, device model and historical network quality data.
4. The unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis according to claim 3 is characterized in that: The calculation formula of the dynamic threshold is: Threshold = α·Historical mean for the same period + β·Recent trend slope + γ·External factor correction Where Threshold is the dynamic threshold; α, β, and γ are all weights, and α + β + γ = 1.
5. The unmanned vending machine location alarm method based on Flink+Doris multidimensional statistical analysis according to claim 4 is characterized in that: In the process of generating the alarm decision according to the dynamic threshold: Define cross-dimensional alarm rules using SQL-like syntax and trigger compound conditional alarms based on the alarm rules; the alarm rules associate time period, geographic location, sales drop rate, and network status; An alarm suppression strategy is used to avoid false alarms caused by network jitter. The strategy is as follows: if the historical network fluctuation rate of a device point exceeds a set threshold, the alarm is delayed and a health check is initiated. If the anomaly persists for longer than a set period, the alarm level is automatically upgraded and an operation and maintenance work order is issued.
6. The unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis is characterized by: include: The data collection module is used to collect device transaction stream data, sensor data streams, and external data streams in real time through Flink to generate real-time data streams; The data processing module is used to generate minute-level statistical indicators for each point through Flink window calculation based on the real-time data stream; based on the minute-level statistical indicators, the Flink-Doris Connector is used to associate the device ID with the point metadata stored in Doris in real time to generate a multi-dimensional real-time data stream; The star model construction and RollUp pre-aggregation module is used to construct a star model in Doris based on the fact table and dimension table; multi-dimensionally organize historical data using the star model to obtain multi-dimensional historical data; and pre-aggregate the multi-dimensional historical data through RollUp to obtain hourly and daily statistical data of the multi-dimensional historical data, thereby obtaining multi-dimensional standardized historical data. A dynamic threshold calculation module, configured to calculate a dynamic threshold based on the multidimensional standardized historical data and the multidimensional real-time data stream using a spatiotemporal dynamic weight algorithm; The alarm decision generation and execution module is used to generate an alarm decision according to the dynamic threshold; and execute a corresponding alarm action according to the alarm decision.
7. The unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis according to claim 6 is characterized in that: In the data acquisition module, the sensor data stream includes: temperature and network status data; The external data stream includes weather, holidays and geographic location data.
8. The unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis according to claim 7 is characterized in that: In the data processing module, the minute-level statistical indicators include: transaction volume and inventory consumption rate; The point location metadata includes: geographic location, device model and historical network quality data.
9. The unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis according to claim 8 is characterized in that: In the dynamic threshold calculation module, the calculation formula of the dynamic threshold is: Threshold = α·Historical mean for the same period + β·Recent trend slope + γ·External factor correction Where Threshold is the dynamic threshold; α, β, and γ are all weights, and α + β + γ = 1.
10. The unmanned vending machine location alarm system based on Flink+Doris multidimensional statistical analysis according to claim 9 is characterized in that: In the alarm decision generation and execution module, in the process of generating the alarm decision according to the dynamic threshold: Define cross-dimensional alarm rules using SQL-like syntax and trigger compound conditional alarms based on the alarm rules; the alarm rules associate time period, geographic location, sales drop rate, and network status; An alarm suppression strategy is used to avoid false alarms caused by network jitter. The strategy is as follows: if the historical network fluctuation rate of a device point exceeds a set threshold, the alarm is delayed and a health check is initiated. If the anomaly persists for longer than a set period, the alarm level is automatically upgraded and an operation and maintenance work order is issued.
Citation Information
Patent Citations
Passenger flow information detection method of operation day system
CN111737314A
Power transmission line forest fire image recognition online monitoring method and system
CN117690088A
Multi-dimensional state monitoring and fault prediction method and system for optical cable
CN119814139A
Intelligent vending machine fault early warning system based on cloud platform
CN120048038A
Property security inspection method and system and storage medium
CN120071546A
Cited By
Internet platform for management and control of vending machine
CN121999555A