Disclosure of Invention
In view of this, embodiments of the present invention provide a driving warning method, a driving warning system, and a terminal, so as to solve the problem that it is difficult for a driver to notify surrounding vehicles when the driver is in a fatigue state in the current driving warning method, which is not beneficial to improving the warning effect of fatigue driving.
In a first aspect, an embodiment of the present invention provides a driving warning method, including:
connecting a camera in the vehicle to acquire a face image of a driver in a sampling period;
according to the face image, acquiring the eye closing times of the driver and the eye closing duration corresponding to each eye closing;
the lane departure detection module is connected and used for acquiring lane departure times in a sampling period and lane departure duration corresponding to each lane departure;
generating a fatigue index of the driver in the sampling period according to a preset fatigue index generation model, the eye closing times, the eye closing time, the lane departure times, the lane departure time, a preset eye closing time threshold and a preset lane departure time threshold;
judging whether the fatigue index of the driver is greater than a preset threshold value, if so, packaging the preset fatigue driving label, the pre-stored vehicle information, the current position coordinate and a timestamp to generate a fatigue driving message, wherein the timestamp represents the time of generating the fatigue driving message;
broadcasting the fatigue driving message to DSRC modules of surrounding vehicles through a dedicated short-range communication DSRC module, so that the DSRC modules of the surrounding vehicles receive and broadcast the fatigue driving message;
the fatigue index generation model specifically comprises the following steps:
in the ith sampling period, Fi represents the fatigue index of the driver, N represents the eye closing times and is used for describing the number of the eye closing time lengths, N represents the serial number of the eye closing time lengths, the numeric range of N represents 1-N, and EnDenotes the nth eye-closing duration, EtIndication deviceSetting a closed-eye time length threshold value, wherein M represents lane departure times and is used for describing the number of lane departure time lengths, M represents a serial number of the lane departure time lengths, the value range of M represents 1-M, and DmDenotes the m-th lane departure time period, DtRepresenting a preset threshold of the lane departure time period, W1 being a first weight, W2 being a second weight, the lane departure time period being used to describe the duration of departure of the vehicle from the current lane, and the fatigue index of the driver being used to describe the degree of fatigue of the driver.
In a second aspect, an embodiment of the present invention provides a driving warning system, including:
the human face image acquisition module is used for connecting a camera in the vehicle and acquiring a human face image of a driver in a sampling period;
the eye closing duration acquisition module is used for acquiring the eye closing times of the driver and the eye closing duration corresponding to each eye closing according to the face image;
the lane departure duration acquisition module is connected with the lane departure detection module and used for acquiring lane departure times in a sampling period and lane departure duration corresponding to each lane departure;
the fatigue index generation module is used for generating a fatigue index of the driver in the sampling period according to a preset fatigue index generation model, the eye closing times, the eye closing time length, the lane departure times, the lane departure time length, a preset eye closing time length threshold value and a preset lane departure time length threshold value;
the fatigue driving message generating module is used for judging whether the fatigue index of the driver is greater than a preset threshold value, if the fatigue index of the driver is greater than the preset threshold value, packaging the preset fatigue driving tag, the prestored vehicle information, the current position coordinate and a timestamp to generate a fatigue driving message, wherein the timestamp represents the time for generating the fatigue driving message;
the fatigue driving message broadcasting module is used for broadcasting the fatigue driving message to DSRC modules of surrounding vehicles through a special short-range communication DSRC module so that the DSRC modules of the surrounding vehicles receive and broadcast the fatigue driving message;
the fatigue index generation model specifically comprises the following steps:
in the ith sampling period, Fi represents the fatigue index of the driver, N represents the eye closing times and is used for describing the number of the eye closing time lengths, N represents the serial number of the eye closing time lengths, the numeric range of N represents 1-N, and EnDenotes the nth eye-closing duration, EtRepresenting a preset eye-closing duration threshold, M representing the lane departure times for describing the number of the lane departure durations, M representing the serial number of the lane departure durations, M representing the value range from 1 to M, DmDenotes the m-th lane departure time period, DtRepresenting a preset threshold of the lane departure time period, W1 being a first weight, W2 being a second weight, the lane departure time period being used to describe the duration of departure of the vehicle from the current lane, and the fatigue index of the driver being used to describe the degree of fatigue of the driver.
In a third aspect, an embodiment of the present invention provides a terminal, including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to perform the above method.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the driver can be informed of surrounding vehicles in the fatigue state, so that the vehicles at the side or rear of the driver can take corresponding measures to avoid danger, and the early warning effect of fatigue driving is improved.
Detailed Description
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a driving warning method provided in an embodiment of the present invention, where the method is applied to a terminal, and the driving warning method shown in fig. 1 may include the following steps:
s101, connecting a camera in the vehicle to acquire a face image of a driver in a sampling period;
the camera in the vehicle is arranged at any position in the vehicle and is not fixed, for example, the camera is arranged on a windshield, or air outlets on two sides of an instrument panel are arranged.
S102, acquiring the eye closing times of the driver and the eye closing duration corresponding to each eye closing according to the face image;
s103, connecting a lane departure detection module, and acquiring lane departure times in a sampling period and lane departure duration corresponding to each lane departure;
s104, generating a fatigue index of the driver in the sampling period according to a preset fatigue index generation model, the eye closing times, the eye closing time, the lane departure times, the lane departure time, a preset eye closing time threshold and a preset lane departure time threshold;
s105, judging whether the fatigue index of the driver is larger than a preset threshold value, if so, packaging the preset fatigue driving label, the prestored vehicle information, the current position coordinate and a timestamp to generate a fatigue driving message, wherein the timestamp represents the time for generating the fatigue driving message;
the fatigue driving message carries 4 fields, namely a preset fatigue driving label, prestored vehicle information, the current position coordinate and a timestamp.
S106, broadcasting the fatigue driving message to DSRC modules of surrounding vehicles through a special short-range communication DSRC module, so that the DSRC modules of the surrounding vehicles receive and broadcast the fatigue driving message;
the fatigue index generation model specifically comprises the following steps:
in the ith sampling period, Fi represents the fatigue index of the driver, N represents the eye closing times and is used for describing the number of the eye closing time lengths, N represents the serial number of the eye closing time lengths, the numeric range of N represents 1-N, and EnDenotes the nth eye-closing duration, EtRepresenting a preset eye-closing duration threshold, M representing the lane departure times for describing the number of the lane departure durations, M representing the serial number of the lane departure durations, M representing the value range from 1 to M, DmDenotes the m-th lane departure time period, DtRepresenting a preset threshold of the lane departure time period, W1 being a first weight, W2 being a second weight, the lane departure time period being used to describe the duration of departure of the vehicle from the current lane, and the fatigue index of the driver being used to describe the degree of fatigue of the driver.
The eye closing time length threshold, the lane departure time length threshold, the first weight and the second weight may be set by a user, or may be set by a system default, which is not limited herein.
It should be noted that Dedicated Short Range Communications (DSRC), a Dedicated Short Range communication module, and a lane departure detection module are prior art, and a specific application process is not described herein.
The terminal broadcasts the fatigue driving message to DSRC modules of surrounding vehicles through a special short-range communication DSRC module;
and after the DSRC modules of the surrounding vehicles receive the fatigue driving message, the fatigue driving message is identified through a fatigue driving label in the fatigue driving message, and the vehicle information of the fatigue driving message is broadcasted.
Taking the vehicle information including the vehicle logo, the vehicle type, the vehicle body color and the license plate number as an example, the following are taken as examples:
the vehicle information for broadcasting the fatigue driving message is as follows: vehicle logo A, truck, black and Yu XXXX;
the vehicle information for broadcasting the fatigue driving message is as follows: logo B, car, white and Yu XXXX.
The vehicle information for broadcasting the fatigue driving message is as follows: logo C, passenger, white, and Hu XXXX.
The car logo A, the car logo B and the car logo C represent any existing car logo.
The vehicle types comprise a truck, a cross-country vehicle, a dump truck, a tractor, a special vehicle, a passenger car, a car and a semitrailer.
After S106, the method further includes:
detecting whether a navigation program is started;
and if the navigation program is started, acquiring the remaining driving distance through the navigation program, generating driving time according to the current speed and the remaining driving distance, and if the driving time exceeds the preset time, playing preset music by adopting the maximum volume.
Or after the emergency alarm lamp is turned on and the preset alarm prompt tone is played, the method also comprises the step of detecting whether a navigation program is started or not;
and if the navigation program is started, acquiring the remaining driving distance through the navigation program, generating driving time according to the current speed and the remaining driving distance, and if the driving time exceeds the preset time, playing preset music by adopting the maximum volume.
The preset music may be user specified or system default. Preferably, the preset music is broadcast music.
If the driving time exceeds the preset time, the maximum volume is adopted, and the preset music is played, so that the refreshing is facilitated, and the driving safety is improved conveniently.
In the embodiment of the present invention, even in severe weather conditions such as night, heavy fog, heavy rain, and the like, when a dangerous signal lamp that a driver is in a fatigue state is not clearly seen by surrounding vehicles, the fatigue driving message can be broadcasted to a DSRC module of a surrounding vehicle through a dedicated short-range communication DSRC module so that the DSRC module of the surrounding vehicle receives and broadcasts the fatigue driving message when the driver is in the fatigue state, which has the advantages that: therefore, the vehicle at the side or the rear of the driver can take corresponding measures to avoid danger, and the early warning effect of fatigue driving is improved.
Preferably, the camera in the connected vehicle acquires a face image of the driver in a sampling period, specifically:
acquiring a current position coordinate, detecting whether the current position coordinate is in a highway or not, if so, connecting a camera in a vehicle to acquire a face image of a driver in a sampling period.
In the embodiment of the invention, because the highway is flat and wide, and visual fatigue is easily generated in the driving process, if the current position coordinate is in the highway, the camera in the vehicle is connected to obtain the face image of the driver in the sampling period, so that the times of eye closing of the driver and the eye closing time corresponding to each eye closing are conveniently obtained, and the beneficial effects are that: on the expressway, when the driver is in a fatigue state, surrounding vehicles are timely informed, and vehicles on the side or behind the driver can take corresponding measures to avoid danger, so that the early warning effect of fatigue driving can be further improved.
Preferably, the vehicle information includes a vehicle logo, a vehicle type, a vehicle body color and a license plate number, the Fatigue driving tag is composed of a first character string and a second character string, the first character string is Fatigue, and the second character string is 4 0 s in a binary form; the duration of the sampling period is 15 seconds or 20 seconds.
Among them, Fatigue represents Fatigue. The user-defined fatigue driving label has the beneficial effects that: the following surrounding vehicles and the management server can quickly recognize the fatigue driving message.
Wherein, the sampling period is set to be 15 seconds or 20 seconds, which has the following beneficial effects: the fatigue index can be quickly updated, and the fatigue driving message can be generated in time.
In the embodiment of the invention, the vehicle information comprises the vehicle logo, the vehicle type, the vehicle body color and the license plate number, so that after the surrounding vehicles receive the fatigue driving message, corresponding measures can be taken to avoid danger through the vehicle information in the fatigue driving message.
Preferably, after the broadcasting of the fatigue driving message to DSRC modules of surrounding vehicles through dedicated short-range communication DSRC modules so that the DSRC modules of the surrounding vehicles receive and broadcast the fatigue driving message, the method further comprises:
and turning on an emergency alarm lamp and playing a preset alarm prompt tone.
In the embodiment of the invention, the emergency alarm lamp is turned on, and the preset alarm prompt tone is played, so that surrounding vehicles can be further reminded to pay attention to driving safety.
Preferably, after the emergency alarm lamp is turned on and a preset alarm prompt tone is played, the method further includes:
and uploading the fatigue driving message to a preset management server by adopting a set network mode, wherein the set network mode comprises at least one of a 3G network mode, a 4G network mode and a 5G network mode.
Specifically, after receiving the fatigue driving message, the management server counts the number of the fatigue driving messages in the same area in the same time period according to the current position coordinates of the fatigue driving messages, and when the number of the fatigue driving messages is larger than a preset threshold value, the management server sends a message for adding a temporary parking area to a preset traffic server.
In the embodiment of the invention, the set network mode is adopted, the fatigue driving message is uploaded to the preset management server, so that the management server can complete the statistics of the fatigue driving message, and when the number of the fatigue driving message is greater than the preset threshold value, the management server sends the message for adding the temporary parking area to the preset traffic server, so that the efficiency for adding the temporary parking area can be improved.
Referring to fig. 2, fig. 2 is a block diagram of a driving warning system according to an embodiment of the present invention, which is applied to a terminal, where the terminal includes, but is not limited to, a navigator and a mobile phone.
Referring to fig. 2, the driving early warning system includes:
the human face image acquisition module 21 is connected with a camera in the vehicle to acquire a human face image of a driver in a sampling period;
the eye closing time obtaining module 22 obtains the eye closing times of the driver and the eye closing time corresponding to each eye closing according to the face image;
the lane departure duration acquisition module 23 is connected with the lane departure detection module, and acquires the number of lane departure times in a sampling period and the lane departure duration corresponding to each lane departure;
the fatigue index generating module 24 generates a fatigue index of the driver in the sampling period according to a preset fatigue index generating model, the eye closing times, the eye closing time, the lane departure times, the lane departure time, a preset eye closing time threshold and a preset lane departure time threshold;
the fatigue driving message generating module 25 is configured to determine whether the fatigue index of the driver is greater than a preset threshold, and if the fatigue index of the driver is greater than the preset threshold, encapsulate the preset fatigue driving tag, the pre-stored vehicle information, the current position coordinate, and a timestamp to generate a fatigue driving message, where the timestamp represents a time at which the fatigue driving message is generated;
the fatigue driving message broadcasting module 26 broadcasts the fatigue driving message to DSRC modules of surrounding vehicles through a dedicated short-range communication DSRC module, so that the DSRC modules of the surrounding vehicles receive and broadcast the fatigue driving message.
Preferably, in the driving warning system, the fatigue index generation model specifically includes:
in the ith sampling period, Fi represents the fatigue index of the driver, N represents the eye closing times and is used for describing the number of the eye closing time lengths, N represents the serial number of the eye closing time lengths, the numeric range of N represents 1-N, and EnDenotes the nth eye-closing duration, EtIndicating a presetThe eye closing time length threshold value, M represents the lane departure times and is used for describing the number of the lane departure time lengths, M represents the serial number of the lane departure time lengths, the value range of M represents 1-M, and DmDenotes the m-th lane departure time period, DtRepresenting a preset threshold of the lane departure time period, wherein W1 is a first weight, W2 is a second weight, the lane departure time period is used for describing the duration of the departure of the vehicle from the current lane, and the fatigue index of the driver is used for describing the fatigue degree of the driver;
the face image acquisition module is specifically used for acquiring current position coordinates, detecting whether the current position coordinates are in a highway or not, and if the current position coordinates are in the highway, connecting a camera in a vehicle to acquire a face image of a driver in a sampling period.
Preferably, in the driving early warning system, the vehicle information includes a vehicle logo, a vehicle type, a vehicle body color, and a license plate number, the Fatigue driving tag is composed of a first character string and a second character string, the first character string is Fatigue, and the second character string is 4 0 s in a binary form; the duration of the sampling period is 15 seconds or 20 seconds.
Preferably, the driving warning system further includes:
the execution module is used for turning on an emergency alarm lamp and playing a preset alarm prompt tone;
the fatigue driving information uploading module is used for uploading the fatigue driving information to a preset management server by adopting a set network mode, wherein the set network mode comprises at least one of a 3G network mode, a 4G network mode and a 5G network mode.
In the embodiment of the invention, if the fatigue index is larger than a preset threshold value, pre-stored vehicle information is acquired, the vehicle information, a preset fatigue driving label and the current position coordinate are packaged to generate a fatigue driving message, and the fatigue driving message is broadcasted to a DSRC module of a surrounding vehicle through a special short-range communication DSRC module, so that the DSRC module of the surrounding vehicle receives and broadcasts the fatigue driving message. The beneficial effects are as follows: even in severe weather conditions such as night, heavy fog or heavy rain, surrounding vehicles can be informed when the driver is in a fatigue state, so that the vehicles on the side or behind the driver can take corresponding measures to avoid danger, and therefore, the early warning effect of fatigue driving is favorably improved.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.