CN115294762A - An adaptive traffic control method based on TinyML - Google Patents
An adaptive traffic control method based on TinyML Download PDFInfo
- Publication number
- CN115294762A CN115294762A CN202210870154.0A CN202210870154A CN115294762A CN 115294762 A CN115294762 A CN 115294762A CN 202210870154 A CN202210870154 A CN 202210870154A CN 115294762 A CN115294762 A CN 115294762A
- Authority
- CN
- China
- Prior art keywords
- duration
- vehicle
- green light
- template
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 230000003044 adaptive effect Effects 0.000 title abstract description 6
- 238000007637 random forest analysis Methods 0.000 claims description 8
- 238000012549 training Methods 0.000 claims description 5
- 238000013480 data collection Methods 0.000 claims description 3
- 206010021033 Hypomenorrhoea Diseases 0.000 claims description 2
- 238000010801 machine learning Methods 0.000 abstract description 2
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000033228 biological regulation Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0108—Measuring and analyzing of parameters relative to traffic conditions based on the source of data
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0137—Measuring and analyzing of parameters relative to traffic conditions for specific applications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0137—Measuring and analyzing of parameters relative to traffic conditions for specific applications
- G08G1/0141—Measuring and analyzing of parameters relative to traffic conditions for specific applications for traffic information dissemination
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/042—Detecting movement of traffic to be counted or controlled using inductive or magnetic detectors
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Traffic Control Systems (AREA)
Abstract
本发明提供一种基于TinyML的自适应交通控制方法,属于机器学习,TinyML,边缘计算领域,通过传感器和MCU模板,统计计算车辆的速度和长度,计算出通过绿灯所需要的持续时间。更改交通灯的持续时间,缓解交通压力。
The invention provides an adaptive traffic control method based on TinyML, which belongs to the field of machine learning, TinyML, and edge computing. Through sensors and MCU templates, the speed and length of vehicles are statistically calculated, and the duration required to pass a green light is calculated. Change the duration of traffic lights to ease traffic stress.
Description
技术领域technical field
本发明涉及机器学习,TinyML,边缘计算领域,尤其涉及一种基于TinyML的自适应交通控制方法。The present invention relates to the fields of machine learning, TinyML and edge computing, and in particular to a TinyML-based adaptive traffic control method.
背景技术Background technique
交通运输是经济社会发展的重要基础和支撑。随着城市的发展,各个城市交通车辆逐渐增多。为了解决交通拥堵,交通管理部门出台了各式各样的规定,但结果还是差强人意。Transportation is an important foundation and support for economic and social development. With the development of cities, the number of traffic vehicles in each city has gradually increased. In order to solve traffic congestion, the traffic management department has issued various regulations, but the results are still unsatisfactory.
发明内容Contents of the invention
为了解决上述问题,本发明提供了一种基于TinyML的自适应交通控制方法。In order to solve the above problems, the present invention provides a TinyML-based adaptive traffic control method.
本发明的技术方案是:Technical scheme of the present invention is:
一种基于TinyML的自适应交通控制方法,通过传感器和MCU模板,统计计算车辆的速度和长度,计算出通过绿灯所需要的持续时间。更改交通灯的持续时间,缓解交通压力。An adaptive traffic control method based on TinyML, through the sensor and MCU template, statistically calculate the speed and length of the vehicle, and calculate the duration required to pass the green light. Change the duration of traffic lights to ease traffic stress.
进一步的,further,
包括(1)在马路上布置压电传感器带,计算车辆的速度和长度,车辆离开信号灯(绿灯)的持续时间。(2)建立随机森林模型,并用模型训练上述采集的数据训练。(3)选择MCU模板,把模型部署在模板上。(4)在十字路口通过布置压电传感器带计算出车辆通过信号灯(绿灯)的持续时间,并根据这个时间合理调整绿灯的持续时间。这种发明提供了一种调整交通信号灯时间的优化方法和装置,突破了传统交通通信策略的限制,优化了交通路口的通行策略,会一定程度上缓解交通路口的通行压力,提高了交通通行效率。Including (1) arranging piezoelectric sensor belts on the road, calculating the speed and length of the vehicle, and the duration of the vehicle leaving the signal light (green light). (2) Establish a random forest model, and use the model to train the data collected above. (3) Select the MCU template and deploy the model on the template. (4) Calculate the duration of the vehicle passing through the signal light (green light) by arranging piezoelectric sensor belts at the intersection, and adjust the duration of the green light reasonably according to this time. This invention provides an optimization method and device for adjusting the time of traffic lights, which breaks through the limitations of traditional traffic communication strategies, optimizes the traffic strategy at traffic intersections, relieves the traffic pressure at traffic intersections to a certain extent, and improves traffic efficiency. .
进一步的,further,
步骤包括:数据收集,随机森林模型训练,MCU选型及部署,在十字路口部署压电传感器和模板,计算南北方向车辆通过的绿灯持续时间,计算东西方向车辆通过的绿灯持续时间。The steps include: data collection, random forest model training, MCU selection and deployment, deployment of piezoelectric sensors and templates at intersections, calculation of the duration of green lights for vehicles passing in the north-south direction, and calculation of the duration of green lights for vehicles passing in the east-west direction.
其中,in,
数据收集,在一条马路上布置4条压电传感器带,收集车辆的信息,和车辆离开信号灯(绿灯)的持续时间。For data collection, 4 piezoelectric sensor strips are arranged on a road to collect vehicle information and the duration of the vehicle leaving the signal light (green light).
建立随机森林模型,并用模型训练上述采集的数据。Build a random forest model and use the model to train the data collected above.
通过自主设计或在现有设备中选型,基本要求是基于开源的RISC-V架构的模板,把模型部署在模板上。Through independent design or selection of existing equipment, the basic requirement is to deploy the model on the template based on the template of the open source RISC-V architecture.
在实现的十字路口的四面各布置两条压电传感器带,统计计算出驶入路口的车辆信息,并通过配套的模板计算出通过绿灯的时间。Two piezoelectric sensor belts are arranged on the four sides of the realized intersection, and the information of the vehicles entering the intersection is calculated statistically, and the time to pass the green light is calculated through the matching template.
先统计北面和南面红灯期间积累的车辆,算出两个时间,取两者最大值,作为南北方向绿灯的持续时间。First count the vehicles accumulated during the red lights in the north and south, calculate two times, and take the maximum value of the two as the duration of the green lights in the north and south directions.
再计算这段时间东西方向积累的车辆,算出两个时间,取两者最大值,作为东西方向绿灯的持续时间,再重复上述步骤。Then calculate the vehicles accumulated in the east-west direction during this period, calculate two times, take the maximum value of the two as the duration of the green light in the east-west direction, and repeat the above steps.
附图说明Description of drawings
图1是本发明的工作流程示意图;Fig. 1 is a schematic diagram of the workflow of the present invention;
图2是压电传感器的布置示意图;2 is a schematic diagram of the layout of the piezoelectric sensor;
图3是车辆通过压电感应带时的时间戳示意图。Fig. 3 is a schematic diagram of the time stamp when the vehicle passes through the piezoelectric induction belt.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the protection of the present invention. scope.
本发明提出了一种基于TinyML的自适应交通控制方法,首先需在道路中距离交通信号灯一定距离安装2条间隔D米的压电传感器1和2,用于检测车辆的密度。当车辆通过压电传感器时,会产生很小的电压脉冲。这些电压脉冲被传递到支持 AI的微控制器。通过处理收集的数据,计算车辆长度(以车辆通过同一压电传感器的两个车轴之间的长度)以识别车辆类型,并根据其通过的速度进行分组。再在距离交通信号灯不远处安装2条间隔D米的压电传感器3和4,用于检测车辆离开信号灯(绿灯)的时间(图2)。将车辆类型和数量作为预训练随机森林回归模型的输入,车辆通过信号灯(绿灯)的时间作为输出(标签)。建立模型,部署在开源的模板上。The present invention proposes an adaptive traffic control method based on TinyML. Firstly, two
模型的输入部分为车辆类型和数量,其中车辆类型主要记录车辆的速度和车辆的长度。当车辆的第一个车轴通过第一条带时计入时间T1,随后计入第一个车轴通过第二条带的时间戳T2,最后是车辆第二个车轴通过第一条带的时间戳T3。于是车辆的速度计算公式为The input part of the model is the vehicle type and quantity, where the vehicle type mainly records the vehicle speed and vehicle length. The time T 1 is counted when the first axle of the vehicle passes the first strip, followed by the time stamp T 2 when the first axle passes the second strip, and finally when the second axle of the vehicle passes the first strip time stamp T 3 . Then the formula for calculating the speed of the vehicle is
车辆的长度为The length of the vehicle is
s=v(T3-T1) (2)s=v(T 3 -T 1 ) (2)
当车辆存在第三车轴时,计算公式和上述相似,把两部分的长度相加即可。When the vehicle has a third axle, the calculation formula is similar to the above, just add the lengths of the two parts.
根据上述车辆的速度和车辆的长度大致可以把车辆的种类划分为7类,分别为自行车,电动车(摩托车),轿车,公共汽车,大巴(3车轴),卡车(3 车轴),重型卡车(4、5车轴)。According to the speed of the above vehicles and the length of the vehicles, the types of vehicles can be roughly divided into 7 categories, namely bicycles, electric vehicles (motorcycles), cars, buses, buses (3 axles), trucks (3 axles), heavy trucks (4, 5 axles).
算法的具体步骤为(使用Python作为程序语言)The specific steps of the algorithm are (using Python as the programming language)
1)收集数据集,每条数据为2个条带的时间戳列表。1) Collect data sets, each piece of data is a timestamp list of 2 stripes.
2)创建4个列表,分别为2车轴,3车轴,和4、5车轴。2) Create 4 lists, namely 2 axles, 3 axles, and 4 and 5 axles.
3)取出第一条带的时间戳列表和第二条带的时间戳的第一项,使用公式1 算出车辆的速度v。3) Take out the time stamp list of the first band and the first item of the time stamp of the second band, and use
4)取出第一条带的时间戳列表的第二项和第一项,根据公式(2)算出车辆的长度s,查看是否有第三项,如果无则把结果存成元组加入2车轴列表,跳到第2)步。4) Take out the second item and the first item of the time stamp list of the first band, calculate the length s of the vehicle according to the formula (2), check whether there is a third item, if not, save the result as a tuple and add it to 2 axles list, skip to step 2).
5)如果存在第三项,则根据公式(2),再一次算出车辆的长度s1,把s和 s1相加,作为新的长度s,查看是否有第4项,如果无则把结果存成元组加入3 车轴列表,跳到第2)步。5) If there is a third item, then according to the formula (2), calculate the length s1 of the vehicle again, add s and s1 as the new length s, check whether there is the fourth item, if not, save the result as Add the tuple to the list of 3 axles, skip to step 2).
6)如果有,重复第4)步,再查看第五项是否存在,不存在把结果存成元组加入4、5车轴列表,跳到第2)步。如果有重复第4)步,把结果存成元组加入4、5车轴列表,跳到第2)步。6) If yes, repeat step 4), and then check whether the fifth item exists, if not, save the result as a tuple and add it to the list of axles 4 and 5, and skip to step 2). If step 4) is repeated, save the result as a tuple and add it to the list of axles 4 and 5, and skip to step 2).
7)循环结束。7) The loop ends.
8)根据车辆的长度和速度添加每个车辆的类别信息。8) Add the category information of each vehicle according to the length and speed of the vehicle.
9)再根据上述算法计算车辆通过路口的时间。9) Calculate the time for the vehicle to pass through the intersection according to the above algorithm.
10)进入预训练,采用随机森林回归器(RFR)将每个类别的车辆数量作为输入,车辆通过路口所需的绿灯持续时间为标签。预测时输入红灯期间记录累积的车辆,预测通过路口所需的绿灯持续时间。10) Enter the pre-training, use the random forest regressor (RFR) to take the number of vehicles in each category as input, and the green light duration required for the vehicle to pass through the intersection as the label. When predicting, enter the accumulated vehicles recorded during the red light period, and predict the green light duration required to pass the intersection.
11)通过自主设计或在现有设备中选型,基本要求是基于开源的RISC-V 架构的模板,把模型部署在模板上,该板的输入是红灯期间累积的车辆,输出是传递给交通信号灯的预测持续时间。11) Through independent design or model selection in existing equipment, the basic requirement is to deploy the model on the template based on the open source RISC-V architecture. The input of the board is the accumulated vehicles during the red light, and the output is passed to Predicted duration of traffic lights.
12)根据十字路口的四个方向,先预测北面和南面红灯期间积累的车辆,算出两个时间,取两者最大值,作为南北方向绿灯的持续时间,再计算这段时间东西方向积累的车辆,算出两个时间,取两者最大值,作为东西方向绿灯的持续时间,再重复上述步骤。12) According to the four directions of the intersection, first predict the vehicles accumulated during the red lights in the north and south, calculate two times, take the maximum value of the two as the duration of the green lights in the north and south directions, and then calculate the accumulated vehicles in the east and west directions during this period For the vehicle, two times are calculated, and the maximum value of the two is taken as the duration of the green light in the east-west direction, and the above steps are repeated.
以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are only used to illustrate the technical solution of the present invention, and are not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210870154.0A CN115294762A (en) | 2022-07-22 | 2022-07-22 | An adaptive traffic control method based on TinyML |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210870154.0A CN115294762A (en) | 2022-07-22 | 2022-07-22 | An adaptive traffic control method based on TinyML |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115294762A true CN115294762A (en) | 2022-11-04 |
Family
ID=83824664
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210870154.0A Pending CN115294762A (en) | 2022-07-22 | 2022-07-22 | An adaptive traffic control method based on TinyML |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115294762A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220167480A1 (en) * | 2020-11-24 | 2022-05-26 | William Tulloch | Sensor to control lantern based on surrounding conditions |
CN114677835A (en) * | 2021-11-30 | 2022-06-28 | 浪潮集团有限公司 | A system and method for self-adaptive traffic scheduling based on microcontroller device and micro-machine learning |
-
2022
- 2022-07-22 CN CN202210870154.0A patent/CN115294762A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220167480A1 (en) * | 2020-11-24 | 2022-05-26 | William Tulloch | Sensor to control lantern based on surrounding conditions |
CN114677835A (en) * | 2021-11-30 | 2022-06-28 | 浪潮集团有限公司 | A system and method for self-adaptive traffic scheduling based on microcontroller device and micro-machine learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105185115B (en) | A kind of traffic forecast method and forecasting system | |
CN106297333B (en) | A kind of green wave appraisal procedure of main line for vehicle record of being made a slip of the tongue based on intersection | |
CN104778834B (en) | Urban road traffic jam judging method based on vehicle GPS data | |
CN101383091B (en) | Network control system for traffic induction outdoor screen | |
CN105096643B (en) | Real-time public transport arrival time Forecasting Methodology based on multi-line front truck service data | |
WO2019047905A1 (en) | Road traffic analysis system, method and apparatus | |
CN111951549A (en) | Adaptive traffic signal control method and system in networked vehicle environment | |
CN106251661B (en) | Tunnel portal section wagon flow control method | |
CN108230217A (en) | A kind of energy consumption total emission volumn accounting system and its accounting method based on expressway tol lcollection data | |
CN110111592A (en) | Method based on traffic signal controlling machine Dynamic Matching Optimal Signals timing scheme | |
CN101281684A (en) | Regional traffic management system with cooperative operation of display board guidance and regional control | |
CN102376162B (en) | Method for setting optimal distance between curb parking lot of intersection exit lane and intersection | |
CN101739823A (en) | Road-section average travel time measuring method suitable for low-frequency sampling | |
CN103593988A (en) | Method for arranging steering buses in sequence in bus stop at inner side of road | |
CN110807926B (en) | Road impedance prediction method and device based on hybrid traffic | |
CN110633558B (en) | A Modeling System of Urban Traffic System | |
CN114596700B (en) | Real-time traffic estimation method for expressway section based on portal data | |
CN109493566A (en) | A kind of fatigue driving prediction technique based on GPS data | |
CN104318315A (en) | City road traffic pollutant discharge monitoring early warning system and method | |
CN106803347A (en) | Urban intersection traffic state judging method based on RFID data | |
CN110070720B (en) | Calculation method for improving fitting degree of traffic capacity model of intersection road occupation construction area | |
CN111724592B (en) | Highway traffic jam detection method based on charging data and checkpoint data | |
CN109785627A (en) | A kind of crossroad access flux monitoring system | |
CN115294762A (en) | An adaptive traffic control method based on TinyML | |
CN111695767A (en) | Highway network traffic efficiency evaluation method, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221104 |
|
RJ01 | Rejection of invention patent application after publication |