Disclosure of Invention
In view of this, the present application provides a method for detecting a road condition by a terminal and the terminal, which solve the problem that when a user uses the terminal, the user cannot observe the surrounding environment and cannot detect the road condition.
In order to solve the above-mentioned prior art problem, a first aspect of the present application provides a method for a terminal to detect a road condition, including:
starting a walking mode, sending a detection signal, receiving a rebound signal rebounded from an obstacle, and detecting a distance value between the obstacle in front of a user and the user according to the time from sending the detection signal to receiving the rebound signal;
judging whether a prejudged absolute value is greater than or equal to a preset prejudged threshold value or not, and judging whether the checked absolute value is smaller than a preset check threshold value or not, wherein the prejudged absolute value is an absolute value of a difference between a currently detected distance value and a preset distance value, the checked absolute value is an absolute value of a difference between the currently detected distance value and a last detected distance value, and the preset distance value is a distance value between a marker in front of a user and the user under a safety condition of the user;
and when the judgment result shows that the prejudgment absolute value is greater than or equal to the prejudgment threshold value and the check absolute value is smaller than the preset check threshold value, prompting by the terminal according to a preset mode so as to prompt the user that the road condition in front is changed and preventive measures are required.
Preferably, the transmitting of the probe signal further comprises:
sending a first detection signal to the horizontal direction;
and sending a second detection signal to a direction which forms a certain angle downwards with the horizontal direction.
Preferably, receiving a bounce signal bounced back by an obstacle further includes:
receiving a first rebound signal rebounded from the first detection signal when encountering an obstacle;
and receiving a second rebound signal which is rebounded by the second detection signal when encountering an obstacle.
Preferably, the method further comprises detecting a distance value between an obstacle in front of the user and the user according to a time elapsed from the transmission of the detection signal to the reception of the bounce signal, and further comprising:
detecting a first distance value between an obstacle in a horizontal direction in front of a user and the user according to the time from the transmission of the first detection signal to the reception of the first bounce signal;
and detecting a second distance value between the obstacle which is in front of the user and is at a certain angle downwards in the horizontal direction and the user according to the time from the sending of the second detection signal to the receiving of the second rebound signal.
Preferably, the determining whether the prejudged absolute value is greater than or equal to a preset prejudged threshold value, and simultaneously determining whether the check absolute value is smaller than a preset check threshold value, further includes:
judging whether a first prejudgment absolute value is equal to a preset first prejudgment threshold value or not, and judging whether a second prejudgment absolute value is greater than a preset second prejudgment threshold value or not, wherein the first prejudgment absolute value is an absolute value of a difference between a currently detected first distance value and a preset first distance value, and the second prejudgment absolute value is an absolute value of a difference between a currently detected second distance value and a preset second distance value;
meanwhile, whether a first check absolute value is smaller than a preset first check threshold value or not is judged, and whether a second check absolute value is smaller than a preset second check threshold value or not is judged, wherein the first check absolute value is an absolute value of a difference between the first distance value detected currently and the first distance value detected last time, and the second check absolute value is an absolute value of a difference between the second distance value detected currently and the second distance value detected last time.
Correspondingly, this application still provides a terminal of surveying road conditions, includes:
the detection module is used for starting a walking mode, sending a detection signal, receiving a rebound signal rebounded by an obstacle, and detecting a distance value between the obstacle in front of a user and the user according to the time from sending the detection signal to receiving the rebound signal;
the judging module is used for judging whether a prejudged absolute value is greater than or equal to a preset prejudged threshold value or not and judging whether the check absolute value is smaller than a preset check threshold value or not, wherein the prejudged absolute value is an absolute value of a difference between a currently detected distance value and a preset distance value, the check absolute value is an absolute value of a difference between the currently detected distance value and a last detected distance value, and the preset distance value is a distance value between a marker in front of a user and the user under the safety condition of the user;
and the prompting module is used for prompting the terminal according to a preset mode when the judgment result shows that the prejudgment absolute value is greater than or equal to the preset prejudgment threshold value and the check absolute value is smaller than the preset check threshold value so as to prompt the user that the road condition in front needs to be changed and preventive measures need to be taken.
Preferably, the detection module is further configured to:
sending a first detection signal to the horizontal direction;
and sending a second detection signal to a direction which forms a certain angle downwards with the horizontal direction.
Preferably, the detection module is further configured to:
receiving a first rebound signal rebounded from the first detection signal when encountering an obstacle;
and receiving a second rebound signal which is rebounded by the second detection signal when encountering an obstacle.
Preferably, the detection module is further configured to:
detecting a first distance value between an obstacle in a horizontal direction in front of a user and the user according to the time from the transmission of the first detection signal to the reception of the first bounce signal;
and detecting a second distance value between the obstacle which is in front of the user and is at a certain angle downwards in the horizontal direction and the user according to the time from the sending of the second detection signal to the receiving of the second rebound signal.
Preferably, the determining module is further configured to:
judging whether a first prejudgment absolute value is equal to a preset first prejudgment threshold value or not, and judging whether a second prejudgment absolute value is greater than a preset second prejudgment threshold value or not, wherein the first prejudgment absolute value is an absolute value of a difference between a currently detected first distance value and a preset first distance value, and the second prejudgment absolute value is an absolute value of a difference between a currently detected second distance value and a preset second distance value;
meanwhile, whether a first check absolute value is smaller than a preset first check threshold value or not is judged, and whether a second check absolute value is smaller than a preset second check threshold value or not is judged, wherein the first check absolute value is an absolute value of a difference between the first distance value detected currently and the first distance value detected last time, and the second check absolute value is an absolute value of a difference between the second distance value detected currently and the second distance value detected last time.
Utilize the technical scheme of this application, when the user walks while lowering user terminal, can avoid the potential safety hazard that causes when the road conditions changes suddenly effectively, especially in night, solved the user when using terminal, the unable observation surrounding environment of eyes, the unable problem of surveying the road conditions, the technical scheme of this application, convenient operation does not influence user terminal, reminds the form diversified, is suitable for all kinds of crowds.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. 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 application.
The main idea of the application is that, at present, as the pace of life of people is increasing, the time for people to use the terminal is getting longer and longer, even many people need to stare at the terminal screen in hand at any time and any place, such as on a subway, a bus, and on the street, some people can watch a mobile phone while walking, which not only damages the health of themselves, but also often causes a safety hazard, and people can not observe the surrounding road condition well while walking, if the people have steps or a tree in front, if the people can not avoid the situation well, the danger is easy to happen, such news is often not available, if the surrounding environment and road condition can be detected through the terminal, when the road condition in front changes, for example, the steps or other obstacles appear, the terminal can give an alarm, reminding the user that the road condition in front of the user changes, and making precautionary measures in advance, so that some potential safety risks can be avoided, and the safety of the user can be well protected.
Embodiments of the present application will be described in detail with reference to the drawings and examples, so that how to implement technical means to solve technical problems and achieve technical effects of the present application can be fully understood and implemented.
Example 1:
fig. 1 is a schematic flow chart of a method for detecting a road condition by a terminal according to an embodiment of the present application, as shown in fig. 1:
a first aspect of the present application provides a method for detecting a road condition by a terminal, including:
step S101: starting a walking mode, sending a detection signal, receiving a rebound signal rebounded from an obstacle, and detecting a distance value between the obstacle in front of a user and the user according to the time from sending the detection signal to receiving the rebound signal;
the user starts a terminal walking mode through manual operation, the terminal comprises but is not limited to a mobile phone, a tablet personal computer and the like, after the terminal starts the walking mode, the terminal starts to send a detection signal, after the detection signal is sent out, the terminal can be rebounded when encountering an obstacle to form a rebounding signal, the rebounding signal is received by the terminal, after the terminal receives the rebounding signal, the distance between the terminal and the obstacle can be calculated according to the time from the beginning of sending the detection signal to the end of receiving the rebounding signal and the speed of the known detection signal in the air, and therefore the distance between the user and the obstacle in front of the user is approximately obtained. Preferably, the detection signal includes: infrared detection signals and/or ultrasonic detection signals.
Specifically, for example, the detection signal sent by the terminal is an infrared detection signal, and we know that the speed of the infrared detection signal in the air is about: c is 3X 108m/s, the time from the emission of the probe signal to the reception of the bounce signal by the terminal is about: 4X 10-6s, then the distance of the obstacle to the terminal is about: 3X 108×4×10-6/2=600m。
As another example, the detection signal sent by the terminal is an ultrasonic detection signal, and we know that the speed of the ultrasonic detection signal in the air is about: 340m/s, the time from the emission of the probe signal to the reception of the bounce signal by the terminal is about: 2s, then the distance of the obstacle to the terminal is approximately: 340 x 2/2 ═ 340 m.
The terminal can also simultaneously detect the road condition through the infrared detection signal and the ultrasonic detection signal, and the distance value between the barrier and the terminal is calculated in a mode of combining the infrared detection signal and the ultrasonic wave.
Step S102: judging whether the prejudged absolute value is greater than or equal to a preset prejudged threshold value or not, and judging whether the check absolute value is smaller than a preset check threshold value or not, wherein the prejudged absolute value is the absolute value of the difference between the currently detected distance value and the preset distance value, the check absolute value is the absolute value of the difference between the currently detected distance value and the last detected distance value, and the preset distance value is the distance value between a marker in front of a user and the user under the safety condition of the user;
the preset distance value is a distance value between a marker in front of a user and the user under a safe condition, and the preset distance value is set by the user in a user-defined mode according to the normal use of the terminal by the user.
The pre-judging absolute value is the absolute value of the difference between the currently detected distance value and the preset distance value, namely the change value between the current road condition and the safe road condition of the user, the preset pre-judging threshold value is the size range of the pre-judging absolute value, namely the safe range value of the current road condition, the change of the pre-judging absolute value can be caused by the arm shaking of the user in the walking process, the interference caused by the situation is eliminated through the setting of the preset pre-judging threshold value, and if the pre-judging absolute value is larger than or equal to the preset pre-judging threshold value, the change of the road condition in front of the user is shown, so that potential danger exists.
The preset check threshold is used for preventing error alarm signals generated by sudden changes of the check absolute value caused by shaking of the user, for example, the user can make the predicted absolute value and the check absolute value suddenly become larger or smaller by shaking hands, turning over a terminal and the like, but the change is not caused by the change of the road condition and needs to be eliminated.
In specific implementation, for example, the preset distance value is 4m, the preset predetermined threshold value is 0.1m, the preset verification threshold value is 0.5m, the user walks on the road, the currently detected distance value between the user and the ground in front is 4.2m, and the last detected distance value is 3.9m, so the predetermined absolute value is 0.2m, and the verification absolute value is 0.3m, then the predetermined absolute value is greater than the predetermined threshold value, and the verification absolute value is less than the verification threshold value, so that the user can be predicted to determine that the road in front is 0.2m higher or 0.2m lower on a relatively flat road, and the change of the road condition in front of the user is not an abrupt change, so that the road condition in front of the user is changed.
Step S103: and when the judgment prejudgment absolute value is larger than or equal to the preset prejudgment threshold value and the check absolute value is smaller than the preset check threshold value, the terminal prompts according to a preset mode so as to prompt the user that the road condition in front is changed and preventive measures are required.
After the judgment process in step S102, after the judgment that the prejudgment absolute value is greater than or equal to the preset prejudgment threshold value and the check absolute value is smaller than the preset check absolute value, it can be judged that the road condition in front of the user is changed compared with the road condition under the safety condition, and the terminal can prompt according to a preset mode so as to prompt the user that the road condition in front is changed and preventive measures are required.
In step S103, the terminal performs a prompt to satisfy a preset prompt condition, where the preset prompt condition is: judging that the prejudgment absolute value is greater than or equal to a prejudgment threshold and the check absolute value is less than a preset check threshold, wherein two prompting conditions are included, and the two prompting conditions are respectively as follows: 1. judging that the prejudgment absolute value is larger than a prejudgment threshold value and the check absolute value is smaller than a preset check threshold value; 2. and judging that the prejudgment absolute value is equal to a preset prejudgment threshold value and the verification absolute value is smaller than a preset verification threshold value.
When the pre-judged absolute value is larger than the pre-judged threshold and the check absolute value is smaller than the pre-judged threshold, the pre-judged absolute value is the absolute value of the difference between the currently detected distance value and the pre-judged distance value, namely the change value between the current road condition and the safe road condition of the user, the pre-judged threshold is the size range of the pre-judged absolute value, namely the safe range value of the current road condition, the terminal detects the distance value between the ground and the user in a direction forming a certain angle downwards with the horizontal direction, the pre-judged absolute value is the absolute value of the difference between the detected distance value and the pre-judged distance value, the pre-judged threshold is the size range of the pre-judged absolute value, namely the safe range value of the current road condition, and under an ideal state, when no obstacle exists on the ground forming a certain angle downwards with the horizontal direction, the influence of arm shaking is eliminated by the user in the walking process, the pre-judgment absolute value is very small and close to zero, the change value of the pre-judgment absolute value is larger and larger along with the appearance of an obstacle on the ground, such as a stair, namely, the detected ground is raised or lowered, so that the safety of a user is ensured by presetting a pre-judgment threshold value, when the pre-judgment absolute value is larger than the pre-judgment threshold value, and the verification absolute value is smaller than the preset verification threshold value, which indicates that the pre-judgment absolute value is not suddenly changed, the terminal prompts.
For example, the prompting condition is that the prejudgment absolute value is greater than a prejudgment threshold and the check absolute value is less than a prejudgment threshold, the prejudgment threshold is set according to experience, the prejudgment threshold is 0.1m, the user normally walks, in an ideal state, the ground is flat and has no obstacle, the prejudgment absolute value is always kept at about 0, the prejudgment absolute value is not greater than the prejudgment threshold, the terminal does not perform alarm prompting, in the walking process, an ascending stair appears in front of the user, when the terminal detects a first step, the prejudgment absolute value is 0.2m, and when the terminal judges that the prejudgment absolute value is greater than the prejudgment threshold, the terminal performs alarm prompting.
And when the prejudgment absolute value is equal to the preset prejudgment threshold and the check absolute value is smaller than the preset check threshold as the preset prompting condition, the terminal does not prompt when the prejudgment absolute value is larger than the preset prejudgment threshold. The terminal detects the road condition in the horizontal direction, the pre-judging absolute value is the absolute value of the difference between the distance value detected in the horizontal direction in front of the user and the preset distance value, the preset pre-judging threshold value is the range of the pre-judging absolute value, namely the safety range value of the current road condition, when no obstacle exists in the horizontal direction, the pre-judging absolute value is large and exceeds the pre-judging threshold value in the walking process of the user, however, the terminal does not prompt, and the change value of the pre-judging absolute value becomes smaller and smaller along with the appearance of the obstacle in the horizontal direction, that is, the obstacle in the horizontal direction is closer to the user, so that the pre-judging threshold needs to be preset to ensure the safety of the user, and when the prejudgment absolute value is equal to the prejudgment threshold value and the check absolute value is smaller than the preset check threshold value, indicating that the prejudgment absolute value is not suddenly changed, prompting by the terminal.
For example, the prompting condition is that the pre-judgment absolute value is equal to the pre-judgment threshold value, the check absolute value is smaller than the pre-judgment threshold value, the pre-judgment threshold value is 3m, the user normally walks, a wall is arranged at a position 30m in the horizontal direction, the pre-judgment absolute value detected by the terminal is 30m and is larger than the pre-judgment threshold value, the terminal does not prompt, the user slowly approaches the wall while walking forward, when the wall is 4m away from the user, the current terminal judges that the pre-judgment absolute value is larger than the pre-judgment threshold value, the terminal does not alarm, at the next moment, the user is 3m away from the wall, and the terminal judges that the pre-judgment absolute value is equal to the pre-judgment threshold value, the terminal gives an alarm.
In step S103, when the judgment prejudgment absolute value is greater than or equal to the preset prejudgment threshold and the verification absolute value is smaller than the preset verification threshold, further judgment is needed: the method comprises the steps that whether a prejudgment absolute value is larger than a preset prejudgment limiting threshold value or not is judged, when the prejudgment absolute value is larger than the preset prejudgment limiting threshold value, a terminal does not prompt, the limited threshold value is preset and is used for setting a detection range of a detection signal, when the detection signal detects that the road condition exceeding the detection range changes, the terminal also prompts, when the detection range of the detection signal is infinite, the terminal cannot receive a rebound signal and also considers that the detection of the detection signal exceeds the detection range, for example, a user sets the detection range of the detection signal to be 20m, the terminal detects the road condition in front of the user beyond the range of 20m, and even if the prejudgment absolute value is larger than or equal to the preset prejudgment threshold value and the verification absolute value is smaller than the preset verification threshold value, the terminal does not prompt.
In the embodiment of the present application, preferably, the terminal prompts according to a preset mode, where the preset mode includes one or more of the following combinations: the method comprises the following steps of light reminding, sound reminding, vibration reminding, starting a terminal flashlight function, starting a camera function and displaying extracted information on a terminal screen. The light reminding comprises but is not limited to modes of indicating light flashing, color changing and the like; audible alerts include, but are not limited to, beeping alerts, voice alerts, and the like; vibrating to remind the user; the flashlight function of the terminal is started to illuminate the road in front of the user, so that the user can observe the road condition in front; starting a camera function, wherein the camera is a camera on the back of the terminal, and a user can observe the condition of a road in front of the user through the camera of the terminal; and displaying prompt information on a terminal screen, wherein the prompt information comprises road condition information and prompts a user to pay attention to taking precautionary measures. The prompting modes of the terminal are various, and the terminal can be convenient for various people to use, including people who walk and watch the screen, blind people, people with poor eyesight at night and the like.
Example 2:
on the basis of embodiment 1, the present application further provides another embodiment, in which the terminal simultaneously sends detection signals to the horizontal direction and a direction forming a certain angle with the horizontal direction, so as to detect the road conditions in the two directions simultaneously, and the embodiment specifically includes:
on the basis of step S101 in embodiment 1, preferably, the sending a probe signal further includes: sending a first detection signal to the horizontal direction; and sending a second detection signal to a direction which forms a certain angle downwards with the horizontal direction. The terminal sends the detection signal to the horizontal direction of terminal and the direction that is certain angle downwards with the horizontal direction simultaneously, send first detection signal to the horizontal direction, be used for surveying whether the terminal horizontal direction can appear the barrier, lead to the road conditions to change, for example, the place ahead appears a tree or a jam wall etc. send the second detection signal to the direction that is certain angle with the horizontal direction, be used for surveying whether road conditions can appear on user place ahead ground and change, through changing the angle between second detection signal and the first detection signal, set up the distance between user place ahead ground that the second detection signal surveyed to the user, the angle is bigger, the distance is littleer.
After the terminal transmits the first probe signal and the second probe signal, it will accordingly receive a bounce signal bounced back from an obstacle hit by the first probe signal and the second probe signal, and preferably receive a bounce signal bounced back from the obstacle, further comprising: receiving a first rebound signal rebounded from the first detection signal when encountering an obstacle; and receiving a second rebound signal which is rebounded back when the second detection signal meets the obstacle.
After receiving the first bounce signal and the second bounce signal, the terminal preferably detects a distance value between an obstacle in front of the user and the user according to an elapsed time from the transmission of the detection signal to the reception of the bounce signal, and further includes: detecting a first distance value between an obstacle in a horizontal direction in front of the user and the user according to the time elapsed from the transmission of the first detection signal to the reception of the first bounce signal; and detecting a second distance value between the obstacle which is in front of the user and is at a certain angle downwards in the horizontal direction and the user according to the time from the sending of the second detection signal to the receiving of the second rebound signal. The distance value between the terminal and the obstacle can be obtained by multiplying the known speed of the detection signal by the time and dividing the time by 2, the first distance value is the distance between the obstacle in the horizontal direction of the terminal and the user, and the second distance value is the distance between the ground in front of the user and the user.
On the basis of step S102 in embodiment 1, preferably, the determining whether the prejudged absolute value is greater than or equal to a prejudged threshold, and determining whether the verified absolute value is smaller than a predetermined verified threshold, further includes: judging whether the first prejudged absolute value is equal to a preset first prejudged threshold value or not, and judging whether the second prejudged absolute value is greater than a preset second prejudged threshold value or not, wherein the first prejudged absolute value is the absolute value of the difference between the currently detected first distance value and the preset first distance value, and the second prejudged absolute value is the absolute value of the difference between the currently detected second distance value and the preset second distance value; meanwhile, whether the first check absolute value is smaller than a preset first check threshold value or not is judged, and whether the second check absolute value is smaller than a preset second check threshold value or not is judged, wherein the first check absolute value is an absolute value of a difference between a currently detected first distance value and a last detected first distance value, and the second check absolute value is an absolute value of a difference between a currently detected second distance value and a last detected second distance value.
Specifically, the method includes the steps of sending a first detection signal in a horizontal direction at a terminal, receiving a first rebound signal rebounded when the first detection signal hits an obstacle, detecting a first distance value between the obstacle and a user in a horizontal direction of the user according to the time from sending the first detection signal to receiving the first rebound signal, taking an absolute value of a difference between a currently detected first distance value and a preset first distance value as a first prejudgment absolute value, taking an absolute value of a difference between a currently detected first distance value and a last detected first distance value as a first check absolute value, judging whether the first prejudgment absolute value is equal to a first prejudgment threshold, and judging whether the first check absolute value is smaller than the preset first check threshold.
And sending a second detection signal in a direction in which the terminal forms a certain angle with the horizontal direction, receiving a second rebound signal rebounded when the second detection signal touches an obstacle, detecting a second distance value between the obstacle and the user in the horizontal direction of the user according to the time from sending the second detection signal to receiving the second rebound signal, taking an absolute value of a difference between the currently detected second distance value and a preset second distance value as a second prejudgment absolute value, taking an absolute value of a difference between the currently detected second distance value and the last detected second distance value as a second check absolute value, judging whether the second prejudgment absolute value is equal to or equal to a second prejudgment threshold value, and judging whether the second check absolute value is smaller than a preset second check threshold value.
On the basis of step S103 in embodiment 1, in an embodiment of the present application, preferably, when it is determined that the prejudged absolute value is greater than or equal to the prejudged threshold and the check absolute value is smaller than the preset check threshold, the terminal performs prompting according to a preset manner, including: and when the first prejudgment absolute value is judged to be equal to the preset first prejudgment threshold value and the first check absolute value is smaller than the preset first check threshold value, and/or when the second prejudgment absolute value is judged to be larger than the preset second prejudgment threshold value and the second check absolute value is smaller than the preset second check threshold value, the terminal prompts in a preset mode.
The first prejudgment absolute value is equal to a preset first prejudgment threshold value, the first check absolute value is smaller than the preset first check threshold value, the situation that the road condition of a user in the horizontal direction changes and is not suddenly changed is shown, the interference of an error signal is eliminated, the terminal prompts in a preset mode, the second prejudgment absolute value is larger than a preset second prejudgment threshold value, the second check absolute value is smaller than a preset second check threshold value, the situation that the road condition of the user in the direction which forms a certain angle with the horizontal direction downwards changes and is not suddenly changed, the interference of the error signal is eliminated, the terminal prompts in a preset mode under the condition that the two conditions are met, the terminal prompts in different modes under different conditions, and the terminal can prompt in the same mode.
Example 3:
on the basis of embodiment 1 or 2, the present application further provides another embodiment, when the terminal detects the road condition through the detection signal, the camera on the back side of the terminal is turned on, so that the user can observe the road condition while walking, and the specific embodiment is as follows:
the walking mode is started, and the method further comprises the following steps: and starting a camera of the terminal, and displaying the ground condition acquired by the camera in real time through a screen on the upper part of a terminal screen.
After the terminal starts a walking mode, a camera at the back of the terminal is started, a user can observe the ground condition acquired by the camera through an upper screen of a terminal screen, the upper part of the terminal screen is the road condition acquired by the camera, the lower part of the terminal screen is a normal operation interface of the terminal, the user can walk and see the terminal screen without influencing the road condition observation and the use of the terminal, meanwhile, the user can detect the road condition in front of the user in real time in cooperation with a detection signal, and the safety risk that the user can see the screen while walking can be better avoided.
Example 4:
fig. 2 is a schematic structural diagram of a terminal for detecting a road condition according to an embodiment of the present application, as shown in fig. 2:
correspondingly, this application still provides a terminal of surveying road conditions, includes:
the detection module 1 is used for starting a walking mode, sending a detection signal, receiving a rebound signal rebounded by an obstacle, and detecting a distance value between the obstacle in front of a user and the user according to the time from sending the detection signal to receiving the rebound signal;
the judging module 2 is used for judging whether the prejudged absolute value is greater than or equal to a preset prejudged threshold value or not and judging whether the check absolute value is smaller than the preset check threshold value or not, wherein the prejudged absolute value is an absolute value of a difference between a currently detected distance value and a preset distance value, the check absolute value is an absolute value of a difference between the currently detected distance value and a last detected distance value, and the preset distance value is a distance value between a marker in front of a user and the user under the safety condition of the user;
and the prompting module 3 is used for prompting the terminal according to a preset mode when the judgment prejudgment absolute value is greater than or equal to the preset prejudgment threshold and the check absolute value is smaller than the preset check threshold so as to prompt the user that the road condition in front is changed and preventive measures are required.
Preferably, the detection module 1 is further configured to:
sending a first detection signal to the horizontal direction;
and sending a second detection signal to a direction which forms a certain angle downwards with the horizontal direction.
Preferably, the detection module 1 is further configured to:
receiving a first rebound signal rebounded from the first detection signal when encountering an obstacle;
and receiving a second rebound signal which is rebounded back when the second detection signal meets the obstacle.
Preferably, the detection module 1 is further configured to:
detecting a first distance value between an obstacle in a horizontal direction in front of the user and the user according to the time elapsed from the transmission of the first detection signal to the reception of the first bounce signal;
and detecting a second distance value between the obstacle which is in front of the user and is at a certain angle downwards in the horizontal direction and the user according to the time from the sending of the second detection signal to the receiving of the second rebound signal.
Preferably, the judging module 2 is further configured to:
judging whether the first prejudged absolute value is equal to a preset first prejudged threshold value or not, and judging whether the second prejudged absolute value is greater than a preset second prejudged threshold value or not, wherein the first prejudged absolute value is the absolute value of the difference between the currently detected first distance value and the preset first distance value, and the second prejudged absolute value is the absolute value of the difference between the currently detected second distance value and the preset second distance value;
meanwhile, whether the first check absolute value is smaller than a preset first check threshold value or not is judged, and whether the second check absolute value is smaller than a preset second check threshold value or not is judged, wherein the first check absolute value is an absolute value of a difference between a currently detected first distance value and a last detected first distance value, and the second check absolute value is an absolute value of a difference between a currently detected second distance value and a last detected second distance value.
Preferably, the prompting module 3 is further configured to:
when the first prejudgment absolute value is judged to be equal to the preset first prejudgment threshold value and the first check absolute value is smaller than the preset first check threshold value, and/or
And when the second prejudgment absolute value is judged to be larger than the preset second prejudgment threshold value and the second check absolute value is smaller than the preset second check threshold value, the terminal prompts in a preset mode.
Preferably, the detection signal includes:
infrared detection signals and/or ultrasonic detection signals.
Preferably, the terminal prompts according to a preset mode, wherein the preset mode comprises one or more of the following combinations:
the method comprises the following steps of light reminding, sound reminding, vibration reminding, starting a terminal flashlight function, starting a camera function and displaying extracted information on a terminal screen.
In addition, preferably, the detection module 1 is further configured to: and starting a camera of the terminal, and displaying the ground condition acquired by the camera in real time through a screen on the upper part of a terminal screen.
The terminal in the present application may specifically execute the method in the present application, and the method in the present application corresponds to the terminal characteristics, and may refer to each other, which is not described in detail herein.
The examples of the present application are intended to concisely illustrate the technical features of the present application so that those skilled in the art can intuitively understand the technical features of the present application, and are not intended to be unduly limiting in the present application.
The above-described apparatus embodiments are merely illustrative, in that elements described as separate components may or may not be physically separate. One of ordinary skill in the art can understand and implement it without inventive effort.
The specific application scenario is as follows:
fig. 3 is a schematic view of an application scenario of an embodiment of the present application, and the following describes the application scenario and combines with fig. 3 to more intuitively understand a technical solution of the embodiment of the present application, where in fig. 3, the terminal 30 sends the first probing signal 10 to the user in the horizontal direction, and sends the second probing signal 20 downward to the user in the horizontal direction.
Application scenario one
The user sets a first preset distance of 0m, a second preset distance of 4m, a first pre-judging threshold of 3m, a second pre-judging threshold of 0.1m, a first verification threshold of 0.5m and a second verification threshold of 0.5m in advance in the mobile phone.
When the user walks on the road, the current terminal detects that the first distance value in the horizontal direction of the user is 3m through the first detection signal, the last detected first distance value is 3.1m, the second distance value from the ground in front of the user to the user, which is detected by the second detection signal at present, is 4.2m, the second distance value detected last time is 3.9m, so that the first prejudged absolute value is 3m, the second prejudged absolute value is 0.2m, the first check absolute value is 0.1m, the second check absolute value is 0.3m, the first prejudged absolute value is equal to the first prejudged threshold value, the second prejudged absolute value is greater than the second prejudged threshold value, and the first check absolute value is smaller than a preset first check threshold value, the second check absolute value is smaller than a preset second check threshold value, the terminal sends out an alarm by the aid of the prompt lamp flickering, vibration and voice prompt, and a user is reminded that the road condition in front changes.
The user raises the head to observe the road condition and finds that the front part of the user appears upstairs.
Application scenario two
In the first application scenario, a user starts a mobile phone walking mode, the upper portion of a mobile phone screen displays road conditions obtained by a camera on the back of the mobile phone, and when the mobile phone gives an alarm, the user observes that an upstairs appears in front through the upper portion of the mobile phone screen.
In summary, according to the method for detecting the road condition by the terminal and the terminal provided by the application, when a user walks while lowering the head of the user using the terminal, the potential safety hazard caused by sudden change of the road condition can be effectively avoided, and especially at night, the problems that the user cannot observe the surrounding environment and cannot detect the road condition by eyes when using the terminal are solved.
The foregoing description shows and describes several preferred embodiments of the present application, but as aforementioned, it is to be understood that the application is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the application as described herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the application, which is to be protected by the claims appended hereto.