Smart city data processing method and system based on machine learning
Through machine learning-based methods, the degree of traffic anomalies and road correlation degree is calculated, combined with the RNN neural network model, the problem of inaccurate traffic detection in the existing technology is solved, and the accuracy of road congestion judgment and smart city data processing are improved. accuracy.
Patent Information
- Application Number
- CN202410840951.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-06-27
AI Technical Summary
When analyzing urban road traffic, especially when driving at high speed or with high vehicle density, it is difficult to accurately detect all vehicles passing through, resulting in underestimation of traffic flow, and thus misjudging road congestion, reducing smart city data processing. accuracy.
Using machine learning-based methods, by obtaining the number of vehicles in each time period, calculating the degree of traffic abnormality, screening the mutation time period, analyzing the correlation between surrounding roads and target roads, and combining the number of vehicles, determining the degree of congestion on the road. And use the RNN neural network model to determine whether there is congestion on the road.
It improves the accuracy of road vehicle congestion judgment, reduces the impact of chance, improves the accuracy of smart city data processing, and can more accurately analyze and predict road congestion.
Smart Images

Figure CN118411828B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a smart city data processing method and system based on machine learning. Background Art
[0002] Smart city data processing involves the collection, storage, analysis and application of various data generated in the city to promote the optimization of urban management, resource utilization and public services. As people's income levels increase, the cost of purchasing cars decreases, and the popularity of vehicles increases, the number of cars on the road increases, resulting in excessive traffic on urban roads and congestion on urban roads; therefore, it is particularly important to analyze and process data on traffic congestion on urban roads to reduce vehicle congestion on roads.
[0003] When analyzing the traffic congestion on urban roads, the traffic flow data of a location on the road can be directly collected, and whether the traffic flow exceeds the maximum traffic flow limit value can be analyzed to determine whether the road is congested; in the case of high-speed driving or high vehicle density, it may not be possible to accurately detect the passage of all vehicles, resulting in the actual traffic flow being underestimated, and the road congestion being mistakenly judged as minor, resulting in inaccurate judgment of road vehicle congestion, reducing the accuracy of smart city data processing. Summary of the invention
[0004] The present invention provides a smart city data processing method and system based on machine learning to solve existing problems.
[0005] The smart city data processing method and system based on machine learning of the present invention adopts the following technical solutions:
[0006] An embodiment of the present invention provides a method for processing smart city data based on machine learning, the method comprising the following steps:
[0007] Get the number of vehicles passing through each road in each time period of each day;
[0008] According to the difference between the number of vehicles passing through each road in each time period and the number of vehicles passing through each road in the left adjacent time period, the abnormal degree of traffic flow in each time period of each road is obtained; any road is recorded as the target road, and according to the difference between the number of vehicles passing through each time period and the adjacent time period on the target road, the mutation time period is screened out from all time periods of each day; any time period in each day is recorded as the reference time period, and the mutation time period closest to the reference time period on each road is recorded as the target mutation time period, and the number of vehicles in all time periods between the target mutation time period and the reference time period is composed into a sequence, which is recorded as the reference vehicle number sequence of the reference time period on each road; the roads near the target road are recorded as peripheral roads, and the correlation degree between the target road and the reference vehicle number sequence of the reference time period on each peripheral road is obtained to obtain the correlation degree between each peripheral road and the target road in the reference time period;
[0009] The congestion degree of the target road in the reference time period is obtained according to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of correlation between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period;
[0010] The congestion situation of the target road during the reference time period is determined through machine learning according to the congestion level of the target road during the reference time period.
[0011] Furthermore, the abnormal degree of traffic flow in each time period of each road is obtained according to the difference between the number of vehicles passing through each road in each time period and the left adjacent time period, and the specific steps include the following:
[0012] Sort the number of vehicles passing through each road in all time periods of each day in chronological order to form a set of sequences, which are recorded as the traffic flow sequence of each road;
[0013] The mean of the difference between each data in the traffic flow sequence of each road and all the data in the left neighborhood is recorded as the abnormal degree of traffic flow in each time period of each road.
[0014] Furthermore, the method of selecting the mutation time period from all time periods of each day according to the difference between the number of vehicles passing through each time period and the number of vehicles passing through the adjacent time periods on the target road includes the following specific steps:
[0015] Obtain the traffic flow sequence of the target road; mark all time periods with serial numbers in chronological order, establish a reference coordinate system with all time periods as the horizontal axis and the number of vehicles passing through the target road in each time period as the vertical axis, and map the data in the traffic flow sequence of the target road into the reference coordinate system;
[0016] According to the difference in slope between each data point and the adjacent data points, the mutation degree of each data point is obtained;
[0017] The mutation degree is greater than or equal to the preset second threshold All data points are recorded as mutation points; the time period corresponding to the mutation point is recorded as the mutation time period.
[0018] Furthermore, the mutation degree of each data point is obtained according to the difference in slope between each data point and the adjacent data point, and the specific calculation formula included is as follows:
[0019]
[0020] In the formula, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. The data and The slope between the data, To preset the first parameter, is the absolute value symbol, Indicates The mutation degree of each data point is represents the linear normalization function.
[0021] Furthermore, the step of obtaining the correlation degree between each surrounding road and the target road in the reference time period by the correlation degree between the target road and the reference vehicle number sequence in the reference time period on each surrounding road comprises the following specific steps:
[0022] Obtaining the degree of association between each peripheral road and the target road according to the distance between each peripheral road and the target road and the correlation coefficient between the reference vehicle number sequence of each peripheral road and the target road in the reference time period;
[0023] Therein, the distance between each surrounding road and the target road is negatively correlated with the degree of association between each surrounding road and the target road.
[0024] Furthermore, the congestion degree of the target road in the reference time period is obtained according to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of association between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period, and the specific steps include the following:
[0025] According to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of correlation between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period, the influence degree of the target road on the traffic flow of the surrounding roads in the reference time period is obtained;
[0026] The congestion degree of the target road in the reference time period is obtained by distributing the impact of the target road on the traffic flow of surrounding roads in the same time period of all historical days.
[0027] Furthermore, the step of obtaining the influence of the target road on the traffic flow of the surrounding roads during the reference time period according to the abnormal degree of the traffic flow of each surrounding road during the reference time period, the correlation degree between each surrounding road and the target road during the reference time period, and the number of vehicles passing through the target road during the reference time period includes the following specific steps:
[0028] The product of the abnormal degree of traffic flow of each surrounding road in the reference time period and the degree of association between each surrounding road and the target road in the reference time period is recorded as the variation parameter of each surrounding road; the average of the variation parameters of all surrounding roads is recorded as the overall variation parameter of the surrounding roads;
[0029] According to the overall change parameters of the surrounding roads and the number of vehicles passing the target road in the reference time period, the influence of the target road on the traffic flow of the surrounding roads in the reference time period is obtained;
[0030] Among them, the number of vehicles passing through the target road in the reference time period is positively correlated with the degree of influence of the target road on the traffic volume of surrounding roads in the reference time period.
[0031] Furthermore, the congestion degree of the target road in the reference time period is obtained by distributing the influence of the target road on the traffic flow of surrounding roads in the same time period of all historical days, and the specific steps include the following:
[0032] According to the information entropy and mean of the impact of the target road on the traffic volume of surrounding roads in the same reference time period in all historical days, the congestion degree of the target road in the reference time period is obtained;
[0033] Among them, the information entropy of the impact of the target road on the traffic volume of surrounding roads during the reference time period of all historical days is negatively correlated with the congestion level of the target road during the reference time period.
[0034] Furthermore, the method of determining the congestion situation of the target road in the reference time period by machine learning according to the congestion level of the target road in the reference time period includes the following specific steps:
[0035] The congestion degree of the target road in all time periods of all historical days is input into the RNN neural network model, and the RNN neural network model is trained to obtain the trained RNN neural network model; wherein the applicable loss function in the RNN neural network model is the cross entropy loss function; the congestion degree of the target road in the reference time period is input into the trained RNN neural network model, and when the output is 1, it is determined that the target road is congested in the reference time period, and traffic police need to be assigned to relieve the road congestion; when the output is 0, it is determined that the target road is not congested in the reference time period.
[0036] The present invention also provides a smart city data processing system based on machine learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of the above-mentioned smart city data processing method based on machine learning when executing the computer program.
[0037] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains the abnormal degree of traffic flow in each time period of each road according to the difference between the number of vehicles passing through each road in each time period and the adjacent time period; according to the difference between the number of vehicles passing through each time period and the adjacent time period on the target road, the mutation time period is screened out from all time periods of each day, and the correlation degree between the target road and the reference vehicle number sequence of the reference time period on each surrounding road is obtained, and the influence relationship of diversion during road congestion is accurately analyzed through the correlation degree; according to the abnormal degree of traffic flow in the reference time period of each surrounding road, the correlation degree between each surrounding road and the target road in the reference time period and the number of vehicles passing through the target road in the reference time period, the congestion degree of the target road in the reference time period is obtained, and the influence of the randomness of road congestion is reduced; according to the congestion degree of the target road in the reference time period, the congestion situation of the target road in the reference time period is determined through machine learning, thereby improving the accuracy of road vehicle congestion judgment and the accuracy of smart city data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 This is a flowchart of the steps of the smart city data processing method based on machine learning of the present invention;
[0040] Figure 2 This is a flow chart of smart city data processing. DETAILED DESCRIPTION
[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of the smart city data processing method and system based on machine learning proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0043] The specific scheme of the smart city data processing method and system based on machine learning provided by the present invention is described in detail below with reference to the accompanying drawings.
[0044] See also Figure 1 , which shows a flowchart of a method for processing smart city data based on machine learning provided by an embodiment of the present invention, the method comprising the following steps:
[0045] Step S001: Collect the number of vehicles passing on each road in each time period every day.
[0046] It should be noted that in order to analyze whether there is congestion on the road, it is necessary to collect the number of vehicles passing the road within a period of time, and analyze the congestion of the road based on the number of vehicles passing the road within a period of time.
[0047] Specifically, a vehicle counter is installed above each road, and each day is equally divided into 288 time periods at a time interval of 5 minutes. The number of vehicles passing through each time period is collected by the vehicle counter.
[0048] At this point, the number of vehicles passing through each road in each time period of each day is obtained.
[0049] Step S002: according to the difference between the number of vehicles passing through each road in each time period and the left adjacent time period, the abnormal degree of traffic flow in each time period of each road is obtained; according to the difference between the number of vehicles passing through each time period and the adjacent time period on the target road, the mutation time period is screened out from all time periods of each day; the mutation time period closest to the reference time period on each road is recorded as the target mutation time period, and the number of vehicles in all time periods between the target mutation time period and the reference time period are combined into a sequence, which is recorded as the reference vehicle number sequence of the reference time period on each road; through the correlation between the target road and the reference vehicle number sequence of the reference time period on each surrounding road, the correlation degree between each surrounding road and the target road in the reference time period is obtained.
[0050] It should be noted that when a road is congested, vehicles generally choose to drive on other roads. Therefore, when the traffic on a road reaches its maximum carrying capacity, car owners will choose to drive on nearby roads, which will cause a sudden increase in traffic on other roads. Therefore, the traffic on each road and the changes in traffic on several nearby roads are used to analyze the congestion on the road as a whole, so as to avoid the possibility of mistakenly believing that there is congestion on a road due to traffic lights.
[0051] It should be further explained that when traffic congestion occurs on the road, it is generally during the morning and evening rush hours. When traffic congestion occurs on the road, the traffic volume on the road will increase suddenly before the congestion. Therefore, the possibility of traffic congestion on the road can be analyzed by the changes in traffic volume over a period of time.
[0052] Specifically, a first parameter is preset , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. It can be determined according to the specific implementation situation. The number of vehicles passing through each road in all time periods of each day is sorted in chronological order to form a set of sequences, which are recorded as the traffic flow sequence of each road.
[0053] As an embodiment, the specific calculation method of the abnormal degree of traffic flow in each time period of each road is as follows: the average of the difference between each data in the traffic flow sequence of each road and all data in the left neighborhood is recorded as the abnormal degree of traffic flow in each time period of each road. The number of data in the left neighborhood of each data is indivual.
[0054] In one embodiment of the present invention, it is specifically expressed by the formula:
[0055]
[0056] In the formula, represents the first data, represents the first data, To preset the first parameter, Indicates that each road The abnormal degree of traffic flow in a certain period of time, is the absolute value symbol. When calculating the abnormal degree of traffic flow in the first five data in the traffic flow sequence of each road, only the difference between the previously existing data is calculated.
[0057] Among them, the smaller the difference between the number of vehicles passing through each road in each time period and the number of vehicles passing through the adjacent previous time periods, the lower the possibility of traffic jam on the road in this time period; the larger the difference between the number of vehicles passing through each road in each time period and the number of vehicles passing through the adjacent previous time periods, the higher the possibility of traffic jam on the road in this time period.
[0058] At this point, the degree of traffic abnormality for each road in each time period is obtained.
[0059] It should be noted that when the traffic volume on a road suddenly increases, causing a certain degree of congestion on the road, a diversion effect will occur, that is, the traffic volume on roads near the road will increase. Therefore, there is a certain positive correlation between the changes in traffic volume on this road and nearby roads.
[0060] It should be further explained that when a road is congested, it usually starts from a relatively stable traffic flow data, then suddenly increases, and then the traffic flow continues to increase until the traffic flow on the road reaches the maximum carrying capacity of the road. At this time, the traffic flow fluctuation is small, that is, the traffic flow on the road is relatively stable; at this time, there will be a diversion, that is, the traffic flow on the roads near the road will also go from stable to sudden increase, and finally to stable; and the change process of traffic flow will be weaker as the distance between nearby roads increases.
[0061] Specifically, any road is recorded as the target road. A second parameter is preset , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. It can be determined according to the specific implementation situation. The roads are recorded as the surrounding roads of the target road.
[0062] Obtain the traffic flow sequence of the target road; mark all time periods in chronological order, establish a reference coordinate system with all time periods as the horizontal axis and the number of vehicles passing the target road in each time period as the vertical axis, map the data in the traffic flow sequence of the target road in the reference coordinate system, calculate the slope between two adjacent data points, and obtain the mutation degree of each data point based on the difference in slope between each data point and the adjacent data point.
[0063] In one embodiment of the present invention, it is specifically expressed by the formula:
[0064]
[0065] In the formula, Indicates the traffic flow sequence of the target road. The data and The slope between the data, Indicates the traffic flow sequence of the target road. The data and The slope between the data, Indicates the traffic flow sequence of the target road. The data and The slope between the data, Indicates the traffic flow sequence of the target road. The data and The slope between the data, To preset the first parameter, is the absolute value symbol, Indicates The mutation degree of each data point is represents the linear normalization function.
[0066] Among them, when the difference in slope between adjacent data points of each data point is greater, it means that the mutation degree of the data point is greater; when the difference in slope between adjacent data points of each data point is smaller, it means that the mutation degree of the data point is smaller. It represents the slope between adjacent data points after each data point. The larger the slope is, the greater the possibility of increased traffic volume in the time period corresponding to this data point is. It represents the slope between adjacent data points before each data point. The smaller the slope is, the greater the possibility that the traffic volume will increase in the time period corresponding to this data point.
[0067] Preset a first threshold , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. The mutation degree is greater than or equal to the preset second threshold value. All data points are recorded as mutation points; the time period corresponding to the mutation point is recorded as the mutation time period.
[0068] Any time period of each day is recorded as a reference time period; the mutation time period that is closest to the reference time period is obtained and recorded as the target mutation time period; the number of vehicles passing through the target road in all time periods between the target mutation time period and the reference time period is grouped into a sequence in chronological order, which is recorded as the reference vehicle number sequence for the reference time period on the target road; the number of vehicles passing through each surrounding road in all time periods between the target mutation time period and the reference time period is grouped into a sequence in chronological order, which is recorded as the reference vehicle number sequence for the reference time period on each surrounding road.
[0069] Therefore, the degree of association between each surrounding road and the target road in the reference time period can be obtained according to the degree of correlation between the reference vehicle number sequence in the reference time period on the target road and the reference vehicle number sequence in the reference time period on each surrounding road.
[0070] As an embodiment, the specific calculation method of the degree of association between each surrounding road and the target road is: according to the distance between each surrounding road and the target road, the correlation coefficient between each surrounding road and the reference vehicle number sequence in the reference time period on the target road is used to obtain the degree of association between each surrounding road and the target road; wherein, the distance between each surrounding road and the target road is negatively correlated with the degree of association between each surrounding road and the target road.
[0071] In one embodiment of the present invention, it is specifically expressed by the formula:
[0072]
[0073] In the formula, Indicates The correlation coefficient between the reference vehicle number sequence of the surrounding roads and the target road in the reference time period, Indicates The distance between the surrounding roads and the target road, for Function, used for linear normalization; Indicates The degree of correlation between the surrounding roads and the target road. The distance between the two roads is the minimum distance between the two roads. The correlation coefficient is obtained by the Pearson correlation coefficient, and the process of obtaining the Pearson correlation coefficient is a well-known technology and will not be described in detail here.
[0074] in, middle As The weight of , that is, when the distance between each peripheral road and the target road is closer, the peripheral road is more affected by the vehicle diversion of the target road; when the distance between each peripheral road and the target road is farther, the peripheral road is less affected by the vehicle diversion of the target road. When the correlation coefficient between each peripheral road and the reference vehicle number sequence of the reference time period on the target road is larger, it means that the degree of association between each peripheral road and the target road is greater; when the correlation coefficient between each peripheral road and the reference vehicle number sequence of the reference time period on the target road is smaller, it means that the degree of association between each peripheral road and the target road is smaller.
[0075] At this point, the correlation degree between each surrounding road and the target road in the reference time period is obtained.
[0076] Step S003: Obtain the congestion degree of the target road in the reference time period according to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of association between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period.
[0077] It should be noted that when the number of vehicles passing through the target road in a certain time period is greater, the target road has a greater impact on the traffic flow of the surrounding roads. Conversely, the target road has a smaller impact on the traffic flow of the surrounding roads. When the degree of association between each surrounding road and the target road is greater, the surrounding roads are more affected by the target road; when the degree of association between each surrounding road and the target road is smaller, the surrounding roads are less affected by the target road. When the degree of abnormality of the road traffic flow in each time period of each surrounding road is greater, it means that the surrounding road is more likely to be affected by the diversion of the target road; conversely, the surrounding road is less likely to be affected by the diversion of the target road. Therefore, according to the degree of abnormality of the traffic flow in the reference time period of each surrounding road, the degree of association between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period, the degree of influence of the target road on the traffic flow of the surrounding roads in the reference time period is obtained.
[0078] As an embodiment, a specific calculation method for the degree of influence of a target road on the traffic flow of surrounding roads during a reference time period is as follows: the product of the degree of traffic flow anomaly of each surrounding road during the reference time period and the degree of association between each surrounding road and the target road during the reference time period is recorded as a variation parameter of each surrounding road; the average of the variation parameters of all surrounding roads is recorded as an overall variation parameter of the surrounding roads; the degree of influence of the target road on the traffic flow of surrounding roads during the reference time period is obtained based on the overall variation parameters of the surrounding roads and the number of vehicles passing through the target road during the reference time period; wherein, the number of vehicles passing through the target road during the reference time period is positively correlated with the degree of influence of the target road on the traffic flow of surrounding roads during the reference time period.
[0079] In one embodiment of the present invention, it is specifically expressed by the formula:
[0080]
[0081] In the formula, Indicates The abnormal degree of traffic flow in the reference time period of the surrounding roads, Indicates The degree of correlation between the surrounding roads and the target road in the reference time period, Indicates the number of vehicles passing the target road during the reference time period, is the second preset parameter, indicating the total number of all surrounding roads of the target road. Indicates the impact of the target road on the traffic volume of surrounding roads during the reference time period.
[0082] Among them, when the number of vehicles passing through the target road in a certain period of time is greater, the target road has a greater impact on the traffic flow of the surrounding roads. Conversely, the target road has a smaller impact on the traffic flow of the surrounding roads. The greater the degree of correlation between each surrounding road and the target road, the greater the impact of the target road on the surrounding roads; conversely, the smaller the impact of the target road on the surrounding roads. The greater the abnormality of the road traffic flow in each time period of each surrounding road, the greater the possibility that the surrounding road is affected by the diversion of the target road; conversely, the smaller the possibility that the surrounding road is affected by the diversion of the target road.
[0083] At this point, the impact of the target road on the traffic volume of surrounding roads during the reference time period is obtained.
[0084] It should be noted that traffic jams usually occur in the morning and evening rush hours, which leads to congestion. When there are traffic accidents such as vehicle collisions on the road, the road will also be congested. The congestion caused by the morning and evening rush hours is the same every day, while the congestion caused by traffic accidents is only occasional. Therefore, it is also necessary to comprehensively analyze the road congestion according to the impact of the target road on the traffic volume of surrounding roads in the same time period in the historical data. Therefore, according to the distribution of the impact of the target road on the traffic volume of surrounding roads in the same reference time period on all historical days, the congestion degree of the target road in the reference time period is obtained.
[0085] As an embodiment, a specific calculation method for the congestion level of a target road in a reference time period is as follows: the congestion level of the target road in the reference time period is obtained based on the information entropy and mean of the impact of the target road on the traffic flow of surrounding roads in the same reference time period of all historical days; wherein the information entropy of the impact of the target road on the traffic flow of surrounding roads in the same reference time period of all historical days is negatively correlated with the congestion level of the target road in the reference time period.
[0086] In one embodiment of the present invention, it is specifically expressed by the formula:
[0087]
[0088] In the formula, The information entropy that represents the degree of influence of the target road on the traffic volume of surrounding roads during the reference time period of all historical days. It represents the average value of the impact of the target road on the traffic volume of surrounding roads during the reference time period of all historical days. represents an exponential function with a natural constant as base, Indicates the congestion level of the target road during the reference time period.
[0089] Among them, when the information entropy of the target road's influence on the traffic flow of surrounding roads in the reference time period of all historical days is smaller, it means that the influence on the traffic flow of surrounding roads in the same time period of all days is relatively close, and the distribution of the influence is relatively concentrated, that is, the greater the possibility caused by the morning peak and the evening peak, the greater the congestion of the target road in the reference time period; otherwise, the smaller the congestion of the target road in the reference time period. When the mean value of the influence of the target road on the traffic flow of surrounding roads in the reference time period of all historical days is larger, the greater the congestion of the target road in the reference time period; otherwise, the smaller the congestion of the target road in the reference time period.
[0090] At this point, the congestion level of the target road in the reference time period is obtained.
[0091] Step S004: Determine the congestion situation of the target road in the reference time period through machine learning according to the congestion level of the target road in the reference time period.
[0092] The congestion degree of the target road in all time periods of all historical days is input into the RNN neural network model, and the RNN neural network model is trained to obtain the trained RNN neural network model; wherein the applicable loss function in the RNN neural network model is the cross entropy loss function. The congestion degree of the target road in the reference time period is input into the trained RNN neural network model. When the output is 1, it is determined that the target road is congested in the reference time period, and it is necessary to assign traffic police to relieve the road congestion; when the output is 0, it is determined that the target road is not congested in the reference time period.
[0093] Among them, the RNN neural network model is a well-known technology and will not be described in detail here.
[0094] Among them, the smart city data processing flow chart is as follows Figure 2 shown.
[0095] It should be noted that the The model is only used to represent negative correlation and constrain the output of the model to be in In the specific implementation, it can be replaced by other models with the same purpose. This embodiment is only based on The model is described as an example without any specific limitation. is the input to the model.
[0096] This embodiment provides a smart city data processing system based on machine learning, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the smart city data processing method based on machine learning in steps S001 to S004 is implemented.
[0097] At this point, this embodiment is completed.
[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A smart city data processing method based on machine learning, characterized in that: The method comprises the following steps: Get the number of vehicles passing through each road in each time period of each day; According to the difference between the number of vehicles passing through each road in each time period and the number of vehicles passing through each road in the left adjacent time period, the abnormal degree of traffic flow in each time period of each road is obtained; any road is recorded as the target road, and according to the difference between the number of vehicles passing through each time period and the adjacent time period on the target road, the mutation time period is screened out from all time periods of each day; any time period in each day is recorded as the reference time period, and the mutation time period closest to the reference time period on each road is recorded as the target mutation time period, and the number of vehicles in all time periods between the target mutation time period and the reference time period is composed into a sequence, which is recorded as the reference vehicle number sequence of the reference time period on each road; the roads near the target road are recorded as peripheral roads, and the correlation degree between the target road and the reference vehicle number sequence of the reference time period on each peripheral road is obtained to obtain the correlation degree between each peripheral road and the target road in the reference time period; The congestion degree of the target road in the reference time period is obtained according to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of correlation between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period; Determine the congestion situation of the target road in the reference time period through machine learning according to the congestion level of the target road in the reference time period; The method of obtaining the abnormal degree of traffic flow on each road in each time period according to the difference between the number of vehicles passing on each road in each time period and the number of vehicles passing on each road in the left adjacent time period includes the following specific steps: Sort the number of vehicles passing through each road in all time periods of each day in chronological order to form a set of sequences, which are recorded as the traffic flow sequence of each road; The mean of the difference between each data in the traffic flow sequence of each road and all data in the left neighborhood is recorded as the abnormal degree of traffic flow in each time period of each road; The method of selecting a mutation time period from all time periods of the day according to the difference between the number of vehicles passing through each time period and the number of vehicles passing through the adjacent time periods on the target road includes the following specific steps: Obtain the traffic flow sequence of the target road; mark all time periods with serial numbers in chronological order, establish a reference coordinate system with all time periods as the horizontal axis and the number of vehicles passing through the target road in each time period as the vertical axis, and map the data in the traffic flow sequence of the target road into the reference coordinate system; According to the difference in slope between each data point and the adjacent data points, the mutation degree of each data point is obtained; The mutation degree is greater than or equal to the preset second threshold All data points are recorded as mutation points; the time period corresponding to the mutation point is recorded as the mutation time period; The mutation degree of each data point is obtained according to the difference in slope between each data point and the adjacent data point, and the specific calculation formula included is as follows: In the formula, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. Data and The slope between the data, Indicates the traffic flow sequence of the target road. Data and The slope between the data, To preset the first parameter, is the absolute value symbol, Indicates The mutation degree of each data point is represents the linear normalization function.
2. The method for processing smart city data based on machine learning according to claim 1 is characterized in that: The step of obtaining the correlation degree between each surrounding road and the target road in the reference time period by the correlation degree between the target road and the reference vehicle number sequence in the reference time period on each surrounding road comprises the following specific steps: Obtaining the degree of association between each peripheral road and the target road according to the distance between each peripheral road and the target road and the correlation coefficient between the reference vehicle number sequence of each peripheral road and the target road in the reference time period; There is a negative correlation between the distance between each surrounding road and the target road and the degree of association between each surrounding road and the target road.
3. The method for processing smart city data based on machine learning according to claim 1 is characterized in that: The method of obtaining the congestion degree of the target road in the reference time period according to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of association between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period includes the following specific steps: According to the abnormal degree of traffic flow of each surrounding road in the reference time period, the degree of correlation between each surrounding road and the target road in the reference time period, and the number of vehicles passing through the target road in the reference time period, the influence degree of the target road on the traffic flow of the surrounding roads in the reference time period is obtained; The congestion degree of the target road in the reference time period is obtained by distributing the impact of the target road on the traffic flow of surrounding roads in the same time period of all historical days.
4. The method for processing smart city data based on machine learning according to claim 3 is characterized in that: The method of obtaining the influence of the target road on the traffic flow of the surrounding roads during the reference time period according to the abnormal degree of the traffic flow of each surrounding road during the reference time period, the degree of association between each surrounding road and the target road during the reference time period, and the number of vehicles passing through the target road during the reference time period includes the following specific steps: The product of the abnormal degree of traffic flow of each surrounding road in the reference time period and the degree of association between each surrounding road and the target road in the reference time period is recorded as the variation parameter of each surrounding road; the average of the variation parameters of all surrounding roads is recorded as the overall variation parameter of the surrounding roads; According to the overall change parameters of the surrounding roads and the number of vehicles passing the target road in the reference time period, the influence of the target road on the traffic flow of the surrounding roads in the reference time period is obtained; Among them, the number of vehicles passing through the target road in the reference time period is positively correlated with the impact of the target road on the traffic volume of surrounding roads in the reference time period.
5. The method for processing smart city data based on machine learning according to claim 4 is characterized in that: The congestion degree of the target road in the reference time period is obtained by distributing the influence of the target road on the traffic flow of surrounding roads in the same time period of all historical days, and the specific steps include the following: According to the information entropy and mean of the impact of the target road on the traffic volume of surrounding roads in the same reference time period in all historical days, the congestion degree of the target road in the reference time period is obtained; Among them, the information entropy of the impact of the target road on the traffic volume of surrounding roads during the reference time period of all historical days is negatively correlated with the congestion level of the target road during the reference time period.
6. The method for processing smart city data based on machine learning according to claim 1, characterized in that: The method of determining the congestion situation of the target road in the reference time period by machine learning according to the congestion level of the target road in the reference time period includes the following specific steps: The congestion degree of the target road in all time periods of all historical days is input into the RNN neural network model, and the RNN neural network model is trained to obtain the trained RNN neural network model; wherein the applicable loss function in the RNN neural network model is the cross entropy loss function; the congestion degree of the target road in the reference time period is input into the trained RNN neural network model, and when the output is 1, it is determined that the target road is congested in the reference time period, and traffic police need to be assigned to relieve the road congestion; when the output is 0, it is determined that the target road is not congested in the reference time period.
7. A smart city data processing system based on machine learning, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the smart city data processing method based on machine learning are implemented as described in any one of claims 1-6.
