Machine learning-based expressway in-transit traffic flow calculation method and device, equipment and medium

By combining machine learning models with data from provincial border gantries and toll stations, the system dynamically adjusts the traffic flow on the road, solving the problems of high complexity and low accuracy in calculating traffic flow on highways, and achieving efficient and accurate real-time calculation.

CN121483040APending Publication Date: 2026-02-06SHANDONG CVICSE MIDDLEWARE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511750117.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing technologies for calculating on-the-go traffic flow on highways suffer from high computational complexity, high resource consumption, and low accuracy. In particular, they are highly dependent on intermediate gantry data, leading to error accumulation and difficulty in meeting real-time requirements.

Method used

By employing a machine learning-based approach, utilizing provincial border gantries and toll station entrance/exit data, and combining historical and recent vehicle trend information, a traffic flow correction model is used to dynamically adjust theoretical values, reducing reliance on intermediate gantry data and improving calculation accuracy.

Benefits of technology

It achieves efficient and accurate calculation of on-the-road traffic flow, reduces computational complexity and resource consumption, improves real-time performance and robustness, and adapts to highway operation and management at different infrastructure levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121483040A_ABST
    Figure CN121483040A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, and relates to a machine learning-based expressway in-transit traffic flow calculation method, device, equipment and medium, and the method comprises the steps: obtaining the total driving-in amount determined by the provincial driving-in traffic flow and the entrance driving-in traffic flow, and the total driving-out amount determined by the provincial driving-out traffic flow and the exit driving-out traffic flow; the theoretical in-transit traffic flow of the current period can be systematically calculated in combination with the corrected traffic flow of the previous period; the method comprises the following steps: acquiring the historical number of vehicles entering or not exiting in the same period to reflect periodic data, and acquiring recent trend information which reflects short-term change dynamics to jointly provide rich context information for a traffic flow correction model; the theoretical in-transit traffic flow of the current period, the historical number of vehicles entering and leaving in the same period and the trend information of the number of vehicles entering and leaving in the recent period are input into the traffic flow correction model, the deviation in the theoretical value can be dynamically adjusted and compensated, and the more accurate real in-transit traffic flow of the current period is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a method, apparatus, device, and medium for calculating on-road traffic flow on highways based on machine learning. Background Technology

[0002] In the provincial-level operation and management of expressways, real-time and accurate monitoring of on-the-go traffic flow within the province's expressway network is of vital guiding significance for traffic scheduling, emergency command, congestion warning, and toll collection.

[0003] In related technologies, the determination of on-the-road vehicle flow relies on ETC gantries and toll station data. However, uneven distribution of sensing points (gantry), occasional equipment malfunctions, and drivers deliberately blocking signals (such as removing cards or obscuring license plates) can lead to missed data readings. Excessively large gantry transaction areas or signal crosstalk between adjacent gantries can cause vehicles to be misidentified. The entire provincial road network can be considered a "closed black box," with its entrances and exits being provincial border gantries and toll stations within the province. Theoretically, the number of on-the-road vehicles can be calculated using "historical on-the-road + entering - exiting - abnormal vehicles." However, the release of "historical on-the-road vehicles" is delayed and uncertain (vehicles may have been traveling for several days), and accurate identification of "abnormal vehicles with no exits" is extremely difficult. If a full and accurate matching of each vehicle's transaction data is used (e.g., precisely matching the entry and exit records of each vehicle), information mismatch problems will arise due to CPC card loss, changes in payment methods, etc. This method has extremely high computational complexity, and the resource consumption from processing massive amounts of data is not commensurate with the application value of the final indicator, making it difficult to meet real-time requirements.

[0004] Therefore, how to improve the accuracy of traffic flow calculation with a small computational load is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, device, and medium for calculating on-road traffic flow on highways based on machine learning, which can improve the accuracy of on-road traffic flow calculation with a small amount of computation.

[0006] Firstly, a machine learning-based method for calculating highway traffic flow is provided, comprising: obtaining the total inbound traffic volume, the total outbound traffic volume, and the corrected traffic flow volume of the previous period, wherein the total inbound traffic volume is determined based on the inbound traffic volume at the provincial border and the entrance traffic volume, and the total outbound traffic volume is determined based on the outbound traffic volume at the provincial border and the exit traffic volume; calculating the theoretical traffic flow volume for the current period based on the total inbound traffic volume, the total outbound traffic volume, and the corrected traffic flow volume of the previous period; obtaining the historical number of vehicles with no outbound traffic and the recent trend information of the number of vehicles with no outbound traffic corresponding to the same period; and inputting the theoretical traffic flow volume, the historical number of vehicles with no outbound traffic, and the recent trend information of the number of vehicles with no outbound traffic into a traffic flow correction model to obtain the actual traffic flow volume for the current period.

[0007] In a preferred embodiment, this application may be further configured to: after obtaining the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-go traffic volume of the previous period, the application may also include: obtaining key gantry flow data within the province; and verifying the total number of vehicles entering the current period and the total number of vehicles leaving the current period based on the key gantry flow data within the province.

[0008] In a preferred embodiment, this application can be further configured to: obtain the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-road traffic volume of the previous period, including: detecting whether a preset period has been reached; if so, obtaining the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-road traffic volume of the previous period.

[0009] In a preferred example, this application can be further configured as follows: after inputting the theoretical on-the-road traffic flow of the current period, the historical number of vehicles entering but not exiting during the same period, and the recent trend information of the number of vehicles entering but not exiting, into the traffic flow correction model to obtain the actual on-the-road traffic flow of the current period, it further includes: if the actual on-the-road traffic flow of the current period is greater than a preset on-the-road traffic flow threshold, then generating an alarm message.

[0010] In a preferred embodiment, this application may be further configured to include: acquiring training data, wherein the training data includes: multiple training features and labels corresponding to the training data, each training feature including: time, environment, historical theoretical number of vehicles on the road, historical number of vehicles entering but not exiting, and recent trend information of the number of vehicles entering but not exiting, and the labels corresponding to the training data representing the actual number of vehicles on the road; training the regression model based on the training data to obtain a traffic flow correction model.

[0011] In a preferred example, this application may be further configured such that the regression model is any one of Gradient Boosting Tree (GBDT), Random Forest, and LSTM network.

[0012] In a preferred embodiment, this application can be further configured to: train a regression model based on training data to obtain a traffic flow correction model, including: training the regression model based on training data to obtain an initial traffic flow correction model; evaluating the initial traffic flow correction model using a test set to obtain an evaluation result; and iteratively training the initial traffic flow correction model based on the evaluation result until a traffic flow correction model is obtained.

[0013] Secondly, a machine learning-based highway traffic flow calculation device is provided, comprising: a first acquisition module for acquiring the total inbound traffic volume, the total outbound traffic volume, and the corrected traffic flow volume of the previous period, wherein the total inbound traffic volume is determined based on the provincial border inbound traffic volume and entrance inbound traffic volume of the target highway, and the total outbound traffic volume is determined based on the provincial border outbound traffic volume and exit outbound traffic volume; a calculation module for calculating the theoretical traffic flow volume of the current period based on the total inbound traffic volume, the total outbound traffic volume, and the corrected traffic flow volume of the previous period; a second acquisition module for acquiring the historical number of vehicles with no outbound traffic and the recent trend information of the number of vehicles with no outbound traffic corresponding to the same period; and a correction module for inputting the theoretical traffic flow volume of the current period, the historical number of vehicles with no outbound traffic and the recent trend information of the number of vehicles with no outbound traffic into a traffic flow correction model to obtain the actual traffic flow volume of the current period.

[0014] Thirdly, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor, when running the computer program, executes the machine learning-based highway traffic flow calculation method described in any one of the first aspects.

[0015] Fourthly, a computer-readable storage medium is provided, wherein at least one piece of program code is stored therein, the program code being loaded and executed by a processor to implement the machine learning-based highway traffic flow calculation method as described in any of the first aspects.

[0016] Fifthly, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the machine learning-based highway traffic flow calculation method as described in any of the first aspects.

[0017] In summary, the machine learning-based method for calculating highway traffic flow provided in this application has the following beneficial technical effects:

[0018] By acquiring the total inbound traffic volume determined by the inbound traffic volume at the provincial border and the inbound traffic volume at the entrance, and the total outbound traffic volume determined by the outbound traffic volume at the provincial border and the outbound traffic volume at the exit, combined with the corrected traffic volume of the previous period, the theoretical on-the-road traffic volume of the current period can be systematically calculated. In this application, the data relies on the provincial border gantries and toll station entrance and exit data with the highest data quality and the most stable data, reducing the dependence on intermediate gantry data within the province. Acquiring the historical number of vehicles entering but not exiting during the same period can reflect the periodicity of the data, while acquiring recent trend information reflects short-term dynamic changes, together providing rich contextual information for the traffic volume correction model. By inputting the theoretical on-the-road traffic volume of the current period, the historical number of vehicles entering but not exiting during the same period, and the recent trend information of the number of vehicles entering but not exiting, into the traffic volume correction model, the deviation in the theoretical value can be dynamically adjusted and compensated, and a more accurate real on-the-road traffic volume of the current period can be output.

[0019] In addition, this application also provides a machine learning-based highway traffic flow calculation device, equipment, and medium, all of which have the aforementioned beneficial technical effects. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of a method for calculating on-the-go traffic flow on highways based on machine learning, provided in an embodiment of this application.

[0022] Figure 2 This is a schematic diagram of the structure of a highway traffic flow calculation device based on machine learning, provided in an embodiment of this application.

[0023] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0024] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of this application.

[0025] It should be noted that, in the optional embodiments of this application, the data related to object information, when applied to specific products or technologies, requires the permission or consent of the object. Furthermore, the collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if the embodiments of this application involve data related to an object, it must be obtained with the permission and consent of the object, the permission and consent of relevant departments, and in accordance with the relevant laws, regulations, and standards of the country and region. If the embodiments involve personal information, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required. The embodiments also need to be implemented with the permission and consent of the object.

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0028] To better understand and explain the solutions of the embodiments of this application, some technical terms involved in the embodiments of this application will be briefly explained below.

[0029] ETC gantry system: A dedicated system and supporting facilities built along the sections of highways, with functions such as segmented toll collection, license plate image recognition, and vehicle trajectory tracking.

[0030] Provincial border gantries: ETC gantries set up on highways at the borders between provinces are used to identify vehicles traveling across provinces.

[0031] CPC card: A composite toll card used in highway network toll collection systems to record vehicle travel route information.

[0032] Vehicles that enter but do not exit: This refers to vehicles whose entry information (entry at toll stations or provincial borders) is recorded by the system, but whose corresponding exit information is not matched within a certain time window. This may be caused by equipment malfunction, data loss, or abnormal vehicle behavior (such as prolonged stays, toll evasion, etc.).

[0033] Conventionally, the on-road traffic volume on highways is a key indicator for measuring the operational status of the road network. Its ideal mathematical model can be expressed as: Real-time on-road traffic on the current day = On-road traffic carried over from the previous day + Total on-road traffic on the current day - Total on-road traffic on the current day - Abnormal traffic with on-road traffic that enters but does not exit on the current day.

[0034] However, the implementation of this model faces significant challenges: Identifying "abnormal vehicles with entries but no exits" is difficult: is it data anomaly or is the vehicle still in motion? Effective algorithms are needed for differentiation. "Vehicles carried over from the previous day" are dynamically changing: vehicle travel times vary, and vehicles from the previous day or even earlier may exit at any time on the current day, making it a slowly released variable that is extremely difficult to calculate directly. Full-scale matching computation is costly: precise matching based on license plates or CPC card numbers requires processing hundreds of millions of transaction records, which is inefficient and cannot handle records with missing information.

[0035] In related technologies, by sorting and segmenting the information from checkpoint equipment, acquiring vehicle data from the checkpoint equipment, and matching the vehicle data with the checkpoint equipment information to remove abnormal data, the number of vehicles currently traveling on the highway can be accurately calculated. This yields the number of vehicles on the highway and each segment of the highway, allowing for monitoring of vehicle traffic and congestion on each segment, and providing a more accurate real-time count of vehicles on each highway segment. However, this method heavily relies on the completeness and accuracy of data from all gantry points within the province, placing stringent requirements on the current state of the infrastructure. In practical applications, equipment problems can easily lead to calculation failures or large errors. The segmented calculation mode inevitably results in errors occurring in each segment and accumulating in the final result, making it impossible to control and reduce overall errors at the system level. Furthermore, it fails to effectively utilize statistical patterns in the data and cannot intelligently handle anomalies such as "inputs without outputs," resulting in poor model robustness.

[0036] To address the above shortcomings, the core technical problem this invention aims to solve is: how to design a calculation method with controllable computational complexity, reasonable resource consumption, and significantly improved accuracy in calculating real-time on-the-go traffic flow across the province, under existing imperfect data conditions. This invention designs a more robust calculation method, which primarily relies on the highest quality and most stable data from provincial border gantries and toll station entrances / exits, reducing dependence on intermediate gantry data within the province.

[0037] By directly modeling and estimating at the provincial macro-system level, the error amplification problem caused by "segmented calculation and accumulation" is avoided, thus improving the overall estimation accuracy. A machine learning model is introduced to intelligently estimate the release pattern of "historical carryover vehicles" and the proportion of abnormal vehicles in "inbound but not outbound" data through learning from historical data, thereby correcting the theoretical calculation formula and obtaining a more accurate value that is closer to reality.

[0038] In one possible scenario, the scope of this study is the province (all expressways within the province), and the exits of the province are all toll stations and provincial border exit gantries.

[0039] In another possible scenario, the scope could be a specific highway.

[0040] This application provides a method for calculating highway traffic flow based on machine learning, such as... Figure 1 As shown, the method provided in this application embodiment can be executed by an electronic device, which is a server. This server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and electronic device can be directly or indirectly connected via wired or wireless communication. This application embodiment does not impose any limitations on this connection. The method includes:

[0041] S101. Obtain the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-go traffic volume of the previous period.

[0042] The total inbound volume is determined based on the inbound traffic flow at the provincial border and the inbound traffic flow at the entrance of the target expressway, while the total outbound volume is determined based on the outbound traffic flow at the provincial border and the outbound traffic flow at the exit.

[0043] Real-time data collection of provincial border gantry transaction records and toll station entrance / exit records from the highway toll collection system;

[0044] The flow data is cleaned, formatted, and timestamped to facilitate obtaining the total number of vehicles entering and leaving the current period.

[0045] Furthermore, it is also possible to obtain key gantry flow data within the province as an auxiliary tool, and then verify the total inbound volume and the total outbound volume within the current period based on the key gantry flow data within the province.

[0046] Among them, key gantries within the province mainly refer to gantries close to the provincial border and toll stations. The auxiliary purpose is to verify and supplement data, such as comparing the data of gantries around the provincial border gantry with the data of the provincial border gantry to reduce the rate of missing vehicles at the provincial border gantry, thereby achieving a more accurate count of the number of vehicles entering and leaving the province.

[0047] In this embodiment of the application, the collection cycle of auxiliary key gantry flow data within the province can be consistent with that of the data collection cycle of provincial boundary gantry and toll station.

[0048] For example, the system collects the traffic flow entering from the provincial border and the entrance within the current period according to a preset cycle, as well as the traffic flow entering from the gantry closest to the provincial border and the toll station within the province.

[0049] The electronic equipment can obtain the provincial border inbound traffic flow a0 and entrance inbound traffic flow b0 of the provincial border gantry in the current period T; and obtain the provincial border inbound traffic flow a1 and entrance inbound traffic flow b1 of the previous period T-1, and the provincial border inbound traffic flow a2 and entrance inbound traffic flow b2 of period T-2.

[0050] The electronic equipment can also obtain the provincial border inbound traffic flow c0 and entrance traffic flow d0 for the current period T, which is closest to the provincial border; and obtain the provincial border inbound traffic flow c1 and entrance traffic flow d1 for the previous period T-1, and the provincial border inbound traffic flow c2 and entrance traffic flow d2 for period T-2.

[0051] Since there is a certain distance between the provincial boundary gantry and the adjacent provincial boundary gantry, the nearest cycle can be used for verification.

[0052] The estimated time can be determined based on the distance between the two gantry and the expected travel speed, and then the cycle can be selected.

[0053] For example, if the data of the provincial border gantry in cycle T-2 corresponds to the data of the key gantry within the province in the current cycle T, the electronic equipment can also obtain accurate data from the audit system continuously analyzing and statistically analyzing the corresponding provincial border gantry data for cycle T-2: the provincial border inbound traffic flow e and the entrance inbound traffic flow f. Then, corrected data e-c0 and f-d0 are obtained; furthermore, based on the corrected data, the provincial border inbound traffic flow a0 and the entrance inbound traffic flow b0 of the provincial border gantry in the current cycle T are corrected, resulting in e-c0+a0 and f-d0+b0, thus achieving data correction.

[0054] In one feasible approach, the road network is acquired, and based on the road network, the gantry closest to the provincial boundary within the province, and the first exit of the two gantry supports are determined. The inbound traffic flow of the gantry closest to the provincial boundary and the outbound traffic flow of the first exit (if a first exit exists) are acquired. The sum of the inbound traffic flow of the gantry closest to the provincial boundary and the outbound traffic flow of the first exit is determined, and the ratio of this sum to the inbound traffic flow at the provincial boundary is determined. If the ratio is within a preset range, no correction is required; otherwise, the latter is used as the corrected total inbound value, or the average of the two is used as the corrected total inbound value. The total outbound volume within the current period is also handled in the same manner, and this application embodiment is not limited thereto.

[0055] In this embodiment of the application, the corrected on-the-road traffic flow of the previous period is obtained based on the traffic flow correction model to obtain the actual on-the-road traffic flow of the previous period.

[0056] S102. Calculate the theoretical on-the-road traffic volume for the current period based on the total inbound volume, the total outbound volume for the current period, and the corrected on-the-road traffic volume for the previous period.

[0057] Based on the corrected on-the-road traffic volume of the previous period, calculate the theoretical on-the-road traffic volume for the current period: S_theoretical = S_previous + N_in - N_out; S_previous is the corrected on-the-road traffic volume of the previous period; N_in is the total inbound traffic volume in the current period, N_out is the total outbound traffic volume in the current period; S_theoretical is the theoretical on-the-road traffic volume for the current period.

[0058] S103. Obtain the historical number of vehicles entering but not exiting in the same period corresponding to the current period and the recent trend information of the number of vehicles entering but not exiting.

[0059] In this application's embodiments, the term "synchronous period" is explained. Because highway traffic flow has a certain periodicity, within a week, there are more short-distance trips on weekends; on a daily basis, due to the existence of urban highways, traffic flow is higher during rush hours, and daytime traffic is higher than nighttime traffic, etc. Therefore, in normal times, the historical synchronous period in this article refers to two things: first, the synchronous period at a specific time each day; and second, the synchronous period corresponding to a particular day of the week from the previous week. During holidays and the 1-2 days before and after holidays, the synchronous period is generally determined by the holidays of the previous year.

[0060] Regarding data with entries but no exits, a dedicated auditing system continuously analyzes and statistically analyzes this data. The more historical the data, the more accurate the statistics; however, the closer to the present, the less accurate the analysis becomes, requiring the gradual accumulation of evidence. In this embodiment, the number of vehicles with entries but no exits is historical data, including both historical periods and recent periods. Based on the statistical period, it is divided into continuous datasets of vehicles with entries but no exits. For recent periods, this can be a preset number of periods before and after the current period; this embodiment does not limit the specific number. The trend information of the recent number of vehicles with entries but no exits represents the recent trend change in the number of vehicles with entries but no exits, which can be linear or polynomial.

[0061] S104. Based on the theoretical on-the-road traffic volume of the current period, the historical number of vehicles entering but not exiting during the same period, and the recent trend information of the number of vehicles entering but not exiting, input the traffic volume correction model to obtain the actual on-the-road traffic volume of the current period.

[0062] The system inputs S_theoretical, the historical number of vehicles entering without exiting during the same period, and the recent trend information on the number of vehicles entering without exiting into a pre-trained machine learning model (traffic flow correction model), and outputs the corrected value of the on-the-road traffic flow for the current period, S_corrected, which is the actual on-the-road traffic flow for the current period. Then, S_corrected is output as the final result for this period and used for the calculation of the next period.

[0063] In this application embodiment, a hybrid computational framework combines theoretical calculations based on provincial border and entrance / exit data with correction values ​​based on machine learning models. It explicitly emphasizes and relies on the highest-quality provincial border gantries and toll station entrance / exit data as the primary input, reducing reliance on unreliable intermediate gantries; this is a key design feature for the method's robustness. When training the machine learning model, theoretical on-the-go volume and the number of vehicles entering but not exiting from historical data are used as input features, and the estimated actual on-the-go volume (or correction value) is used as the output target, thereby intelligently compensating for system errors and data anomalies. It is noteworthy that this application inputs "the number of vehicles entering but not exiting" as a key feature into the model, allowing the model to learn the complex relationship between this data and the actual error, rather than using rigid rules for elimination.

[0064] As can be seen, in this embodiment, by obtaining the total inflow determined by the inflow of vehicles entering from the provincial border and the inflow of vehicles entering from the entrance, and the total outflow determined by the outflow of vehicles exiting from the provincial border and the outflow of vehicles exiting from the exit, combined with the corrected traffic flow of the previous period, the theoretical on-the-road traffic flow of the current period can be systematically calculated. In this application, the data relies on the provincial border gantries and toll station entrance and exit data with the highest data quality and the most stable data, reducing the dependence on intermediate gantry data within the province; obtaining the historical number of vehicles entering without exiting during the same period can reflect the periodicity of the data, while obtaining the recent trend information reflects the short-term dynamic changes, together providing rich contextual information for the traffic flow correction model; inputting the theoretical on-the-road traffic flow of the current period, the historical number of vehicles entering without exiting during the same period, and the recent trend information of the number of vehicles entering without exiting into the traffic flow correction model can dynamically adjust and compensate for the deviation in the theoretical value, and output a more accurate real on-the-road traffic flow of the current period.

[0065] One possible implementation of this application embodiment is to obtain the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-road traffic volume of the previous period, including: detecting whether a preset period has been reached; if so, obtaining the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-road traffic volume of the previous period.

[0066] The application sets the cycle to a short period (such as 5 minutes) for iterative calculation, using the correction result of the previous cycle as the input for the theoretical calculation of the next cycle, to achieve real-time rolling updates, which not only ensures real-time performance but also allows the model correction effect to be continuously transmitted.

[0067] One possible implementation of this application embodiment is as follows: after inputting the theoretical on-the-road traffic flow of the current period, the historical number of vehicles entering but not exiting during the same period, and the recent trend information of the number of vehicles entering but not exiting, into the traffic flow correction model to obtain the actual on-the-road traffic flow of the current period, the method further includes: if the actual on-the-road traffic flow of the current period is greater than a preset on-the-road traffic flow threshold, then generating an alarm message.

[0068] To adapt to different road network pressure scenarios, multiple threshold levels can be set, such as level 1, level 2, and level 3 thresholds, to improve the accuracy and practicality of alarms.

[0069] Compare the actual traffic flow in the current period with the Level 1, Level 2, and Level 3 thresholds. If the traffic flow exceeds the Level 1 threshold but does not exceed the Level 2 threshold, a minor alarm is triggered; if the traffic flow exceeds the Level 2 threshold but does not exceed the Level 3 threshold, a moderate alarm is triggered; and if the traffic flow exceeds the Level 3 threshold, a severe alarm is triggered.

[0070] Furthermore, if the current period is a moderate alarm and the previous period was a light alarm / no alarm, and the traffic volume is predicted to increase in the next period, then the alarm level for the current period will be raised to a severe alarm.

[0071] As can be seen, in this embodiment of the application, a threshold is set, and when the actual traffic flow exceeds the preset traffic flow threshold, an alarm message is generated to alert relevant personnel.

[0072] One possible implementation of this application embodiment further includes: acquiring training data, the training data including: multiple training features and labels corresponding to the training data, each training feature including: time, environment, historical theoretical number of vehicles on the road, historical number of vehicles entering but not exiting, and recent trend information of the number of vehicles entering but not exiting, the labels corresponding to the training data representing the actual number of vehicles on the road; training the regression model based on the training data to obtain a traffic flow correction model.

[0073] One possible implementation of this application embodiment involves training a regression model based on training data to obtain a traffic flow correction model, including: training the regression model based on training data to obtain an initial traffic flow correction model; evaluating the initial traffic flow correction model using a test set to obtain an evaluation result; and iteratively training the initial traffic flow correction model based on the evaluation result until a traffic flow correction model is obtained.

[0074] In this embodiment of the application, training features for machine learning models are constructed based on historical data, such as time (hours, days of the week, holidays), environment (such as weather), the theoretical number of vehicles on the road in the same period of history, the number of vehicles that entered but did not exit in the same period of history, and the trend information of the number of vehicles that entered but did not exit recently.

[0075] A regression model (such as Gradient Boosting Tree (GBDT), Random Forest, or LSTM network) is employed, with the goal of learning the corrective relationship between the "theoretical in-transit quantity" and the "actual in-transit quantity".

[0076] The model is trained using historical data (some of which can be used as labels to obtain approximate values ​​through other costly methods) so that its output correction values ​​are as close as possible to the actual traffic flow.

[0077] For regression models, the goal is that the model inputs (features) include, but are not limited to: the theoretical amount of vehicles on the road within the time window (i.e., the amount of vehicles on the road at the previous moment + the number of vehicles entering during the period - the number of vehicles leaving during the period), and the number of vehicles entering without leaving (historical same period and recent).

[0078] The model output includes the actual on-the-go traffic volume for the current period.

[0079] One possible implementation of this application embodiment is to construct a traffic flow curve based on the actual traffic flow in multiple consecutive periods; and to estimate the actual traffic flow in the current period based on the traffic flow curve constructed in the previous period.

[0080] The model verifies the actual traffic flow for the current period against its predicted traffic flow. If the difference exceeds a preset threshold, the model is recalculated to obtain the actual traffic flow for the current period. Using the constructed traffic flow curve for prediction ensures the accuracy of the model's output to a certain extent. Furthermore, the traffic flow curve becomes more accurate with an increasing number of periods. Using small periods, such as 5 minutes, also contributes to the accuracy of the actual results.

[0081] In summary, firstly, existing technologies rely on rule-based micro-segment matching and counting methods, whose accuracy is severely limited by the sophistication of hardware infrastructure. This invention, however, innovatively adopts a machine learning-based macro-system estimation and correction paradigm. This means we no longer focus on precise tracking of every vehicle and every road segment, but rather take a holistic view of the provincial road network as a closed system, using machine learning models to intelligently learn the dynamic patterns of traffic flow, thereby achieving efficient and accurate estimation of the total number of vehicles on the road. Secondly, regarding data dependency and robustness, existing solutions heavily rely on the completeness and accuracy of data from all gantry points within the province. Failure or missing data from any gantry can cause segmented calculation errors, which can accumulate and amplify, affecting the overall result. Conversely, this invention cleverly avoids this weakness. Its core calculation relies primarily on the highest quality and most stable data from provincial border gantries and toll station entrances / exits. Data collection at these key nodes typically has redundant backups and manual safeguards, making its reliability far higher than that of ordinary gantries. Therefore, this invention exhibits stronger adaptability and robustness under existing infrastructure conditions, maintaining stable and reliable output even when some intermediate gantry data is abnormal. Third, regarding error control and anomaly handling capabilities, existing technologies employ a "divide and conquer" strategy, resulting in cumulative errors. The accumulation of small errors across different road segments leads to significant deviations in the final result. Furthermore, their method of rigidly eliminating outlier data through hard rules is too inflexible. This invention fundamentally avoids error accumulation by adopting a holistic correction strategy. More importantly, we intelligently learn and compensate for systemic biases caused by data anomalies (such as "entering but not exiting" vehicles) through a machine learning model. The model can learn the complex relationships between these anomalies and the true values ​​from historical data, thus enabling more flexible and accurate corrections. Finally, in terms of computational efficiency and universality, existing technologies require processing massive amounts of flow data from all gantries across the entire road network for real-time matching calculations, resulting in enormous resource consumption and high demands on the computing system. This invention primarily processes aggregated provincial boundary and entry / exit data, significantly reducing the data volume and computational complexity. This makes it possible to achieve high-frequency, real-time province-wide on-the-go vehicle calculations with limited resources, thus increasing its application value. Because it reduces the strong dependence on intermediate gantries, the invention is more universal and can be widely applied to the operation and management scenarios of provincial expressways with different levels of infrastructure construction, solving the pain point that existing technologies cannot be effectively promoted due to hardware limitations.

[0082] The following describes a device provided by an embodiment of this application. The device described below can be referred to in correspondence with the method described above. The device of this embodiment is installed in an electronic device. Figure 2 , Figure 2This is a structural block diagram of an apparatus according to one embodiment of this application, comprising: a first acquisition module 210, used to acquire the total inbound traffic volume, the total outbound traffic volume, and the corrected on-the-road traffic volume of the previous period, wherein the total inbound traffic volume is determined based on the provincial border inbound traffic volume and entrance inbound traffic volume of the target expressway, and the total outbound traffic volume is determined based on the provincial border outbound traffic volume and exit outbound traffic volume; a calculation module 220, used to calculate the theoretical on-the-road traffic volume of the current period based on the total inbound traffic volume, the total outbound traffic volume, and the corrected on-the-road traffic volume of the previous period; a second acquisition module 230, used to acquire the historical number of vehicles with no outbound traffic and the recent trend information of the number of vehicles with no outbound traffic corresponding to the same period of the current period; and a correction module 240, used to input the theoretical on-the-road traffic volume of the current period, the historical number of vehicles with no outbound traffic and the recent trend information of the number of vehicles with no outbound traffic into a traffic flow correction model to obtain the actual on-the-road traffic volume of the current period.

[0083] In one possible implementation, the first acquisition module 210 is further configured to: acquire key gantry flow data within the province; and verify the total inbound volume and the total outbound volume within the current period based on the key gantry flow data within the province.

[0084] In one possible implementation, the first acquisition module 210 is further configured to: detect whether a preset period has been reached; if so, acquire the total number of vehicles entering the current period, the total number of vehicles leaving the current period, and the corrected on-the-go traffic volume of the previous period.

[0085] In one possible implementation, it also includes an alert module, which generates an alert message if the actual traffic flow in the current period is greater than a preset traffic flow threshold.

[0086] In one feasible approach, the system further includes: a training module for acquiring training data, which includes: multiple training features and corresponding labels. Each training feature includes: time, environment, historical theoretical number of vehicles on the road, historical number of vehicles entering but not exiting, and recent trend information on the number of vehicles entering but not exiting. The labels corresponding to the training data represent the actual number of vehicles on the road. The regression model is trained based on the training data to obtain a traffic flow correction model.

[0087] In one feasible approach, the regression model is any of the Gradient Boosting Tree (GBDT), Random Forest, or LSTM network.

[0088] In one possible implementation, the training module is further configured to: train the regression model based on the training data to obtain an initial traffic flow correction model; evaluate the initial traffic flow correction model using a test set to obtain an evaluation result; and iteratively train the initial traffic flow correction model based on the evaluation result until a traffic flow correction model is obtained.

[0089] Figure 3 A structural diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device includes: a memory 60 for storing a computer program; and a processor 61 for executing the computer program to implement the steps of the method as described in the above embodiments.

[0090] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.

[0091] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0092] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, is capable of implementing the relevant steps of the method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc.

[0093] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.

[0094] Those skilled in the art will understand that Figure 3 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0095] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical disks, and other media capable of storing program code.

[0096] Based on this, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.

[0097] Based on this, embodiments of the present invention also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method. It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0098] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for calculating the traffic volume of a highway in progress based on machine learning, characterized by, The method comprises the following steps: obtaining total driving-in quantity in a current period, total driving-out quantity in the current period and corrected in-transit vehicle quantity of a previous period, wherein the total driving-in quantity is determined according to provincial boundary driving-in vehicle quantity and entrance driving-in vehicle quantity, and the total driving-out quantity is determined according to provincial boundary driving-out vehicle quantity and exit driving-out vehicle quantity; calculating theoretical in-transit vehicle quantity of the current period according to the total driving-in quantity in the current period, the total driving-out quantity in the current period and the corrected in-transit vehicle quantity of the previous period; obtaining historical same-period in-and-out vehicle quantity and recent in-and-out vehicle quantity trend information corresponding to the current period; inputting the theoretical in-transit vehicle quantity of the current period, the historical same-period in-and-out vehicle quantity and the recent in-and-out vehicle quantity trend information into a vehicle flow correction model to obtain true in-transit vehicle quantity of the current period.

2. The method of claim 1, wherein the machine learning-based expressway in- transit traffic volume calculation method is characterized by, After obtaining the total driving-in quantity in the current period, the total driving-out quantity in the current period and the corrected in-transit vehicle quantity of the previous period, the method further comprises the following steps: obtaining provincial key gate flow data; verifying the total driving-in quantity in the current period and the total driving-out quantity in the current period according to the provincial key gate flow data. 3.The highway in-route vehicle flow calculation method based on machine learning according to claim 1, characterized in that, The method comprises the following steps: detecting whether a preset period is reached; if the preset period is reached, obtaining the total driving-in quantity in the current period, the total driving-out quantity in the current period and the corrected in-transit vehicle quantity of the previous period. 4.The highway in-route vehicle flow calculation method based on machine learning according to claim 1, characterized in that, After inputting the theoretical in-transit vehicle quantity of the current period, the historical same-period in-and-out vehicle quantity and the recent in-and-out vehicle quantity trend information into the vehicle flow correction model to obtain the true in-transit vehicle quantity of the current period, the method further comprises the following step: if the true in-transit vehicle quantity of the current period is greater than a preset in-transit vehicle quantity threshold, generating an alarm information. 5.The highway in-route vehicle flow calculation method based on machine learning according to claim 1, wherein, The method further comprises the following steps: obtaining training data, wherein the training data comprises a plurality of training features and a label corresponding to the training data, each training feature comprises time, environment, historical same-period theoretical in-transit vehicle quantity, historical same-period in-and-out vehicle quantity, recent in-and-out vehicle quantity trend information, and the label corresponding to the training data represents actual in-transit vehicle quantity; training a regression model according to the training data to obtain a vehicle flow correction model. 6.The highway in-route vehicle flow calculation method based on machine learning according to claim 5, characterized in that, The regression model is any one of a gradient boosting decision tree (GBDT), a random forest and an LSTM network. 7.The highway in-route vehicle flow calculation method based on machine learning according to claim 5, characterized in that, The method of training the regression model according to the training data to obtain the vehicle flow correction model comprises the following steps: training the regression model according to the training data to obtain an initial vehicle flow correction model; evaluating the initial vehicle flow correction model by using a test set to obtain an evaluation result; iteratively training the initial vehicle flow correction model according to the evaluation result until the vehicle flow correction model is obtained.

8. A highway in-vehicle traffic volume calculation device based on machine learning, characterized by, The method comprises the following steps: a first obtaining module is configured to obtain total driving-in quantity in a current period, total driving-out quantity in the current period and corrected in-transit vehicle quantity of a previous period, wherein the total driving-in quantity is determined according to provincial boundary driving-in vehicle quantity and entrance driving-in vehicle quantity, and the total driving-out quantity is determined according to provincial boundary driving-out vehicle quantity and exit driving-out vehicle quantity; The computing module is configured to calculate a theoretical in-transit vehicle flow of the current period according to a total driving-in amount in the current period, a total driving-out amount in the current period, and a corrected in-transit vehicle flow of a previous period; The second obtaining module is configured to obtain trend information of a historical in-out vehicle quantity of a same period corresponding to the current period and a recent in-out vehicle quantity; The correction module is configured to input a vehicle flow correction model according to the theoretical in-transit vehicle flow of the current period, the historical in-out vehicle quantity of the same period, and the trend information of the recent in-out vehicle quantity, to obtain an actual in-transit vehicle flow of the current period.

9. An electronic device, comprising: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the method for calculating the in-transit vehicle flow of the expressway based on machine learning according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one program code, and the program code is loaded and executed by the processor to implement the method for calculating the in-transit vehicle flow of the expressway based on machine learning according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Traffic flow prediction method, device and equipment based on LSTM feedback mechanism

    CN114999182A

  • Traffic flow prediction model training method and device, traffic flow prediction method and device and electronic equipment

    CN115311842A

  • Urban expressway traffic management method

    CN116913084A

  • Traffic flow management and control method and system based on in-transit information, terminal and medium

    CN119625991A

  • Method and device for analyzing dynamic behaviors of vehicles on road on highway and medium

    CN119763337A