Disclosure of Invention
The invention aims to provide an accident rating model and method for optimizing storage space of an automobile data recorder, which are used for dividing storage spaces with different sizes according to road conditions so as to solve the problem that the automobile data recorder is always full of storage cards.
In order to solve the above technical problem, the present invention provides an accident rating model for optimizing a storage space method, including:
wherein Z
C=w*x
CW is the normal vector of the optimal classification hyperplane, x
CFor the road section data vector, mu, of the algorithm model to be constructed
AData mean, mu, obtained by projection of the data without occurrence of an accident on a normal vector w
BThe mean of the data obtained after the normal vector w projection for the accident data.
Furthermore, the normal vector w of the optimal classification hyperplane is calculated by the following method,
xiFor training ith data vector x ═ x (x)(1),x(2),x(3)),x(1)Is the traffic class, x(1)=1、2……5;x(2)For the vehicle complexity level, x(2)=1、2……5;x(3)Is road grade, x(3)=1、2……5;yiIs corresponding to xiWhether accidents occur is marked, wherein the accidents which do not occur are marked as 1, the accidents which occur are marked as-1, and N is the number of training data; alpha is alphai *The ith element which is a solution to the dual problem in the Lagrangian multiplier vector; n is the number of training data, NAIs a category yiNumber of samples equal to 1, NBIs a category yiThe number of samples is-1.
In another aspect, the present invention provides a method for optimizing storage space for a vehicle event data recorder, comprising the following steps:
step S1, obtaining historical traffic flow data, historical traffic flow type data, road attributes and accident conditions through road video monitoring, and dividing traffic flow grades, vehicle complexity grades and road grades of each road section in each time period;
step S2, constructing the accident rating model according to the traffic flow grade, the vehicle complexity grade and the road grade of each time segment of each road section;
step S3, acquiring vehicle and road information of the current road section, and calculating a current road section risk index D according to the accident rating model;
and step S4, obtaining the storage space of the corresponding video data according to the current road section risk degree index D.
Further, the method for constructing the accident rating model of the road segment time period in the step S2 includes:
step S21, step S21, according to the historical traffic flow rate grade as x(1)Vehicle complexity class x(2)Road grade x(3)Establishing a data vector x ═ x(1),x(2),x(3));
In step S22, a coefficient vector w is created (w ═ w(1),w(2),w(3)),w(j)For the corresponding feature x(j)The value of j is 1, 2 and 3;
step S23, using soft space SVM to solve the classification hyperplane with the maximum geometric space and the normal vector thereof, and expressing the problem as the constrained optimization problem
S.t yi(w.xi+b)≥1-ξi
ξi≥0i=1,2,...N
Wherein, C is a penalty coefficient and takes a value of 0.9; xi is a relaxation variable; xi
iRelaxation variables for the ith training data; b is an offset; by converting the original problem into a dual problem, solving the optimal solution of the dual problem by using a KKT condition, the optimal solution of the optimal classification hyperplane and a coefficient vector can be obtained, namely the normal vector of the optimal classification hyperplane:
α
i *the i-th element, x, of the solution to the dual problem in the Lagrangian multiplier vector
iFor the ith training data vector, y
iIs corresponding to x
iWhether accidents occur is marked, wherein the accidents which do not occur are marked as 1, the accidents which occur are marked as-1, and N is the number of training data;
step S24, the data mean value obtained by the projection of the data without accident on the normal vector w
Data of accident in normal vector wMean of data obtained after projection
Wherein N isAIs a category yiNumber of samples equal to 1, NBIs a category yi-1 sample number;
in the step of S25,
Z
C=w*x
C,x
Cand the time section data vector is the current road section.
Further, in step S3, the method for acquiring the vehicle information of the current road segment includes:
and acquiring the current position coordinates and the corresponding road sections through the GPS, and inquiring the corresponding traffic flow grade, the vehicle complexity grade and the road grade on the cloud server.
Further, the method for obtaining the storage space of the corresponding video data according to the current road segment risk index D in step S4 includes: setting a threshold value K; when D is larger than or equal to K, the automobile data recorder adopts the camera module to record in high resolution; when D is less than K, the automobile data recorder adopts low-resolution recording; and distributing the storage space of the corresponding video data according to the high resolution and the low resolution.
The method has the advantages that the historical traffic flow data, the historical traffic flow category data, the road attributes and the accident situation are obtained through road video monitoring to divide the traffic flow grade, the vehicle complexity grade and the road grade of each road section in each time period, the accident rating model is constructed through the traffic flow grade, the vehicle complexity grade and the road grade, the road section danger index is calculated through the accident rating model, the storage space is divided according to the danger index, the storage method is optimized, and the problems that a memory card is full frequently and newly recorded video data can cover original video data when circular recording is adopted are solved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
As shown in fig. 1, this embodiment 1 provides a method for optimizing a storage space for a vehicle event data recorder, which may include: step S1, obtaining historical traffic flow data, historical traffic flow type data, road attributes and accident conditions through road video monitoring, and dividing traffic flow grades, vehicle complexity grades and road grades of each road section in each time period; step S2, constructing an accident rating model according to the traffic flow grade, the vehicle complexity grade and the road grade of each road section in each time period; step S3, acquiring vehicle information of the current road section, and calculating a current road section risk index D according to the accident rating model; and step S4, obtaining the storage space of the corresponding video data according to the current road section risk degree index D. The method for optimizing the storage space provided by the embodiment can realize the optimization of the storage space and simultaneously avoid the loss of data.
As shown in fig. 2, in the present example, the method of constructing the accident rating model for the link time period at step S2 includes:
step S21, traffic flow data and traffic flow type data in each hour time period are obtained according to video monitoring, and traffic flow grades are divided into x according to historical traffic flow data(1),x(1)1, 2 … … 5; dividing the complexity level of the vehicle into x according to the historical traffic flow category data(2),x(2)1, 2 … … 5; classifying the road grade as x according to the road attribute(3),x(3)1, 2 … … 5, optional, x(3)The value can be 1, 2, 3 and 4 on the first-level, second-level, third-level and fourth-level roads and 5 on the expressway according to the technical standard of highway engineering in China. Establish data vector x ═ x(1),x(2),x(3));
In step S22, a coefficient vector w is created (w ═ w(1),w(2),w(3)),w(j)For the corresponding feature x(j)The value of j is 1, 2 and 3;
step S23, using soft space SVM to solve the classification hyperplane with the maximum geometric space, and expressing the problem as a constraint optimization problem
S.t yi(w.xi+b)≥1-ξi
ξi≥0i=1,2,...N;
Wherein C is a penalty coefficient; xi is a relaxation variable; xi
iRelaxation variables for the ith training data; b is an offset; by converting the original problem into a dual problem, solving the optimal solution of the dual problem by using a KKT condition, namely a Carrocon-Kuen-Tack condition, the optimal solution of the optimal classification hyperplane and a coefficient vector can be solved, namely the normal vector of the optimal classification hyperplane:
α
i *the i-th element, x, of the solution to the dual problem in the Lagrangian multiplier vector
iFor the ith training data vector, y
iIs corresponding to x
iWhether accidents occur is marked, wherein the accidents which do not occur are marked as 1, the accidents which occur are marked as-1, and N is the number of training data;
step S24, the data mean value obtained by the projection of the data without accident on the normal vector w
Mean value of data obtained after projection of accident data on normal vector w
Wherein N isAIs a category yiNumber of samples equal to 1, NBIs a category yiThe number of samples is-1.
in the present embodiment, in order to obtain more timely information, the method of acquiring the vehicle information of the current link in step S3 is: and acquiring the current position coordinates and the corresponding road sections through the GPS, and inquiring the corresponding traffic flow grade, the vehicle complexity grade and the road grade on the cloud server.
In this embodiment, in order to store videos as needed, the method of obtaining a storage space of corresponding video data according to the current link risk degree index D in S4 includes: setting a threshold value K; when D is larger than or equal to K, the automobile data recorder adopts the camera module to record in high resolution; and when D is less than K, the automobile data recorder adopts low-resolution recording. A
In summary, in the embodiment, an accident rating model is constructed through the historical traffic flow data, the historical traffic flow category data, the road attributes and the accident situation, the current road risk index is calculated through the accident rating model, and the resolution is selected according to the comparison result between the risk index and the threshold, so that the storage space can be effectively optimized.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. 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.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In light of the foregoing description of the preferred embodiment of the present invention, many modifications and variations will be apparent to those skilled in the art without departing from the spirit and scope of the invention. The technical scope of the present invention is not limited to the content of the specification, and must be determined according to the scope of the claims.