CN116029395B - Pedestrian flow early warning method and device for business area, electronic equipment and storage medium - Google Patents

Pedestrian flow early warning method and device for business area, electronic equipment and storage medium Download PDF

Info

Publication number
CN116029395B
CN116029395B CN202310294587.0A CN202310294587A CN116029395B CN 116029395 B CN116029395 B CN 116029395B CN 202310294587 A CN202310294587 A CN 202310294587A CN 116029395 B CN116029395 B CN 116029395B
Authority
CN
China
Prior art keywords
data
people flow
prediction model
people
current
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
CN202310294587.0A
Other languages
Chinese (zh)
Other versions
CN116029395A (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 Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology 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 Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202310294587.0A priority Critical patent/CN116029395B/en
Publication of CN116029395A publication Critical patent/CN116029395A/en
Application granted granted Critical
Publication of CN116029395B publication Critical patent/CN116029395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Abstract

The application discloses a traffic early warning method, a traffic early warning device, electronic equipment and a storage medium of a business area, and relates to the technical field of artificial intelligence, wherein the traffic early warning method of the business area comprises the following steps: extracting historical characteristic data of a business area, and constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions; training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function; evaluating each second people flow prediction model to determine a target people flow prediction model; and inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme. The method and the device solve the technical problem that the effect of controlling and dredging the people flow in the public place is poor when the people flow is congested.

Description

Pedestrian flow early warning method and device for business area, electronic equipment and storage medium
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a people stream early warning method, a device, electronic equipment and a storage medium for a business area.
Background
In recent years, with the increasing urban proportion of China, urban population is increasing. Accordingly, the traffic of various business centers/business complexes in cities is also increasing, and particularly in public places such as weekends, holidays and the like, people tend to become full. In public places, controlling people flow density is a key factor in ensuring safety, security and proper operation of infrastructure. However, monitoring and management of people flow has a certain difficulty because the effect of managing and dredging people flow is poor when it is judged that the people flow is already congested. Therefore, a method for predicting the people flow in the public place is needed, which is convenient for the manager to predict the people flow in the business area and to manage and dredge the people flow in the business area in advance.
Disclosure of Invention
The main purpose of the application is to provide a people stream early warning method, a device, electronic equipment and a storage medium for a business area, and aims to solve the technical problem that the effect of controlling and dredging people stream in public places is poor when people stream is congested.
In order to achieve the above objective, the present application provides a traffic early warning method for a commercial area, where the traffic early warning method for the commercial area includes:
extracting historical characteristic data of a business area, wherein the historical characteristic data at least comprises area data, people flow data, time data, merchant data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total people in the business area, average people flow of each shop in the business area and average residence time, the time data at least comprises time points and date types corresponding to the historical characteristic data, the merchant data at least comprises merchant sales promotion conditions and online scoring conditions, and the environment data at least comprises weather conditions, economic environments and traffic congestion indexes;
constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function;
evaluating each second people flow prediction model through a k-fold cross validation method to determine a target people flow prediction model;
And inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme.
Optionally, before the step of training each of the first people flow prediction models based on the historical feature data, the method further includes:
screening abnormal data meeting preset abnormal conditions from the historical characteristic data;
and eliminating abnormal data in the historical characteristic data.
Optionally, the step of constructing the corresponding first person flow prediction model based on the preset support vector regression algorithm and the preset multiple kernel functions includes:
extracting each feature dimension in the historical feature data;
and constructing a first person flow prediction model corresponding to each kernel function based on a support vector regression algorithm, wherein the independent variable of the first person flow prediction model comprises each characteristic dimension.
Optionally, the step of training each first people flow prediction model based on the historical feature data to obtain a second people flow prediction model corresponding to each kernel function includes:
dividing the historical characteristic data into a training set and a testing set, and inputting the characteristic data in the training set into each first person flow prediction model to obtain corresponding first predicted person flow;
Comparing the difference between the first predicted traffic and the traffic data in the feature data in the training set to adjust model parameters in the first traffic prediction model;
inputting the characteristic data in the test set into each first people flow prediction model to obtain corresponding second predicted people flow;
inputting the second predicted people flow and the people flow data in the characteristic data in the test set into a preset loss function, and calculating a characteristic loss value;
and when the characteristic loss value is smaller than a preset threshold value, stopping training the first people flow prediction model, and obtaining a second people flow prediction model corresponding to each kernel function.
Optionally, the expression of the preset loss function is:
wherein ,is penalty constant, and->Is a constant greater than 0 for adjusting the weight of said preset loss function,/->For each of said feature dimensions, a corresponding feature value, < >>For said second predicted traffic, +.>Representing the corresponding headcount in the historical feature data,/->For the number of sets of history feature data, +.>Dimension number, +.> and />Are model parameters of the preset loss function, </i > >Is->Insensitive loss function->Is an insensitive parameter.
Optionally, the step of evaluating each of the second people flow prediction models by a k-fold cross validation method, and determining the target people flow prediction model includes:
randomly dividing the historical characteristic data into preset number parts, randomly taking one part as test set data, and taking other historical characteristic data as training sets;
the steps are repeatedly executed: randomly taking one of the sets as test set data and other historical characteristic data as training sets until a preset number of sets of training sets and test sets are obtained;
respectively inputting each group of training sets and test sets into the second people flow prediction model to obtain each group of evaluation results corresponding to the second people flow prediction model;
calculating the average value of each group of evaluation results to obtain the average evaluation result of the second people flow prediction model;
setting a second people flow prediction model with the best average evaluation result as a target people flow prediction model
Optionally, the people stream early warning scheme at least includes early warning information, and the step of inputting the area data, the current people stream data, the current time data, the current merchant data, the current environment data and the prediction time into the target people stream prediction model includes:
Acquiring a prediction time and a people flow threshold;
extracting current people flow data, current time data, current merchant data and current environment data of the business area;
inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time;
and when the predicted people flow rate data exceeds the people flow rate threshold value, sending out early warning information.
The application also provides a traffic early warning device of business district, traffic early warning device of business district is applied to traffic early warning equipment of business district, traffic early warning device of business district includes:
the characteristic extraction module is used for extracting historical characteristic data of a business area, wherein the historical characteristic data at least comprises area data, people flow data, time data, merchant data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total people in the business area, average people flow of each shop in the business area and average residence time, the time data at least comprises time points and date types corresponding to the historical characteristic data, the merchant data at least comprises merchant sales promotion conditions and on-line scoring conditions, and the environment data at least comprises weather conditions, economic environments and traffic jam indexes;
The model construction module is used for constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
the model training module is used for training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function;
the model verification module is used for evaluating each second people flow prediction model through a k-fold cross verification method and determining a target people flow prediction model;
and the people flow early warning module is used for inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme.
Optionally, the model training module is further configured to:
screening abnormal data meeting preset abnormal conditions from the historical characteristic data;
and eliminating abnormal data in the historical characteristic data.
Optionally, the model building module is further configured to:
extracting each feature dimension in the historical feature data;
and constructing a first person flow prediction model corresponding to each kernel function based on a support vector regression algorithm, wherein the independent variable of the first person flow prediction model comprises each characteristic dimension.
Optionally, the model training module is further configured to:
dividing the historical characteristic data into a training set and a testing set, and inputting the characteristic data in the training set into each first person flow prediction model to obtain corresponding first predicted person flow;
comparing the difference between the first predicted traffic and the traffic data in the feature data in the training set to adjust model parameters in the first traffic prediction model;
inputting the characteristic data in the test set into each first people flow prediction model to obtain corresponding second predicted people flow;
inputting the second predicted people flow and the people flow data in the characteristic data in the test set into a preset loss function, and calculating a characteristic loss value;
and when the characteristic loss value is smaller than a preset threshold value, stopping training the first people flow prediction model, and obtaining a second people flow prediction model corresponding to each kernel function.
Optionally, the model verification module is further configured to:
randomly dividing the historical characteristic data into preset number parts, randomly taking one part as test set data, and taking other historical characteristic data as training sets;
The steps are repeatedly executed: randomly taking one of the sets as test set data and other historical characteristic data as training sets until a preset number of sets of training sets and test sets are obtained;
respectively inputting each group of training sets and test sets into the second people flow prediction model to obtain each group of evaluation results corresponding to the second people flow prediction model;
calculating the average value of each group of evaluation results to obtain the average evaluation result of the second people flow prediction model;
and setting a second people flow prediction model with the best average evaluation result as a target people flow prediction model. Optionally, the people stream early warning module is further configured to:
acquiring a prediction time and a people flow threshold;
extracting current people flow data, current time data, current merchant data and current environment data of the business area;
inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time;
and when the predicted people flow rate data exceeds the people flow rate threshold value, sending out early warning information.
The application also provides an electronic device, which is an entity device, and includes: the system comprises a memory, a processor and a program of the traffic early warning method of the commercial area, wherein the program of the traffic early warning method of the commercial area is stored in the memory and can be run on the processor, and the program of the traffic early warning method of the commercial area can realize the steps of the traffic early warning method of the commercial area when being executed by the processor.
The present application also provides a computer readable storage medium, where a program for implementing a traffic early warning method of a business area is stored, where the program for implementing the traffic early warning method of the business area, when executed by a processor, implements the steps of the traffic early warning method of the business area as described above.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a people stream early warning method for a business area as described above.
The application provides a traffic early warning method, a device, an electronic device and a storage medium of a business area, firstly, historical characteristic data of the business area are extracted, wherein the historical characteristic data at least comprise area data, traffic data, time data, merchant data and environment data, the area data at least comprise business area and entrance width, the traffic data at least comprise total number of people in the business area, average traffic of each shop in the business area and average residence time, the time data at least comprise time points and date types corresponding to the historical characteristic data, the merchant data at least comprise merchant sales promotion conditions and online scoring conditions, the environment data at least comprise weather conditions, economic environment and traffic congestion indexes, thereby fully considering factors affecting each dimension of the traffic, the accuracy of people flow prediction is improved, a corresponding first people flow prediction model is constructed based on a preset support vector regression algorithm and each kernel function, each first people flow prediction model is trained based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function, each second people flow prediction model is finally evaluated through a k-fold cross validation method to determine a target people flow prediction model, wherein the k-fold cross validation method is applied to improve the utilization rate of characteristic data, the accuracy of people flow prediction model evaluation can be improved when the historical characteristic data are insufficient, and therefore a target people flow prediction model with high prediction accuracy is obtained, and the regional data, the current people flow data, the current time data, the current merchant data, the current time data and the like are processed, the current environmental data and the prediction time are input into the target people flow prediction model, and a people flow early warning scheme is generated, so that people flow in public places is predicted. By means of the target people flow prediction model, management staff can conduct people flow dispersion in advance, the technical defect that people flow control and dispersion effect is poor when people flow is congested is overcome, and therefore effects of controlling and dispersion on people flow in public places are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a first embodiment of a people stream early warning method in a business area of the present application;
FIG. 2 is a schematic diagram of loss calculation of a support vector regression model in a pedestrian flow early warning method of a business area of the application;
FIG. 3 is a schematic flow chart of a first embodiment of a people stream early warning method in a business area of the present application;
FIG. 4 is a schematic diagram of the independent variables, input parameters and dependent variables of a gate plate traffic prediction model in the traffic early warning method of the business area of the present application;
fig. 5 is a schematic diagram of a composition structure of a traffic early warning device in a business area according to an embodiment of the present application;
fig. 6 is a schematic device structure diagram of a hardware operating environment related to a traffic early warning method in a business area according to an embodiment of the present application.
The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present application more comprehensible, the following description will make the technical solutions of the embodiments of the present application clear and complete with reference to the accompanying drawings of the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which are within the scope of the protection of the present application, will be within the purview of one of ordinary skill in the art without the exercise of inventive faculty.
Example 1
In recent years, the urban area of China is higher and higher, and the urban population is more and more. Accordingly, there is also an increasing traffic volume of various business centers/business complexes in cities, especially on weekends, holidays, etc., which tend to be very ill. Controlling the people stream density in public places is a key factor in ensuring safety, security and proper operation of infrastructure. However, monitoring and managing people streams is challenging, and thus, there is a need for a system and method that can predict public people streams and provide early warning, helping the manager to predict how much people flow in different areas to drain people flow in advance. According to the embodiment of the application, the artificial intelligent algorithm is used for constructing and training the people flow prediction model, and the people flow in a business area is predicted by means of camera images, spatial positions, store information, weather, holidays, time and other data, so that the people flow in the business area is early warned, and management staff can dredge the people flow in time.
In a first embodiment of a traffic early warning method for a business area according to the present application, referring to fig. 1, the traffic early warning method for a business area includes:
step S10, historical characteristic data of a business area are extracted, wherein the historical characteristic data at least comprise area data, people flow data, time data, merchant data and environment data, the area data at least comprise business area and entrance width, the people flow data at least comprise total people in the business area, average people flow of each shop in the business area and average residence time, the time data at least comprise time points and date types corresponding to the historical characteristic data, the merchant data at least comprise merchant sales promotion conditions and online scoring conditions, and the environment data at least comprise weather conditions, economic environments and traffic jam indexes;
step S20, constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
step S30, training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function;
Step S40, evaluating each second people flow prediction model through a k-fold cross validation method to determine a target people flow prediction model;
and S50, inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme.
In this embodiment of the present application, it should be noted that, the business area may be an area in a business center where a certain camera may photograph, the historical feature area is feature values such as area data, time data, merchant data, and environmental data acquired through people flow data acquired by the camera and other channels, where each feature value is used as a factor affecting people flow prediction to participate in model training, so that a people flow prediction model obtained by training is more accurate. In the embodiment of the application, an SVR (Support Vector Regressio, support vector regression algorithm) model is adopted when people flow in the first business area is early-warned, the SVR belongs to a regression model, is mainly used for fitting numerical values and is generally applied to a prediction scene with sparse characteristics, for example, in the embodiment of the application, people flow is predicted, the dimensionality of characteristic data is more, the relevance among all dimensionalities is not high, the SVR model is adopted for predicting the people flow, the characteristic data of all dimensionalities can be comprehensively considered more comprehensively, and a predicted value can be obtained accurately; in the model construction, under the condition that feature data is not easy to be linearly segmented in a low dimension, nonlinear transformation is carried out through a certain kernel function, an input space is mapped to a high-dimension feature space, dot products of feature vectors in the high-dimension feature space are returned, and common kernel functions comprise a polynomial kernel function, a Gauss radial basis kernel function and a multi-layer perceptron kernel function; in addition, the k-fold cross validation method is used for repeatedly utilizing the collected characteristic data for multiple times when the historical characteristic data are fewer, for example, when the characteristic data are difficult to collect, and the collected characteristic data are divided into different training sets and test sets, so that the utilization rate of the characteristic data is improved, and the evaluation effect on the model is better improved under the condition that the characteristic data quantity is certain.
In addition, the business area is a certain area divided in the business center, the area data at least comprises a business area S and a sum W of an outlet width and an inlet width, and if the area is an open area with obvious entrances and exits, the value W takes the perimeter of the business area; the people flow data is the daily average passenger flow rate of each shop in the business area in a recent preset time period, wherein P1, P2, …, pn, P1, P2 and the like are the daily average passenger flow rate of each shop, the setting of the preset time period can be set according to actual needs, for example, the preset time period can be set to be one month for reflecting the prosperity degree of the shop, and the average residence time of the passenger flow of each shop in the business area can be expressed as ST= [ ST1, ST2 …, stn ], ST1, ST2 and the like are the average residence time of the passenger flow of each shop; in the embodiment of the application, one-Hot Encoding is used to represent date types, d= [ D1, D2, D3, D4, D5], wherein D1, D2, D3, D4, D5 respectively represent [ common workdays, special workdays, common weekends, minor holidays, long holidays ], wherein the special workdays refer to workdays with special meanings but without holidays, such as plot of lovers, plot of children, etc., the minor holidays refer to holidays less than 5 days, the long holidays refer to holidays not less than 5 days, and the influence of different date types on people flow is analyzed by setting different date types; the current time point is denoted by T, and the number of people in the business area is denoted by C, where when the number of people in the business area is acquired, the picture captured by the camera is firstly acquired through a fixed frequency (for example, once in a minute, according to actual needs), and then a common target detection model is used for identifying the target through the head, for example: YOLO (You Only Look Once, single-stage object detection model) or fast R-CNN (classical two-stage detection model), SSD (Single Shot MultiBox Detector, single-lens multi-box detection model) performs object detection on the acquired picture, thereby obtaining the number of people N in the commercial area; the merchant data comprises sales promotion conditions, in a commercial center, sales promotion activities of all shops attract more consumers, the sales promotion condition X can be set to be 0/1 of binary variable, the value of no sales promotion activity is 0, and the value of the sales promotion activity is 1; the online scoring condition U in merchant data can be obtained by obtaining the current overall score of a commercial center on each platform of the Internet; the environment data comprise economic environment, because the flow of people in a commercial center can be influenced by economic factors, people are more willing to consume under the condition of better economic environment, and people are more tended to not consume under the condition of poor economic environment, so the CPI index I in the current certain period (such as quarterly, half year and one year) is used as characteristic data in the embodiment of the application; weather conditions in the environmental data may also be represented using One-Hot Encoding, wh= [ WH1, WH2 …, whn ], where WH1, WH2 … whn represent n weather types as may be preset (sunny, rainy, snowy, cloudy), for example: sunny days: [1, 0], cloudiness: [0, 1]; the traffic congestion index R in the environmental data may be obtained from historical data in each traffic navigation software.
In summary, the feature dimensions in the historical feature data include a business area S, a sum W of an exit width and an entrance width, a daily average passenger flow P, an average residence time ST, a date type D, a current time point T, a number N of people, a sales promotion situation X, an online scoring situation U, an economic environment I, a weather situation WH, and a traffic congestion index R. When the first person flow prediction model is trained, the number of persons N is a variable needing prediction, namely an output value, and other characteristic data are variables affecting the number of persons N.
As an example, steps S10 to S50 include: extracting people flow data in a business area from a monitoring video of the business area; extracting time data according to the time stamp of the monitoring video of the business area; acquiring regional data, merchant data and corresponding environmental data of the commercial region; selecting each common kernel function, and constructing first person flow prediction models corresponding to each common kernel function based on SVR algorithm; selecting a business area S, a sum W of an outlet width and an inlet width, a daily average passenger flow rate P, an average residence time ST, a date type D, a current time point T, a number N of people, a sales promotion condition X, an on-line scoring condition U, an economic environment I, a weather condition WH and a traffic jam index R from the historical characteristic data, and inputting the obtained historical characteristic data into each first person flow rate prediction model to obtain predicted person flow rates; optimizing parameters in each first people flow prediction model according to the predicted people flow and the people flow density in the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function; dividing the historical characteristic data into a plurality of groups of training sets and test sets by a k-fold cross validation method, and respectively evaluating each second people flow prediction model based on each group of training sets and test sets to obtain an evaluation result corresponding to each second people flow prediction model; selecting a kernel function corresponding to a second people flow prediction model with the best evaluation result as a target kernel function, and setting the second people flow prediction model corresponding to the target kernel function as a target people flow prediction model; acquiring predicted time input by a user and a people flow threshold; inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time; judging whether the predicted people flow data is larger than the people flow threshold, if so, sending out early warning information to prompt a manager to dredge people flow in time.
In addition, before the step of training each of the first people flow prediction models based on the historical feature data, the method further includes:
step A10, screening out abnormal data meeting preset abnormal conditions from the historical characteristic data;
and step A20, eliminating abnormal data in the historical characteristic data.
In this embodiment of the present application, it should be noted that the preset abnormal condition may be data with deviation from other data exceeding a preset deviation, where the preset deviation may be set according to specific requirements, such as a missing value, an outlier, etc., for example, when some stores in a certain area have obvious changes (such as decoration) in a certain period of time, the corresponding feature data should be regarded as the missing value to be removed, so that it is avoided that the traffic prediction model trained by the abnormal data is affected by the abnormal value, thereby resulting in poor prediction accuracy.
As an example, steps a10 to a20 include: acquiring a preset deviation corresponding to a preset abnormal condition input by a user, screening out historical characteristic data, of which the deviation from other data exceeds the preset deviation, in the historical characteristic data, and acquiring abnormal data; deleting the abnormal data from the history feature data to obtain the preprocessed history feature data.
The step of constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions comprises the following steps:
step S21, extracting each feature dimension in the history feature data;
step S22, constructing a first person flow prediction model corresponding to each kernel function based on a support vector regression algorithm, wherein the independent variables of the first person flow prediction model comprise each characteristic dimension.
In the embodiment of the present application, it should be noted that, the embodiment of the present application provides a model training method based on SVR algorithm, where the model training method includes a first people flow prediction model corresponding to a plurality of kernel functions respectively, that is, an initially constructed people flow prediction model; the second people flow prediction model is a trained people flow prediction model; because the best training effect of which kernel function can not be determined during the primary training, the model is built and trained based on each function, the corresponding second people flow prediction model is obtained and then evaluated, and the kernel function with the best effect is selected, so that the prediction precision of the obtained target people flow prediction model is best. SVR is an important application branch of SVM (support vector machine ). The SVM is built on the VC (Vapnik-chervonensis, mo Puni g-ze Fan Lan jis) dimension theory and the structure risk minimization theory in statistical learning theory, seeking the best compromise between the complexity of the model (learning accuracy for a specific training sample) and learning ability (ability to identify any sample without error) based on limited sample information in order to obtain the best generalization ability. The goal of statistical learning is changed from experience risk minimization to seeking that the sum of experience risk and confidence risk is minimum, namely the structure risk is minimum, and the formula of the generalization error bound is as follows:
wherein ,for real risk->As an empirical function->Is a confidence interval.
In the prior art, the support vector machine can be classified into a support vector classifier and a Support Vector Regression (SVR) for classification problems and regression problems. The SVR algorithm is mainly used for predicting the traffic flow, the SVR is used as a model for processing nonlinear fitting regression, a corresponding relation is mainly constructed between vectors to be predicted in the characteristic data and the support vectors, and simulation prediction is carried out on the vectors to be predicted (the number of people N in the embodiment of the application) in the test data (the historical characteristic data in the embodiment of the application). For a feature data set, for example, feature data set s= { (x 1, x 2..xj, y 1), (x 1, x 2..xj, y 2) … (x 1, x 2..xj, yl) }, where x is a feature value, j is a feature number of samples, and l is the number of samples, SVR maps data to a high-dimensional space according to a nonlinear transformation defined by an inner kernel function, performs regression fitting in the high-dimensional space, and further calculates feature loss of each individual flow prediction value, thereby optimizing model parameters of a first individual flow prediction model corresponding to each kernel function.
The accuracy of selecting different kernel functions is greatly different for different problems, so whether to select a proper kernel function becomes a key factor affecting the prediction accuracy. The method for selecting the corresponding kernel function aiming at the specific problem is not unified, and only the corresponding people flow prediction model can be trained respectively and then compared according to the evaluation result, and the common kernel function mainly comprises the following steps:
Polynomial kernel function: k (xi, x) = [ γ (xi·x) +coef ] d, where d is the order of the polynomial and coef is the paranoid coefficient; RBF kernel function (Gauss radial basis function), K (xi, x) =exp (-gamma II xi-x II), where gamma denotes the radius of the kernel function, multi-layer perceptron kernel function (Sigmoid kernel function), K (xi, x) =tanh (gamma (xi. X) +coef).
As an example, steps S21 to S22 include: extracting feature dimensions of feature data from the historical feature data; and constructing a first person flow prediction model of a support vector regression machine based on each characteristic dimension and each kernel function, wherein each kernel function at least comprises a polynomial kernel function, an RBF kernel function and a multi-layer perceptron kernel function.
The step of training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function comprises the following steps:
step S31, dividing the historical characteristic data into a training set and a testing set, and inputting the characteristic data in the training set into each first people flow prediction model to obtain corresponding first predicted people flow;
step S32, comparing the difference between the first predicted people flow and the people flow data in the characteristic data in the training set to adjust the model parameters in the first people flow prediction model;
Step S33, inputting the characteristic data in the test set into each first people flow prediction model to obtain corresponding second predicted people flow;
step S34, inputting the second predicted people flow and the people flow data in the characteristic data in the test set into a preset function, and calculating a characteristic loss value;
and S35, stopping training the first people flow prediction model when the characteristic loss value is smaller than a preset threshold value, and obtaining a second people flow prediction model corresponding to each kernel function.
In the embodiment of the present application, it should be noted that the first predicted traffic is a traffic prediction value obtained in a model training process; the second predicted people flow is a people flow predicted value obtained in the model test process; and the second people flow prediction model is a people flow prediction model corresponding to each kernel function meeting expected requirements after training is completed. In the model training process, characteristic values of each dimension data in the training set comprise a business area S, a sum W of an outlet width and an inlet width, a daily average passenger flow rate P, an average residence time ST, a date type D, a current time point T, a sales promotion condition X, an on-line scoring condition U, an economic environment I, a weather condition WH and a traffic jam index R, and the output first predicted passenger flow rate can be the number N of people or the passenger flow density E=C/S, is used for measuring the jam condition in the business area, and is convenient for management staff to dredge in time. Wherein the loss function applied when training the first people flow prediction model according to the feature data in the training set, that is, when adjusting model parameters in the first people flow prediction model and calculating a feature loss value based on the second predicted people flow and the people flow data in the feature data in the test set is The insensitivity loss function can be expressed as:
wherein ,is constant and->Is that>A constant of 0, for adjusting the weight of the loss function. When we allow more samples to fail the constraint, let +.>Smaller, i.e. less weight lost. Otherwise, let +.>A little bigger; />Representing the characteristic value (S, W, P, ST, D, T, XU, I, WH) and R +.>For predicting the flow of people>Representing the corresponding number of people (C) in the history feature data, and>for the number of characteristic data sets>Is the number of dimensions of the feature value, +.>Andmodel parameters, which are all loss functions, +.>Is->Insensitive loss function, i.e. loss less than +.>When considered as no computational loss, the expression is as follows:
wherein the schematic diagram is shown in FIG. 2, and the horizontal axis is self-containedThe variable, i.e., the eigenvalue, and the vertical axis is the dependent variable, i.e., the predicted value,、/> and />From top to bottom, a virtual straight line, a real straight line and a virtual straight line, wherein +.>The human flow prediction model expression, the open circles are data with loss of not 0, and the closed circles are data with loss of 0. The purpose of model training in the embodiment of the application is to make the interval zone pass through the most dense zone (center) of the sample as far as possible, so as to achieve the effect of fitting training samples, thereby obtaining a target people flow prediction model which accords with expectations and realizing the prediction of people flow in a business area.
As an example, steps S31 to S35 include: extracting each characteristic value (S, W, P, ST, D, T, XU, I, WH and R) from the training set, and inputting the characteristic values into each first person flow prediction model to obtain a corresponding first predicted number of persons; determining first characteristic losses between the first predicted population and the corresponding real population N based on a preset loss function and the real population N corresponding to the first predicted population and the training set; adjusting model parameters in each first person flow prediction model to obtain the number of predicted persons after adjustment and first characteristic loss after adjustment; continuing to optimize model parameters in each of the first people flow prediction models based on the first characteristic loss before adjustment and the change trend of the first characteristic loss after adjustment, wherein if the first characteristic loss becomes smaller, continuing to continue the last adjustment direction, and if the first characteristic loss becomes larger, adjusting the model parameters in a direction opposite to the last adjustment direction, wherein the model parameters at least comprise、/>、/> and />The method comprises the steps of carrying out a first treatment on the surface of the After the people flow of the first business area is pre-warned, extracting characteristic values (S, W, P, ST, D, T, XU, I, WH and R) from the test set, and inputting the characteristic values into each first people flow prediction model to obtain a corresponding second predicted number of people; determining second characteristic losses between the first predicted population and the corresponding real population N based on a preset loss function and the real population N corresponding to the second predicted population and the test set; judging whether the second characteristic loss is larger than a preset threshold value, if so, returning to the execution step: extracting each characteristic value (S, W, P, ST, D, T, XU, I, WH and R) from the training set, and inputting the characteristic values into each first person flow prediction model to obtain a corresponding first predicted number of persons; otherwise, stopping training the first people flow prediction model, and setting the first people flow prediction model as a second people flow prediction model.
In addition, the step of evaluating each second people flow prediction model through the k-fold cross validation method and determining the target people flow prediction model comprises the following steps:
step S41, the historical characteristic data are randomly divided into preset number parts, one part is randomly used as test set data, and other historical characteristic data are used as training sets;
step S42, repeatedly executing the steps of: randomly taking one of the sets as test set data and other historical characteristic data as training sets until a preset number of sets of training sets and test sets are obtained;
step S43, respectively inputting each group of training set and test set into the second people flow prediction model to obtain each group of evaluation results corresponding to the second people flow prediction model;
step S44, calculating the average value of each group of evaluation results to obtain the average evaluation result of the second people flow prediction model;
step S45, setting a second people flow prediction model with the best average evaluation result as a target people flow prediction model.
In the embodiment of the application, it should be noted that, in the k-fold cross validation method, the historical characteristic data is randomly divided into k parts of mutually exclusive subsets, when the performance of the second people flow prediction model needs to be evaluated and validated, a part of subsets is randomly selected as a test set, other parts are taken as training sets, and the second people flow prediction model is validated to obtain a corresponding evaluation result; and continuing to select another subset as the test set, and pushing the test set until k evaluation results on the second people flow prediction model are obtained. Therefore, the performance of the second people flow prediction model corresponding to each kernel function can be effectively evaluated, and the most suitable kernel function is selected. The most stable one of the second people flow prediction models can be selected on the basis of the historical characteristic data, and over-fitting and under-fitting can be effectively avoided. The preset number is k, the k can be set according to specific requirements, and the larger the k value is, the higher the stability and the fidelity of an evaluation result are, and the longer the evaluation time is; the evaluation result mainly comprises the accuracy of prediction, a characteristic loss value and the like, and is used for measuring the quality of the second people flow prediction model; the target people flow rate prediction model is a second people flow rate prediction model corresponding to the kernel function which is the most fit with the people flow rate prediction model, namely the above steps are also the process of confirming the optimal kernel function.
As an example, step S41 to step S45 include: dividing the historical characteristic data into k mutually exclusive subsets with capacity differences not exceeding a preset difference value through non-repeated sampling; randomly selecting one subset of the mutually exclusive subsets as a test set and the other subsets as training sets; the steps are repeatedly executed: randomly selecting one subset which is not selected from all the subsets as a test set, and the other subsets as training sets until all the subsets are selected, and obtaining k groups of evaluation data, wherein each group of evaluation data comprises the training set and the test set. Respectively carrying out model evaluation on each second people flow prediction model through the k groups of evaluation data, wherein the model evaluation step comprises the steps of training the second people flow prediction models according to training sets in each group, and then testing the second people flow prediction models according to corresponding test set data to obtain corresponding evaluation results until all k groups of evaluation data are used, and obtaining k groups of evaluation results; calculating the average value of k groups of evaluation results corresponding to the second people flow prediction models, and obtaining the average evaluation result of the second people flow prediction models; and selecting the second people flow prediction model with the best average evaluation result as a target people flow prediction model according to the average evaluation result of each second people flow prediction model.
Finally, the people stream early warning scheme at least comprises early warning information, and the step of inputting the area data, the current people stream data, the current time data, the current merchant data, the current environment data and the predicted time into the target people stream prediction model to generate the people stream early warning scheme comprises the following steps:
step S51, obtaining a prediction time and a people flow threshold;
step S52, extracting current people flow data, current time data, current merchant data and current environment data of the business area;
step S53, inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time;
and step S54, when the predicted people flow rate data exceeds the people flow rate threshold value, sending out early warning information.
In the embodiment of the present application, it should be noted that, referring to fig. 4, the current feature data (independent variable) at least includes a business area S, a sum W of an exit width and an entrance width, a daily passenger flow P, an average residence time ST, a date type D, a current time point T, a current number N of people, a sales promotion situation X, an on-line scoring situation U, an economic environment I, a weather situation WH, and a traffic congestion index R; the predicted time period Y and the traffic threshold (threshold) are input parameters determined by a manager, and may be determined according to specific requirements, for example, if the traffic growth speed in the business area is relatively high, the predicted time period may be set to be shorter, so that traffic is dredged in time, the predicted traffic data (dependent variable) and the traffic threshold may be traffic density E or traffic density C, and the traffic density E may be determined by the number of people C and the business area S (e=c/S), which may be converted with each other. The early warning information can be in a visual prompt window, a mobile terminal pushing mode or a beeping prompt mode.
As an example, step S51 to step S54 include: acquiring a predicted time period input by a user and a people flow threshold; extracting the current number of people in the business area from the monitoring video of the business area; extracting the current time and the current date type according to the time stamp of the monitoring video of the business area; acquiring the business area and the width sum of an entrance and a exit of the business area, the current sales promotion situation, the online scoring situation, the average daily passenger flow, the average residence time, the current economic environment, the current weather situation and the current traffic congestion index; inputting the current number of people, the current time, the current date type, the business area, the entrance width sum, the current sales promotion situation, the online scoring situation, the average daily traffic, the average residence time, the current economic environment, the current weather situation, the current traffic congestion index and the predicted time period into the target traffic prediction model to obtain predicted traffic data in the business area after the predicted time period, wherein the predicted traffic data at least comprises one of the number of people or traffic density; judging whether the predicted people flow data exceeds the people flow threshold, if so, sending warning information to a manager, wherein the warning information is beeping; otherwise, continuing to predict the flow of people in the business area.
As one preference, the predicted time period may be half an hour.
As one preference, two people flow thresholds (threshold 1 and threshold 2) may be set, where threshold1 is smaller than threshold2, and when predicted people flow data output by the target people flow prediction model exceeds threshold1, a visual prompt window is pushed to a manager to remind the manager to pay attention to the predicted people flow data; when the predicted traffic data output by the predicted target traffic prediction model exceeds threshold2, a buzzing alarm prompt tone is sent to a manager to prompt the manager to execute measures such as leading in advance, thereby playing the effect of reducing traffic and traffic density in a business area.
The embodiment of the application provides a people flow early warning method of a business area, firstly, historical characteristic data of the business area are extracted, wherein the historical characteristic data at least comprises area data, people flow data, time data, business data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total people in the business area, average people flow of each business in the business area and average residence time, the time data at least comprises time points and date types corresponding to the historical characteristic data, the business data at least comprises sales promotion conditions and on-line scoring conditions, the environment data at least comprises weather conditions, economic environment and traffic congestion indexes, thereby fully considering factors affecting people flow, improving accuracy of people flow prediction, constructing corresponding first people flow prediction models based on preset support vector regression algorithms and kernel functions, training each first people flow prediction model based on the historical characteristic data, obtaining second people flow prediction models corresponding to kernel functions, finally, using a k-fold cross-validation method to evaluate the second people flow prediction models, determining accuracy of current characteristics when the current characteristics of the business flow prediction models are improved, the current characteristics of the people flow prediction models can be obtained by using the current characteristics of the people flow prediction models, the current characteristics of the people flow prediction models can be improved, and the current flow prediction models can be estimated by using the current characteristics of the people flow prediction models can be improved, and generating a people flow early warning scheme, and realizing the prediction of people flow in public places. By means of the target people flow prediction model, management staff can conduct people flow dispersion in advance, the technical defect that people flow control and dispersion effect is poor when people flow is congested is overcome, and therefore effects of controlling and dispersion on people flow in public places are improved.
Example two
The embodiment of the application also provides a traffic early warning device of a business area, wherein the traffic early warning device of the business area is applied to traffic early warning equipment of the business area, and referring to fig. 5, the traffic early warning device of the business area comprises:
the feature extraction module 101 is configured to extract historical feature data of a business area, where the historical feature data at least includes area data, people flow data, time data, merchant data and environment data, the area data at least includes business area and entrance width, the people flow data at least includes total number of people in the business area, average people flow of each shop in the business area and average residence time, the time data at least includes time point and date type corresponding to the historical feature data, the merchant data at least includes merchant sales promotion condition and on-line scoring condition, and the environment data at least includes weather condition, economic environment and traffic jam index;
the model construction module 102 is configured to construct a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
the model training module 103 is configured to train each of the first people flow prediction models based on the historical feature data, and obtain a second people flow prediction model corresponding to each kernel function;
The model verification module 104 is configured to evaluate each of the second people flow prediction models by using a k-fold cross verification method, and determine a target people flow prediction model;
and the people stream early warning module 105 is used for inputting the area data, the current people stream data, the current time data, the current merchant data, the current environment data and the predicted time into the target people stream prediction model to generate a people stream early warning scheme.
Optionally, the model training module is further configured to:
screening abnormal data meeting preset abnormal conditions from the historical characteristic data;
and eliminating abnormal data in the historical characteristic data.
Optionally, the model building module is further configured to:
extracting each feature dimension in the historical feature data;
and constructing a first person flow prediction model corresponding to each kernel function based on a support vector regression algorithm, wherein the independent variable of the first person flow prediction model comprises each characteristic dimension.
Optionally, the model training module is further configured to:
dividing the historical characteristic data into a training set and a testing set, and inputting the characteristic data in the training set into each first person flow prediction model to obtain corresponding first predicted person flow;
Comparing the difference between the first predicted traffic and the traffic data in the feature data in the training set to adjust model parameters in the first traffic prediction model;
inputting the characteristic data in the test set into each first people flow prediction model to obtain corresponding second predicted people flow;
inputting the second predicted people flow and the people flow data in the characteristic data in the test set into a preset loss function, and calculating a characteristic loss value;
and when the characteristic loss value is smaller than a preset threshold value, stopping training the first people flow prediction model, and obtaining a second people flow prediction model corresponding to each kernel function.
Optionally, the model verification module is further configured to:
randomly dividing the historical characteristic data into preset number parts, randomly taking one part as test set data, and taking other historical characteristic data as training sets;
the steps are repeatedly executed: randomly taking one of the sets as test set data and other historical characteristic data as training sets until a preset number of sets of training sets and test sets are obtained;
respectively inputting each group of training sets and test sets into the second people flow prediction model to obtain each group of evaluation results corresponding to the second people flow prediction model;
Calculating the average value of each group of evaluation results to obtain the average evaluation result of the second people flow prediction model;
and setting a second people flow prediction model with the best average evaluation result as a target people flow prediction model. Optionally, the people stream early warning module is further configured to:
acquiring a prediction time and a people flow threshold;
extracting current people flow data, current time data, current merchant data and current environment data of the business area;
inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time;
and when the predicted people flow rate data exceeds the people flow rate threshold value, sending out early warning information.
According to the traffic early warning device for the commercial area, the traffic early warning method for the commercial area solves the technical problem that the effect of controlling and dredging traffic in public places is poor when traffic is congested. Compared with the prior art, the traffic early warning device for the commercial area has the same beneficial effects as the traffic early warning method for the commercial area provided by the embodiment, and other technical features in the traffic early warning device for the commercial area are the same as the features disclosed by the method of the previous embodiment, and are not repeated herein.
Example III
The embodiment of the application provides electronic equipment, the electronic equipment includes: at least one processor; and a memory communicatively linked to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the traffic alert method in the business area of the first embodiment.
Referring now to fig. 6, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistant, personal digital assistants), PADs (tablet computers), PMPs (Portable Media Player, portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage means into a random access memory (RAM, random access memory). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM and RAM are connected to each other via a bus. Input/output (I/O) interfaces are also linked to the bus.
In general, the following systems may be linked to I/O interfaces: input devices including, for example, touch screens, touch pads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs, liquid crystal display), speakers, vibrators, etc.; storage devices including, for example, magnetic tape, hard disk, etc.; a communication device. The communication means may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
According to the electronic equipment, the people flow early warning method of the business area solves the technical problem that the effect of controlling and dredging the people flow in the public place is poor when the people flow is congested. Compared with the prior art, the electronic device provided in the embodiment of the present application has the same beneficial effects as the people stream early warning method in the business area provided in the first embodiment, and other technical features in the electronic device are the same as the features disclosed in the method in the previous embodiment, which are not described in detail herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Example IV
The present embodiment provides a computer readable storage medium having computer readable program instructions stored thereon for performing the method of traffic pre-warning in a business area of the above embodiment.
The computer readable storage medium provided by the embodiments of the present application may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical link having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (EPROM, erasable Programmable Read-Only Memory, or flash Memory), an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: extracting historical characteristic data of a business area, wherein the historical characteristic data at least comprises area data, people flow data, time data, merchant data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total people in the business area, average people flow of each shop in the business area and average residence time, the time data at least comprises time points and date types corresponding to the historical characteristic data, the merchant data at least comprises merchant sales promotion conditions and online scoring conditions, and the environment data at least comprises weather conditions, economic environments and traffic congestion indexes; constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions; training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function; evaluating each second people flow prediction model through a k-fold cross validation method to determine a target people flow prediction model; and inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be linked to the user's computer through any kind of network, including a local area network (LAN, local area network) or a wide area network (WAN, wide Area Network), or it may be linked to an external computer (e.g., through the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium is stored with computer readable program instructions for executing the people stream early warning method of the business area, and solves the technical problem that the effect of controlling and dredging people stream in public places is poor when people stream is congested. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the present application are the same as the beneficial effects of the people stream early warning method of the business area provided by the above embodiment, and are not described in detail herein.
Example five
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a people stream early warning method for a business area as described above.
The computer program product solves the technical problem that the effect of controlling and dredging the people flow in the public place is poor when the people flow is congested. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the people stream early warning method of the business area provided by the above embodiment, and are not described in detail herein.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims.

Claims (9)

1. The people stream early warning method for the commercial area is characterized by comprising the following steps of:
extracting historical characteristic data of a business area, wherein the historical characteristic data at least comprises area data, people flow data, time data, merchant data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total number of people in the business area, average people flow of each shop and average residence time in the business area, the time data at least comprises time points and date types corresponding to the historical characteristic data, the merchant data at least comprises merchant sales promotion conditions and online scoring conditions, the environment data at least comprises weather conditions, economic environment and traffic jam indexes, when the total number of people is acquired, firstly, acquiring pictures captured by a camera based on preset frequency, and then performing target detection on the pictures through a preset target detection model to obtain the total number of people in the business area, wherein the preset frequency is once per minute;
Constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function;
evaluating each second people flow prediction model through a k-fold cross validation method to determine a target people flow prediction model;
inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to generate a people flow early warning scheme;
the people flow early warning scheme at least comprises early warning information, the steps of inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model, and generating the people flow early warning scheme comprise the following steps:
acquiring prediction time and a people flow threshold, wherein the people flow threshold comprises a first people flow threshold and a second people flow threshold, and the first people flow threshold is smaller than the second people flow threshold;
Extracting current people flow data, current time data, current merchant data and current environment data of the business area;
inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time;
pushing a visual prompt window to a manager to remind the manager to pay attention to the predicted people flow data when the predicted people flow data exceeds the first people flow threshold;
and when the predicted people flow rate data exceeds the second people flow rate threshold value, a buzzing alarm prompt tone is sent to the manager.
2. The method of traffic early warning in a business area of claim 1, further comprising, prior to the step of training each of the first people traffic prediction models based on the historical feature data:
screening abnormal data meeting preset abnormal conditions from the historical characteristic data;
and eliminating abnormal data in the historical characteristic data.
3. The traffic early warning method according to claim 1, wherein the step of constructing the corresponding first traffic prediction model based on a preset support vector regression algorithm and a preset plurality of kernel functions comprises:
Extracting each feature dimension in the historical feature data;
and constructing a first person flow prediction model corresponding to each kernel function based on a support vector regression algorithm, wherein the independent variable of the first person flow prediction model comprises each characteristic dimension.
4. The traffic warning method according to claim 3, wherein the step of training each of the first traffic prediction models based on the history feature data to obtain a second traffic prediction model corresponding to each of the kernel functions comprises:
dividing the historical characteristic data into a training set and a testing set, and inputting the characteristic data in the training set into each first person flow prediction model to obtain corresponding first predicted person flow;
comparing the difference between the first predicted traffic and the traffic data in the feature data in the training set to adjust model parameters in the first traffic prediction model;
inputting the characteristic data in the test set into each first people flow prediction model to obtain corresponding second predicted people flow;
inputting the second predicted people flow and the people flow data in the characteristic data in the test set into a preset loss function, and calculating a characteristic loss value;
And when the characteristic loss value is smaller than a preset threshold value, stopping training the first people flow prediction model, and obtaining a second people flow prediction model corresponding to each kernel function.
5. The traffic warning method in a commercial area according to claim 4, wherein the expression of the preset loss function is:
wherein ,is penalty constant, and->Is a constant greater than 0 for adjusting the weight of said preset loss function,/->For each of said feature dimensions, a corresponding feature value, < >>For said second predicted traffic, +.>Representing the corresponding headcount in the historical feature data,/->For the number of sets of history feature data, +.>Dimension number, +.> and />Are model parameters of the preset loss function, </i >>Is->Insensitive loss function->Is an insensitive parameter.
6. The traffic warning method according to claim 1, wherein the step of evaluating each of the second traffic prediction models by a k-fold cross validation method to determine a target traffic prediction model comprises:
randomly dividing the historical characteristic data into preset number parts, randomly taking one part as test set data, and taking other historical characteristic data as training sets;
The steps are repeatedly executed: randomly taking one of the sets as test set data and other historical characteristic data as training sets until a preset number of sets of training sets and test sets are obtained;
respectively inputting each group of training sets and test sets into the second people flow prediction model to obtain each group of evaluation results corresponding to the second people flow prediction model;
calculating the average value of each group of evaluation results to obtain the average evaluation result of the second people flow prediction model;
and setting a second people flow prediction model with the best average evaluation result as a target people flow prediction model.
7. The utility model provides a traffic early warning device of commercial district, its characterized in that, traffic early warning device of commercial district includes:
the characteristic extraction module is used for extracting historical characteristic data of a business area, wherein the historical characteristic data at least comprises area data, people flow data, time data, business data and environment data, the area data at least comprises business area and entrance width, the people flow data at least comprises total number of people in the business area, average people flow of each business in the business area and average residence time, the time data at least comprises time points and date types corresponding to the historical characteristic data, the business data at least comprises business promotion conditions and on-line scoring conditions, the environment data at least comprises weather conditions, economic environment and traffic jam indexes, when the total number of people is acquired, firstly, a picture captured by a camera is acquired based on preset frequency, then target detection is carried out on the picture through a preset target detection model, and the total number of people in the business area is obtained, and the preset frequency is once per minute;
The model construction module is used for constructing a corresponding first person flow prediction model based on a preset support vector regression algorithm and a plurality of preset kernel functions;
the model training module is used for training each first people flow prediction model based on the historical characteristic data to obtain a second people flow prediction model corresponding to each kernel function;
the model verification module is used for evaluating each second people flow prediction model through a k-fold cross verification method and determining a target people flow prediction model;
the people stream early warning module is used for inputting the regional data, the current people stream data, the current time data, the current merchant data, the current environment data and the predicted time into the target people stream prediction model to generate a people stream early warning scheme;
the people stream early warning scheme at least comprises early warning information, and the people stream early warning module is further used for: acquiring prediction time and a people flow threshold, wherein the people flow threshold comprises a first people flow threshold and a second people flow threshold, and the first people flow threshold is smaller than the second people flow threshold; extracting current people flow data, current time data, current merchant data and current environment data of the business area; inputting the regional data, the current people flow data, the current time data, the current merchant data, the current environment data and the predicted time into the target people flow prediction model to obtain predicted people flow data after the predicted time; pushing a visual prompt window to a manager to remind the manager to pay attention to the predicted people flow data when the predicted people flow data exceeds the first people flow threshold; and when the predicted people flow rate data exceeds the second people flow rate threshold value, a buzzing alarm prompt tone is sent to the manager.
8. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively linked to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the people stream early warning method of a business area of any one of claims 1 to 6.
9. A computer-readable storage medium, wherein a program for realizing a traffic early warning method of a business area is stored thereon, the program for realizing the traffic early warning method of a business area being executed by a processor to realize the steps of the traffic early warning method of a business area according to any one of claims 1 to 6.
CN202310294587.0A 2023-03-24 2023-03-24 Pedestrian flow early warning method and device for business area, electronic equipment and storage medium Active CN116029395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310294587.0A CN116029395B (en) 2023-03-24 2023-03-24 Pedestrian flow early warning method and device for business area, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310294587.0A CN116029395B (en) 2023-03-24 2023-03-24 Pedestrian flow early warning method and device for business area, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116029395A CN116029395A (en) 2023-04-28
CN116029395B true CN116029395B (en) 2023-08-04

Family

ID=86077863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310294587.0A Active CN116029395B (en) 2023-03-24 2023-03-24 Pedestrian flow early warning method and device for business area, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116029395B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056730A (en) * 2023-09-08 2023-11-14 广西大也智能数据有限公司 Method, device, equipment and storage medium for data prediction
CN117557300B (en) * 2024-01-12 2024-04-05 湖南大学 Method and system for deducing business liveness based on energy consumption data of main equipment

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914744A (en) * 2014-04-23 2014-07-09 北京市市政工程设计研究总院有限公司 Method and device for predicting subway station underground commercial passenger flow
CN107844848A (en) * 2016-09-20 2018-03-27 中国移动通信集团湖北有限公司 A kind of region flow of the people Forecasting Methodology and system
CN107895283A (en) * 2017-11-07 2018-04-10 重庆邮电大学 A kind of businessman's volume of the flow of passengers big data Forecasting Methodology based on Time Series
CN109640249A (en) * 2018-11-27 2019-04-16 佛山科学技术学院 A kind of market flow of the people forecasting system based on big data
CN109977759A (en) * 2019-01-30 2019-07-05 长视科技股份有限公司 A kind of passenger flow statistics monitoring system surpassed towards wisdom quotient
CN110991734A (en) * 2019-11-29 2020-04-10 西安理工大学 Subway passenger flow prediction method based on multi-objective optimization and SVR
CN111160622A (en) * 2019-12-09 2020-05-15 北京建筑大学 Scenic spot passenger flow prediction method and device based on hybrid neural network model
CN113033618A (en) * 2021-03-03 2021-06-25 四川大学 Layered reservoir water taking and discharging water temperature prediction model and prediction method based on support vector regression
CN113240197A (en) * 2020-12-31 2021-08-10 深圳云天励飞技术股份有限公司 Prediction method and device for mall passenger flow, electronic equipment and storage medium
CN113256326A (en) * 2021-04-30 2021-08-13 深圳云瞰科技有限公司 Method for realizing prediction of commodity extra-large screen point position pedestrian volume based on deep learning
CN113473592A (en) * 2021-06-21 2021-10-01 上海邮电设计咨询研究院有限公司 Passenger flow monitoring system and method
CN113850417A (en) * 2021-08-27 2021-12-28 浙江浙大中控信息技术有限公司 Passenger flow organization decision-making method based on station passenger flow prediction
CN113869963A (en) * 2021-11-01 2021-12-31 北京深演智能科技股份有限公司 Method and device for intelligently predicting user presence situation and data processing equipment
CN114202103A (en) * 2021-11-17 2022-03-18 浙江桢数科技有限公司 Machine learning-based holiday scenic spot passenger flow prediction method
CN114529037A (en) * 2021-12-30 2022-05-24 天翼电子商务有限公司 Scheme for acquiring scenic spot pedestrian volume in real time

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109214584B (en) * 2018-09-21 2022-02-08 北京百度网讯科技有限公司 Method and device for predicting passenger flow

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914744A (en) * 2014-04-23 2014-07-09 北京市市政工程设计研究总院有限公司 Method and device for predicting subway station underground commercial passenger flow
CN107844848A (en) * 2016-09-20 2018-03-27 中国移动通信集团湖北有限公司 A kind of region flow of the people Forecasting Methodology and system
CN107895283A (en) * 2017-11-07 2018-04-10 重庆邮电大学 A kind of businessman's volume of the flow of passengers big data Forecasting Methodology based on Time Series
CN109640249A (en) * 2018-11-27 2019-04-16 佛山科学技术学院 A kind of market flow of the people forecasting system based on big data
CN109977759A (en) * 2019-01-30 2019-07-05 长视科技股份有限公司 A kind of passenger flow statistics monitoring system surpassed towards wisdom quotient
CN110991734A (en) * 2019-11-29 2020-04-10 西安理工大学 Subway passenger flow prediction method based on multi-objective optimization and SVR
CN111160622A (en) * 2019-12-09 2020-05-15 北京建筑大学 Scenic spot passenger flow prediction method and device based on hybrid neural network model
CN113240197A (en) * 2020-12-31 2021-08-10 深圳云天励飞技术股份有限公司 Prediction method and device for mall passenger flow, electronic equipment and storage medium
CN113033618A (en) * 2021-03-03 2021-06-25 四川大学 Layered reservoir water taking and discharging water temperature prediction model and prediction method based on support vector regression
CN113256326A (en) * 2021-04-30 2021-08-13 深圳云瞰科技有限公司 Method for realizing prediction of commodity extra-large screen point position pedestrian volume based on deep learning
CN113473592A (en) * 2021-06-21 2021-10-01 上海邮电设计咨询研究院有限公司 Passenger flow monitoring system and method
CN113850417A (en) * 2021-08-27 2021-12-28 浙江浙大中控信息技术有限公司 Passenger flow organization decision-making method based on station passenger flow prediction
CN113869963A (en) * 2021-11-01 2021-12-31 北京深演智能科技股份有限公司 Method and device for intelligently predicting user presence situation and data processing equipment
CN114202103A (en) * 2021-11-17 2022-03-18 浙江桢数科技有限公司 Machine learning-based holiday scenic spot passenger flow prediction method
CN114529037A (en) * 2021-12-30 2022-05-24 天翼电子商务有限公司 Scheme for acquiring scenic spot pedestrian volume in real time

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
城市商业综合体人群聚集踩踏风险及监测预警研究—以西单大悦城为例;陈志刚等;《中国安全生产科学技术》;第15卷(第2期);第157-163页 *

Also Published As

Publication number Publication date
CN116029395A (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN116029395B (en) Pedestrian flow early warning method and device for business area, electronic equipment and storage medium
Koesdwiady et al. Improving traffic flow prediction with weather information in connected cars: A deep learning approach
Xiao et al. Short-term traffic volume prediction by ensemble learning in concept drifting environments
US10831827B2 (en) Automatic extraction of user mobility behaviors and interaction preferences using spatio-temporal data
Al-Sharif et al. A novel approach for predicting the spatial patterns of urban expansion by combining the chi-squared automatic integration detection decision tree, Markov chain and cellular automata models in GIS
Shih et al. Grey number prediction using the grey modification model with progression technique
Zheng et al. Investigation of model ensemble for fine-grained air quality prediction
CN111091196A (en) Passenger flow data determination method and device, computer equipment and storage medium
Kirkwood et al. A framework for probabilistic weather forecast post-processing across models and lead times using machine learning
CN111898675B (en) Credit wind control model generation method and device, scoring card generation method, machine readable medium and equipment
Saha et al. Deep learning approach for predictive analytics to support diversion during freeway incidents
Li et al. Multi-task spatio-temporal augmented net for industry equipment remaining useful life prediction
Wang et al. Spatial–temporal multi-feature fusion network for long short-term traffic prediction
Cao et al. Cluster-based correlation of severe driving events with time and location
Liao et al. MFGCN: a multimodal fusion graph convolutional network for online car-hailing demand prediction
CN117391466A (en) Novel early warning method and system for contradictory dispute cases
CN108229542A (en) A kind of cycle debt-credit credit risk monitoring method based on Time-Series analysis technology
KR102005874B1 (en) Device and method for analysis of real estate market
Guo et al. Learning and integration of adaptive hybrid graph structures for multivariate time series forecasting
WO2023051085A1 (en) Object recognition method and apparatus, device, storage medium and program product
CN113836241B (en) Time sequence data classification prediction method, device, terminal equipment and storage medium
CN109858489A (en) A kind of alert method for early warning and equipment
Lu et al. Mul-DesLSTM: An integrative multi-time granularity deep learning prediction method for urban rail transit short-term passenger flow
Liu et al. Hidformer: Hierarchical dual-tower transformer using multi-scale mergence for long-term time series forecasting
US11947627B2 (en) Context aware anomaly detection

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