CN116959259B - Traffic prediction method based on school student events, electronic equipment and storage medium - Google Patents

Traffic prediction method based on school student events, electronic equipment and storage medium Download PDF

Info

Publication number
CN116959259B
CN116959259B CN202311203137.2A CN202311203137A CN116959259B CN 116959259 B CN116959259 B CN 116959259B CN 202311203137 A CN202311203137 A CN 202311203137A CN 116959259 B CN116959259 B CN 116959259B
Authority
CN
China
Prior art keywords
school
data
traffic
event
events
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311203137.2A
Other languages
Chinese (zh)
Other versions
CN116959259A (en
Inventor
刘星
孙超
黄国明
李鋆元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Bao'an Design Group Co ltd
Shenzhen Urban Transport Planning Center Co Ltd
Original Assignee
Shenzhen Baoan Planning And Design Institute Co ltd
Shenzhen Urban Transport Planning Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Baoan Planning And Design Institute Co ltd, Shenzhen Urban Transport Planning Center Co Ltd filed Critical Shenzhen Baoan Planning And Design Institute Co ltd
Priority to CN202311203137.2A priority Critical patent/CN116959259B/en
Publication of CN116959259A publication Critical patent/CN116959259A/en
Application granted granted Critical
Publication of CN116959259B publication Critical patent/CN116959259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/211Selection of the most significant subset of features
    • G06F18/2113Selection of the most significant subset of features by ranking or filtering the set of features, e.g. using a measure of variance or of feature cross-correlation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0137Measuring and analyzing of parameters relative to traffic conditions for specific applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Traffic prediction method, electronic equipment and storage medium based on school release events belong to the technical field of traffic prediction. The traffic flow prediction method aims at solving the problem of school student events. The method collects school release event data to construct a school release event set and collects traffic data for later use; extracting features of the school release event set, and extracting binary features, duration features, geographic features and weight features to obtain school release event set feature vector data; and carrying out data fusion on the feature vector data and the traffic data of the school clearance event set, obtaining the traffic data set of the school clearance event, inputting the traffic data set into a constructed traffic prediction model based on the school clearance event for training, carrying out traffic flow prediction by using the trained traffic prediction model based on the school clearance event, and finally comparing the traffic flow prediction result with the actual traffic flow in the test set to calculate the mean square error. The invention can more accurately predict the traffic flow of school during school discipline.

Description

Traffic prediction method based on school student events, electronic equipment and storage medium
Technical Field
The invention belongs to the technical field of traffic prediction, and particularly relates to a traffic prediction method based on school student events, electronic equipment and a storage medium.
Background
In the intelligent traffic prediction method in the prior art, sensors installed on roads, such as traffic cameras and geomagnetic sensors, are generally adopted to collect information of traffic flow, vehicle speed, vehicle density and the like, vehicle position, speed, acceleration and the like are collected by utilizing vehicle-mounted sensors, public traffic data are collected to collect timetable and real-time position data of public traffic means, social media and application programs are collected to obtain data of social media and smart phone application programs, and then machine learning or deep learning modeling is conducted on the data to predict traffic flow.
In the traffic prediction method in the prior art, prediction can only be performed according to real-time feedback and traffic flow, external factors in traffic prediction cannot be comprehensively considered, so that prediction cannot be performed on traffic flow rapid changes caused by sudden events or fixed events, and accuracy of a prediction result is greatly influenced. Especially, when school is at school, the traffic flow is relatively large, and traffic jam can be caused, but the traffic prediction method in the prior art can not accurately predict the traffic flow.
Disclosure of Invention
The invention aims to solve the problem of accurately predicting traffic flow of school events and provides a traffic prediction method, electronic equipment and a storage medium based on school events.
In order to achieve the above purpose, the present invention is realized by the following technical scheme:
a traffic prediction method based on school student events comprises the following steps:
s1, collecting school release event data to construct a school release event set and collecting traffic data for later use;
s2, extracting features of the school release event set obtained in the step S1, and extracting binary features, duration features, geographic features and weight features to obtain school release event set feature vector data;
s3, carrying out data fusion on the characteristic vector data of the school release event set obtained in the step S2 and the traffic data obtained in the step S1 to obtain a traffic data set of the school release event;
s4, constructing a traffic prediction model based on school release events;
s5, dividing the traffic data set of the school release event obtained in the step S3 into a training set and a prediction set, inputting the training set and the prediction set into the traffic prediction model based on the school release event constructed in the step S4 for training, predicting traffic flow by using the trained traffic prediction model based on the school release event, and finally comparing the traffic flow prediction result with actual traffic flow in a test set to calculate mean square error.
Further, in step S1, school clearance event data including time data and place data of a school clearance event are collected through a school calendar, and traffic data before and after the occurrence of the school clearance event including traffic flow data and time data, duration data and coordinate data corresponding to the traffic flow data are collected.
Further, the specific implementation method of the step S2 includes the following steps:
s2.1, extracting binary characteristicsThe binary feature is used to indicate whether a school clearance event exists within a certain period of time,wherein->=1 indicates that there is a school student event, +.>=0 indicates that there is no school clearance event;
s2.2, extracting the time length characteristicsThe duration feature is used to calculate the difference between the start and end times of school events, +.>Wherein->Indicating the start time of school student event, +.>Indicating the end time of the school student event;
s2.3, extracting geographic features, wherein the geographic features are longitude and latitude of a school or region codes, and represent places of school events;
s2.4, extracting weight characteristics, wherein the weight characteristics are used for representing the influence degree of school release events on traffic, and the calculation expression of the weight characteristics is as follows:
weight feature = relative change/total relative change;
the relative change represents the relative change degree of the average traffic flow and the usual traffic flow caused by school student events, and the calculation expression of the relative change is:
relative change = (average traffic flow during school clearance event-average traffic flow in usual)/average traffic flow in usual
The total relative change is the sum of the relative changes of all school student events, and the total relative change is calculated by the following expression:
total relative change = Σ (relative change).
Further, the specific implementation method of the step S3 includes the following steps:
s3.1, aligning the characteristic vector data of the school release event set obtained in the step S2 with the traffic data obtained in the step S1, collecting the school release event time period as [ start_time, end_time ], collecting the time stamp of the traffic data as time stamp, and mapping the school release event time period to the time stamp of the traffic data, wherein the calculation expression is as follows:
wherein,the school clearance event time period corresponding to the traffic data;
s3.2, carrying out data cleaning on the data aligned in the step S3.1, and deleting abnormal values or outliers or inconsistent data;
a threshold is defined by using a statistical method, specifically using the mean value ± 2 standard deviations as the threshold of the outlier, and the treatment is performed by using the following formula, wherein the calculation expression is as follows:
wherein,for the original dataset +.>Is the mean value of the dataset, +.>Is the standard deviation of the dataset +.>For the cleaned dataset, +.>Data point coordinates;
s3.3, processing the data cleaned in the step S3.2, namely processing the missing value, and processing according to the degree of the data missing value;
s3.3.1 when the data missing value is less than or equal to 5%, processing by deleting the row or column where the missing value is located, wherein the calculation expression is as follows:
s3.3.2 when the data missing value is more than 5%, the linear interpolation method is adopted for processing, and the calculation expression is as follows:
wherein,for the interpolated value, (-)>, />) And (/ ->, />) As a result of the known data points,is the position of the missing value, wherein +.>And->Respectively represents a first independent variable and a second independent variable,and->Respectively representing a first dependent variable and a second dependent variable;
s3.3.3 when the missing value of the data is more than 5% and the missing value cannot be filled by interpolation, the specific value filling is adopted for processing, and the calculation expression is as follows:
wherein,for the filled data set, +.>For judging element->Whether a function of the missing value.
Further, in step S4, the traffic prediction model based on school release events adopts a linear regression method, and the fitted linear equation correlates the characteristics with the traffic flow through weights and deviations, and the calculation expression is as follows:
wherein,yfor traffic flow, p i Is characteristic of the ith school student's event, w i And b is a deviation, wherein the weight corresponds to the characteristic of the i-th school student-playing event.
Further, the specific implementation method of step S5 is to use the features of the training set and the corresponding traffic flow data to perform model training on the traffic prediction model based on the school release event, use the traffic prediction model based on the school release event to perform traffic flow prediction on the features of the test set, and finally compare the prediction result with the actual traffic flow in the test set, and calculate the mean square error, where the calculation formula of the mean square error is:
wherein,for mean square error, n is the number of test samples, < >>For the traffic flow predicted by the model,corresponding actual traffic flow in the test set.
Further, in step S5, the features are input into a traffic prediction model based on school student events to predict traffic flow.
The electronic equipment comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the traffic prediction method based on school release events when executing the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of traffic prediction based on school student events.
The invention has the beneficial effects that:
compared with the traditional method based on historical data, the traffic prediction method based on school student events provided by the invention has the advantage that the external factors in traffic prediction are more comprehensively considered.
The traffic prediction method based on school student events provides an intuitive way for explaining traffic prediction results, and the contribution degree of each school student event to traffic flow is known through weight setting. Such an interpretation helps traffic managers, city planners and decision makers understand the working principles of traffic prediction models and make corresponding adjustments and optimizations as needed.
According to the traffic prediction method based on school student events, the influence of the school student event set is considered and the corresponding weight is given to the school student event set, so that the traffic flow during school student can be predicted more accurately.
Drawings
Fig. 1 is a flow chart of a traffic prediction method based on school student events according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and detailed description. It should be understood that the embodiments described herein are for purposes of illustration only and are not intended to limit the invention, i.e., the embodiments described are merely some, but not all, of the embodiments of the invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein can be arranged and designed in a wide variety of different configurations, and the present invention can have other embodiments as well.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, are intended to fall within the scope of the present invention.
For further understanding of the invention, the following detailed description is presented in conjunction with the accompanying drawings 1 to provide a further understanding of the invention in its aspects, features and efficacy:
the first embodiment is as follows:
a traffic prediction method based on school student events comprises the following steps:
s1, collecting school release event data to construct a school release event set and collecting traffic data for later use;
further, in step S1, school clearance event data including time data and place data of a school clearance event are collected through a school calendar, and traffic data before and after the occurrence of the school clearance event including traffic flow data and time data, duration data and coordinate data corresponding to the traffic flow data are collected;
s2, extracting features of the school release event set obtained in the step S1, and extracting binary features, duration features, geographic features and weight features to obtain school release event set feature vector data;
further, the specific implementation method of the step S2 includes the following steps:
s2.1, extracting binary characteristicsThe binary feature is used to indicate whether a school clearance event exists within a certain period of time,wherein->=1 indicates that there is a school student event, +.>=0 indicates that there is no school clearance event;
s2.2, extracting the time length characteristicsThe duration feature is used to calculate the difference between the start and end times of school events, +.>Wherein->Indicating the start time of school student event, +.>Indicating the end time of the school student event;
s2.3, extracting geographic features, wherein the geographic features are longitude and latitude of a school or region codes, and represent places of school events;
further, for each possible value of a geographic feature, a binary feature is created using One-Hot encoding. If there are three schools (school A, school B, school C), three binary features can be created, indicating whether each school belongs to, e.g., a sample belongs to school A, and the corresponding feature value is [1, 0, 0];
s2.4, extracting weight characteristics, wherein the weight characteristics are used for representing the influence degree of school release events on traffic, and the calculation expression of the weight characteristics is as follows:
weight feature = relative change/total relative change;
the relative change represents the relative change degree of the average traffic flow and the usual traffic flow caused by school student events, and the calculation expression of the relative change is:
relative change = (average traffic flow during school clearance event-average traffic flow in usual)/average traffic flow in usual
The total relative change is the sum of the relative changes of all school student events, and the total relative change is calculated by the following expression:
total relative change = Σ (relative change);
s3, carrying out data fusion on the characteristic vector data of the school release event set obtained in the step S2 and the traffic data obtained in the step S1 to obtain a traffic data set of the school release event;
further, the specific implementation method of the step S3 includes the following steps:
s3.1, aligning the characteristic vector data of the school release event set obtained in the step S2 with the traffic data obtained in the step S1, collecting the school release event time period as [ start_time, end_time ], collecting the time stamp of the traffic data as time stamp, and mapping the school release event time period to the time stamp of the traffic data, wherein the calculation expression is as follows:
wherein,the school clearance event time period corresponding to the traffic data;
s3.2, carrying out data cleaning on the data aligned in the step S3.1, and deleting abnormal values or outliers or inconsistent data;
a threshold is defined by using a statistical method, specifically using the mean value ± 2 standard deviations as the threshold of the outlier, and the treatment is performed by using the following formula, wherein the calculation expression is as follows:
wherein,for the original dataset +.>Is the mean value of the dataset, +.>Is the standard deviation of the dataset +.>For the cleaned dataset, +.>Data point coordinates;
further, the values in the historical traffic data are classified to generate a value list, such as [ flow 1, flow 2, ], flow n ] or [ time 1, time 2, ], time n ];
the calculation formula of the average flow is as follows:
mean= (flow 1+flow 2+, +flow n)/n;
the calculation formula of the average value time is as follows:
mean= (time 1+time 2+, +time n)/n;
the calculation formula of the standard deviation flow is as follows:
std=sqrt (((flow 1-mean)/(2+) (flow 2-mean)/(2+) + (flow n-mean)/(2)/n)
The calculation formula of standard deviation time is:
std=sqrt (((time 1-mean)/(2+) (time 2-mean)/(2+) + (time n-mean)/(2)/n);
s3.3, processing the data cleaned in the step S3.2, namely processing the missing value, and processing according to the degree of the data missing value;
s3.3.1 when the data missing value is less than or equal to 5% and the whole data analysis is not affected, processing by deleting the row or column where the missing value is located, wherein the calculation expression is as follows:
s3.3.2 when the data missing value is more than 5%, the linear interpolation method is adopted for processing, and the calculation expression is as follows:
wherein,for the interpolated value, (-)>, />) And (/ ->, />) As a result of the known data points,is the position of the missing value, wherein +.>And->Respectively represents a first independent variable and a second independent variable,and->Respectively representing a first dependent variable and a second dependent variable;
s3.3.3 when the missing value of the data is more than 5% and the missing value cannot be filled by interpolation, the specific value filling is adopted for processing, and the calculation expression is as follows:
wherein,for the filled data set, +.>For judging element->Whether or not it is a function of the missing value;
s4, constructing a traffic prediction model based on school release events;
further, in step S4, the traffic prediction model based on school release events adopts a linear regression method, and the fitted linear equation correlates the characteristics with the traffic flow through weights and deviations, and the calculation expression is as follows:
wherein,yfor traffic flow, p i Is characteristic of the ith school student's event, w i The weight corresponding to the characteristics of the i-th school student-playing event is given, and b is the deviation;
further, the traffic flow corresponds to the congestion situation, and the congestion situation is manually set according to the current traffic flow and is classified into A, B, C three grades;
further, the prediction accuracy of the model is evaluated by using the test data, and the prediction result is compared with the actual situation. Model improvement and optimization are carried out according to the evaluation result, characteristic selection adjustment is carried out, and characteristic deletion and weight adjustment can be carried out according to the actual evaluation result.
S5, dividing the traffic data set of the school release event obtained in the step S3 into a training set and a prediction set, inputting the training set and the prediction set into the traffic prediction model based on the school release event constructed in the step S4, performing traffic flow prediction by using the trained traffic prediction model based on the school release event, and finally comparing the traffic flow prediction result with actual traffic flow in a test set to calculate a mean square error;
further, the specific implementation method of step S5 is to use the features of the training set and the corresponding traffic flow data to perform model training on the traffic prediction model based on the school release event, use the traffic prediction model based on the school release event to perform traffic flow prediction on the features of the test set, and finally compare the prediction result with the actual traffic flow in the test set, and calculate the mean square error, where the calculation formula of the mean square error is:
wherein,for mean square error, n is the number of test samples, < >>For the traffic flow predicted by the model,corresponding actual traffic flow in the test set.
Further, in step S5, the features are input into a traffic prediction model based on school student events to predict traffic flow.
The second embodiment is as follows:
the electronic equipment comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the traffic prediction method based on school release events when executing the computer program.
The computer device of the present invention may be a device including a processor and a memory, such as a single chip microcomputer including a central processing unit. And the processor is used for realizing the steps of the traffic prediction method based on school student events when executing the computer program stored in the memory.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
And a third specific embodiment:
a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of traffic prediction based on school student events.
The computer readable storage medium of the present invention may be any form of storage medium that is readable by a processor of a computer device, including but not limited to, nonvolatile memory, volatile memory, ferroelectric memory, etc., on which a computer program is stored, and when the processor of the computer device reads and executes the computer program stored in the memory, the steps of the traffic prediction method based on school student events described above may be implemented.
The computer program comprises computer program code which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Although the present application has been described hereinabove with reference to specific embodiments, various modifications thereof may be made and equivalents may be substituted for elements thereof without departing from the scope of the application. In particular, the features of the embodiments disclosed in this application may be combined with each other in any way as long as there is no structural conflict, and the exhaustive description of these combinations is not given in this specification merely for the sake of omitting the sake of brevity and saving resources. Therefore, it is intended that the present application not be limited to the particular embodiments disclosed, but that the present application include all embodiments falling within the scope of the appended claims.

Claims (6)

1. A traffic prediction method based on school release events is characterized by comprising the following steps:
s1, collecting school release event data to construct a school release event set and collecting traffic data for later use;
s2, extracting features of the school release event set obtained in the step S1, and extracting binary features, duration features, geographic features and weight features to obtain school release event set feature vector data;
the specific implementation method of the step S2 comprises the following steps:
s2.1, extracting a binary feature B, wherein the binary feature B is used for indicating whether a school clearance event exists in a certain time period, B epsilon {0,1}, wherein B=1 indicates that the school clearance event exists, and B=0 indicates that the school clearance event does not exist;
s2.2, extracting a time length feature D, wherein the time length feature is used for calculating the difference value between the starting time and the ending time of the school student events, and D=T e -T s Wherein T is s Indicating the start time of school student's events, T e Indicating the end time of the school student event;
s2.3, extracting geographic features, wherein the geographic features are longitude and latitude of a school or region codes, and represent places of school events;
s2.4, extracting weight characteristics, wherein the weight characteristics are used for representing the influence degree of school release events on traffic, and the calculation expression of the weight characteristics is as follows:
weight feature = relative change/total relative change
The relative change represents the relative change degree of the average traffic flow and the usual traffic flow caused by school student events, and the calculation expression of the relative change is:
relative change = (average traffic flow during school clearance event-average traffic flow in usual)/average traffic flow in usual
The total relative change is the sum of the relative changes of all school student events, and the total relative change is calculated by the following expression:
total relative change = Σ (relative change);
s3, carrying out data fusion on the characteristic vector data of the school release event set obtained in the step S2 and the traffic data obtained in the step S1 to obtain a traffic data set of the school release event;
the specific implementation method of the step S3 comprises the following steps:
s3.1, aligning the characteristic vector data of the school release event set obtained in the step S2 with the traffic data obtained in the step S1, collecting the school release event time period as [ start_time, end_time ], collecting the time stamp of the traffic data as time stamp, and mapping the school release event time period to the time stamp of the traffic data, wherein the calculation expression is as follows:
f(time)=timestamp
wherein f (time) is a school clearance event time period corresponding to traffic data;
s3.2, carrying out data cleaning on the data aligned in the step S3.1, and deleting abnormal values or outliers or inconsistent data;
a threshold is defined by using a statistical method, specifically using the mean value ± 2 standard deviations as the threshold of the outlier, and the treatment is performed by using the following formula, wherein the calculation expression is as follows:
filtered_data={x|x∈data,mean(data)-2×std(data)≤x≤mean(data)+2×std(data)}
wherein, data is an original data set, mean (data) is an average value of the data set, std (data) is a standard deviation of the data set, filtered_data is a cleaned data set, and x is a data point coordinate;
s3.3, processing the data cleaned in the step S3.2, namely processing the missing value, and processing according to the degree of the data missing value;
s3.3.1, when the data missing value is less than or equal to 5%, processing by adopting a method of deleting the row or column where the missing value is located;
s3.3.2 when the data missing value is more than 5%, the linear interpolation method is adopted for processing, and the calculation expression is as follows:
wherein, interpolated_value is an interpolated value, (x) 1 ,y 1 ) And (x) 2 ,y 2 ) Interpolated_value is the location of the missing value, where x is the known data point 1 And x 2 Respectively representing a first independent variable, a second independent variable, y 1 And y 2 Respectively representA first dependent variable, a second dependent variable;
s3.3.3 when the missing value of the data is more than 5% and the missing value cannot be filled by interpolation, the specific value filling is adopted for processing, and the calculation expression is as follows:
filled_data={x|x∈data,is_missing(x)}
the file_data is a filled data set, and is_missing (x) is a function for judging whether the element x is a missing value or not;
s4, constructing a traffic prediction model based on school release events;
in the step S4, a linear regression method is adopted in the traffic prediction model based on school release events, the fitted linear equation correlates the characteristics with traffic flow through weight and deviation, and the calculation expression is as follows:
y=w 1 *p 1 +w 2 *p 2 +…+w i *p i+ …w n *p n +b
wherein y is traffic flow, p i Is characteristic of the ith school student's event, w i The weight corresponding to the characteristics of the i-th school student-playing event is given, and b is the deviation;
s5, dividing the traffic data set of the school release event obtained in the step S3 into a training set and a prediction set, inputting the training set and the prediction set into the traffic prediction model based on the school release event constructed in the step S4 for training, predicting traffic flow by using the trained traffic prediction model based on the school release event, and finally comparing the traffic flow prediction result with actual traffic flow in a test set to calculate mean square error.
2. The traffic prediction method based on school events according to claim 1, wherein in step S1, school event data including time data and place data of school events are collected through a school calendar, and traffic data before and after occurrence of school events including traffic flow data and time data, duration data and coordinate data corresponding to the traffic flow data are collected.
3. The traffic prediction method based on school release events according to claim 2, wherein the specific implementation method of step S5 is to use the features of the training set and the corresponding traffic flow data to perform model training on the traffic prediction model based on school release events, and use the traffic prediction model based on school release events to perform traffic flow prediction on the features of the test set, and finally compare the prediction result with the actual traffic flow in the test set, and calculate a mean square error, where the calculation formula of the mean square error is:
where MSE is the mean square error, n is the number of test samples,traffic flow predicted for model, +.>Corresponding actual traffic flow in the test set.
4. The traffic prediction method based on school events according to claim 3, wherein the feature is input into the traffic prediction model based on school events to predict the traffic flow in step S5.
5. An electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of a school release event-based traffic prediction method according to any one of claims 1-4 when the computer program is executed.
6. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a school-release event based traffic prediction method according to any of claims 1-4.
CN202311203137.2A 2023-09-19 2023-09-19 Traffic prediction method based on school student events, electronic equipment and storage medium Active CN116959259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311203137.2A CN116959259B (en) 2023-09-19 2023-09-19 Traffic prediction method based on school student events, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311203137.2A CN116959259B (en) 2023-09-19 2023-09-19 Traffic prediction method based on school student events, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116959259A CN116959259A (en) 2023-10-27
CN116959259B true CN116959259B (en) 2023-12-26

Family

ID=88447732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311203137.2A Active CN116959259B (en) 2023-09-19 2023-09-19 Traffic prediction method based on school student events, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116959259B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111613054A (en) * 2020-05-07 2020-09-01 浙江大学 Multi-step traffic speed prediction method cooperatively considering space-time correlation and contribution difference
CN115762165A (en) * 2022-11-30 2023-03-07 陈宇 Campus traffic control system
CN116504078A (en) * 2023-05-22 2023-07-28 新疆交通职业技术学院 Traffic control method and system for primary school crossing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9928735B2 (en) * 2015-02-09 2018-03-27 Operr Technologies, Inc. Systems and methods for traffic violation avoidance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111613054A (en) * 2020-05-07 2020-09-01 浙江大学 Multi-step traffic speed prediction method cooperatively considering space-time correlation and contribution difference
CN115762165A (en) * 2022-11-30 2023-03-07 陈宇 Campus traffic control system
CN116504078A (en) * 2023-05-22 2023-07-28 新疆交通职业技术学院 Traffic control method and system for primary school crossing

Also Published As

Publication number Publication date
CN116959259A (en) 2023-10-27

Similar Documents

Publication Publication Date Title
WO2022142042A1 (en) Abnormal data detection method and apparatus, computer device and storage medium
CN108875746B (en) License plate recognition method, device and system and storage medium
JPWO2017115458A1 (en) Log analysis system, method and program
CN113570867B (en) Urban traffic state prediction method, device, equipment and readable storage medium
CN114037140A (en) Prediction model training method, prediction model training device, prediction model data prediction method, prediction model data prediction device, prediction model data prediction equipment and storage medium
CN113269240A (en) Rainfall station site selection information output method and device, electronic equipment and medium
CN106530198B (en) Adaptive batch steganography method based on parameter fitting safe capacity
CN105429792B (en) User behavior flow acquisition methods and device, user behavior analysis method and system
CN116959259B (en) Traffic prediction method based on school student events, electronic equipment and storage medium
CN116703132B (en) Management method and device for dynamic scheduling of shared vehicles and computer equipment
CN116431923B (en) Traffic travel prediction method, equipment and medium for urban road
CN109800887B (en) Generation method and device of prediction process model, storage medium and electronic equipment
CN114663731B (en) Training method and system of license plate detection model, and license plate detection method and system
CN116091964A (en) High-order video scene analysis method and system
CN111553737B (en) Business time prediction method and device
CN110475198B (en) Urban road user track deviation correction processing method and device
CN112149833A (en) Prediction method, device, equipment and storage medium based on machine learning
CN113326877A (en) Model training method, data processing method, device, apparatus, storage medium, and program
CN115482500A (en) Crowd counting method and device based on confidence probability
CN111767937A (en) Target detection model training method and device, electronic equipment and storage medium
CN115830874B (en) Traffic flow basic diagram fitting performance evaluation method and system
CN117079062B (en) Dynamic and static influence parameter analysis method based on pavement crack analysis method
CN112508303B (en) OD passenger flow prediction method, device, equipment and readable storage medium
CN117392854B (en) Method for extracting administrative region OD (optical density) based on expressway charging data
CN117596551B (en) Green road network user behavior restoration method and device based on mobile phone signaling data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Room 1210, block C, building 1, Xinghe legend Garden Phase III, Longtang community, Minzhi street, Longhua District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Urban Traffic Planning and Design Research Center Co.,Ltd.

Country or region after: China

Patentee after: Shenzhen Bao'an Design Group Co.,Ltd.

Address before: Room 1210, block C, building 1, Xinghe legend Garden Phase III, Longtang community, Minzhi street, Longhua District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen Urban Traffic Planning and Design Research Center Co.,Ltd.

Country or region before: China

Patentee before: Shenzhen Baoan Planning and Design Institute Co.,Ltd.

CP03 Change of name, title or address