Air quality detection method, device, electronic device and readable storage medium
By setting up an air quality sensor in the headset to automatically obtain and report air quality information, the problem of users' difficulty in obtaining nearby air quality is solved, and simple air quality detection is achieved.
Patent Information
- Application Number
- CN202210740983.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-06-28
AI Technical Summary
It is difficult for users to accurately obtain air quality information in a small area near themselves, and they usually require manual measurement, which leads to inconvenience in obtaining.
Set up an air quality sensor in the headset to detect the air quality broadcasting requirements, obtain historical air quality information, and determine whether it meets the broadcasting conditions. If so, broadcast it, otherwise wake the sensor to measure the current air quality and broadcast it.
It realizes the automatic broadcast of current air quality information when user needs are detected, without manual measurement, which improves the simplicity of air quality information detection.
Smart Images

Figure CN115112839B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of earphone technology, and in particular to an air quality detection method, device, electronic device, and readable storage medium. Background Art
[0002] Currently, users usually obtain air quality information from smartphones. This air quality information is usually about the air quality of a large area, such as the air quality of an entire city. It is difficult to accurately obtain air quality information in a small area near the user. If the user wants to obtain air quality information in a small area near himself, he usually needs to manually measure the air quality, such as using a handheld air meter to measure the air quality. Therefore, it is very inconvenient for users to obtain air quality information in the area near themselves. Summary of the Invention
[0003] The main purpose of this application is to provide an air quality detection method, device, electronic device and readable storage medium, aiming to solve the technical problem of low simplicity of air quality detection.
[0004] To achieve the above objectives, the present application provides an air quality detection method, which is applied to headphones, wherein the headphones are provided with an air quality sensor. The air quality detection method includes:
[0005] When an air quality broadcast demand is detected, historical air quality detection information is obtained, wherein the historical air quality detection information includes historical detection locations and historical detection times;
[0006] Determining whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time;
[0007] If yes, then broadcast the historical air quality detection information;
[0008] If not, waking up the air quality sensor to measure the current air quality;
[0009] Based on the current time, current location and the current air quality, current air quality detection information is generated and the current air quality detection information is broadcast.
[0010] Optionally, the step of determining whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time includes:
[0011] Obtaining the current time and the current position, and determining a time offset between the historical detection time and the current time, and a position offset between the historical detection position and the current position;
[0012] According to the time deviation and the position deviation, it is determined whether the historical air quality detection information meets the preset broadcast conditions.
[0013] Optionally, the headset is provided with a position sensor, and the step of determining whether the historical air quality detection information meets a preset broadcast condition according to the historical detection position and the historical detection time includes:
[0014] Obtain the current time, and determine whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold;
[0015] If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor;
[0016] Determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold;
[0017] If the position deviation is less than the preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions.
[0018] Optionally, after the step of determining whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold, the air quality detection method further includes:
[0019] If the time deviation is not less than the preset time deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted;
[0020] After the step of determining whether the position deviation between the current position and the historical detection position is less than a preset position deviation threshold, the air quality detection method further includes:
[0021] If the position deviation is not less than the preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted.
[0022] Optionally, the headset is provided with a seismic measurement module, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least historical detection locations and historical detection times, the air quality detection method further includes:
[0023] If a vibration signal is acquired by the vibration measuring module, detecting whether the vibration signal is a preset tooth occlusion vibration signal;
[0024] If the vibration signal is a preset tooth occlusion vibration signal, it triggers the generation of an air quality broadcast requirement.
[0025] Optionally, the headset is provided with an acceleration sensor, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least a historical detection location and a historical detection time, the air quality detection method further includes:
[0026] detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting a head movement posture of a user wearing the headset;
[0027] If the level change direction corresponding to the first level signal meets the preset level change direction, and the number of level changes corresponding to the first level signal meets the preset number of level changes, then the air quality broadcast requirement is triggered.
[0028] Optionally, the headset is provided with a photosensor, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least historical detection locations and historical detection times, the air quality detection method further includes:
[0029] detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of corresponding amplitude according to the intensity of the irradiated light;
[0030] If the level signal meets the preset trigger condition, it triggers the generation of the air quality broadcast requirement.
[0031] To achieve the above-mentioned purpose, the present application further provides an air quality detection device, which is applied to headphones. The headphones are provided with an air quality sensor. The air quality detection device includes:
[0032] An acquisition module, configured to acquire historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes historical detection locations and historical detection times;
[0033] A judgment module, configured to judge whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time;
[0034] A first reporting module, configured to report the historical air quality detection information;
[0035] The second broadcast module is used to generate current air quality detection information based on the current time, current location and current air quality measured by the air quality sensor, and broadcast the current air quality detection information if no.
[0036] Optionally, the judgment module is further configured to:
[0037] Obtaining the current time and the current position, and determining a time offset between the historical detection time and the current time, and a position offset between the historical detection position and the current position;
[0038] According to the time deviation and the position deviation, it is determined whether the historical air quality detection information meets the preset broadcast conditions.
[0039] Optionally, the earphone is provided with a position sensor, and the judgment module is further configured to:
[0040] Obtain the current time, and determine whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold;
[0041] If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor;
[0042] Determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold;
[0043] If the position deviation is less than the preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions.
[0044] Optionally, the air quality detection device is further used to:
[0045] If the time deviation is not less than the preset time deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted;
[0046] If the position deviation is not less than the preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted.
[0047] Optionally, the earphone is provided with a vibration measurement module, and the air quality detection device is further used to:
[0048] If a vibration signal is acquired by the vibration measuring module, detecting whether the vibration signal is a preset tooth occlusion vibration signal;
[0049] If the vibration signal is a preset tooth occlusion vibration signal, it triggers the generation of an air quality broadcast requirement.
[0050] Optionally, the earphone is provided with an acceleration sensor, and the air quality detection device is further used to:
[0051] detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting a head movement posture of a user wearing the headset;
[0052] If the level change direction corresponding to the first level signal meets the preset level change direction, and the number of level changes corresponding to the first level signal meets the preset number of level changes, then the air quality broadcast requirement is triggered.
[0053] Optionally, the earphone is provided with a photosensor, and the air quality detection device is further used to:
[0054] detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of corresponding amplitude according to the intensity of the irradiated light;
[0055] If the level signal meets the preset trigger condition, it triggers the generation of the air quality broadcast requirement.
[0056] The present application also provides an electronic device, which is a physical device, and includes: a memory, a processor, and a program of the air quality detection method stored in the memory and runnable on the processor. When the program of the air quality detection method is executed by the processor, the steps of the air quality detection method as described above can be implemented.
[0057] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the air quality detection method. When the program of the air quality detection method is executed by a processor, the steps of the air quality detection method as described above are implemented.
[0058] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned air quality detection method when executed by a processor.
[0059] The present application provides an air quality detection method, device, electronic device and readable storage medium. Compared with the technical means of measuring air quality information with a handheld air meter, the present application is provided with an air quality sensor in the headset. When an air quality broadcast demand is detected, historical air quality detection information is obtained, wherein the historical air quality detection information includes a historical detection location and a historical detection time; based on the historical detection location and the historical detection time, it is determined whether the historical air quality detection information meets the preset broadcast conditions; if so, the historical air quality detection information is broadcast; if not, the air quality sensor is awakened to measure the current air quality; based on the current time, current location and the current air quality, current air quality detection information is generated and broadcast. The present application achieves the purpose of automatically broadcasting the real-time air quality information of the user's current location when it is detected that the user has an air quality broadcast request, without the user having to manually measure the air quality. Therefore, it overcomes the technical defect that if the user wants to obtain the air quality information in a small area near himself, the user usually needs to manually measure the air quality, which makes it very inconvenient for the user to obtain the air quality information in the area near himself, and improves the simplicity of air quality information detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0062] Figure 1 This is a flow chart of the first embodiment of the air quality detection method of the present application;
[0063] Figure 2 This is a flow chart of a second embodiment of the air quality detection method of the present application;
[0064] Figure 3 Schematic diagram of the equipment structure of the hardware operating environment involved in the air quality detection method in the embodiment of the present application.
[0065] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0066] To make the above-mentioned purposes, features, and advantages of the present application more clearly understood, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.
[0067] Example 1
[0068] The embodiment of the present application provides an air quality detection method applied to earphones, wherein the earphones are provided with an air quality sensor. Figure 1 In a first embodiment of the air quality detection method of the present application, the air quality detection method includes:
[0069] Step S10: When an air quality broadcasting demand is detected, historical air quality detection information is obtained, wherein the historical air quality detection information includes historical detection locations and historical detection times;
[0070] Step S20: judging whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time;
[0071] Step S30: If yes, broadcast the historical air quality detection information;
[0072] Step S40: If not, wake up the air quality sensor to measure the current air quality;
[0073] Step S50: Generate current air quality detection information based on the current time, current location and the current air quality, and broadcast the current air quality detection information.
[0074] In this embodiment, it should be noted that the headset can be a TWS (True Wireless Stereo) headset, and the headset is provided with an air quality sensor, which can be a VOC (volatile organic compounds) sensor. The air quality sensor is usually in an off state, and will only wake up the air quality sensor to measure the air quality when a preset wake-up condition is triggered. The detection of the air quality broadcast demand can be triggered by detecting that the headset is turned on. The historical air quality detection information includes historical air quality, historical detection time and historical detection position. The historical air quality can be the detection value obtained by the air quality sensor in the last detection. The historical detection time can be the time when the air quality sensor detected the historical air quality. The historical detection position can be the location information of the air quality sensor detecting the historical air quality. The location information can be location coordinates, for example, coordinates composed of longitude and latitude. The current air quality detection information and the historical air quality detection information can both be voice information, so that voice broadcasting can be performed.
[0075] As an example, steps S10 to S50 include: when it is detected that the headset is turned on, it is determined that there is a need for air quality broadcasting, and locally stored historical air quality detection information is obtained, wherein the historical air quality detection information includes historical air quality, historical detection time and historical detection position; based on the position deviation between the historical detection position and the current position of the headset, and the time deviation between the historical detection time and the current time, it is determined whether the historical air quality detection information meets the preset broadcast conditions; if the historical air quality detection information meets the preset broadcast conditions, the historical air quality detection information is broadcast; if the historical air quality detection information does not meet the preset broadcast conditions, the air quality sensor is awakened from the off state, the current air quality is measured by the air quality sensor, and the current time and the current position of the headset are obtained, the current air quality, current time and current position are encapsulated as current air quality detection information, and the current control quality detection information is broadcast; the air quality sensor is turned off.
[0076] It should be noted that the air quality sensor consumes more power when working, and due to the size limitation of the earphones, the power of the earphones is usually limited. Therefore, the air quality sensor set on the earphones in the embodiment of the present application is usually in the off state. When the air quality needs to be detected, it will be briefly awakened and will be turned off immediately after the air quality detection is completed, so as to achieve the purpose of saving power when performing air quality detection by setting an air quality sensor on the earphones.
[0077] The step of determining whether the historical air quality detection information meets the preset broadcast conditions based on the historical detection location and the historical detection time includes:
[0078] Step S21, obtaining the current time and the current position, determining the time deviation between the historical detection time and the current time, and the position deviation between the historical detection position and the current position;
[0079] Step S22: judging whether the historical air quality detection information meets the preset broadcast conditions according to the time deviation and the position deviation.
[0080] In this embodiment, it should be noted that the current position can be measured and obtained by a position sensor provided on the headset, or can be obtained by connecting the headset to the Internet. The position sensor can be a Beidou sensor for measuring the position of the headset.
[0081] As an example, steps S21 to S22 include: obtaining the current time and measuring the current position of the headset through a position sensor; calculating the time deviation between the historical detection time and the current time, and calculating the position deviation between the historical detection position and the current position; if the time deviation is less than the preset time deviation threshold and the position deviation is less than the preset position deviation threshold, then it is determined that the historical air quality detection information meets the preset broadcast conditions; if the time deviation is not less than the preset time deviation threshold or the position deviation is not less than the preset position deviation threshold, then it is determined that the historical air quality detection information does not meet the preset broadcast conditions.
[0082] The headset is provided with a seismic module, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least a historical detection location and a historical detection time, the air quality detection method further includes:
[0083] Step A10: if a vibration signal is acquired by the vibration measuring module, detecting whether the vibration signal is a preset tooth occlusion vibration signal;
[0084] Step A20: If the vibration signal is a preset tooth occlusion vibration signal, it triggers the generation of an air quality broadcast requirement.
[0085] In this embodiment, it should be noted that the earphone is provided with a seismic module, which is a seismic meter for detecting external vibrations, thereby generating a corresponding external vibration signal based on the external vibrations. The external vibration signal can be a level signal output according to the deformation status information of the crystal in the seismometer due to the external vibration. The deformation status information can be information such as the direction of deformation, the frequency of deformation, and the size of deformation.
[0086] As an example, step A10 to step A20 include: if a vibration signal is collected by the vibration measurement module, then feature extraction is performed on the vibration signal to obtain vibration signal features; based on the vibration signal features, it is determined whether the vibration signal is a preset tooth occlusion vibration signal; if the vibration signal is a preset occlusion vibration signal, then the generation of an air quality broadcast demand is triggered; otherwise, the generation of an air quality broadcast demand is not triggered. The preset tooth occlusion vibration signal can be a vibration signal generated by the teeth occluding continuously for a preset number of times, for example, it can be a vibration signal generated by the teeth occluding continuously for 3 times within 2 seconds. The embodiment of the present application realizes the determination of whether the user has an air quality broadcast demand based on whether the user occludes his teeth autonomously, and can intelligently determine whether the user needs to detect the air quality. In particular, for users with speech disorders who cannot perform voice control, the user's convenience in performing air quality detection can be improved.
[0087] As an example, the step of determining whether the vibration signal is a preset tooth occlusion vibration signal according to the vibration signal characteristics includes:
[0088] The vibration signal features are classified according to a preset vibration signal feature classification model to obtain a feature classification label; and based on the feature classification label, whether the vibration signal is a preset tooth occlusion vibration signal is determined. For example, it can be set that when the feature classification label is 1, the vibration signal is determined to be a preset tooth occlusion vibration signal, and when the feature classification label is 0, the vibration signal is determined to be a preset tooth occlusion vibration signal.
[0089] As an example, the step of determining whether the vibration signal is a preset tooth occlusion vibration signal according to the vibration signal characteristics includes:
[0090] Obtain the target vibration signal feature corresponding to the preset tooth occlusion vibration signal, and calculate the feature similarity between the target vibration signal feature and the vibration signal feature; if the feature similarity is less than the preset feature similarity threshold, determine that the vibration signal feature is the preset tooth occlusion vibration signal; if the feature similarity is not less than the preset feature similarity threshold, determine that the vibration signal feature is the preset tooth occlusion vibration signal.
[0091] The headset is provided with an acceleration sensor, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least a historical detection location and a historical detection time, the air quality detection method further includes:
[0092] Step B10: detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting a head movement posture of a user wearing the headset;
[0093] Step B20: If the level change direction corresponding to the first level signal meets the preset level change direction, and the number of level changes corresponding to the first level signal meets the preset number of level changes, then triggering the generation of an air quality broadcast demand.
[0094] In this embodiment, it should be noted that the acceleration sensor is configured to generate a corresponding level signal by detecting the head movement posture of the user wearing the headset. The signal characteristics of the level signal can reflect the head movement posture of the user wearing the headset. The signal characteristics of the level signal include at least one of a level change direction and a level change number. The level change direction can be a change direction of the amplitude of the level signal relative to a standard amplitude. The level change direction can be an increase direction of the amplitude of the level signal or a decrease direction of the amplitude of the level signal. For example, assuming that the standard amplitude of the level signal output by the acceleration sensor when the acceleration is 0 is A, the level change direction of a level signal greater than A is an increase direction, and the level change direction of a level signal less than A is a decrease direction. The level change number is the number of changes in the amplitude of the level signal. The change in the amplitude of the level signal from the standard amplitude to the return to the standard amplitude can be set as one level change number. For example, if the standard amplitude of the level signal output by the acceleration sensor when the acceleration is 0 is A, the amplitude of the level signal increases from A to B and then resets to A, and then decreases from A to C and resets to A, then the level signal change number is 2.
[0095] As an example, steps B10 to B20 include: detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting the head movement posture of the user wearing the headset; if the level change directions corresponding to the first level signal all conform to a preset level change direction, and the number of level changes corresponding to the first level signal conforms to a preset number of level changes, then triggering the generation of an air quality broadcast requirement; if the level change directions corresponding to the first level signal do not all conform to the preset level change direction, or the number of level changes corresponding to the first level signal does not conform to the preset number of level changes, then not triggering the generation of an air quality broadcast requirement. For example, it can be configured that when the level change directions are up, down, up, and down, respectively, and the number of level changes is 4, then triggering the generation of an air quality broadcast requirement, and at this time, the user's head movement posture is first nodding downward, then looking up, then nodding downward, and finally looking up. This embodiment of the present application realizes determining whether a user has an air quality broadcast requirement based on the user's head movement posture, and can intelligently determine whether the user needs to detect air quality. This is particularly convenient for users with speech impairments who cannot perform voice control, and can improve the user's convenience in performing air quality detection.
[0096] The headset is provided with a photosensor, and before the step of obtaining historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes at least a historical detection location and a historical detection time, the air quality detection method further includes:
[0097] Step C10, detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of corresponding amplitude according to the intensity of the irradiated light;
[0098] Step C20: If the level signal meets the preset trigger condition, it triggers the generation of the air quality broadcast requirement.
[0099] In this embodiment, it should be noted that the headset is provided with a photosensor, which is used to generate a level signal of corresponding amplitude according to the intensity of the irradiated light. For example, it can be set that the stronger the light irradiating the photosensor, the higher the amplitude of the level signal output by the photosensor, and the weaker the light irradiating the photosensor, the lower the amplitude of the level signal output by the photosensor.
[0100] As an example, steps C10 to C20 include: detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of a corresponding amplitude based on the intensity of the irradiated light; determining the number of times the photosensor is continuously blocked within a preset time period based on the number of consecutive changes in the amplitude of the second level signal within a preset time period; if the number of consecutive blockages is greater than a preset number threshold, determining that the level signal meets a preset trigger condition, triggering the generation of an air quality report request; and if the number of consecutive blockages is not greater than the preset number threshold, determining that the level signal does not meet the preset trigger condition, and not triggering the generation of an air quality report request. For example, assuming that the amplitude of the level signal generated by the photosensor under ambient light is A, and the amplitude of the level signal generated when the photosensor is blocked is B, then a change in the amplitude from A to B is recorded as a number of blockages. Further assuming that the preset time period is 5 seconds and the preset number threshold is 3, then if the photosensor is continuously blocked more than three times within 5 seconds, determining that the level signal meets the preset trigger condition, thereby triggering the generation of an air quality report request. The embodiment of the present application realizes determining whether a user has an air quality broadcast demand based on the number of times the user voluntarily and continuously blocks the photosensor, and can intelligently determine whether the user needs to detect the air quality. Especially for users with speech disorders who cannot perform voice control, the convenience of air quality detection for users can be improved.
[0101] The embodiment of the present application provides an air quality detection method. Compared with the technical means of measuring air quality information by a user holding an air meter, the embodiment of the present application is provided with an air quality sensor in the headset. When an air quality broadcast demand is detected, historical air quality detection information is obtained, wherein the historical air quality detection information includes a historical detection location and a historical detection time; based on the historical detection location and the historical detection time, it is determined whether the historical air quality detection information meets the preset broadcast conditions; if so, the historical air quality detection information is broadcast; if not, the air quality sensor is awakened to measure the current air quality; based on the current time, current location and the current air quality, current air quality detection information is generated and broadcast. The embodiment of the present application achieves the purpose of automatically broadcasting the real-time air quality information of the user's current location when it is detected that the user has an air quality broadcast request, without the user having to manually measure the air quality. Therefore, it overcomes the technical defect that if the user wants to obtain the air quality information in a small area near himself, the user usually needs to manually measure the air quality, which makes it very inconvenient for the user to obtain the air quality information in the area near himself, and improves the simplicity of air quality information detection.
[0102] Example 2
[0103] Reference Figure 2Based on the first embodiment of the present application, in another embodiment of the present application, the headset is provided with a position sensor, and the step of determining whether the historical air quality detection information meets the preset broadcast conditions based on the historical detection position and the historical detection time includes:
[0104] Step D10, obtaining the current time, and determining whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold;
[0105] Step D20: If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor;
[0106] Step D30, determining whether the position deviation between the current position and the historical detection position is less than a preset position deviation threshold;
[0107] Step D40: If the position deviation is less than a preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions.
[0108] In this embodiment, it should be noted that the headset is also provided with a position sensor, which is usually in an off state. When the corresponding wake-up condition is triggered, the headset will automatically wake up the position sensor briefly to measure the current position of the headset.
[0109] As an example, steps D10 to D40 include: obtaining the current time, determining whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold; if the time deviation is less than the preset time deviation threshold, waking up the position sensor from the off state, measuring the current position of the headset through the position sensor, and turning off the position sensor after the measurement is completed; determining whether the position deviation between the current position and the historical detection position is less than a preset position deviation threshold; if the position deviation is less than the preset position deviation threshold, determining that the historical air quality detection information meets the preset broadcast conditions.
[0110] Wherein, after the step of determining whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold, the air quality detection method further includes:
[0111] Step E10: If the time deviation is not less than a preset time deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast condition, and the historical air quality detection information is deleted;
[0112] As an example, step E10 includes: if the time deviation is not less than the preset time deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information has expired, thereby deleting the historical air quality detection information, and executing the steps: waking up the air quality sensor to measure the current air quality, generating current air quality detection information based on the current time, current location and the current air quality, and broadcasting the current air quality detection information.
[0113] After the step of determining whether the position deviation between the current position and the historical detection position is less than a preset position deviation threshold, the air quality detection method further includes:
[0114] Step F10: If the position deviation is not less than the preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast condition, and the historical air quality detection information is deleted.
[0115] As an example, step F10 includes: if the position deviation is not less than the preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information has expired, thereby deleting the historical air quality detection information, and executing the steps: waking up the air quality sensor to measure the current air quality, generating current air quality detection information based on the current time, current position and the current air quality, and broadcasting the current air quality detection information.
[0116] As an example, after the step of deleting the historical air quality detection information, the method further includes: after the current air quality detection information is broadcast, storing the current air quality detection information as new historical air quality detection information.
[0117] It should be noted that due to the small size of the headset, the storage space carried by the headset itself is limited. Therefore, in the embodiment of the present application, after discovering that the historical air quality detection information is invalid, the historical air quality detection information is immediately deleted to save the local storage space of the headset and reduce the occupancy of the local storage space of the headset.
[0118] An embodiment of the present application provides an air quality detection method, namely, obtaining a current time, determining whether a time deviation between the current time and a historical detection time is less than a preset time deviation threshold; if the time deviation is less than the preset time deviation threshold, waking up the position sensor, and measuring the current position of the headset through the position sensor; if the time deviation is not less than the preset time deviation threshold, waking up the air quality sensor to measure the current air quality, generating current air quality detection information based on the current time, current position, and current air quality, and broadcasting the current air quality detection information; determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold; if the position deviation is less than the preset position deviation threshold, determining that the historical air quality detection information meets a preset broadcast condition, and broadcasting the historical air quality detection information; if the position deviation is not less than the preset position deviation threshold, waking up the air quality sensor to measure the current air quality, generating current air quality detection information based on the current time, current position, and current air quality, and broadcasting the current air quality detection information, and turning off the position sensor and air quality sensor after the broadcast is completed. Therefore, in the embodiment of the present application, the position sensor and air quality sensor on the headset are usually set to off. Only when there is a measurement demand will they be briefly awakened to measure the current position and current air quality, thereby determining whether to broadcast historical air quality detection information or regenerate the current air quality detection information for broadcast. On the basis of realizing automatic air quality detection, the embodiment of the present application can save the power consumed by the headset for air quality detection by setting the on and off conditions of the position sensor and air quality sensor, thereby ensuring the sustainable operation time of the headset.
[0119] Example 3
[0120] The present application also provides an air quality detection device, which is applied to headphones. The headphones are provided with an air quality sensor. The air quality detection device includes:
[0121] An acquisition module, configured to acquire historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes historical detection locations and historical detection times;
[0122] A judgment module, configured to judge whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time;
[0123] A first reporting module, configured to report the historical air quality detection information;
[0124] The second broadcast module is used to generate current air quality detection information based on the current time, current location and current air quality measured by the air quality sensor, and broadcast the current air quality detection information if no.
[0125] Optionally, the judgment module is further configured to:
[0126] Obtaining the current time and the current position, and determining a time offset between the historical detection time and the current time, and a position offset between the historical detection position and the current position;
[0127] According to the time deviation and the position deviation, it is determined whether the historical air quality detection information meets the preset broadcast conditions.
[0128] Optionally, the earphone is provided with a position sensor, and the judgment module is further configured to:
[0129] Obtain the current time, and determine whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold;
[0130] If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor;
[0131] Determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold;
[0132] If the position deviation is less than the preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions.
[0133] Optionally, the air quality detection device is further used to:
[0134] If the time deviation is not less than the preset time deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted;
[0135] If the position deviation is not less than the preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions, and the historical air quality detection information is deleted.
[0136] Optionally, the earphone is provided with a vibration measurement module, and the air quality detection device is further used to:
[0137] If a vibration signal is acquired by the vibration measuring module, detecting whether the vibration signal is a preset tooth occlusion vibration signal;
[0138] If the vibration signal is a preset tooth occlusion vibration signal, it triggers the generation of an air quality broadcast requirement.
[0139] Optionally, the earphone is provided with an acceleration sensor, and the air quality detection device is further used to:
[0140] detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting a head movement posture of a user wearing the headset;
[0141] If the level change direction corresponding to the first level signal meets the preset level change direction, and the number of level changes corresponding to the first level signal meets the preset number of level changes, then the air quality broadcast requirement is triggered.
[0142] Optionally, the earphone is provided with a photosensor, and the air quality detection device is further used to:
[0143] detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of corresponding amplitude according to the intensity of the irradiated light;
[0144] If the level signal meets the preset trigger condition, it triggers the generation of the air quality broadcast requirement.
[0145] The air quality detection device provided in this application utilizes the air quality detection method of the above-described embodiment to solve the technical problem of the low simplicity of air quality detection. Compared with the prior art, the beneficial effects of the air quality detection device provided in the embodiment of this application are the same as the beneficial effects of the air quality detection method provided in the above-described embodiment, and the other technical features of the air quality detection device are the same as those disclosed in the above-described embodiment method, and are not further described here.
[0146] Example 4
[0147] An embodiment of the present application provides an electronic device, which may be an earphone or a terminal device carrying an earphone, and the electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the air quality detection method in the above-mentioned embodiment one.
[0148] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0149] like Figure 3 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). 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. An input / output (I / O) interface is also connected to the bus.
[0150] Typically, the following systems can be connected to the I / O interface: input devices such as a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices such as a magnetic tape, hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figures show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have instead.
[0151] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0152] The electronic device provided in this application utilizes the air quality detection method of the above-described embodiment to resolve the technical problem of the low simplicity of air quality detection. Compared with the prior art, the beneficial effects of the electronic device provided in the embodiment of this application are the same as those of the air quality detection method provided in the above-described embodiment 1, and the other technical features of the electronic device are the same as those disclosed in the above-described embodiment method, and are not further described here.
[0153] It should be understood that various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in an appropriate manner.
[0154] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0155] Example 5
[0156] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the air quality detection method in the above-mentioned embodiment 1.
[0157] The computer-readable storage medium provided in the embodiment of the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. A more specific example of a computer-readable storage medium can include, but is not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, a system or a device or used in combination therewith. The program code contained in the computer-readable storage medium can be transmitted with any appropriate medium, including but not limited to: an electric wire, an optical cable, RF (radio frequency), etc., or any suitable combination thereof.
[0158] The computer-readable storage medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0159] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: when an air quality broadcast demand is detected, obtains historical air quality detection information, wherein the historical air quality detection information includes historical detection location and historical detection time; based on the historical detection location and the historical detection time, determines whether the historical air quality detection information meets the preset broadcast conditions; if so, broadcasts the historical air quality detection information; if not, wakes up the air quality sensor to measure the current air quality; generates current air quality detection information based on the current time, current location and the current air quality, and broadcasts the current air quality detection information.
[0160] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0161] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0162] The modules involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0163] The computer-readable storage medium provided in this application stores computer-readable program instructions for executing the aforementioned air quality detection method, thereby resolving the technical issue of the limited simplicity of air quality detection. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this embodiment of the application are the same as those of the air quality detection method provided in the aforementioned embodiment, and are not further elaborated here.
[0164] Example 6
[0165] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned air quality detection method when executed by a processor.
[0166] The computer program product provided in this application solves the technical problem of low simplicity in air quality detection. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the air quality detection method provided in the above embodiment, and will not be repeated here.
[0167] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A method for detecting air quality, characterized in that: Applied to headphones, the headphones are provided with an air quality sensor and a position sensor, and the air quality detection method includes: When an air quality broadcast demand is detected, historical air quality detection information is obtained, wherein the historical air quality detection information includes historical detection locations and historical detection times; Determining whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time; If yes, then broadcast the historical air quality detection information; If not, waking up the air quality sensor to measure the current air quality; Generate current air quality detection information based on the current time, current location and the current air quality, and broadcast the current air quality detection information; The step of determining whether the historical air quality detection information meets the preset broadcast conditions based on the historical detection location and the historical detection time includes: Obtain the current time, and determine whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold; If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor; Determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold; If the position deviation is less than a preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions; If the time deviation is not less than a preset time deviation threshold or the position deviation is not less than a preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions.
2. The air quality detection method according to claim 1, wherein: After the step of determining that the historical air quality detection information does not meet the preset broadcast condition, the air quality detection method further includes: Delete the historical air quality detection information.
3. The air quality detection method according to any one of claims 1 to 2, characterized in that: The headset is provided with a seismic detection module. Before the step of obtaining historical air quality detection information when an air quality broadcasting demand is detected, wherein the historical air quality detection information includes at least historical detection locations and historical detection times, the air quality detection method further includes: If a vibration signal is acquired by the vibration measuring module, detecting whether the vibration signal is a preset tooth occlusion vibration signal; If the vibration signal is a preset tooth occlusion vibration signal, it triggers the generation of an air quality broadcast requirement.
4. The air quality detection method according to any one of claims 1 to 2, characterized in that: The headset is provided with an acceleration sensor. Before the step of obtaining historical air quality detection information when an air quality broadcasting demand is detected, wherein the historical air quality detection information includes at least historical detection locations and historical detection times, the air quality detection method further includes: detecting a first level signal output by the acceleration sensor, wherein the acceleration sensor is configured to generate a corresponding level signal by detecting a head movement posture of a user wearing the headset; If the level change direction corresponding to the first level signal meets the preset level change direction, and the number of level changes corresponding to the first level signal meets the preset number of level changes, then the air quality broadcast requirement is triggered.
5. The air quality detection method according to any one of claims 1 to 2, characterized in that: The headset is provided with a photosensor, and before the step of obtaining historical air quality detection information when an air quality broadcasting demand is detected, wherein the historical air quality detection information includes at least historical detection locations and historical detection times, the air quality detection method further includes: detecting a second level signal output by the photosensor, wherein the photosensor is configured to generate a level signal of corresponding amplitude according to the intensity of the irradiated light; If the level signal meets the preset trigger condition, it triggers the generation of the air quality broadcast requirement.
6. An air quality detection device, characterized in that: Applied to earphones, the earphones are provided with an air quality sensor and a position sensor, and the air quality detection device includes: An acquisition module, configured to acquire historical air quality detection information when an air quality broadcast demand is detected, wherein the historical air quality detection information includes historical detection locations and historical detection times; A judgment module, configured to judge whether the historical air quality detection information meets a preset broadcast condition based on the historical detection location and the historical detection time; A first reporting module, configured to report the historical air quality detection information; a second reporting module, configured to, if not, generate current air quality detection information based on the current time, the current location, and the current air quality measured by the air quality sensor, and report the current air quality detection information; The judgment module is further configured to: Obtain the current time, and determine whether the time deviation between the current time and the historical detection time is less than a preset time deviation threshold; If the time deviation is less than a preset time deviation threshold, waking up the position sensor and measuring the current position of the headset through the position sensor; Determining whether a position deviation between the current position and the historical detection position is less than a preset position deviation threshold; If the position deviation is less than a preset position deviation threshold, it is determined that the historical air quality detection information meets the preset broadcast conditions; If the time deviation is not less than a preset time deviation threshold or the position deviation is not less than a preset position deviation threshold, it is determined that the historical air quality detection information does not meet the preset broadcast conditions.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the air quality detection method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program for implementing the air quality detection method, and the program for implementing the air quality detection method is executed by a processor to implement the steps of the air quality detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Detecting method and device and terminal
CN106442876A
Navigation path information broadcasting method, broadcasting system, vehicle-mounted terminal and vehicle
CN110108293A