Urban traffic management method
By acquiring and training urban traffic data, using machine learning and data processing technology to monitor and analyze traffic behavior in real time, the problems of data quality and accident prevention are solved, and rapid response and efficient management are achieved.
Patent Information
- Application Number
- CN202510673796.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-24
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-12
AI Technical Summary
In the existing urban traffic management methods, the data quality and accuracy are not high, and complex and changing traffic situations cannot be handled quickly and accurately, and traffic accidents cannot be effectively prevented.
By obtaining the first and second traffic data, using machine learning and data processing technology to train the laws of traffic flow and congestion information, monitoring traffic behavior in real time, using random forest and decision tree algorithms to analyze traffic accident risk factors, predict traffic conditions and promptly deal with irregular behaviors to prevent accidents.
It improves data quality and accuracy, can quickly respond to complex traffic conditions, reduce traffic congestion, improve user experience and management efficiency, and reduce the probability of traffic accidents.
Smart Images

Figure CN120472668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of urban traffic management, and in particular to an urban traffic management method. Background Art
[0002] With the advancement of science and technology, the application of artificial intelligence (AI) technology is becoming increasingly widespread across various fields, with urban traffic management being a key application area. Smart city construction, a key trend in current urban development, focuses on leveraging advanced technologies to improve the efficiency, safety, and sustainability of urban transportation systems. Against this backdrop, urban traffic management methods have emerged. However, while existing smart city traffic management methods have improved the efficiency and safety of urban transportation systems to a certain extent, they still suffer from several issues and shortcomings. First, most existing urban traffic management methods rely on large amounts of historical and real-time traffic data, resulting in low data quality and accuracy. Second, existing urban traffic management methods often fail to respond quickly and accurately to complex and changing traffic conditions, resulting in poor management effectiveness. Furthermore, existing methods still need to be strengthened in terms of preventing traffic accidents. Therefore, in future urban traffic management methods, improving data quality and accuracy, enabling rapid and accurate responses to complex and changing traffic conditions, and reducing the probability of traffic accidents are pressing challenges. Summary of the Invention
[0003] The main purpose of the embodiments of the present invention is to provide an urban traffic management method and related devices, aiming to solve the technical problems that the data quality and accuracy in existing urban traffic management methods are not high, when dealing with complex and changeable traffic conditions, they are often unable to respond quickly and accurately, and the existing urban traffic management methods cannot accurately predict the occurrence of traffic accidents.
[0004] An embodiment of the present invention provides an urban traffic management method, including:
[0005] Acquire first traffic data and second traffic data;
[0006] Training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information;
[0007] predicting the traffic flow information and the traffic congestion information within a target time period according to the traffic rules;
[0008] monitoring the second traffic data in real time so as to promptly handle the traffic irregularities corresponding to the second traffic data;
[0009] determining, based on a random forest algorithm, the second traffic data corresponding to the irregular traffic behavior as third traffic data;
[0010] Among them, the expression corresponding to the random forest algorithm is:
[0011]
[0012] VIM represents the degree of traffic irregularity of a certain element, i, j, respectively represent arbitrary constants, and c represents the total number of traffic features;
[0013] performing data analysis on the third traffic data based on a decision tree algorithm to determine risk factors and regional information of traffic accidents corresponding to the third traffic data;
[0014] Among them, the loss function expression corresponding to the decision tree algorithm is:
[0015] C α (t)=C(T)+α|T|
[0016] C α (t) represents a loss function, C(T) represents an error value, α represents a parameter, and |T| represents the number of samples in the third traffic data;
[0017] Prevent the traffic accident from occurring based on the risk factors and the area information. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a method for urban traffic management provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of the module structure of an artificial intelligence-based smart city traffic management device provided by an embodiment of the present invention;
[0021] Figure 3 The present invention provides a schematic block diagram of the structure of an electronic device. DETAILED DESCRIPTION
[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0023] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0024] It should be understood that the terms used in this specification are only for the purpose of describing particular embodiments and are not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] The embodiment of the present invention provides a city traffic management method and related devices. The city traffic management method can be applied to electronic devices, such as electronic watches, electronic bracelets, and electronic displays.
[0026] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0027] Please refer to Figure 1 , Figure 1 A flow chart of a method for urban traffic management provided by an embodiment of the present invention.
[0028] like Figure 1 As shown, the urban traffic management method includes steps S101 to S107.
[0029] Step S101: Acquire first traffic data and second traffic data.
[0030] Specifically, the first traffic data is historical traffic data; the second traffic data is real-time traffic data; wherein the first traffic data and the second traffic data may include: road condition data, vehicle flow data, weather condition data, traffic accident data, and the like.
[0031] For example, the first traffic data stored in the memory of the traffic monitoring camera can be directly retrieved by accessing the memory. For example, the first traffic data corresponding to each image or video information within the past month can be retrieved from the memory. Of course, it is understood that within the storage capacity of the memory, at least one set of first traffic data for any suitable time period, such as two months or three months, can also be retrieved, and this application does not impose any limitation on this.
[0032] In addition, if the memory does not store the first traffic data, but directly stores the image information or video information collected by the traffic camera during the corresponding time period, then after extracting the image information or video information corresponding to the traffic in a specific area in the previous time period from the memory, the first traffic data corresponding to each of the above image information or video information is obtained based on digital image processing technology or image extraction algorithm.
[0033] It should be noted that each image information and each video information corresponds to a set of first traffic data and a set of second traffic data. Therefore, at least one set of first traffic data and at least one set of second traffic data can be obtained in the end.
[0034] Digital image processing techniques include geometric processing, arithmetic processing, image enhancement, image restoration, image reconstruction, and image recognition. Image extraction algorithms include at least one of the following: Histogram of Oriented Gradient (HOG) features, Local Binary Pattern (LBP), and Haar-like features.
[0035] It should be noted that in actual applications, appropriate digital image processing technology and image extraction algorithm can be selected according to actual conditions, and this application does not impose any restrictions on this.
[0036] For example, by using a traffic monitoring camera or a global positioning system (GPS) to acquire image information or video information of a specific traffic intersection or road section in real time, and performing image processing on the image information or video information, the second traffic data corresponding to the image information or video information is obtained. The image information or video information can be processed using an image feature extraction algorithm to obtain the second traffic data corresponding to the image information or video information.
[0037] It should be noted that in addition to using traffic monitoring cameras or a global positioning system to obtain the second traffic data in real time, the second traffic data can also be obtained in real time through monitoring footage captured by a car's driving recorder. Furthermore, if the driving recorder is directly connected to a mobile phone via Bluetooth, the second traffic data can be directly obtained by viewing the application software on the user's mobile phone that is connected to the driving recorder.
[0038] It should be noted that the above-mentioned method of obtaining the first traffic data and the second traffic data is only for illustrative purposes. In actual applications, any other suitable method can be used to obtain the first traffic data and the second traffic data, and this application does not impose any restrictions on this.
[0039] Step S102: training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information.
[0040] For example, the extracted first traffic data and the second traffic data may be trained based on machine learning technology or data processing technology to obtain traffic patterns of traffic flow information and traffic congestion information corresponding to the first traffic data and the second traffic data.
[0041] Furthermore, a target network model corresponding to the first traffic data and the second traffic data can be obtained through machine learning technology, and traffic patterns corresponding to the traffic flow information and traffic congestion information can be obtained based on the target network model.
[0042] In some embodiments, the first traffic data and the second traffic data are trained to obtain traffic patterns corresponding to traffic flow and congestion conditions, including: performing forward propagation calculations on the first traffic data and the second traffic data based on an initial network model to determine a prediction result after the forward propagation; performing error calculations on the prediction results and preset results to determine a loss value corresponding to the initial network model; determining a target network model corresponding to the initial network model according to a backpropagation algorithm; and determining the traffic patterns corresponding to the traffic flow and the congestion conditions according to the target network model.
[0043] Exemplarily, the initial network model includes an input layer, a hidden layer, and an output layer. Before training the first traffic data and the second traffic data, the initial network model needs to be initialized. The specific initialization process can be: using a random number generator to initialize the weights and biases in the initial network.
[0044] Exemplarily, after the initial network is initialized, the first traffic data and the second traffic data are trained. When training the first traffic data and the second traffic data, a forward propagation calculation is first performed on the first traffic data and the second traffic data based on the initial network model to determine a prediction result after the forward propagation. The forward propagation calculation refers to a forward calculation process from the input layer to the output layer.
[0045] Specifically, at least one set of first traffic data and at least one set of second traffic data obtained are sequentially input into the input layer of the initial network model. The first traffic data or the second traffic data entering the input layer enters the hidden layer through the neurons of the hidden layer. In the hidden layer, the first traffic data or the second traffic data is forward propagated through the activation function located in the hidden layer, and the prediction result after the forward propagation calculation is determined.
[0046] The expression corresponding to the activation function is:
[0047]
[0048] Wherein, t represents the first traffic data or the second traffic data, and H(t) represents the prediction result obtained by the activation function.
[0049] According to the activation function, the weights and biases corresponding to the initial network model can be determined.
[0050] For example, after obtaining the prediction result, the error between the prediction result and the preset result is calculated to determine the loss value corresponding to the initial network model. It should be noted that during the training of the initial network model, the above loss value is obtained in the output layer.
[0051] It should be noted that the preset result is determined before the first traffic data or the second traffic data is input into the hidden layer. The purpose is to determine whether the initial network model meets the accuracy requirements of data training.
[0052] Specifically, the method used to calculate the error between the prediction result and the preset result may be to calculate the mean square error or cross entropy between the prediction result and the preset result.
[0053] After calculating the error between the predicted result and the preset result, the loss value corresponding to the initial network model can be obtained. At this point, the forward propagation algorithm calculation is completed.
[0054] Next, the target network model corresponding to the initial network model is determined according to the back-propagation algorithm. The back-propagation algorithm refers to adjusting the weights and biases in the initial network model using the gradient descent method based on the loss value corresponding to the initial network model to minimize the loss value.
[0055] In some embodiments, according to the back propagation algorithm, the target network model corresponding to the initial network model is determined, including: calculating the gradient value of each parameter in the initial network model; according to the gradient value, using the gradient descent method to update the weights and biases in the initial network model to reduce the loss value until the loss value is within a preset loss threshold range, thereby obtaining the target network model corresponding to the initial network model.
[0056] Specifically, the gradient values of each parameter in the initial network model with respect to the activation function are calculated. Based on these gradient values, optimization methods such as gradient descent are used to update the initial network model's weights, biases, and other parameters to reduce the loss. This is done until the loss values corresponding to the first and second traffic data of the updated initial network model fall within a preset loss threshold. At this point, the target network model corresponding to the initial network model is obtained.
[0057] By performing forward propagation calculations and backward propagation calculations on the first traffic data and the second traffic data, the loss value between the predicted result and the preset result is continuously reduced, and finally a loss value within the preset loss threshold range is obtained, thereby corresponding to a more accurate target network model, which is used for subsequent predictions to obtain more accurate traffic flow information and the traffic congestion information.
[0058] It should be noted that the above-mentioned preset loss threshold is determined at any time before the loss value is obtained. The specific value of the preset loss threshold can be reasonably set according to the specific application in actual application, and this application does not impose any restrictions on this.
[0059] After obtaining the target network model, by adding the first traffic data obtained at any time in the past and the second traffic data obtained in real time to the target network model, the traffic patterns within the period corresponding to the first traffic data or the second traffic data can be obtained in the output layer of the target network model.
[0060] It should be noted that, in addition to using the aforementioned machine learning techniques, other suitable techniques such as data processing techniques can also be used to train the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information. The specific implementation process is similar to that of the traffic patterns corresponding to traffic flow information and traffic congestion information obtained using the aforementioned machine learning techniques and will not be further described here.
[0061] Step S103: predicting the traffic flow information and the traffic congestion information within a target time period according to the traffic rules.
[0062] The target time period represents a period of time in the future, which may be the next day, the next week, or the next month, etc. The time range of the target time period can be reasonably set according to the specific situation, and this application does not impose any limitation on this.
[0063] Among them, traffic flow information may include: pedestrian flow, vehicle flow or pedestrian and vehicle flow within the target time period, etc.; traffic congestion information includes: no congestion, general congestion, severe congestion, etc. The specific classification of traffic congestion information into no congestion, general congestion, and severe congestion can be judged based on the position and movement distance of pedestrians or vehicles within a certain period of time.
[0064] For example, after obtaining the target network model, the target network model can be added to the corresponding electronic device. When target traffic data is input into the input window of the application software containing the target network model of the electronic device, the display window of the electronic device will display the traffic flow information and traffic congestion information corresponding to the target traffic data. This achieves the purpose of predicting the traffic flow information and traffic congestion information within the target time period.
[0065] Specifically, the acquired target traffic data is input into the input layer of the target network model through an electronic device, and then the target traffic data is transmitted to the hidden layer through the neurons connected to the input layer. The activation function in the hidden layer performs forward propagation calculation on the target traffic data to obtain the traffic flow information and the traffic congestion information corresponding to the target traffic data.
[0066] When the traffic flow information obtained from the target traffic data indicates vehicle and pedestrian traffic, and the traffic congestion information indicates moderate or severe congestion, the user can choose whether to continue the original route or change the route based on the traffic flow and congestion information, and choose a route with less congestion. This can significantly shorten travel time and improve the user experience.
[0067] Step S104: monitor the second traffic data in real time so as to promptly handle the traffic irregularities corresponding to the second traffic data.
[0068] Specifically, after acquiring the second traffic data, data changes in the second traffic data are monitored in real time, and based on the monitored second traffic data, it is determined whether the second traffic data exceeds a prescribed data range corresponding to legal traffic behavior. If the second traffic data exceeds the prescribed data range, it can be determined that the second traffic data contains the corresponding illegal traffic behavior.
[0069] In some embodiments, real-time monitoring of the second traffic data is performed to promptly handle traffic irregularities corresponding to the second traffic data, including: determining a moving target corresponding to the second traffic data; performing target tracking processing on the moving target based on a target tracking algorithm to determine motion parameters and motion trajectory of the moving target; comparing the motion parameters with preset parameters to obtain a first comparison result; comparing the motion trajectory with a preset trajectory to obtain a second comparison result; determining the traffic irregularities corresponding to the moving target based on the first comparison result and the second comparison result, and promptly handling the traffic irregularities.
[0070] The preset parameters may be speed, distance, etc.; the preset trajectory may be one-way driving on a certain route or driving within a specified section of the road.
[0071] For example, based on the second traffic data, image information or video information corresponding to the second traffic data is determined, and a moving target moving in real time is determined in the image information or video information. Position information of the moving target is determined based on positioning technology such as GPS and Beidou.
[0072] After the moving target is determined, target tracking processing can be performed on the moving target based on a target tracking algorithm to determine the motion parameters and motion trajectory of the moving target. The target tracking algorithm can adopt at least one of the optical flow method, particle filter, Mean-Shift algorithm, CamShift algorithm, etc.
[0073] After obtaining the motion parameters and motion trajectory of the moving target, the motion parameters are compared with the preset parameters to obtain a first comparison result; and the motion trajectory is compared with the preset trajectory to obtain a second comparison result. The first comparison result can be: yes, indicating that the motion parameters are within the range of the preset parameters, that is, the motion parameters of the moving target are within a reasonable data range, and there is no traffic irregularity; no, indicating that the motion parameters are not within the range of the preset parameters, that is, the motion parameters of the moving target are not within a reasonable data range, and there may be traffic irregularity.
[0074] Similarly, the second comparison result can be obtained as: a yes or no answer. The meaning of the second comparison result corresponding to yes or no of the first comparison result is similar to the meaning of the first comparison result, which will not be repeated here.
[0075] After respectively obtaining the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target is determined according to the first comparison result and the second comparison result, and the traffic irregularity is handled in a timely manner.
[0076] In some embodiments, based on the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target is determined, and the traffic irregularity is handled in a timely manner, including: if at least one of the first comparison result or the second comparison result is not within a preset comparison range, the moving target has traffic irregularity, and the moving area corresponding to the moving target where the traffic irregularity exists is determined; within the moving area, the traffic irregularity of the moving target is handled in a timely manner.
[0077] For example, taking the preset parameter of speed as an example, assuming that the preset parameter of speed is: 80km / s, when the motion parameter of the car is that the driving speed exceeds 80km / s, the comparison result obtained is: No, that is, it is determined that the car has irregular traffic behavior.
[0078] For example, if a car is driving in the wrong direction on a certain section of road, when the car's movement trajectory is compared with a preset trajectory on that section of road, if the car's movement trajectory is inconsistent with the preset trajectory, it can be determined that the car has engaged in irregular traffic behavior.
[0079] In addition, if the first comparison result obtained by comparing the motion parameters with the preset parameters and the second comparison result obtained by comparing the motion trajectory with the preset trajectory are both negative, it means that the motion parameters of the car or other vehicle are too large and the driving route is incorrect. At this time, the moving target must have engaged in traffic irregularities. After determining the traffic irregularities, the specific location of the moving target corresponding to the traffic irregularities can be determined based on any suitable positioning system such as GPS and Beidou positioning system. This allows professional staff to more quickly determine the specific location of the moving target and handle the traffic irregularities more promptly and accurately, avoiding road paralysis or more serious traffic accidents due to untimely handling.
[0080] Step S105: Determine the second traffic data corresponding to the irregular traffic behavior as third traffic data.
[0081] Specifically, after the traffic irregularity is determined, the second traffic data corresponding to the traffic irregularity is determined as the third traffic data.
[0082] In some embodiments, determining the second traffic data corresponding to the traffic irregularity as the third traffic data includes: determining the second traffic data corresponding to the traffic irregularity as the third traffic data based on a random forest algorithm; wherein the expression corresponding to the random forest algorithm is:
[0083]
[0084] VIM represents the degree of traffic irregularity of a certain element, i, j, respectively represent arbitrary constants, and c represents the total number of traffic features.
[0085] Exemplarily, the judgment elements corresponding to traffic irregularities include speed, distance, driving direction, and the number of passengers. For example, by sequentially adding the VIM values corresponding to the speed, distance, driving direction, and number of passengers, the denominator in the expression corresponding to the random forest algorithm is obtained. Then, by adding the speed, distance, driving direction, and number of passengers to the numerator of the expression corresponding to the random forest algorithm, the proportion of the speed, distance, driving direction, and number of passengers in the judgment elements corresponding to the entire traffic irregularity is obtained. Furthermore, based on the proportion of each element in the judgment elements corresponding to the entire traffic irregularity, the second traffic data corresponding to each traffic irregularity can be determined as the third traffic data.
[0086] In addition, the second traffic data corresponding to the above-obtained traffic irregularity may be marked by data marking, and the marked second traffic data may be determined as the third traffic data.
[0087] Step S106: performing data analysis on the third traffic data to determine risk factors and regional information of traffic accidents corresponding to the third traffic data.
[0088] Specifically, the third traffic data may be analyzed based on data processing technology or data processing algorithm to determine risk factors and regional information of traffic accidents corresponding to the third traffic data.
[0089] In some embodiments, performing data analysis on the third traffic data to determine the risk factors and regional information of traffic accidents corresponding to the third traffic data includes: performing data analysis on the third traffic data based on a decision tree algorithm to determine the risk factors and regional information of traffic accidents corresponding to the third traffic data. The loss function expression corresponding to the decision tree algorithm is:
[0090] C α (t)=C(T)+α|T|
[0091] C α (t) represents a loss function, C(T) represents an error value, α represents a parameter, and |T| represents the number of samples in the third traffic data.
[0092] The third traffic data includes multiple data types, including road data, vehicle data, weather data, time data, etc.
[0093] For example, risk factors can include weather factors, time factors, and other factors. Area information can include any appropriate area information, such as a road bend, an uphill road, or a downhill road. By inputting the third traffic data into the loss function expression corresponding to the decision tree algorithm, an error loss value for the corresponding data type is obtained. Based on the error loss values for various data types in the third traffic data, the risk factors and area information for traffic accidents corresponding to the third traffic data are determined.
[0094] Step S107: Prevent the traffic accident from occurring based on the risk factors and the area information.
[0095] For example, if the risk factor is a time factor, and the area information is near a school, specifically between 8 and 9 in the morning, traffic accidents are prone to occur. To address this problem, multiple traffic police can be arranged to be on duty near the school during this time period to promptly direct traffic and reduce the occurrence of traffic accidents.
[0096] Furthermore, relevant government departments can take measures to reduce the number of people and vehicles near schools, such as parents dropping off their children. School buses can be arranged for pick-up and drop-off, reducing the number of vehicles near schools, especially those used by parents to drop off their children. This can help prevent traffic accidents. Alternatively, schools can arrange staggered start and end times to reduce vehicle and pedestrian traffic during the same time period, thereby reducing the number of accidents.
[0097] It should be noted that the above-mentioned method of preventing the occurrence of traffic accidents based on the risk factors and the regional information is only for illustrative purposes. In actual applications, other suitable ways or methods can also be used to achieve the purpose of preventing traffic accidents, and this application does not impose any restrictions on this.
[0098] The above embodiment provides a method for urban traffic management, which includes acquiring first and second traffic data; training the first and second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information; predicting the traffic flow information and traffic congestion information within a target time period based on the traffic patterns; monitoring the second traffic data in real time to promptly address traffic irregularities corresponding to the second traffic data; determining the second traffic data corresponding to the traffic irregularities as third traffic data; analyzing the third traffic data to determine risk factors and regional information for traffic accidents corresponding to the third traffic data; and preventing the occurrence of traffic accidents based on the risk factors and regional information. Training the acquired first and second traffic data improves data quality and accuracy, and obtains traffic patterns corresponding to traffic flow information and traffic congestion information. Based on these traffic patterns, traffic flow information and traffic congestion information within a target time period can be greatly facilitated, allowing users to choose appropriate travel routes based on their circumstances, thereby improving user experience and traffic management efficiency. By monitoring the second traffic data in real time, traffic personnel can more promptly and quickly handle traffic irregularities corresponding to the second traffic data, reducing traffic congestion and improving the efficiency of traffic personnel in handling traffic irregularities. Furthermore, by determining the risk factors and regional information of traffic accidents corresponding to the third traffic data, the occurrence of traffic accidents can be prevented based on the risk factors and regional information. This provides greater assurance for reducing the probability of traffic accidents and ensuring safe travel for people in the future.
[0099] See also Figure 2 , Figure 2An artificial intelligence-based smart city traffic management device 200 is provided in an embodiment of the present application. The artificial intelligence-based smart city traffic management device 200 includes a data acquisition module 201, a traffic pattern determination module 202, an information prediction module 203, a data detection module 204, a data determination module 205, an information determination module 206, and a prevention module 207. The data acquisition module 201 is used to acquire first traffic data and second traffic data; the traffic pattern determination module 202 is used to train the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information; the information prediction module 203 , used to predict the traffic flow information and the traffic congestion information within the target time period based on the traffic rules; a data detection module 204, used to monitor the second traffic data in real time so as to promptly handle the traffic irregularities corresponding to the second traffic data; a data determination module 205, used to determine the second traffic data corresponding to the traffic irregularities as third traffic data; an information determination module 206, used to perform data analysis on the third traffic data, and determine the risk factors and regional information of traffic accidents corresponding to the third traffic data; a prevention module 207, used to prevent the occurrence of the traffic accident based on the risk factors and the regional information.
[0100] In some embodiments, the traffic pattern determination module 202 processes, during the process of training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow and congestion conditions;
[0101] Performing a forward propagation calculation on the first traffic data and the second traffic data based on an initial network model to determine a prediction result after the forward propagation;
[0102] Performing error calculation on the predicted result and the preset result to determine the loss value corresponding to the initial network model;
[0103] Determine the target network model corresponding to the initial network model according to the back propagation algorithm;
[0104] The traffic rules corresponding to the traffic flow and the congestion situation are determined according to the target network model.
[0105] In some embodiments, the traffic pattern determination module 202 processes, in the process of determining the target network model corresponding to the initial network model according to the back propagation algorithm;
[0106] Calculating the gradient value of each parameter in the initial network model;
[0107] According to the gradient value, the gradient descent method is used to update the weights and biases in the initial network model to reduce the loss value until the loss value is within a preset loss threshold range, thereby obtaining a target network model corresponding to the initial network model.
[0108] In some embodiments, the information prediction module 203 processes;
[0109] The traffic flow information and the traffic congestion information within a target time period are predicted according to the traffic law.
[0110] In some embodiments, the data detection module 204 processes, in a process of monitoring the second traffic data in real time so as to promptly process the traffic irregularity corresponding to the second traffic data;
[0111] determining a moving target corresponding to the second traffic data;
[0112] Based on the target tracking algorithm, target tracking processing is performed on the moving target to determine the motion parameters and motion trajectory of the moving target;
[0113] Comparing the motion parameter with a preset parameter to obtain a first comparison result;
[0114] Comparing the motion trajectory with a preset trajectory to obtain a second comparison result;
[0115] According to the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target is determined, and the traffic irregularity is handled in a timely manner.
[0116] In some embodiments, the data detection module 204 processes, in the process of determining the traffic irregularity corresponding to the moving target based on the first comparison result and the second comparison result, and promptly processing the traffic irregularity;
[0117] If at least one of the first comparison result or the second comparison result is not within the preset comparison range, the moving target has traffic irregularities, and a movement area corresponding to the moving target having the traffic irregularities is determined;
[0118] In the movement area, the traffic irregularities of the moving target are promptly handled.
[0119] In some implementations, during the process of determining the second traffic data corresponding to the traffic irregularity as the third traffic data, the data determination module 205 processes:
[0120] determining, based on a random forest algorithm, the second traffic data corresponding to the irregular traffic behavior as third traffic data;
[0121] Among them, the expression corresponding to the random forest algorithm is:
[0122]
[0123] VIM represents the degree of traffic irregularity of a certain element, i, j, respectively represent arbitrary constants, and c represents the total number of traffic features.
[0124] In some implementations, the information determination module 206 , in performing data analysis on the third traffic data to determine the risk factors and regional information of traffic accidents corresponding to the third traffic data, includes:
[0125] performing data analysis on the third traffic data based on a decision tree algorithm to determine risk factors and regional information of traffic accidents corresponding to the third traffic data;
[0126] Among them, the loss function expression corresponding to the decision tree algorithm is:
[0127] C α (t)=C(T)+α|T|
[0128] C α (t) represents a loss function, C(T) represents an error value, α represents a parameter, and |T| represents the number of samples in the third traffic data.
[0129] In some embodiments, the prevention module 207, processes;
[0130] Prevent the traffic accident from occurring based on the risk factors and the area information.
[0131] In some embodiments, the artificial intelligence-based smart city traffic management device 200 can be applied to electronic devices.
[0132] It should be noted that technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the artificial intelligence-based smart city traffic management device 200 described above can refer to the corresponding process in the aforementioned urban traffic management method embodiment, and will not be repeated here.
[0133] See also Figure 3 , Figure 3 The present invention provides a schematic block diagram of the structure of an electronic device.
[0134] like Figure 3As shown, the electronic device 300 includes a processor 301 and a memory 302 , and the processor 301 and the memory 302 are connected via a bus 303 , such as an I 2 C (Inter-integrated Circuit) bus.
[0135] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire electronic device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be 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. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0136] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0137] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0138] The processor is configured to run a computer program stored in a memory, and implement any one of the urban traffic management methods provided by the embodiments of the present invention when executing the computer program.
[0139] In one embodiment, the processor is configured to run a computer program stored in the memory, and implement the following steps when executing the computer program:
[0140] Acquire first traffic data and second traffic data;
[0141] Training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information;
[0142] predicting the traffic flow information and the traffic congestion information within a target time period according to the traffic rules;
[0143] monitoring the second traffic data in real time so as to promptly handle the traffic irregularities corresponding to the second traffic data;
[0144] determining the second traffic data corresponding to the traffic irregularity as third traffic data;
[0145] performing data analysis on the third traffic data to determine risk factors and regional information of traffic accidents corresponding to the third traffic data;
[0146] Prevent the traffic accident from occurring based on the risk factors and the area information.
[0147] In some embodiments, the processor 301 executes, during the process of training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow and congestion conditions;
[0148] Performing a forward propagation calculation on the first traffic data and the second traffic data based on an initial network model to determine a prediction result after the forward propagation;
[0149] Performing error calculation on the predicted result and the preset result to determine the loss value corresponding to the initial network model;
[0150] Determine the target network model corresponding to the initial network model according to the back propagation algorithm;
[0151] The traffic rules corresponding to the traffic flow and the congestion situation are determined according to the target network model.
[0152] In some embodiments, the processor 301 executes, during the process of determining the target network model corresponding to the initial network model using a back propagation algorithm;
[0153] Calculating the gradient value of each parameter in the initial network model;
[0154] According to the gradient value, the gradient descent method is used to update the weights and biases in the initial network model to reduce the loss value until the loss value is within a preset loss threshold range, thereby obtaining a target network model corresponding to the initial network model.
[0155] In some embodiments, the processor 301 executes, during the process of monitoring the second traffic data in real time so as to promptly process the traffic irregularity corresponding to the second traffic data;
[0156] determining a moving target corresponding to the second traffic data;
[0157] Based on the target tracking algorithm, target tracking processing is performed on the moving target to determine the motion parameters and motion trajectory of the moving target;
[0158] Comparing the motion parameter with a preset parameter to obtain a first comparison result;
[0159] Comparing the motion trajectory with a preset trajectory to obtain a second comparison result;
[0160] According to the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target is determined, and the traffic irregularity is handled in a timely manner.
[0161] In some embodiments, the processor 301, in the process of determining the traffic irregularity corresponding to the moving target based on the first comparison result and the second comparison result, and promptly processing the traffic irregularity, executes;
[0162] If at least one of the first comparison result or the second comparison result is not within the preset comparison range, the moving target has traffic irregularities, and a movement area corresponding to the moving target having the traffic irregularities is determined;
[0163] In the movement area, the traffic irregularities of the moving target are promptly handled.
[0164] In some embodiments, when the processor 301 determines the second traffic data corresponding to the traffic irregular behavior as the third traffic data, the processor 301 executes:
[0165] determining, based on a random forest algorithm, the second traffic data corresponding to the irregular traffic behavior as third traffic data;
[0166] Among them, the expression corresponding to the random forest algorithm is:
[0167]
[0168] VIM represents the degree of traffic irregularity of a certain element, i, j, respectively represent arbitrary constants, and c represents the total number of traffic features.
[0169] In some embodiments, the processor 301 performs, during the process of performing data analysis on the third traffic data and determining the risk factors and regional information of traffic accidents corresponding to the third traffic data;
[0170] performing data analysis on the third traffic data based on a decision tree algorithm to determine risk factors and regional information of traffic accidents corresponding to the third traffic data;
[0171] Among them, the loss function expression corresponding to the decision tree algorithm is:
[0172] C α (t)=C(T)+α|T|
[0173] C α (t) represents a loss function, C(T) represents an error value, α represents a parameter, and |T| represents the number of samples in the third traffic data.
[0174] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, the specific working process of the electronic device described above can refer to the corresponding process in the aforementioned urban traffic management method embodiment, and will not be repeated here.
[0175] An embodiment of the present invention also provides a computer-readable storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any urban traffic management method provided in the description of the embodiment of the present invention.
[0176] The storage medium may be an internal storage unit of the terminal device described in the aforementioned embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the terminal device.
[0177] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0178] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system that includes a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system that includes the element.
[0179] The serial numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope of protection of the claims.
Claims
1. A method for urban traffic management, characterized in that: include: Acquire first traffic data and second traffic data; Training the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow information and traffic congestion information; predicting the traffic flow information and the traffic congestion information within a target time period according to the traffic rules; monitoring the second traffic data in real time so as to promptly handle the traffic irregularities corresponding to the second traffic data; determining, based on a random forest algorithm, the second traffic data corresponding to the irregular traffic behavior as third traffic data; Among them, the expression corresponding to the random forest algorithm is: VIM represents the degree of traffic irregularity of a certain element, i, j, respectively represent arbitrary constants, and c represents the total number of traffic features; performing data analysis on the third traffic data based on a decision tree algorithm to determine risk factors and regional information of traffic accidents corresponding to the third traffic data; Among them, the loss function expression corresponding to the decision tree algorithm is: C α (t)=C(T)+α|T| C α (t) represents a loss function, C(T) represents an error value, α represents a parameter, and |T| represents the number of samples in the third traffic data; Prevent the traffic accident from occurring based on the risk factors and the area information.
2. The smart city traffic management method based on artificial intelligence according to claim 1 is characterized in that: The real-time monitoring of the second traffic data so as to promptly handle the traffic irregularity corresponding to the second traffic data includes: determining a moving target corresponding to the second traffic data; Based on the target tracking algorithm, target tracking processing is performed on the moving target to determine the motion parameters and motion trajectory of the moving target; Comparing the motion parameter with a preset parameter to obtain a first comparison result; Comparing the motion trajectory with a preset trajectory to obtain a second comparison result; According to the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target is determined, and the traffic irregularity is handled in a timely manner.
3. The smart city traffic management method based on artificial intelligence according to claim 2 is characterized in that: The determining, based on the first comparison result and the second comparison result, the traffic irregularity corresponding to the moving target and promptly handling the traffic irregularity includes: If at least one of the first comparison result or the second comparison result is not within the preset comparison range, the moving target has traffic irregularities, and a movement area corresponding to the moving target having the traffic irregularities is determined; In the movement area, the traffic irregularities of the moving target are promptly handled.
4. The method for smart city traffic management based on artificial intelligence according to claim 3 is characterized in that: The training of the first traffic data and the second traffic data to obtain traffic patterns corresponding to traffic flow and congestion conditions includes: Performing a forward propagation calculation on the first traffic data and the second traffic data based on an initial network model to determine a prediction result after the forward propagation; Performing error calculation on the predicted result and the preset result to determine the loss value corresponding to the initial network model; Determine the target network model corresponding to the initial network model according to the back propagation algorithm; The traffic rules corresponding to the traffic flow and the congestion situation are determined according to the target network model.
5. The method for smart city traffic management based on artificial intelligence according to claim 4 is characterized in that: The step of determining the target network model corresponding to the initial network model according to the back propagation algorithm includes: Calculating the gradient value of each parameter in the initial network model; According to the gradient value, the gradient descent method is used to update the weights and biases in the initial network model to reduce the loss value until the loss value is within a preset loss threshold range, thereby obtaining a target network model corresponding to the initial network model.