Traffic signal control method and control equipment
By combining traffic flow model and attention mechanism, the outflow flow and traffic state of the lane are predicted, and the passage time is adjusted according to the law of conservation of vehicles, the problem of inaccurate prediction of lane outflow in the existing technology is solved, and traffic signal control is improved accuracy and efficiency of traffic.
Patent Information
- Application Number
- CN202411383357.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
In the existing traffic signal control method, the lane outflow prediction based on simplified mathematical model is not accurate enough, which leads to the traffic signal control scheme being unable to effectively respond to traffic flow changes in actual applications, reducing the traffic efficiency of the traffic area.
Using a traffic flow model and attention mechanism based on the current and historical traffic data of each lane in the traffic area, combined with the law of conservation of vehicles, predict the outbound flow and traffic status of the lane, and adjust the pass time according to the preset adjustment target to improve the Accuracy of traffic signal control.
By accurately predicting the outbound flow and traffic status of the lane, optimizing the traffic duration, significantly improving the accuracy and traffic efficiency of traffic signal control, ensuring balanced distribution of vehicles, and reducing traffic congestion.
Smart Images

Figure CN119274337A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of intelligent transportation technology, and in particular, relates to a traffic signal control method and control device. Background Art
[0002] In the field of intelligent transportation, the configuration of traffic signal control schemes for traffic areas usually involves the prediction of lane exit flow. Lane exit flow refers to the number of vehicles exiting a lane at a certain moment in the future. This prediction is crucial for the reasonable configuration of traffic signal control schemes.
[0003] In the related art, the method of determining lane exit flow is mostly achieved by simplifying the mathematical model of the real traffic scene. However, this simplified mathematical model has certain limitations in expressing the real traffic situation, resulting in inaccurate prediction results. The traffic signal control scheme configured based on inaccurate prediction results often cannot effectively respond to the changes in actual traffic flow during implementation, reducing the traffic efficiency of the traffic area. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a traffic signal control method and a control device, which can improve the accuracy of traffic signal control, thereby improving the traffic efficiency of the traffic area.
[0005] A first aspect of an embodiment of the present application provides a traffic signal control method, comprising:
[0006] Based on the current traffic data and historical traffic data of each lane in the traffic area, a traffic flow model is used to determine the first exit flow of each lane at the current moment, and the second exit flow of each lane at the current moment is obtained by processing through an attention mechanism;
[0007] Determining a predicted exit flow rate of each lane at a current moment based on each of the first exit flows and each of the second exit flows;
[0008] Determining the predicted traffic state of each lane at a future time based on the vehicle conservation law and each predicted exit flow;
[0009] Based on a preset adjustment target and each of the predicted traffic conditions, adjusting the travel time of each of the lanes until a target travel time that meets the adjustment target is obtained;
[0010] The duration of the traffic lights controlling each of the lanes is the target duration of the traffic.
[0011] In an implementation of the first aspect, the determining the second exit flow of each lane at the current moment through attention mechanism processing based on the current traffic data and historical traffic data of each lane in the traffic area includes:
[0012] For each lane, the current traffic data of the lane is used as a query feature, and the historical traffic data of the lane is used as a key feature and a value feature, and an attention mechanism is processed at least once to obtain a weight of each historical traffic data of the lane;
[0013] A weighted sum is performed on each of the historical traffic data and the weight to obtain the second exit flow of the lane at the current moment.
[0014] In an implementation of the first aspect, the determining the second exit flow of each lane at the current moment through attention mechanism processing based on the current traffic data and historical traffic data of each lane in the traffic area includes:
[0015] Acquire a dynamic environment model based on an attention mechanism, wherein the dynamic environment is trained based on traffic data samples of the traffic area, and the labels of the traffic data samples are the outgoing flow of the lane;
[0016] The current traffic data and historical traffic data of each lane are predicted by the dynamic environment model to obtain the second exit flow of each lane at the current moment.
[0017] In an implementation of the first aspect, the method further includes: acquiring real sample data of each lane, wherein a label of the real sample data is a real exit flow of the lane;
[0018] Determine the virtual exit flow of each of the real sample data based on the traffic state and travel time in each of the real sample data based on the traffic flow model, wherein the traffic flow model is used to determine the exit flow of the lane;
[0019] Based on each of the real sample data and each of the virtual exit flows, construct virtual sample data, wherein the label of the virtual sample data is the virtual exit flow;
[0020] The virtual sample data and the real sample data are used as traffic data samples for training the dynamic environment model.
[0021] In an implementation of the first aspect, based on current traffic data and historical traffic data of each lane, a traffic flow model is used to determine a first exit flow of each lane at a current moment, including:
[0022] Determine the total travel time of each lane in the current signal cycle based on the current traffic data and historical traffic data of each lane;
[0023] Determine the first exit flow of each lane at the current moment based on the saturated flow of each lane, the total travel time of each lane, and the traffic flow model;
[0024] The traffic flow model is used to characterize the mapping relationship between the exit flow of the lane and the total travel time of the lane within any signal cycle.
[0025] In an implementation of the first aspect, determining the predicted exit flow of each lane at the current moment based on each of the first exit flow rates and each of the second exit flow rates includes:
[0026] Acquire a preset mapping relationship, where the preset mapping relationship represents a relationship between a first exit flow rate, a second exit flow rate, and a target exit flow rate of a lane;
[0027] Determine the predicted exit flow of each lane at the current moment based on the preset mapping relationship, the first exit flow of each lane, and the second exit flow of each lane;
[0028] The preset mapping relationship includes a first sub-relationship based on the first outgoing flow, a second sub-relationship based on the second outgoing flow, and a third sub-relationship determined based on the first outgoing flow and the second outgoing flow.
[0029] In an implementation of the first aspect, determining the predicted traffic state of each lane at a future time based on the vehicle conservation law and each predicted exit flow includes:
[0030] Obtaining the current traffic status of each lane and the current traffic flow of each lane;
[0031] According to the law of conservation of vehicles, for each lane, a difference between a current incoming flow rate and a predicted outgoing flow rate of the lane is determined to obtain a vehicle increment of the lane;
[0032] The current traffic state of the lane and the vehicle increment are summed, and the sum result is used as the predicted traffic state of the lane at a future moment.
[0033] In an implementation of the first aspect, obtaining a current inbound flow rate of each lane includes:
[0034] Acquire a lane type of each lane, wherein the lane type includes an inner lane and an outer lane, wherein the inner lane is a lane located between two adjacent intersections in a traffic area, and the outer lane is not a lane located between two adjacent intersections in a traffic area;
[0035] Based on the acquisition method adapted for each lane type, the current incoming flow rate of each lane is acquired.
[0036] In an implementation of the first aspect, the lane type is an internal lane, and the acquiring of the current incoming traffic of each lane based on the acquisition method adapted for each lane type includes:
[0037] Acquire a lane transfer matrix of the traffic area, wherein elements in the lane transfer matrix represent vehicle transfer rates between lanes having an upstream and downstream relationship;
[0038] Based on the lane transfer matrix, determining an upstream lane of each lane and a target vehicle transfer rate of each upstream lane;
[0039] Based on the number of vehicles in each of the upstream lanes and the transfer rate of each of the target vehicles, the current incoming flow rate of each of the lanes is determined.
[0040] In an implementation of the first aspect, before acquiring the lane transfer matrix of the traffic area, the method includes:
[0041] For each lane in the traffic area, determining an upstream lane associated with the lane;
[0042] Determine, based on historical traffic data of the targeted lane, a plurality of historical lane shift rates of each of the upstream lanes relative to the targeted lane, the historical lane shift rate being a ratio of an incoming flow from the upstream lane at a specified historical moment to an incoming flow of the targeted lane at the historical moment;
[0043] Determining a target lane shift rate of each upstream lane relative to the targeted lane at the current moment based on each of the historical lane shift rates;
[0044] A lane transfer matrix of the traffic area is constructed based on the target lane transfer rate of each lane in the traffic area.
[0045] In an implementation of the first aspect, the method further includes: obtaining a traffic state threshold, a travel time threshold, and an exit flow threshold of a lane in the traffic area;
[0046] Based on the traffic state threshold, the travel time threshold and the exit flow threshold, the traffic state, the travel time and the exit flow in the original traffic data of each lane are normalized to obtain the current traffic data and the historical traffic data of each lane;
[0047] The original traffic data includes the original current traffic data and the original historical traffic data of the lane.
[0048] In an implementation of the first aspect, the adjustment target includes a first target or a second target;
[0049] Among them, the first goal is to minimize the maximum queuing ratio of each lane in the traffic area, the second goal is to minimize the variance of the queuing ratios between the lanes in the traffic area, the queuing ratio is the ratio of the lane queue length to the lane length, and the adjustment operation on the travel time of each lane based on the first goal or the second goal makes the vehicles in each lane in the traffic area evenly distributed without overflow of vehicles.
[0050] A second aspect of an embodiment of the present application provides a traffic signal control device, including:
[0051] A first determination module is used to determine the first exit flow of each lane at the current moment by using a traffic flow model based on the current traffic data and the historical traffic data of each lane in the traffic area, and to determine the second exit flow of each lane at the current moment by using an attention mechanism;
[0052] A prediction module, configured to determine a predicted exit flow rate of each lane at a current moment based on each of the first exit flows and each of the second exit flows;
[0053] A second determination module is used to determine the predicted traffic state of each lane at a future time based on the vehicle conservation law and each predicted exit flow;
[0054] An adjustment module, configured to adjust the travel time of each lane based on a preset adjustment target and each predicted traffic state until a target travel time that meets the adjustment target is obtained;
[0055] The control module is used to control the passing time of the traffic lights of each lane to be the target passing time.
[0056] A third aspect of an embodiment of the present application provides a control device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method described in the first aspect above is implemented.
[0057] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0058] In the first aspect of the embodiment of the present application, the current traffic data and historical traffic data of each lane in the traffic area are integrated, and the first and second exit flows of the lane are determined in combination with the traffic flow model and the attention mechanism. Then, the predicted exit flow at the current moment is determined collaboratively based on the first and second exit flows. It is possible to make an accurate prediction based on the rich and comprehensive traffic data to obtain a predicted exit flow that conforms to the actual traffic conditions; then, the vehicle conservation law is used in combination with the predicted exit flow to determine the predicted traffic state at the future moment, and according to the preset adjustment target and the predicted traffic state, the lane travel time is adjusted until the target travel time that conforms to the adjustment target is obtained. Finally, traffic signal control is performed based on the target travel time, which can improve the accuracy of traffic signal control and thus improve the traffic efficiency of the traffic area.
[0059] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0061] Figure 1 is a schematic diagram of a traffic scene in a traffic area provided in an embodiment of the present application;
[0062] Figure 2 It is a flow chart of a traffic signal control method provided in an embodiment of the present application;
[0063] Figure 3 is a flow chart of a second method for determining an exit flow rate provided in an embodiment of the present application;
[0064] Figure 4 is a flow chart of a first method for determining an exit flow rate provided in an embodiment of the present application;
[0065] Figure 5 It is a flowchart of a method for determining predicted exit flow provided in an embodiment of the present application;
[0066] Figure 6is another flow chart of the second exit flow determination method provided by an embodiment of the present application;
[0067] Figure 7 is an example diagram of a dynamic environment model provided in an embodiment of the present application;
[0068] Figure 8 It is a flowchart of a method for obtaining traffic data samples provided in an embodiment of the present application;
[0069] Fig. 9 This is an example diagram of obtaining traffic data samples provided in an embodiment of the present application;
[0070] Fig.10 is a schematic diagram of a method for determining a predicted traffic state provided in an embodiment of the present application;
[0071] Fig.11 is a flow chart of a method for obtaining inbound traffic provided in an embodiment of the present application;
[0072] Fig.12 is a flow chart of a method for determining the inbound flow of an internal lane provided in an embodiment of the present application;
[0073] Fig.13 It is a flowchart of a lane transfer matrix construction method provided in an embodiment of the present application;
[0074] Fig.14 It is a flow chart of a method for normalizing traffic data provided in an embodiment of the present application;
[0075] Fig.15 is a schematic diagram of the structure of a traffic signal control device provided in an embodiment of the present application;
[0076] Fig.16 It is a schematic diagram of the structure of the control device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0077] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0078] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0079] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0080] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0081] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0082] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0083] In one embodiment, Figure 1 As shown, Figure 1 A schematic diagram of a traffic scene in a traffic area provided in an embodiment of the present application, wherein a traffic area refers to an intersection area in a road, or a collection of multiple interconnected intersection areas in a road, and a traffic signal refers to a traffic light signal in an intersection area in a road. A traffic area may include at least one intersection ( Figure 1 Two intersections are shown in the figure, intersection j 1 and intersection j 2), each intersection includes multiple lanes, and each lane has a corresponding travel time. The traffic signal control for the traffic area is essentially to control the travel time of the traffic lights associated with each lane in the traffic area. The travel time actually refers to the length of time the green light is on in each signal cycle of the traffic light. In different time periods, the traffic status in each lane in the traffic area is constantly changing. The traffic status can be characterized by the number of vehicles in the lane. If the number of vehicles in the lane reaches the preset saturation number of the lane, it means that the lane is in a saturated state. At any time, each lane in the traffic area maintains the conservation of the number of vehicles when there are vehicles entering upstream and vehicles leaving downstream, that is, it complies with the vehicle conservation law.
[0084] The vehicle conservation law refers to the correlation between the traffic state of the lane at time k (k is a positive integer), the lane entry flow, the lane exit flow and the lane traffic state at time (k+1). The traffic state of all lanes in the traffic area constitutes the regional state of the traffic area. The vehicle conservation law is expressed by the following formula (1):
[0085] S z (k+1)=S z (k)+[q z (k)-r z (k)](1)
[0086] In the above formula (1), S z (k+1) represents the traffic status of any lane z in the traffic area at the (k+1)th time. If the traffic status is represented by the number of vehicles on the lane, then S z (k+1) represents the number of vehicles in lane z at the (k+1)th moment, S z (k) represents the number of vehicles in lane z at the kth moment, q z (k) represents the incoming flow rate of lane z at the kth moment, r z (k) represents the outgoing flow rate of lane z at the kth time, r z (k) is related to the travel time associated with lane z. Formula (1) can be used to determine the number of vehicles at each moment under different travel times of lane z.
[0087] In the application, the control device can perform real-time traffic signal control through an adaptive control method. The adaptive control method takes into account the random volatility of the traffic flow in the lane and can adaptively and timely adjust the traffic signals in the traffic area according to the current overall regional state of the traffic area with a unified control (adjustment) target (the adjustment target is usually expressed in the form of a function, so it can be called an objective function). The traffic control based on the adjusted traffic signals can improve the traffic conditions in the traffic area and achieve a more balanced distribution of vehicles in the entire traffic area under any traffic state (saturated state or unsaturated state) in the traffic area.
[0088] In one embodiment, Figure 2 As shown, a traffic signal control method is provided, which is described by taking the method applied to a control device in an intelligent traffic scenario as an example, and includes the following steps S101 to S105. Among them:
[0089] Step S101, based on the current traffic data and historical traffic data of each lane in the traffic area, a traffic flow model is used to determine the first exit flow of each lane at the current moment, and an attention mechanism is used to determine the second exit flow of each lane at the current moment.
[0090] In the application, the criterion for the control device to perform regional signal control is that all lanes in the traffic area satisfy the vehicle conservation law shown in the above formula (1). The control device first obtains the current traffic data and historical traffic data of each lane in the traffic area. The current traffic data refers to the traffic data of the lane at the current moment, and the historical traffic data refers to the traffic data of the lane at at least one historical moment. The traffic data includes the traffic status, travel time and outgoing flow of the lane. Then, for each lane, based on the current traffic data and historical traffic data of the lane, the traffic status of the lane at the current moment, the incoming vehicles at the current moment and the outgoing flow at the current moment are determined respectively.
[0091] In the application, the incoming flow of any lane in the traffic area is determined by the outgoing flow of all upstream lanes of the lane and the vehicle transfer rate of each upstream lane for the lane. The method for determining the outgoing flow of any lane in the traffic area at the current moment includes at least the following methods: a method based on the derivation of the traffic flow model and a prediction method based on the attention mechanism Transformer. For the sake of distinction, the outgoing flow obtained based on the traffic flow model derivation method can be called the first outgoing flow, and the outgoing flow obtained based on the attention mechanism Transformer prediction method can be called the second outgoing flow. The specific implementation steps for obtaining the first outgoing flow and the second outgoing flow will be described in detail later.
[0092] In the application, there are many sources of traffic data, which can be map data related to the traffic area, radar detection data, and signal control data in historical signal control schemes. The control equipment also performs data checks on traffic data from each source to remove various unreasonable interference data such as missing and repeated data.
[0093] Step S102: determining a predicted exit flow rate of each lane at a current moment based on each of the first exit flow rates and each of the second exit flow rates.
[0094] In the application, for each lane, the control device can determine the predicted exit flow of the lane at the current moment based on the first exit flow and the second exit flow in combination with the actual application scenario. For at least one lane associated with each intersection in the traffic area, an exit flow mark is configured, and the exit flow mark is used to indicate the acquisition method of the exit flow of the lane at the intersection, including the acquisition method based only on the first exit flow, the acquisition method based only on the second exit flow, and the acquisition method based on the combination of the first exit flow and the second exit flow. For example, Figure 1 The exit flow indicator of lane z can be {j 1 ,z,0} is the intersection j 1 The method for obtaining the exit flow of lane z at the current moment is determined only based on the first exit flow, {j 1 ,z,1} is the intersection j 1 The exit flow of lane z at the current moment is determined only based on the second exit flow, {j 1 ,z,2} is the intersection j 1 The exit flow of lane z at the current moment is determined jointly by the first exit flow and the second exit flow.
[0095] Step S103, based on the vehicle conservation law and each predicted exit flow, determining the predicted traffic state of each lane at a future time.
[0096] In the application, after the control device predicts the predicted exit flow of each lane in the traffic area at the current moment, since each lane obeys the vehicle conservation law when there are vehicles entering and exiting the upstream and downstream, the predicted traffic state of the lane at the future moment can be obtained based on the vehicle conservation law shown in the above formula (1) combined with the traffic state of each lane at the current moment, the entry flow at the current moment, and the predicted exit flow at the current moment.
[0097] Step S104, based on the preset adjustment target and each of the predicted traffic conditions, the travel time of each of the lanes is adjusted until a target travel time that meets the adjustment target is obtained.
[0098] In the application, the predicted traffic state of each lane in the traffic area constitutes the predicted area state of the traffic area at the future moment. Each predicted traffic state is associated with a travel time of the lane, and the predicted area state is associated with a travel time sequence. The change of the travel time of the lane is the decision variable that causes the change of the traffic state of the lane. Whether the value of the decision variable can make the traffic state of the lane meet the required target state can be determined by adjusting the target. The adjustment target is to adjust the value of the decision variable so that the value of the decision variable can ultimately make the traffic state of the lane meet the required target state. The adjustment target is usually expressed in the form of a mathematical function, which can be called an objective function.
[0099] In the application, different adjustment targets can be set for intelligent traffic scenarios according to actual needs, and based on the adjustment targets, the travel time of each lane in the traffic area is adjusted until the target travel time that meets the adjustment target is obtained. In the process of setting the adjustment target, in order to ensure that the value of the travel time is in line with the actual situation, constraints are usually added to the objective function corresponding to the adjustment target. The constraints include maximum travel time, minimum travel time, reasonable signal cycle, and barrier constraints. The travel time adjustment based on the adjustment target can ensure the balance of vehicle distribution in the entire traffic area for any traffic state (saturated or unsaturated) while ensuring that each lane in the traffic area does not overflow.
[0100] Step S105, controlling the passing time of the traffic lights of each lane to be the target passing time.
[0101] In the application, after obtaining the target travel time of each lane at a future moment, the control device obtains the traffic light associated with each lane, and controls the travel time of the traffic light to be the target travel time, so that the traffic status of the lanes in the traffic area is in a reasonable state at a future moment.
[0102] In this embodiment, the current traffic data and historical traffic data of each lane in the traffic area are integrated first, and the predicted exit flow of the lane is determined by applying the attention mechanism. It can accurately predict based on rich and comprehensive traffic data to obtain the predicted exit flow that conforms to the actual traffic situation; then the vehicle conservation law is used in combination with the predicted exit flow to determine the predicted traffic state at the future moment, and according to the preset adjustment target and the predicted traffic state, the lane travel time is adjusted until the target travel time that conforms to the adjustment target is obtained. Finally, traffic signal control is performed based on the target travel time. In this way, the accuracy of traffic signal control can be improved, thereby improving the traffic efficiency of the traffic area.
[0103] In one embodiment, Figure 3As shown, the implementation process of determining the second exit flow of the lane in step S101 includes the following steps S201 to S202:
[0104] Step S201, for each lane, the current traffic data of the lane is used as a query feature, and the historical traffic data of the lane is used as a key feature and a value feature, and an attention mechanism is processed at least once to obtain the weight of each historical traffic data of the lane.
[0105] In the application, for the current time k, the current traffic data of lane z can be expressed as {S z (k), a(k), r z (k)},S z (k) is the traffic status of the lane at time k (generally refers to the number of vehicles in the lane at time k), a(k) is the travel time of the lane at time k, r z (k) is the outgoing traffic volume of the lane at time k, and the prediction starts at r z (k) is zero (has not occurred yet). The historical traffic data includes traffic data of a preset number of historical moments, and the historical traffic data is represented by the following data sequence, namely {{S z (k-1), a(k-1), r z (k-1)},{S z (k-2), a(k-2), r z (k-2)},..., {S z (ku), a(ku), r z (ku)}},S z (ku) is the traffic status of lane z at time ku, a(ku) is the traffic duration of lane z at time ku, r z (ku) is the exit flow of lane z at time ku, u∈{1,2,…,k-1}.
[0106] For each lane, the control device fuses the lane’s current traffic data and historical traffic data based on the attention mechanism to predict the lane’s second exit flow rate r at the current moment. z (k). The essence of the processing based on the attention mechanism is to assign a suitable weight token to each historical traffic data according to the similarity between the historical traffic data and the current traffic data. The historical traffic data with high similarity is assigned a high weight, and the historical traffic data with low similarity is assigned a low weight. The weight represents the historical traffic data for the second exit flow r at the current moment. z The importance of (k) is calculated, and the weight is adjusted multiple times to finally obtain the target weight of the historical traffic data. Finally, the second outbound flow at the current moment is obtained based on the weight and the outbound flow in the historical traffic data. The current traffic data and the historical traffic data are shown in Table 1.
[0107] Table 1
[0108] time k k-1 k-2 …… ku <![CDATA[Traffic state S z > <![CDATA[S z (k)]]> <![CDATA[S z (k-1)]]> <![CDATA[S z (k-2)]]> …… <![CDATA[S z (to)]]> <![CDATA[Passage duration a z > a(k) a(k-1) a(k-2) …… a(ku) <![CDATA[Outflow rate r z > <![CDATA[r z (k)]]> <![CDATA[r z (k-1)]]> <![CDATA[r z (k-2)]]> …… <![CDATA[r z (to)]]> Weight <![CDATA[token k-1 ]]> <![CDATA[token k-2 ]]> …… <![CDATA[token k-u ]]>
[0109] Compared with the first acquisition method based on the traffic flow model mentioned above, the second acquisition method based on the attention mechanism can fully integrate the historical traffic data of the lane and accurately predict the exit flow at the current moment, so that the predicted exit flow can be more in line with the actual situation. At the same time, it can also provide highly accurate predicted exit flow for complex traffic scenarios.
[0110] In the process of performing attention mechanism processing on the current traffic data and historical traffic data of each lane, the control device extracts the current traffic features of the current traffic data and extracts the historical traffic features of the historical traffic data, wherein the traffic features at least include the traffic state represented by the number of vehicles, the lane's travel time, the lane's exit flow, etc. The current traffic features are used as the query features Query, and the historical traffic features of the historical traffic data are used as the key features Key and the value features Value, and the attention mechanism is processed at least once to obtain the weight of each piece of historical traffic data.
[0111] In the application, each attention mechanism processing process includes: determining the similarity between the query feature associated with the attention mechanism processing and each key feature; normalizing each similarity to obtain the weight of each historical traffic data; based on each weight, weighted summing the historical traffic data to obtain the feature output by the attention mechanism processing; the feature output by the attention mechanism processing is used to determine the query feature in the next attention mechanism processing process. Among them, the current traffic feature is used as the query feature Query during the first attention mechanism processing, and the historical traffic feature of the historical traffic data is used as the key feature Key and the value feature Value to obtain the weight of the historical traffic feature. The non-first attention mechanism processing uses the feature output by the previous attention mechanism processing as the new query feature for the current attention mechanism processing until convergence (such as the number of times reaches the preset threshold, or the weight of the historical traffic feature remains stable, etc.).
[0112] Step S202: performing weighted summation on each of the historical traffic data and the weight to obtain a second exit flow rate of the lane at the current moment.
[0113] In the application, the control device performs weighted summation of the historical traffic data and the corresponding weights of each lane to obtain the predicted exit flow of the lane at the current moment.
[0114] In this embodiment, by utilizing the combination of current traffic data and historical traffic data, different historical data are given corresponding weights after being processed by the attention mechanism, so as to more accurately predict the exit flow of the lane at the current moment, which can effectively improve the accuracy and timeliness of traffic flow prediction.
[0115] In one embodiment, Figure 4 As shown, the implementation process of determining the first exit flow of the lane in step S101 includes the following steps S301 to S302:
[0116] Step S301, based on the current traffic data and historical traffic data of each lane, determine the total travel time of each lane in the current signal cycle.
[0117] Step S302: determining the first exit flow of each lane at the current moment based on the saturated flow of each lane, the total travel time and the traffic flow model.
[0118] The traffic flow model is used to characterize the mapping relationship between the exit flow of the lane and the total travel time of the lane within any signal cycle.
[0119] In application, the traffic flow model is a mechanism model, which can be expressed by the following formula (2):
[0120]
[0121] In the above formula (2), T represents the signal period, which can be understood as the time interval between the green light starts to light up and the next time the green light lights up again. z represents the saturated flow rate of lane z, V z represents the phase set in which lane z has the right of way. Each lane corresponds to a phase, and a phase corresponds to at least one lane. j2,i (k) represents intersection j 2 The duration of the i-th phase (i.e. the duration of the green light), Represents the total travel time of lane z in signal cycle T.
[0122] In this embodiment, the lane exit flow is deduced based on the traffic flow model, which is calculated according to the saturated flow and travel time of the lane. It is a pure traffic mechanism model. The traffic mechanism model is usually a simplification of the actual traffic situation, has strong versatility, and can provide a method for quickly determining the lane exit flow in a simple intelligent traffic scenario.
[0123] In one embodiment, Figure 5 As shown, the implementation process of determining the first exit flow of the lane in step S101 includes the following steps S401 to S402:
[0124] Step S401 : obtaining a preset mapping relationship, wherein the preset mapping relationship represents a relationship between a first exit flow rate, a second exit flow rate, and a target exit flow rate of a lane.
[0125] The preset mapping relationship includes a first sub-relationship based on the first outgoing flow, a second sub-relationship based on the second outgoing flow, and a third sub-relationship determined based on the first outgoing flow and the second outgoing flow.
[0126] In the application, the control device can perform corresponding processing on the first exit flow and the second exit flow corresponding to each lane through a preset mapping relationship to determine the target exit flow of each lane at the current moment. The preset mapping relationship indicates the relationship between the first exit flow, the second exit flow and the predicted exit flow. The preset mapping relationship can be a linear relationship or a non-linear relationship. The embodiment of the present application does not limit the specific form of the preset mapping relationship. In the application, the control device can select a suitable sub-relationship from the first sub-relationship, the second sub-relationship and the third sub-relationship included in the preset mapping relationship according to the actual situation.
[0127] Exemplarily, the preset mapping relationship is shown in the following formula (3):
[0128]
[0129] Among them, r z (k) The predicted exit flow of lane z at time k, r z1 (k) is the first outgoing flow at time k, r z2 (k) is the second outgoing flow at time k, w 1 For r z1 The weight of (k), w 2 For r z2 The weight of (k) is the weight of .
[0130] Step S402: determining the predicted exit flow of each lane at the current moment based on the preset mapping relationship, the first exit flow of each lane, and the second exit flow of each lane.
[0131] In an application, the control device substitutes the first exit flow and the second exit flow of each lane into the preset mapping relationship to determine the predicted exit flow of the lane at the current moment.
[0132] In one embodiment, Figure 6 As shown, the implementation process of the second exit flow in step S101 may further include the following steps S501 to S502:
[0133] Step S501, obtaining a dynamic environment model based on an attention mechanism, wherein the dynamic environment is trained based on traffic data samples of the traffic area, and the label of the traffic data sample is the exit flow of the lane.
[0134] In the application, the prediction process of the outgoing flow based on the attention mechanism can also be implemented by pre-training an artificial intelligence model based on the attention mechanism. The artificial intelligence model based on the attention mechanism can be called a dynamic environment model. The dynamic environment model can essentially predict the state after the action is executed based on the current state of the environment and the action to be performed. The dynamic environment model applicable to the field of intelligent transportation can predict the predicted area state of the traffic area after the lane's travel time is adjusted based on the current area state of the traffic area and the adjustment operations to be performed on the travel time of each lane. In order to improve the accuracy of the outgoing flow for the lane, a dynamic environment model applicable to the field of intelligent transportation can be trained in combination with the attention mechanism.
[0135] The dynamic environment model based on the attention mechanism is obtained by performing a specified round of training based on the traffic data samples of the traffic area. A single traffic data sample includes the traffic data of any lane at a specific time and a preset number of historical traffic data before the specific time. The traffic data includes traffic status, travel time, and outbound flow at a specific time. The control device performs a specified round of training on the dynamic environment model to be trained based on the traffic data samples to obtain a trained dynamic environment model. Each round of training is an adjustment of the weight of the historical traffic data, and appropriate weights are assigned to different historical traffic data. The traffic data is integrated to obtain the predicted outbound flow of the traffic data sample at a specific time. The label of the traffic data sample is the outbound flow at a specific time (the outbound flow as a label can be the real outbound flow or the virtual outbound flow derived from the real traffic data). The control device determines the difference between the label of the traffic data sample and the predicted result of the dynamic environment model (the predicted outbound flow for the sample), and updates the model parameters of the dynamic environment model to be trained based on the difference to obtain the trained dynamic environment model.
[0136] Step S502: predicting the current traffic data and historical traffic data of each lane through the dynamic environment model to obtain the second exit flow of each lane at the current moment.
[0137] In the application, the control device obtains the trained dynamic environment model, and for each lane in the traffic area, uses the current traffic data and historical traffic data of the targeted lane as input information of the dynamic environment model, performs at least one attention mechanism processing operation through the dynamic environment model, and predicts the predicted exit flow of the targeted lane at the current moment.
[0138] In the application, the control device preprocesses the current traffic data and historical traffic data of the lane to obtain three different time series. Specifically, taking the current time as time k, the current traffic data of lane z includes the traffic state S at time k z (k), the travel time a(k) of lane z at time k, and the predicted number of exits of lane Z at time k r z (k). Before making a prediction, r z (k) is zero. The historical traffic data includes the traffic data of u consecutive moments before time k, that is, the traffic status S at time (ku) z The travel time a(ku) of lane z at time (ku) and the historical number of exits of lane z at time ku r z The control device preprocesses the current traffic data and historical traffic data to obtain the traffic state sequence of lane z {S z (k), S z (k-1), S z (k-2), ..., S z (ku)}, the travel time sequence (k), a(k-1), a(k-2), ..., a(ku) and the exit flow sequence {r z (k), r z (k-1), r z (k-2), ..., r z (ku)}, where the outbound flow rate at the current moment before the prediction begins is r z (k) is zero. The control device inputs the above three time series of lane Z into the dynamic environment model for multiple attention mechanism processing to obtain the predicted exit flow, i.e., r z (k).
[0139] For example, Figure 7 The processing flow based on the dynamic environment model shown in FIG. 1 inputs the current traffic data and historical traffic data of the lane at time k into the trained dynamic environment model, performs attention mechanism processing, and outputs the predicted exit flow of the lane at time k.
[0140] In this embodiment, a dynamic environment model obtained through training based on the attention mechanism is used to predict the current and historical traffic data of the lane, thereby obtaining the predicted exit flow of each lane at the current moment. This method can more accurately reflect the actual traffic conditions and improve the accuracy and reliability of traffic prediction.
[0141] In one embodiment, Figure 8 As shown, the implementation process of the method for obtaining traffic data samples for training a dynamic environment model includes the following steps S601 to S604. Among them:
[0142] Step S601, obtaining real sample data of each lane, wherein the label of the real sample data is the real exit flow of the lane.
[0143] In the application, the source of the traffic data samples of the dynamic environment model to be trained can be real sample data, and the source of the real sample data can be map data related to the traffic area, radar detection data and historical signal control schemes. The label of the real sample data is the real exit flow of the lane.
[0144] Step S602, for the traffic status and travel time in each of the real sample data, based on the traffic flow model, determine the virtual exit flow of each of the real sample data, and the traffic flow model is used to determine the exit flow of the lane.
[0145] In applications, the control device can use a preset derivation method to derive more virtual sample data in combination with real sample data to increase the number of training samples of the dynamic environment model, thereby increasing the accuracy of the trained model.
[0146] The preset derivation method may be determined based on the traffic flow model shown in the aforementioned formula (2). Based on the aforementioned traffic flow model, the virtual exit flow corresponding to each real sample data may be calculated.
[0147] Step S603: construct virtual sample data based on each of the real sample data and each of the virtual exit flows, wherein the label of the virtual sample data is the virtual exit flow.
[0148] In the application, the control device combines the traffic status and travel time of the lane in the real sample data and the virtual exit flow of the real sample data to generate virtual sample data, and marks the virtual exit flow as a label of the virtual sample data.
[0149] Step S604: Using the virtual sample data and the real sample data as traffic data samples for training the dynamic environment model.
[0150] In the application, real sample data and virtual sample data derived from the real sample data are used as traffic data samples for training the dynamic environment model to train the dynamic environment model, thereby obtaining a dynamic environment model with stronger generalization ability.
[0151] For example, Fig. 9The traffic data sample acquisition process shown in the figure collects traffic data in the traffic area and constructs real sample data (including lane traffic status, travel time, and real outbound flow), with the label being the real outbound flow. Virtual sample data is derived by combining the traffic mechanism model with the real sample data, with the label being the virtual outbound flow derived from the traffic mechanism model. The dynamic environment model is trained using the real sample data and the virtual sample data.
[0152] In this embodiment, the traffic flow model is used to enhance the real data collected on site, which solves the problem of insufficient generalization of the model after offline training due to insufficient on-site data. Compared with using only real on-site data, the model accuracy of the dynamic environment model obtained by training can be greatly improved.
[0153] In one embodiment, Fig.10 As shown, the implementation process of step S103 includes the following steps S701 to S703. Among them:
[0154] Step S701, obtaining the current traffic status of each lane and the current incoming flow of each lane.
[0155] In the application, when there are vehicles entering and exiting the upstream and downstream of each lane, the number of vehicles is conserved, which complies with the vehicle conservation law shown in the above formula (1). Based on the vehicle conservation law, when the control device obtains the predicted traffic state of the lane at a future time, it is necessary to first obtain the current traffic state of the lane, the current incoming flow of the lane, and the current predicted outgoing flow of the lane. Among them, the current traffic state of the lane can refer to the number of vehicles on the lane at the current moment. The current incoming flow of the lane can be determined based on an acquisition method adapted to the lane type, and the lane type includes at least an inner lane and an outer lane. Different lane types have different ways of acquiring the current incoming flow of the lane.
[0156] Step S702: According to the law of conservation of vehicles, for each lane, the difference between the current incoming flow rate and the predicted outgoing flow rate of the lane is determined to obtain the vehicle increment of the lane.
[0157] In the application, the control device determines the vehicle increment of each lane at the current moment according to the above vehicle conservation law. The vehicle increment may be the difference between the current incoming flow of the lane and the predicted outgoing flow of the lane.
[0158] Step S703, summing the current traffic state of the lane and the vehicle increment, and using the summation result as the predicted traffic state of the lane at a future moment.
[0159] In the application, the current traffic state of the lane is the initial number of vehicles on the lane at the current moment. The control device determines to use the sum of the current traffic state and the vehicle increment as the predicted traffic state of the lane at a future moment.
[0160] In this embodiment, by obtaining the current traffic status and incoming flow of the lane and using the vehicle conservation law to calculate the vehicle increment in the lane, the traffic status at future moments is predicted, which helps to evaluate and predict traffic conditions in real time and improve the efficiency and accuracy of traffic management and scheduling.
[0161] In one embodiment, Fig.11 As shown, the process of obtaining the current inflow flow of each lane in step S701 includes the following steps S801 to S802. Among them:
[0162] Step S801, obtaining the lane type of each lane, wherein the lane type includes an inner lane and an outer lane, wherein the inner lane is a lane located between two adjacent intersections in a traffic area, and the outer lane is not a lane located between two adjacent intersections in a traffic area.
[0163] In the application, the method for obtaining the lane entry flow in the above formula (1) is related to the lane type. Different lane types have different methods for obtaining the lane entry flow. The lane types of the traffic area may include at least an inner lane and an outer lane. The inner lane refers to the lane located between two adjacent intersections in the traffic area, and the outer lane is not the lane located between two adjacent intersections.
[0164] like Figure 1 As shown in , lane z is located between two adjacent intersections and belongs to the inner lane, and lanes w1, w2, etc. are not located between two adjacent intersections and belong to the outer lanes.
[0165] Step S802: acquiring the current incoming flow of each lane based on the acquisition method adapted for each lane type.
[0166] In the application, different lane types use different ways to obtain the lane entry flow. The control device determines the lane type and then uses the acquisition method adapted to the lane type to obtain the current lane entry flow. Among them, the acquisition method adapted to the inner lane is determined based on the vehicle transfer rate of the upstream lane, and the acquisition method adapted to the outer lane is determined based on the historical lane entry flow.
[0167] In the application, if the lane type is a peripheral lane, the current entry flow of the lane can be obtained in the following ways: obtain multiple historical entry flows of the lane within a historical time range; determine the current entry flow of the lane based on the multiple historical entry flows of the lane. Specifically, the control device can select the historical entry flows corresponding to multiple different travel times within the most recent specified historical time range. The specified time range can be the most recent specified number of sampling time points, such as q z (k-1),q z (k-2), ..., q z (km), etc. The control device performs statistical analysis on multiple historical entry flows to obtain the current entry flow of the lane, wherein the statistical analysis method includes calculating the mean, variance, median, etc.
[0168] In this embodiment, by distinguishing between inner lanes and outer lanes in the traffic area and using corresponding data acquisition methods for different types of lanes to collect current incoming traffic information, it is possible to more accurately adapt to the characteristics of different lanes, thereby improving the accuracy and efficiency of traffic flow monitoring.
[0169] In one embodiment, Fig.12 As shown, the lane type is an internal lane, and the implementation process of step S802 includes the following steps S901 to S903. Among them:
[0170] Step S901, obtaining a lane transfer matrix of the traffic area, wherein the elements in the lane transfer matrix represent vehicle transfer rates between lanes having an upstream and downstream relationship.
[0171] In the application, the traffic area corresponds to a lane transfer matrix, which is used to record the transfer rates of all vehicles with upstream and downstream relationships in the traffic area. A single element in the lane transfer matrix represents the transfer rates of two lanes with upstream and downstream relationships, that is, the lane transfer rate of the upstream lane of the lane for the lane. The lane transfer matrix is updated in real time. The lane transfer rate refers to the ratio of the number of vehicles in the upstream lane of any lane heading to the lane to the outgoing flow of the upstream lane.
[0172] For example, Figure 1 As shown, taking lane z as an example, intersection j 1 is the upstream intersection of lane z, intersection j 1 Lane w1, lane w2, and lane w3 at the intersection are all upstream lanes of lane z (vehicles in lane w1 can choose to drive straight into lane z or turn right into other lanes when they have the right of way; vehicles in lane w2 can choose to turn right into lane z or drive straight into other lanes when they have the right of way; vehicles in lane w3 must drive into lane z when they have the right of way). 2is the downstream intersection of lane z, and vehicles in lane z can only turn left when they have the right of way. For each internal lane, the inbound flow of the lane is related to the vehicle transfer rate of the associated upstream lane for the lane.
[0173] Step S902: determining the upstream lane of each lane and the target vehicle transfer rate of each upstream lane based on the lane transfer matrix.
[0174] In the application, for a designated lane, the control device first obtains at least one upstream lane of each designated lane, and reads the target vehicle transfer rate of each upstream lane for the designated lane from the lane transfer matrix.
[0175] Step S903: determining the current incoming flow rate of each lane based on the number of vehicles in each upstream lane and the transfer rate of each target vehicle.
[0176] In the application, the control device processes the current number of vehicles in each upstream lane of the designated lane and the target vehicle transfer rate of each upstream lane for the designated lane to obtain the current incoming flow of each lane in the traffic area. The processing may be to multiply the current number of vehicles in the upstream lane by the corresponding target transfer rate to obtain the partial incoming flow of each upstream lane for the designated lane. If there are multiple upstream lanes, the weighted sum of the multiple partial use flows may be performed to obtain the current incoming flow of the corresponding lane.
[0177] For example, continue to refer to Figure 1 , use r w1 (k), r w2 (k), r w3 (k) represents the outgoing flow of lanes w1-w3 upstream of lane z at time k, τ w1,z , τ w2,z , τ w3,z represents the vehicle transfer rate from upstream lane w1-upstream lane w3 to lane z, then the entry flow rate of lane z Q z The calculation formula of (k) is: z (k) = τ w1,z × w1 (k)+τ w2,z × w2 (k)+τ w3,z × w3 (k).
[0178] In this embodiment, by obtaining and using the lane transfer matrix to characterize the vehicle transfer rate between the upstream and downstream lanes, the upstream lane of each lane and its target vehicle transfer rate can be accurately determined, and then the current incoming flow of each lane can be calculated according to the number of vehicles and the transfer rate of the upstream lane, thereby improving the accuracy of the current incoming flow prediction.
[0179] In one embodiment, Fig.13 As shown, the implementation process of creating a lane transfer matrix includes the following steps S1001 to S1004. Among them:
[0180] Step S1001: for each lane in the traffic area, determine an upstream lane associated with the lane.
[0181] In the application, the control device obtains the upstream and downstream relationship between lanes in the traffic area, thereby determining the upstream lane associated with each lane.
[0182] like Figure 1 As shown, taking lane z as an example, intersection j 1 is the upstream intersection of lane z, intersection j 1 Lane w1, lane w2, and lane w3 at are all upstream lanes of lane z.
[0183] Step S1002, based on the historical traffic data of the targeted lane, determine multiple historical lane transfer rates of each upstream lane relative to the targeted lane, and the historical lane transfer rate is the ratio of the incoming flow from the upstream lane at a specified historical moment to the incoming flow of the targeted lane at the historical moment.
[0184] In an application, the control device determines a plurality of historical lane transfer rates for each upstream lane according to the historical incoming flow rate included in the historical traffic data of the lane and the historical outgoing flow rate of each upstream lane.
[0185] like Figure 1 As shown, the control device reads the historical outgoing flow y of lane w1 upstream of lane z at five historical moments, and determines the number of vehicles v entering lane z from lane w1 at the corresponding historical moment from the historical incoming flow of lane z at the corresponding historical moment. The ratio of the number of vehicles v to the historical outgoing flow y of lane w1 is the historical lane shift rate of lane w1 relative to lane z at the historical moment. After reading five historical moments, the five historical lane shift rates of lane w1 relative to lane z are determined.
[0186] Step S1003: determining a target lane shift rate of each upstream lane relative to the targeted lane at the current moment based on each of the historical lane shift rates.
[0187] In the application, for each upstream lane, the associated historical lane shift rates are counted, and the obtained statistical value is used as the target lane shift rate of the upstream lane relative to the lane at the current moment. The specific implementation of the statistics can be to perform weighted averaging, median, etc. on each historical lane shift rate. For example, the weighted averaging of the above five historical lane shift rates is performed to obtain the target lane shift rate of the upstream lane w1 relative to the lane z at the current moment.
[0188] Step S1004: constructing a lane transfer matrix of the traffic area based on the target lane transfer rate of each lane in the traffic area.
[0189] In the application, the target lane transfer rates of all lanes in the traffic area at the current moment are represented in the form of a matrix, that is, the lane transfer matrix of the traffic area at the current moment can be constructed.
[0190] For example, assuming that there are 10 lanes in the traffic area, a 10×10 lane transfer matrix can be constructed, and each element τ of the lane transfer matrix m,n The value of represents the lane transfer rate between the mth lane and the nth lane. Positive and negative numbers can be used to represent the upstream and downstream relationship between the two lanes. m, n are both positive integers and m, n∈[1,10]. If τ m,n >0 indicates that lane m is the upstream lane of lane n and the transfer rate is τ m,n , if τ m,n <0, it indicates that lane n is the upstream lane of lane m and the transfer rate is |τ m,n |, if τ m,n =0, it can indicate that there is no upstream or downstream relationship between lane m and lane n.
[0191] In this embodiment, by analyzing historical traffic data, the vehicle transfer situation between lanes at a certain moment in the future can be predicted more accurately, thereby improving the accuracy of traffic flow prediction.
[0192] In one embodiment, Fig.14 As shown, the implementation process of the control device preprocessing the traffic data includes the following steps S1101 to S1102. Among them:
[0193] Step S1101, obtaining the traffic state threshold, travel time threshold and exit flow threshold of the lanes in the traffic area.
[0194] In the application, the control device can normalize the acquired raw traffic data of each lane so that data with the same attribute can be mapped to a specific space, thereby reducing the differences between the data. Based on this, the control device obtains a threshold value for normalization associated with each attribute in the traffic data of the lane, and performs a normalization operation on the corresponding attribute value of the traffic data based on the threshold value.
[0195] In the application, the control device obtains the traffic status threshold, the travel time threshold and the exit flow threshold, wherein the traffic status threshold can be a preset value or the historical maximum value of the traffic status in the traffic area, the travel time threshold can be a preset value and can be the maximum value of the travel time in the traffic area, and the exit flow threshold can be a preset value or the historical maximum value of the exit flow in the traffic area. The embodiment of the present application does not limit the setting method of the above thresholds.
[0196] Step S1102, based on the traffic state threshold, travel time threshold and exit flow threshold, the traffic state, travel time and exit flow in the original traffic data of each lane are normalized respectively to obtain the current traffic data and historical traffic data of each lane, wherein the original traffic data includes the original current traffic data and the original historical traffic data.
[0197] In the application, the control device obtains the original traffic data of each lane, which includes the original current traffic data and the original historical traffic data. The control device normalizes the traffic state, travel time and exit flow in each traffic data through the traffic state threshold, travel time threshold and exit flow threshold, and obtains the current traffic data and historical traffic data for exit flow prediction. The result of normalization is to normalize each data to between [0,1], thereby reducing the difference between the data.
[0198] In this embodiment, by setting thresholds for the traffic status, travel time and exit flow of lanes in the traffic area, and normalizing the original traffic data of the lanes based on these thresholds, standardized current and historical traffic data can be obtained, which helps to more accurately analyze and manage traffic conditions.
[0199] In one embodiment, the adjustment target includes a first target or a second target; wherein, the first target is to minimize the maximum queuing ratio of each lane in the traffic area, and the second target is to minimize the variance of the queuing ratios between the lanes in the traffic area, and the queuing ratio is the ratio of the lane queuing length to the lane length. The adjustment operation on the travel time of each lane based on the first target or the second target makes the vehicles in each lane in the traffic area evenly distributed without overflow of vehicles.
[0200] In the application, the adjustment target is used to adjust the travel time of each lane, that is, the control device adjusts the travel time of each lane in the traffic area so that the regional state of the traffic area when the signal control is performed based on the adjusted travel time meets the requirements of the adjustment target. The adjustment target may include at least a first target or a second target, wherein the first target is to minimize the maximum queue ratio of each lane in the traffic area, and the second target may be to minimize the variance of the queue ratios between the lanes in the traffic area. The queue ratio of each lane is determined based on the ratio of the queue length of the lane to the lane length, and the size of the queue ratio is between 0 and 1.
[0201] In application, the adjustment target can be represented in the form of a mathematical function. The objective function of the first target can be represented by formula (4-1) and formula (4-2) as shown below:
[0202]
[0203] In the above formula (4-1), since the traffic area may contain multiple road sections, each road section includes multiple lanes, so n is used to represent the nth road section, I n represents the set of lanes on road segment n, l n represents the length of lane n, represents the length of the vehicle queue in lane i. The number of vehicles in each lane in the area at each time can be obtained based on the lane travel time under different values. For each adjustment of the travel time, a travel time set corresponding to the traffic area will be obtained, and the travel time set stores the travel time of each lane in the traffic area after each adjustment.
[0204] After determining the queuing ratio based on the traffic status of each lane in the traffic area, the travel time value of each lane can be adjusted in reverse, and then the queuing ratio of each lane can be calculated based on the adjusted travel time value, and the adjustment can be repeated until the minimum maximum queuing ratio is obtained. For each travel time set, the maximum queuing ratio is obtained. If there are d travel time sets, d maximum queuing ratios are obtained, and the travel time set corresponding to the minimum queuing ratio is selected from the d maximum queuing ratios as the target travel time set corresponding to the traffic area. The target travel time set records the target travel time of each lane.
[0205] In the application, the objective function of the second objective can be represented by the following formula (5):
[0206]
[0207] In the above formula (5), T is the total control time or the indicator statistical time interval (for example, the time interval is 5 minutes), N is the total number of road sections in the traffic area, is the vehicle queue density of the road section, is the average vehicle queue density, and σ is the queue ratio variance.
[0208] After determining the queuing ratio variance based on the traffic status of each lane in the traffic area, the travel time value of each lane can be adjusted in reverse, and then the queuing ratio of each lane can be calculated based on the adjusted travel time value, and the adjustment is repeated until the minimum queuing ratio variance is obtained.
[0209] In this embodiment, by using the minimum variance of the queuing ratios of each lane in the area as the optimization objective function, the vehicle distribution in the area can be made more balanced, the number of queuing vehicles in each lane can be closer, the carrying capacity of each lane can be fully utilized, the traffic conditions in the area can be optimized, and congestion can be reduced.
[0210] The present application also provides a traffic signal control device for executing the steps in the above traffic signal control method embodiment. Fig.15 As shown, the traffic signal control device 1500 provided in the embodiment of the present application includes:
[0211] The first determination module 1510 is used to determine the first exit flow of each lane at the current moment by using a traffic flow model based on the current traffic data and historical traffic data of each lane in the traffic area, and to determine the second exit flow of each lane at the current moment by processing through an attention mechanism.
[0212] The prediction module 1520 determines the predicted exit flow of each lane at the current moment based on each of the first exit flow and each of the second exit flow.
[0213] The second determination module 1530 is used to determine the predicted traffic state of each lane at a future moment based on the vehicle conservation law and each predicted exit flow.
[0214] The adjustment module 1540 is used to adjust the travel time of each lane based on a preset adjustment target and each predicted traffic state until a target travel time that meets the adjustment target is obtained.
[0215] The control module 1550 is used to control the passing time of the traffic lights of each lane to be the target passing time.
[0216] In one embodiment, the first determination module is also used to, for each lane, use the current traffic data of the lane as a query feature, and use the historical traffic data of the lane as a key feature and a value feature, perform at least one attention mechanism processing to obtain the weight of each historical traffic data of the lane; perform weighted summation on each historical traffic data and the weight to obtain the second exit flow of the lane at the current moment.
[0217] In one embodiment, the first determination module is also used to obtain a dynamic environment model based on an attention mechanism, wherein the dynamic environment is trained based on traffic data samples of the traffic area, and the label of the traffic data sample is the exit flow of the lane; through the dynamic environment model, the current traffic data and historical traffic data of each lane are predicted to obtain the second exit flow of each lane at the current moment.
[0218] In one embodiment, the first determination module is further used to obtain real sample data of each lane, and the label of the real sample data is the real exit flow of the lane; based on the traffic flow model, the virtual exit flow of each real sample data is determined according to the traffic status and travel time in each real sample data, and the traffic flow model is used to determine the exit flow of the lane; based on each real sample data and each virtual exit flow, virtual sample data is constructed, and the label of the virtual sample data is the virtual exit flow; the virtual sample data and the real sample data are used as traffic data samples for training the dynamic environment model.
[0219] In one embodiment, the first determination module is further used to determine the total travel time of each lane in the current signal cycle based on the current traffic data and historical traffic data of each lane; based on the saturated flow of each lane, the total travel time and the traffic flow model, determine the first exit flow of each lane at the current moment; wherein the traffic flow model is used to characterize the mapping relationship between the exit flow of the lane and the total travel time of the lane in any signal cycle.
[0220] In one embodiment, the prediction module is further used to obtain a preset mapping relationship, which represents the relationship between the first exit flow, the second exit flow and the target exit flow of the lane; based on the preset mapping relationship, the first exit flow of each lane and the second exit flow of each lane, the predicted exit flow of each lane at the current moment is determined; wherein the preset mapping relationship includes a first sub-relationship based on the first exit flow, a second sub-relationship based on the second exit flow, and a third sub-relationship determined jointly based on the first exit flow and the second exit flow.
[0221] In one embodiment, the second determination module is further used to obtain the current traffic status of each lane and the current incoming flow of each lane; according to the vehicle conservation law, for each lane, determine the difference between the current incoming flow and the predicted outgoing flow of the lane to obtain the vehicle increment of the lane; sum the current traffic status of the lane and the vehicle increment, and use the sum result as the predicted traffic status of the lane at the future moment.
[0222] In one embodiment, the second determination module is also used to obtain the lane type of each lane, and the lane type includes an inner lane and an outer lane. The inner lane is a lane located between two adjacent intersections in the traffic area, and the outer lane is not a lane located between two adjacent intersections in the traffic area; based on the acquisition method adapted for each lane type, the current incoming traffic flow of each lane is obtained.
[0223] In one embodiment, the lane type is an internal lane, and the second determination module is further used to obtain a lane transfer matrix of the traffic area, wherein the elements in the lane transfer matrix represent vehicle transfer rates between lanes having upstream and downstream relationships; based on the lane transfer matrix, the upstream lane of each lane and the target vehicle transfer rate of each upstream lane are determined; based on the number of vehicles in each upstream lane and each target vehicle transfer rate, the current incoming flow of each lane is determined.
[0224] In one embodiment, the first determination module is also used to obtain the traffic status threshold, travel time threshold and exit flow threshold of the lanes in the traffic area; based on the traffic status threshold, travel time threshold and exit flow threshold, the traffic status, travel time and exit flow in the original traffic data of each lane are normalized respectively to obtain the current traffic data and historical traffic data of each lane; wherein the original traffic data includes the original current traffic data and the original historical traffic data of the lane.
[0225] In one embodiment, the adjustment target includes a first target or a second target; wherein the first target is to minimize the maximum queuing ratio of each lane in the traffic area, and the second target is to minimize the variance of the queuing ratios between the lanes in the traffic area, and the queuing ratio is the ratio of the lane queuing length to the lane length.
[0226] In applications, each module in the traffic signal control device may be a software program module, or may be implemented by different logic circuits integrated in a processor, or may be implemented by multiple distributed processors.
[0227] Fig.16 A schematic diagram of the structure of a control device for implementing a traffic signal control method provided in an embodiment of the present application. Fig.16 As shown, the control device 1600 of this embodiment includes: at least one processor 1610 ( Fig.16 Only one is shown in the figure) a processor, a memory 1620, and a computer program 1630 stored in the memory 1620 and executable on the at least one processor 1610, wherein the processor 1610 implements the steps of any of the above-mentioned event detection method embodiments when executing the computer program 1630.
[0228] The control device 1600 may include, but is not limited to, a processor 1610 and a memory 1620. Those skilled in the art will appreciate that Fig.16 This is merely an example of the control device 1600 and does not constitute a limitation on the control device 1600 . The control device 1600 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0229] The processor 1610 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0230] In some embodiments, the memory 1620 may be an internal storage unit of the control device 1600, such as a hard disk or memory of the control device 1600. In other embodiments, the memory 1620 may also be an external storage device of the control device 1600, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the control device 1600. Further, the memory 1620 may also include both an internal storage unit of the control device 1600 and an external storage device. The memory 1620 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 1620 may also be used to temporarily store data that has been output or is to be output.
[0231] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0232] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0233] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0234] An embodiment of the present application provides a computer program product. When the computer program product runs on a control device, the control device can implement the steps in the above-mentioned method embodiments when the computer program product is executed.
[0235] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the control device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0236] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0237] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0238] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0239] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0240] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A traffic signal control method, characterized in that: include: Based on the current traffic data and historical traffic data of each lane in the traffic area, a traffic flow model is used to determine the first exit flow of each lane at the current moment, and an attention mechanism is used to determine the second exit flow of each lane at the current moment; Determining a predicted exit flow rate of each lane at a current moment based on each of the first exit flows and each of the second exit flows; Determining the predicted traffic state of each lane at a future time based on the vehicle conservation law and each predicted exit flow; Based on a preset adjustment target and each of the predicted traffic conditions, adjusting the travel time of each of the lanes until a target travel time that meets the adjustment target is obtained; The duration of the traffic lights controlling each of the lanes is the target duration of the traffic.
2. The traffic signal control method according to claim 1, characterized in that: Based on the current traffic data and historical traffic data of each lane in the traffic area, the second exit flow of each lane at the current moment is determined by attention mechanism processing, including: For each lane, the current traffic data of the lane is used as a query feature, and the historical traffic data of the lane is used as a key feature and a value feature, and an attention mechanism is processed at least once to obtain a weight of each historical traffic data of the lane; A weighted sum is performed on each of the historical traffic data and the weight to obtain the second exit flow of the lane at the current moment.
3. The traffic signal control method according to claim 1, characterized in that: Based on the current traffic data and historical traffic data of each lane, determining the second exit flow of each lane at the current moment through attention mechanism processing includes: Acquire a dynamic environment model based on an attention mechanism, wherein the dynamic environment is trained based on traffic data samples of the traffic area, and the labels of the traffic data samples are the outgoing flow of the lane; The current traffic data and historical traffic data of each lane are predicted by the dynamic environment model to obtain the second exit flow of each lane at the current moment.
4. The traffic signal control method according to claim 3, characterized in that: The method further comprises: Acquire real sample data of each lane, where the label of the real sample data is the real exit flow of the lane; Determine the virtual exit flow of each of the real sample data based on the traffic state and travel time in each of the real sample data and the traffic flow model; Based on each of the real sample data and each of the virtual exit flows, construct virtual sample data, wherein the label of the virtual sample data is the virtual exit flow; The virtual sample data and the real sample data are used as traffic data samples for training the dynamic environment model.
5. The traffic signal control method according to claim 1, characterized in that: Based on the current traffic data and historical traffic data of each lane, a traffic flow model is used to determine the first exit flow of each lane at the current moment, including: Determine the total travel time of each lane in the current signal cycle based on the current traffic data and historical traffic data of each lane; Determine the first exit flow of each lane at the current moment based on the saturated flow of each lane, the total travel time of each lane, and the traffic flow model; The traffic flow model is used to characterize the mapping relationship between the exit flow of the lane and the total travel time of the lane within any signal cycle.
6. The traffic signal control method according to claim 1, characterized in that: The determining, based on each of the first exit flows and each of the second exit flows, a predicted exit flow of each of the lanes at the current moment includes: Acquire a preset mapping relationship, where the preset mapping relationship represents a relationship between a first exit flow rate, a second exit flow rate, and a target exit flow rate of a lane; Determine the predicted exit flow of each lane at the current moment based on the preset mapping relationship, the first exit flow of each lane, and the second exit flow of each lane; The preset mapping relationship includes a first sub-relationship based on the first outgoing flow, a second sub-relationship based on the second outgoing flow, and a third sub-relationship determined based on the first outgoing flow and the second outgoing flow.
7. The traffic signal control method according to claim 1, characterized in that: The step of determining the predicted traffic state of each lane at a future time based on the vehicle conservation law and each predicted exit flow rate includes: Obtaining the current traffic status of each lane and the current traffic flow of each lane; According to the law of conservation of vehicles, for each lane, a difference between a current incoming flow rate and a predicted outgoing flow rate of the lane is determined to obtain a vehicle increment of the lane; The current traffic state of the lane and the vehicle increment are summed, and the sum result is used as the predicted traffic state of the lane at a future moment.
8. The traffic signal control method according to claim 7, characterized in that: Get the current inbound traffic of each lane, including: Acquire a lane type of each lane, wherein the lane type includes an inner lane and an outer lane, wherein the inner lane is a lane located between two adjacent intersections in a traffic area, and the outer lane is not a lane located between two adjacent intersections in a traffic area; Based on the acquisition method adapted for each lane type, the current incoming flow rate of each lane is acquired.
9. The traffic signal control method according to claim 8, characterized in that: The lane type is an internal lane, and the acquisition method based on the adaptation of each lane type, acquiring the current incoming traffic of each lane, includes: Acquire a lane transfer matrix of the traffic area, wherein elements in the lane transfer matrix represent vehicle transfer rates between lanes having an upstream and downstream relationship; Based on the lane transfer matrix, determining an upstream lane of each lane and a target vehicle transfer rate of each upstream lane; Based on the number of vehicles in each of the upstream lanes and the transfer rate of each of the target vehicles, the current incoming flow rate of each of the lanes is determined.
10. The traffic signal control method according to claim 9, characterized in that: Before acquiring the lane transfer matrix of the traffic area, the method includes: For each lane in the traffic area, determining an upstream lane associated with the lane; Determine, based on historical traffic data of the targeted lane, a plurality of historical lane shift rates of each of the upstream lanes relative to the targeted lane, the historical lane shift rate being a ratio of an incoming flow from the upstream lane at a specified historical moment to an incoming flow of the targeted lane at the historical moment; Determining a target lane shift rate of each upstream lane relative to the targeted lane drill at the current moment based on each of the historical lane shift rates; A lane transfer matrix of the traffic area is constructed based on the target lane transfer rate of each lane in the traffic area.
11. The traffic signal control method according to claim 1, characterized in that: The method further comprises: Obtaining a traffic state threshold, a travel time threshold, and an exit flow threshold for lanes in the traffic area; Based on the traffic state threshold, the travel time threshold and the exit flow threshold, the traffic state, the travel time and the exit flow in the original traffic data of each lane are normalized to obtain the current traffic data and the historical traffic data of each lane; The original traffic data includes the original current traffic data and the original historical traffic data of the lane.
12. The traffic signal control method according to any one of claims 1 to 11, characterized in that: The adjustment target includes a first target or a second target; Among them, the first goal is to minimize the maximum queuing ratio of each lane in the traffic area, the second goal is to minimize the variance of the queuing ratios between the lanes in the traffic area, the queuing ratio is the ratio of the lane queue length to the lane length, and the adjustment operation on the travel time of each lane based on the first goal or the second goal makes the vehicles in each lane in the traffic area evenly distributed without overflow of vehicles.
13. A control device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Traffic signal control method and system, electronic equipment and storage medium
CN120319047A