Business busy degree calculation method and device, computer device and storage medium
By combining a distributed stream processing engine and a high-speed cache database, the system calculates the busyness of gas stations in real time, solving the problems of high resource consumption and low query efficiency in existing technologies, and achieving efficient and accurate busyness assessment and fast query.
Patent Information
- Application Number
- CN202310840647.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-07-10
AI Technical Summary
The existing method for calculating the busyness of gas stations involves directly querying the business database, which results in excessive resource consumption, affects system stability, has low query efficiency, cannot meet the requirements for real-time and accurate calculation, and is difficult to handle high-concurrency access scenarios.
A distributed stream processing engine is used to collect operational data in real time, perform feature extraction and busyness calculation, store the results in a cache database, calculate the busyness assessment value through feature values and compare it with preset indicators, and output the comparison results.
It improves the efficiency and accuracy of busyness assessment, reduces latency and delay during high-concurrency access, and increases the throughput of gas station busyness queries.
Smart Images

Figure CN116894053B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a business busy degree calculation method and device, computer equipment and storage medium. BACKGROUND
[0002] The busy degree of the oil station will affect the oil supply of the oil station. The existing oil station busy degree calculation method is to query and calculate through direct connection with the business database. This method is easy to cause the business database resource to be occupied too much, thereby affecting the stability of the business system. In addition, due to the large amount of data queried, the query efficiency is low, which cannot meet the real-time and accurate calculation requirements. The business database resource is limited and difficult to expand, which cannot handle the calculation in complex scenarios and cannot meet the high-concurrency access scenarios. SUMMARY
[0003] Therefore, it is necessary to provide a business busy degree calculation method and device, computer equipment and storage medium to solve the above technical problems.
[0004] A business busy degree calculation method comprises the following steps:
[0005] Real-time collection of operation data of an oil station, and importing the collected operation data into a distributed stream processing engine;
[0006] Feature extraction of the operation data based on the distributed stream processing engine to obtain feature values;
[0007] Busy degree calculation based on the feature values to obtain a busy degree evaluation value;
[0008] Comparison of the busy degree evaluation value with a preset busy index to obtain a comparison result, output of the comparison result, and storage of the comparison result in a cache database.
[0009] In one of the embodiments, the step of feature extraction of the operation data based on the distributed stream processing engine to obtain feature values comprises the following steps:
[0010] Feature extraction of the operation data based on the distributed stream processing engine by using a preset time window to obtain the feature values.
[0011] In one of the embodiments, the step of busy degree calculation based on the feature values to obtain a busy degree evaluation value comprises the following steps:
[0012] Obtaining of a weight value corresponding to each feature value;
[0013] Busy degree calculation based on the feature values and the weight values corresponding to the feature values to obtain the busy degree evaluation value.
[0014] In one of the embodiments, before the step of extracting feature values from the operation data based on the distributed stream processing engine, the method further comprises:
[0015] filtering the operation data based on the distributed stream processing engine to obtain the operation data meeting preset conditions;
[0016] performing format conversion on the operation data meeting the preset conditions to obtain the operation data in a preset format.
[0017] In one of the embodiments, the operation data comprises order quantity, oil gun quantity and refueling quantity.
[0018] In one of the embodiments, the step of calculating busy degree based on the feature values to obtain a busy degree evaluation value comprises:
[0019] calculating busy degree based on the feature values by using the following calculation formula to obtain a busy degree evaluation value:
[0020] busy degree evaluation value = (order quantity * 0.8 + refueling quantity * 0.2) / oil gun quantity.
[0021] A business busy degree calculation device comprises:
[0022] An acquisition and import module is configured to acquire operation data of a gas station in real time and import the acquired operation data into a distributed stream processing engine.
[0023] A feature value extraction module is configured to extract feature values from the operation data based on the distributed stream processing engine.
[0024] A busy degree calculation module is configured to calculate busy degree based on the feature values to obtain a busy degree evaluation value.
[0025] A comparison module is configured to compare the busy degree evaluation value with a preset busy index to obtain a comparison result and output the comparison result.
[0026] In one of the embodiments, the feature value extraction module is further configured to extract feature values from the operation data based on the distributed stream processing engine by using a preset time window.
[0027] A computer device comprises a memory and a processor, and the memory stores a computer program, characterized in that the processor implements the steps of the business busy degree calculation method in any one of the embodiments when executing the computer program.
[0028] A computer readable storage medium, having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the service busy degree calculation method in any of the above embodiments.
[0029] The service busy degree calculation method, device, computer equipment and storage medium can accurately extract effective feature values and improve the efficiency of busy degree evaluation value calculation by extracting features of operation data through a distributed stream processing engine and then calculating the busy degree evaluation value. In addition, the comparison result obtained by comparison is stored in a cache database, which has the advantages of high concurrency and low latency compared with a traditional hard disk storage system. In this way, the throughput of the gas station busy degree query is higher and the delay is lower, effectively solving the problem of slow access speed in a high concurrency access state. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 A flowchart of a service busy degree calculation method in an embodiment;
[0031] Figure 2 A structural block diagram of a service busy degree calculation device in an embodiment;
[0032] Figure 3 An internal structure diagram of a computer equipment in an embodiment;
[0033] Figure 4 A functional framework diagram of a distributed stream processing engine in an embodiment. DETAILED DESCRIPTION
[0034] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0035] Embodiment one
[0036] In this embodiment, as shown in Figure 1 , a service busy degree calculation method is provided, which includes:
[0037] Step 110, real-time collection of operation data of a gas station, and importing the collected operation data into a distributed stream processing engine.
[0038] Specifically, a gas station's operational data can reflect its business volume. In this embodiment, this operational data includes the number of orders, the number of fuel nozzles, and the amount of fuel delivered. The number of orders refers to the number of fuel orders placed within a period of time, the number of fuel nozzles refers to the number of fuel nozzles in the gas station, and the amount of fuel delivered refers to the total amount of fuel delivered within a period of time. This distributed stream processing engine has both stream and batch processing capabilities and is capable of distributed computing, effectively improving data processing efficiency and effectively coping with concurrent data processing scenarios.
[0039] Step 120: Extract features from the operational data based on the distributed stream processing engine to obtain feature values.
[0040] like Figure 4 As shown, the distributed stream processing engine has functions such as data cleaning, feature extraction using a sliding window method, and feature calculation using weighted average. In this embodiment, the distributed stream processing engine is used to extract features from the operational data, extracting feature values from the operational data that have an impact on the busyness. It is worth mentioning that the feature values come from the operational data, so the feature values and the operational data belong to the same type of data or feature values of the same dimension. It should be understood that for the same type or the same set of data, the impact on the busyness is different when evaluated in different time periods or from different dimensions. Therefore, in this embodiment, the operational data is extracted based on preset rules to extract feature values that have a greater impact on the busyness.
[0041] Step 130 : Calculate the busyness based on the characteristic value to obtain a busyness evaluation value.
[0042] In this embodiment, based on a preset busyness calculation formula and a characteristic value, the characteristic value is substituted into the preset busyness calculation formula to calculate and obtain a busyness evaluation value.
[0043] Step 140 : Compare the busyness evaluation value with a preset busyness index to obtain a comparison result, output the comparison result, and store the comparison result in a cache database.
[0044] In this embodiment, the preset busy indicator is a value within a range or a value in an interval. The preset busy indicator is used to evaluate the busyness. In one embodiment, when the busyness evaluation value is greater than the preset busy indicator, the comparison result is busy; when the busyness evaluation value is less than the preset busy indicator, the comparison result is busy; when the busyness evaluation value is within the numerical range of the preset busy indicator, the comparison result is normal.
[0045] In the embodiment, the comparison result obtained by comparison is stored in a cache database. Compared with a traditional hard disk storage system, the cache database has advantages of high concurrency and low latency. In this way, the query of the oil station busy degree has higher throughput and lower latency, and effectively alleviates the problem of slow access speed in a high concurrency access state.
[0046] In one embodiment, the step of extracting features from the operation data based on the distributed stream processing engine to obtain feature values includes: extracting features from the operation data based on the distributed stream processing engine using a preset time window to obtain the feature values.
[0047] As shown in Figure 4 The distributed stream processing engine has the function of extracting features in a sliding window manner. In the embodiment, the preset time window is a sliding window. Extracting features from operation data using a preset time window means extracting operation data within the preset time window as feature values. The size of the preset time window is the time length. It is worth mentioning that the size of the preset time window can be defined by the user, and the preset time window can also be set to change over time. For example, during a regular busy period, the preset time window is small, so that enough feature values can be extracted in a small time window. During a regular idle period, the preset time window is large, so that enough feature values can be collected in a large time window.
[0048] In one embodiment, the step of calculating the busy degree based on the feature values to obtain a busy degree evaluation value includes: obtaining a weight value corresponding to each feature value; and calculating the busy degree based on the feature values and the weight values corresponding to the feature values to obtain the busy degree evaluation value.
[0049] In the embodiment, different dimensions of feature values have different effects on the busy degree, so different dimensions of feature values correspond to different weight values. Each dimension of feature value has its corresponding weight value, which is used to represent the influence of the feature value of this dimension on the busy degree. Through weighted calculation, the busy degree evaluation value can be more accurately calculated.
[0050] In one embodiment, the step of extracting features from the operation data based on the distributed stream processing engine to obtain feature values further includes: filtering the operation data based on the distributed stream processing engine to obtain operation data meeting a preset condition; and converting the operation data meeting the preset condition into a preset format to obtain operation data in the preset format.
[0051] In the embodiment, the operation data is cleaned, filtered and converted in format, so that the retained cloud hidden data meets the preset condition, so that the operation data that does not meet the requirement is excluded, and the data that meets the requirement is retained. In addition, the operation data is converted into a preset format, so that the formats of the operation data are unified and compatible with subsequent processing steps, thereby improving the processing efficiency of the data.
[0052] In one embodiment, the step of performing the busy degree calculation based on the characteristic value to obtain the busy degree evaluation value includes: performing the busy degree calculation based on the characteristic value to obtain the busy degree evaluation value by using the following calculation formula:
[0053] The busy degree evaluation value=(order quantity*0.8+refueling quantity*0.2) / number of oil guns.
[0054] In the embodiment, 0.8 is the weight value of the order quantity, and 0.2 is the weight value of the refueling quantity. It should be understood that the greater the order quantity and the refueling quantity, the higher the busy degree. Therefore, the order quantity and the refueling quantity are directly proportional to the busy degree. The order quantity has a greater impact on the busy degree because each order quantity occupies an oil gun. Although the refueling quantity also affects the busy degree, a large refueling quantity only occupies one oil gun, and thus has little impact on the overall busy degree. Therefore, in the embodiment, the weight value of the order quantity is 0.8, and the weight value of the refueling quantity is 0.2, which can well reflect the busy degree. The greater the number of oil guns, the more business can be accommodated, and the greater the idle probability. Therefore, the number of oil guns is inversely proportional to the busy degree. Through the above calculation formula, the busy degree evaluation value can be accurately calculated, so that the busy degree of the oil station can be accurately grasped.
[0055] Embodiment two
[0056] In the embodiment, a business busy degree calculation method is provided, including the following steps:
[0057] 1. Real-time data acquisition technology is used to collect order quantity, number of oil guns and refueling quantity and other data of the oil station into a stream processing engine in real time.
[0058] 2. The original data is cleaned, filtered, converted and the like in the stream to obtain data meeting the requirement.
[0059] 3. A high-performance big data distributed computing capability is used to extract meaningful features from the processed data stream. A sliding window method is used to collect order quantity and other indicators every half hour in the data stream. The size and step length of the sliding window can be customized. This method can collect data in any time window and at any time interval in real time and flexibly.
[0060] 4. Busy degree calculation according to feature value. The order quantity, refueling quantity and oil gun number of every half hour are weighted and averaged to obtain a comprehensive busy degree index. Compared with the traditional calculation method considering only a single index, this algorithm has the advantages of wide application range and more accurate reflection of the actual situation.
[0061] 5. The busy degree index is stored in the cache database through a custom connector, which has the advantages of high concurrency and low latency compared with the traditional hard disk storage system.
[0062] The following is a specific embodiment:
[0063] First, the order data of the business system is accessed to the message hub in real time through the dts service of Ali Cloud.
[0064] Second, collect the operation data provided by the message hub, and divide the data stream in the message hub based on the 'transaction time' in the data stream using a sliding time window. The window size is set to 30 minutes and the sliding step is 1 minute.
[0065] Third, aggregate the refueling data and order quantity data in the order within the window to obtain the total refueling quantity and total order quantity of each gas station in the window, and then calculate the busy degree value of the gas station using the formula '(total order quantity * 0.8 + total refueling quantity * 0.2) / initialized oil gun number'.
[0066] Fourth, output the calculation result to the cache database at the end of the window.
[0067] Fifth, the App accesses the interface, the interface queries the busy degree value of a certain gas station from the cache database, compares it with the preset busy degree threshold to obtain the idle, normal and busy states of the gas station, and then returns it to the App.
[0068] It should be understood that, although Figure 1 the steps in the flowchart are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this article, the execution of these steps has no strict order restriction, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps in may include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0069] Embodiment three
[0070] In this embodiment, asFigure 2 The business busy degree calculation apparatus is shown, comprising:
[0071] The collection import module 210 is used for collecting the operation data of the oil station in real time, and importing the collected operation data into a distributed stream processing engine.
[0072] The feature value extraction module 220 is used for extracting features from the operation data based on the distributed stream processing engine to obtain feature values.
[0073] The busy degree calculation module 230 is used for calculating a busy degree based on the feature values to obtain a busy degree evaluation value.
[0074] The comparison module 240 is used for comparing the busy degree evaluation value with a preset busy index to obtain a comparison result, and outputting the comparison result.
[0075] In one embodiment, the feature value extraction module is further used for extracting features from the operation data based on the distributed stream processing engine and using a preset time window to obtain the feature values.
[0076] In one embodiment, the busy degree calculation module comprises:
[0077] The weight acquisition unit is used for acquiring weights corresponding to the feature values.
[0078] The busy degree calculation unit is used for calculating a busy degree based on the feature values and the weights corresponding to the feature values to obtain the busy degree evaluation value.
[0079] In one embodiment, the business busy degree calculation apparatus further comprises:
[0080] The filtering module is used for filtering the operation data based on the distributed stream processing engine to obtain operation data meeting preset conditions.
[0081] The format conversion module is used for converting the operation data meeting the preset conditions into operation data in a preset format.
[0082] The specific limitations of the business busy degree calculation apparatus can be referred to the limitations of the business busy degree calculation method in the foregoing, which will not be described herein. Each unit in the business busy degree calculation apparatus can be realized by software, hardware, and combinations thereof in whole or in part. Each unit can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each unit.
[0083] Embodiment Four
[0084] In this embodiment, a computer device is provided. Its internal structure diagram can be as shown in the figure. Figure 3 The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured 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 and a computer program, and the non-volatile storage medium is deployed with a database configured to store operation data. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is configured to communicate with a computer device of a gas station. The computer program is executed by the processor to implement a service busy degree calculation method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0085] Those skilled in the art can understand that the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. Figure 3 Figure 3
[0086] In one embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the service busy degree calculation method described in any of the above embodiments.
[0087] Embodiment five
[0088] In this embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps of the service busy degree calculation method described in any of the above embodiments.
[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0090] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0091] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A traffic intensity calculation method, characterized by, The method comprises the following steps: real-time collection of operation data of a gas station, import of the collected operation data into a distributed stream processing engine, the operation data comprising order quantity, number of oil guns and refueling volume; feature extraction of the operation data based on the distributed stream processing engine, the feature extraction being performed using a preset time window, the feature extraction resulting in feature values, the feature values being of the same type as the operation data or being feature values of the same dimension, the preset time window being set to change over time, the preset time window being smaller during busy hours so as to extract sufficient feature values within a smaller time window, the preset time window being larger during idle hours so as to collect sufficient feature values within a larger time window; busy degree calculation based on the feature values, the busy degree calculation being performed using the following calculation formula: busy degree evaluation value = (order quantity * 0.8 + refueling volume * 0.2) / number of oil guns; comparison of the busy degree evaluation value with a preset busy index, resulting in a comparison result, output of the comparison result, and storage of the comparison result in a cache database.
2. The method of claim 1, wherein, The busy degree calculation based on the feature values, resulting in a busy degree evaluation value, comprises the following steps: acquisition of a weight value corresponding to each feature value; busy degree calculation based on the feature values and the weight value corresponding to each feature value, resulting in the busy degree evaluation value.
3. The method of claim 1, wherein, The feature extraction of the operation data based on the distributed stream processing engine, resulting in feature values, further comprises the following steps: filtering of the operation data based on the distributed stream processing engine, resulting in operation data meeting a preset condition; format conversion of the operation data meeting the preset condition, resulting in operation data in a preset format.
4. A traffic intensity calculation apparatus characterized by comprising: The method comprises the following steps: a collection and import module for real-time collection of operation data of a gas station, import of the collected operation data into a distributed stream processing engine, the operation data comprising order quantity, number of oil guns and refueling volume; a feature value extraction module for feature extraction of the operation data based on the distributed stream processing engine, the feature extraction being performed using a preset time window, the feature extraction resulting in feature values, the feature values being of the same type as the operation data or being feature values of the same dimension, the preset time window being set to change over time, the preset time window being smaller during busy hours so as to extract sufficient feature values within a smaller time window, the preset time window being larger during idle hours so as to collect sufficient feature values within a larger time window; a busy degree calculation module for busy degree calculation based on the feature values, the busy degree calculation being performed using the following calculation formula: busy degree evaluation value = (order quantity * 0.8 + refueling volume * 0.2) / number of oil guns; a comparison module for comparison of the busy degree evaluation value with a preset busy index, resulting in a comparison result, and output of the comparison result. 5.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-4 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 3.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Intelligent fueling management system and method based on cloud platform
CN106529690A
Wave number management method and device of order, storage medium and electronic equipment
CN113537864A