Voice message playing method and electronic equipment
By combining proximity sensor data and attitude motion data, false alarms are corrected to ensure that the terminal device correctly switches to the earphone playback mode in the scene of answering in the ear, the user experience problem caused by proximity sensor is solved and the reliable use of the device is improved sex.
Patent Information
- Application Number
- CN202410339285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2024-12-13
AI Technical Summary
When existing terminal devices answer voice messages in the user's ear, false alarms may occur due to the proximity sensor, resulting in the chat application being accidentally turned off the anti-touch process, affecting the user experience. The phone may light up the screen in the speaker playback mode, causing false touch.
By obtaining the detection results of the proximity light sensor and combining attitude and motion data, the proximity light status of the electronic device is calculated, and false alarms are corrected to ensure that the voice message is played using the earpiece while answering the scene in the ear, the screen is turned off, and the error is avoided.
Improves user experience, ensures that you correctly switch to the earpiece playback mode when answering in the ear, avoids mist touching, and enhances the reliability of the device's use.
Smart Images

Figure CN119135796A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 202310697883.5 submitted to the China Patent Office, application date June 13, 2023, and invention name “Voice Message Playing Method and Electronic Device”. Technical Field
[0002] The present application relates to the field of terminal devices, and in particular to a voice message playing method and electronic device. Background Art
[0003] At present, with the development of terminal technology, the functions of terminal applications are becoming more and more powerful. For example, users can use chat applications for text communication and voice communication. Among them, voice communication includes but is not limited to video calls, voice calls, and voice messages. When the user picks up the phone and answers the voice message at his ear, the chat application obtains the proximity light sensor to detect the proximity state, starts the anti-false touch process, automatically switches from the speaker playback mode to the receiver playback mode, and turns off the screen to prevent accidental touch. Correspondingly, when the user puts down the phone, the chat application obtains the proximity light sensor to detect the distance state, turns off the anti-false touch process, automatically switches from the receiver playback mode to the speaker playback mode, and turns on the screen.
[0004] However, since the proximity light sensor may generate false alarms, the chat application may mistakenly close the anti-false touch process when the user answers the voice message at the ear. As a result, when the phone is still at the user's ear, the chat application has already switched to speaker playback mode and the screen is on, affecting the user experience. Summary of the invention
[0005] The present application provides a voice message playing method and an electronic device. In the method, the electronic device can obtain the proximity light state based on an algorithm, and correct the proximity light state detected by the proximity light sensor to avoid false alarms and affect the user experience.
[0006] In the first aspect, the present application provides a method for playing a voice message. The method includes: the electronic device responds to a received click operation on the voice message, calls a speaker to play the voice message, and the display screen of the electronic device is in a bright screen state. In the process of the electronic device playing the voice message, the electronic device obtains a first proximity light state based on the detection result of the proximity light sensor, and the electronic device obtains a second proximity light state based on the first state data; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device. The electronic device detects that both the first proximity light state and the second proximity light state indicate a distant state, continues to call the speaker to play the voice message, and the display screen of the electronic device is in a bright screen state. When the user raises his hand and places the electronic device next to his ear to answer the voice message, the third proximity light state is obtained based on the detection result of the proximity light sensor. The electronic device obtains a fourth proximity light state based on the second state data. When the electronic device detects that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a close state, the electronic device determines that the third proximity light state is an abnormal state, and based on the fourth proximity light state, the electronic device determines that the electronic device is in an ear-to-ear listening scenario, calls the handset to play a voice message, and the display screen of the electronic device is in an off-screen state. In this way, the electronic device in the present application can calculate the proximity light state of the electronic device by the posture and motion state of the electronic device, so as to correct the detection result of the proximity light sensor in the case of a false alarm of the proximity light sensor to obtain the correct proximity light state. Thereby, the electronic device can control the mode of the electronic device when playing voice messages based on the correct proximity light state. In addition, the gesture assistance algorithm continuously obtains status data after the speaker is turned on, so that the gesture assistance algorithm can obtain the corresponding proximity light state in real time. Correspondingly, the electronic device can also call the proximity light state calculated by the algorithm in real time.
[0007] Exemplarily, the state data is ACC data. The posture data includes but is not limited to pitch angle and roll angle. The motion data includes but is not limited to handupJudge parameters.
[0008] In a possible implementation, the method also includes: in the process of the user continuously placing the electronic device next to the ear to answer the voice message, the electronic device obtains the fifth proximity light state based on the detection result of the proximity light sensor. The electronic device obtains the sixth proximity light state based on the third state data. The electronic device detects that the fifth proximity light state indicates a distant state, and the sixth proximity light state indicates a close state, determines that the fifth proximity light state is an abnormal state, and, based on the sixth proximity light state, determines that the electronic device is still in the ear-answering scene, continues to call the earpiece to play the voice message, and the display screen of the electronic device is in the off state. In this way, after the earpiece is turned on, the electronic device can obtain the accurate motion state of the electronic device based on the state parameters obtained before the earpiece is turned on and the current state parameters obtained, so as to obtain the accurate proximity light state based on the algorithm.
[0009] In a possible implementation, it is detected that both the first proximity light state and the second proximity light state indicate a far away state, the speaker is continued to be called to play the voice message, and the electronic device display screen is in a bright screen state, including: the electronic device detects whether the receiver is in an open state. The electronic device detects that the receiver is in a closed state, and determines whether the first proximity light state indicates a far away state. The electronic device determines that the first proximity light state indicates a far away state, and determines whether the second proximity light state indicates a near state. The electronic device determines that the second proximity light state indicates a far away state, and determines that the current target proximity light state of the electronic device is a far away state. Based on the target proximity light state, the electronic device continues to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state. In this way, the electronic device can determine whether it is necessary to make a judgment based on the result of the proximity light sensor in combination with the proximity light state obtained by the algorithm. If it is necessary to combine the algorithm, the proximity light state calculated by the algorithm is called again to further determine whether there is a false alarm in the result detected by the proximity light sensor.
[0010] In a possible implementation, the electronic device detects that the third proximity light state indicates a far state, and the fourth proximity light state indicates a near state, and determines that the third proximity light state is an abnormal state, including: the electronic device detects whether the handset is in an open state. The electronic device detects that the handset is in a closed state, and determines whether the third proximity light state indicates a far state. The electronic device determines that the third proximity light state indicates a far state, and determines whether the fourth proximity light state indicates a near state. The electronic device determines that the fourth proximity light state indicates a near state, and based on the third proximity light state and the fourth proximity light state, determines that the third proximity light state is an abnormal state. The electronic device determines that the fourth proximity light state is a target proximity light state. In this way, the electronic device can determine whether it is necessary to make a determination in combination with the proximity light state obtained by the algorithm based on the result of the proximity light sensor. In the case where it is necessary to combine the algorithm, the proximity light state calculated by the algorithm is called again to further determine whether there is a false alarm in the result detected by the proximity light sensor.
[0011] In a possible implementation, based on the fourth proximity light state, determining that the electronic device is in an ear-to-ear listening scenario, calling the handset to play a voice message, and the display screen of the electronic device is in an off-screen state, includes: the electronic device determines that the electronic device is in an ear-to-ear listening scenario based on the target proximity light state, calling the handset to play a voice message, and the display screen of the electronic device is in an off-screen state. In this way, the electronic device can determine whether the electronic device is currently in an ear-to-ear listening state based on the algorithm and the result of the proximity light sensor to obtain an accurate result, and control the mode of the electronic device to play the voice message based on the target proximity light state finally determined.
[0012] In a possible implementation, it is detected that the fifth proximity light state indicates a distant state, and the sixth proximity light state indicates a close state, and the fifth proximity light state is determined to be an abnormal state, including: the electronic device detects whether the handset is in an open state. The electronic device detects that the handset is in an open state, and determines whether the sixth proximity light state indicates a close state. The electronic device determines that the sixth proximity light indicates a close state, and determines that the fifth proximity light state is an abnormal state based on the fifth proximity light state and the sixth proximity light state. The electronic device determines that the sixth proximity light state is a target proximity light state. In this way, the electronic device can obtain the status data before the handset is turned on, and based on the status data, the gesture lock is locked, that is, the proximity light state is locked, so that in the scenario where the electronic device is answering the call by the ear, even if the proximity light sensor misreports, based on the gesture lock having locked the proximity state, the proximity light state finally obtained by the electronic device is still the proximity state, and will not be affected by the sensor's false alarm.
[0013] In a possible implementation, the electronic device determines that the electronic device is still in the ear-to-ear listening scenario based on the sixth proximity light state, continues to call the handset to play the voice message, and the display screen of the electronic device is in the off-screen state, including: based on the target proximity light state, determining that the electronic device is in the ear-to-ear listening scenario, continues to call the handset to play the voice message, and the display screen of the electronic device is in the off-screen state. In this way, the electronic device can correct the abnormal report of the proximity light sensor based on the proximity light state obtained by the algorithm, and control the mode of the electronic device to play the voice message based on the correct proximity light state.
[0014] In a second aspect, the present application provides an electronic device, comprising: one or more processors, a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: in response to a received click operation on a voice message, calling a speaker to play the voice message, and the display screen of the electronic device is in a bright screen state; based on the detection result of the proximity light sensor, obtaining a first proximity light state; based on the first state data, obtaining a second proximity light state; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current posture of the electronic device the previous motion state; detecting that the first proximity light state and the second proximity light state both indicate the away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in the screen-on state; when the user raises his hand and puts the electronic device to his ear to answer the voice message, based on the detection result of the proximity light sensor, obtaining the third proximity light state; based on the second state data, obtaining the fourth proximity light state; detecting that the third proximity light state indicates the away state, and the fourth proximity light state indicates the approaching state, determining that the third proximity light state is an abnormal state, and, based on the fourth proximity light state, determining that the electronic device is in the ear-answering scenario, calling the handset to play the voice message, and the electronic device display screen is in the screen-off state.
[0015] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: while the user continues to place the electronic device to the ear to listen to voice messages, a fifth proximity light state is obtained based on the detection result of the proximity light sensor; a sixth proximity light state is obtained based on the third state data; when the fifth proximity light state indicates a distant state and the sixth proximity light state indicates a close state, the fifth proximity light state is determined to be an abnormal state; and, based on the sixth proximity light state, it is determined that the electronic device is still in the ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in the off state.
[0016] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in an on state; detecting that the earpiece is in a off state, determining whether the first proximity light state indicates a away state; determining that the first proximity light state indicates a away state, determining whether the second proximity light state indicates a proximity state; determining that the second proximity light state indicates a away state, determining that the current target proximity light state of the electronic device is the away state; based on the target proximity light state, continuing to call the speaker to play the voice message, and the electronic device display is in a bright screen state.
[0017] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in an on state; detecting that the earpiece is in a off state, and determining whether the third proximity light state indicates a away state; determining that the third proximity light state indicates a away state, and determining whether the fourth proximity light state indicates a proximity state; determining that the fourth proximity light state indicates a proximity state, and based on the third proximity light state and the fourth proximity light state, determining that the third proximity light state is an abnormal state; and determining that the fourth proximity light state is a target proximity light state.
[0018] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: based on the target proximity light state, determining that the electronic device is in an ear listening scenario, calling the earpiece to play a voice message, and the display screen of the electronic device is in an off state.
[0019] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in an on state; detecting that the earpiece is in an on state, determining whether the sixth proximity light state indicates a proximity state; determining that the sixth proximity light indicates a proximity state, and based on the fifth proximity light state and the sixth proximity light state, determining that the fifth proximity light state is an abnormal state; and determining that the sixth proximity light state is a target proximity light state.
[0020] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: based on the target proximity light state, determining that the electronic device is in an ear listening scenario, continuing to call the earpiece to play the voice message, and the display screen of the electronic device is in an off state.
[0021] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0022] In a third aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0023] In a fourth aspect, the present application provides a computer program, comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0024] In a fifth aspect, the present application provides a chip, the chip comprising a processing circuit and a transceiver pin, wherein the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive a signal and control the sending pin to send a signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic diagram of the hardware structure of an electronic device shown as an example;
[0026] Figure 2 A schematic diagram of the software structure of an electronic device is shown as an example;
[0027] Figure 3 A schematic diagram of an exemplary user interface;
[0028] Figure 4a is a schematic diagram of an application scenario shown as an example;
[0029] Figure 4b is a schematic diagram of an application scenario shown as an example;
[0030] Figure 4c to Figure 4d is a schematic diagram of module interaction shown as an example;
[0031] Figure 5 A flowchart of a method for playing a voice message is shown as an example;
[0032] Figure 6 A flowchart of a method for playing a voice message is shown as an example;
[0033] Figure 7 The figure is a schematic diagram of a state value calculation process of a gesture assistance algorithm shown as an example;
[0034] Figure 8 A flowchart of a method for playing a voice message is shown as an example;
[0035] Figure 9a to Figure 9b A flowchart of a method for playing a voice message is shown as an example;
[0036] Fig.10 is a schematic diagram of a gesture lock calculation process shown as an example;
[0037] Fig.11 A flowchart of a voice playback method is shown as an example;
[0038] Fig.12 The figure is a schematic diagram of an exemplary voice message playing process;
[0039] Fig.13 Schematic diagram of the structure of the device shown as an example. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are 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 creative work are within the scope of protection of this application.
[0041] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0042] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.
[0043] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0044] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0045] Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. It should be understood that Figure 1The illustrated electronic device 100 is merely one example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 1 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0046] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0047] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0048] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0049] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0050] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0051] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0052] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0053] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0054] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0055] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0056] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0057] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0058] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0059] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0060] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0061] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0062] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0063] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0064] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0065] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0066] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0067] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0068] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0069] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0070] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0071] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0072] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0073] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0074] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0075] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0076] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0077] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0078] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0079] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0080] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0081] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0082] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0083] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0084] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0085] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0086] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0087] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0088] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0089] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0090] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0091] Figure 2It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0092] The layered architecture of the electronic device 100 divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer (HAL), and the kernel layer.
[0093] The application layer can include a series of application packages.
[0094] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, chat and other applications. Among them, the chat application can be an application pre-installed on the electronic device, or it can be a third-party application, which is not limited in this application. In the embodiments of this application, only the chat application is used as an example for explanation. In other embodiments, the method in the embodiments of this application can be applied to any application that can send voice messages, which is not limited in this application.
[0095] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0096] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a Sensorservice (sensor service), an Audioservice (audio service), and the like.
[0097] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0098] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0099] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0100] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0101] Sensorservice is used to provide sensor-related services and provide service interfaces for upper-layer applications.
[0102] Audioservice is used to provide audio related services and provide service interfaces for upper-layer applications.
[0103] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: SensorHal (sensor hardware abstraction layer), AudioHal (audio hardware abstraction layer), etc.
[0104] Among them, the Audio HAL is used to process the audio stream, for example, to perform noise reduction, directional enhancement and other processing on the audio stream.
[0105] SensorHal is used to process events reported by sensor drivers.
[0106] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, Sensorevent module, audio driver, Bluetooth driver, Wi-Fi driver, etc.
[0107] The display driver is used to control the display of the display.
[0108] Sensorevent is used to record the status of the receiver or speaker.
[0109] The audio driver is used to control audio devices, such as but not limited to: receivers, speakers, etc.
[0110] The SensorHub (sensor component) layer includes but is not limited to: gesture auxiliary module and sensor driver.
[0111] The gesture auxiliary module is used to control the gesture lock. Among them, the gesture lock can also be understood as a proximity light state lock, which is used to lock the proximity light state. If the gesture lock is in the locked state, that is, the proximity light state is locked, the proximity light state reported by the proximity light driver is the proximity state. If the gesture lock is not locked, that is, the proximity light state is not locked, the proximity light driver reports according to the actually detected proximity light state (which can be a distance state or a proximity state).
[0112] The sensor driver is used to control the state of the sensor (e.g., open or close) and receive the sensor parameters reported by the sensor. Optionally, the sensor driver may further include sensor drivers corresponding to different sensors. For example, in an embodiment of the present application, the sensor driver may include a proximity light driver to control the proximity light sensor and receive the sensor parameters uploaded by the proximity light sensor. Optionally, the sensor driver may also include an acceleration sensor, etc., which is not limited in the present application.
[0113] Understandably, Figure 2 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.
[0114] Figure 3 For an exemplary user interface diagram, please refer to Figure 3 The display interface 300 includes a chat application interface 310. The chat application interface includes but is not limited to a chat box and an input box. The chat box is used to display received and sent chat messages. In the embodiment of the present application, the chat messages include but are not limited to: voice chat messages 311 (hereinafter referred to as voice messages) and text chat messages (hereinafter referred to as text messages).
[0115] like Figure 3 As shown, the user can click on the voice message 311 to instruct the mobile phone to play the voice message. It should be noted that in the embodiments of the present application, only the electronic device is a mobile phone as an example for description. In other embodiments, the electronic device can also be a wearable device (such as a smart watch or bracelet), a tablet, etc., and the present application does not limit it.
[0116] For example, Figure 4a In the scenario diagram shown in the present embodiment, when the user clicks on the voice message 311, the mobile phone is usually in a away state. In the present embodiment, the away state can be understood as a non-ear-to-ear listening state. Figure 4aIn the scenario shown, if the user needs to click on the voice message 311, the user usually holds the phone with one hand (either the left or right hand), and the user can observe the display interface of the phone to click on the voice message 311. In the embodiment of the present application, after the user clicks on the voice message 311, the phone (specifically the chat application) responds to the received user operation and plays the voice message 311 through the speaker. It can also be understood that in the away state, the phone plays the audio content in the voice message 311 through the speaker, and the display interface 300 is in the bright screen state, that is, it displays the following. Figure 3 The interface shown.
[0117] In the embodiment of the present application, the state corresponding to the distant state is the close state, which can also be understood as the ear-to-ear listening state. Figure 4b FIG4 is a schematic diagram of a scenario of answering a call by ear. In FIG4, the user can Figure 4a The handheld mobile phone is in the away state shown, and moves toward the user's ear, so that the receiver of the mobile phone is close to the user's ear, which is the approach state. In this scenario, the mobile phone detects that it is currently in the approach state, and can start the anti-mistouch process, that is, play a voice message through the receiver, and turn off the screen (that is, the display interface 300 turns black). In the embodiment of the present application, after the screen of the mobile phone is turned off, the touch event is locked, that is, the touch sensor no longer detects the touch event to prevent mistouch.
[0118] Combination Figure 4a and Figure 4b The scene shown, Figure 4c to Figure 4d This is an exemplary diagram of module interaction. Figure 4c When answering a voice message, the chat application will register to monitor proximity light events. Specifically, the chat application can send a registration monitoring message to Sensorservice. Sersorservice receives the registration monitoring message and sends an activate (trigger) message to SersorHal. In response to the received activate message, SersorHal instructs the sensor driver (specifically, it can be a proximity light driver) to trigger (i.e., start) the proximity light sensor. The proximity light sensor detects proximity light, and the specific detection method can refer to the existing technical embodiments, which is not limited in this application.
[0119] In an embodiment of the present application, the proximity light sensor may continuously report the detected sensor parameters to the proximity light driver, and the proximity light driver may determine the corresponding proximity light event based on the received sensor parameters, which is not limited in this application. Wherein, the proximity light event includes but is not limited to: proximity events and distance events. Optionally, the sensor driver may report the relevant event to the proximity light driver when it is determined that a proximity light event switch has occurred (for example, switching from a proximity event to a distance event, or switching from a distance event to a proximity event, which is not limited in this application).
[0120] Optionally, the proximity light sensor may also report a proximity light event to the sensor driver based on the detected parameters (which may be referred to as sensor parameters or proximity light parameters). Wherein, the proximity light event includes but is not limited to: proximity events and distance events. Optionally, the proximity light sensor may report the relevant event to the proximity light driver only when a switching event occurs.
[0121] Exemplarily, after the sensor driver determines that a proximity light event (including a distance event or a proximity event) occurs, the proximity light event is reported to SensorHal. In response to the received proximity light event, SensorHal sends the proximity light event to Sensorservice. Sensorsevice sends the proximity light event to the chat application.
[0122] In the embodiment of the present application, if the user picks up the phone to answer the call, the chat application receives the proximity event reported by the proximity light driver through other modules, which can also be understood as the proximity light driver reporting the proximity state. The chat application responds to the reported proximity state (i.e., proximity event) to start the anti-mistouch process. Figure 4d As shown, exemplarily, the chat application sends an instruction message to the PoserManager (power management) module to instruct the start of the screen off process. The PoserManager module sends a screen off instruction to the hardware composer (HWC). The HWC sends the screen off instruction to the display driver. The display driver controls the display screen to turn off in response to the received screen off instruction.
[0123] For example, the chat application sends a receiver play instruction to Audioservice at the same time, which is used to instruct the receiver to play the current voice message. Audioservice sends a receiver play instruction to AudioHal, and AudioHal sends a receiver play instruction to the audio driver. In response to the received instruction, the audio driver calls the receiver (i.e. Figure 1 The receiver shown in FIG. 1 plays the current audio data, that is, the voice content in the voice message.
[0124] exist Figure 4b and Figure 4cIn the process shown, whether the chat application starts the anti-mistouch process depends on the detection result of the proximity light sensor. In some embodiments, if the proximity light sensor detects an error, for example, the proximity state is detected as the far state. For example, the user's hair may block the detection signal of the proximity light sensor, and the user's hair may absorb the detection signal of the proximity light sensor, so that the proximity light sensor fails to receive the reflected detection signal. Correspondingly, the detection result of the proximity light sensor will indicate that the current proximity light state is the far state. Among them, as described above, the detection result may be determined by the proximity light sensor, or it may be determined by the proximity light drive, which is not limited in this application. In this abnormal scenario, due to the false alarm of the proximity light sensor, the chat application will turn off the anti-mistouch process. For details, please refer to Figure 4c In response to the received proximity status, the chat application turns off the accidental touch prevention process. The chat application sends an instruction message to the PoserManager module to instruct the screen off process to be turned off. The PoserManager module sends a screen light up instruction to the HWC. The HWC sends the screen light up instruction to the display driver. The display driver controls the display light up in response to the received screen light up instruction, for example, Figure 3 The display interface 300 in FIG.
[0125] Exemplarily, the chat application simultaneously sends a speaker play instruction to Audioservice, which is used to instruct the speaker to play the current voice message. Audioservice sends a speaker play instruction to AudioHal, and AudioHal sends a speaker play instruction to the audio driver. In response to the received instruction, the audio driver calls the speaker to play the current audio data, that is, the voice content in the voice message.
[0126] That is to say, when the user picks up the phone and puts it to the ear to answer the voice message, the chat application shuts down the anti-false touch process due to the sensor-driven false alarm, causing the phone to play audio through the speaker, affecting the user experience. In addition, since the screen is already on when the phone is next to the ear, the user may accidentally touch it.
[0127] The embodiment of the present application provides a voice message playback method, which can lock the proximity light state through a gesture lock, so that when the algorithm detects that the mobile phone is still in the proximity state, the distance state falsely reported by the proximity light sensor can be corrected to avoid false alarms and improve the accuracy of proximity light reporting.
[0128] Figure 5 For an exemplary flow chart of a method for playing a voice message, please refer to Figure 5 , including but not limited to:
[0129] S501, play a voice message.
[0130] For example, Figure 3As shown, the chat application receives the voice message and displays the voice message 311 in the chat application interface. The user can click the voice message 311 to trigger the chat application to play the voice message 311 through the speaker. In the embodiments of the present application, the default speaker plays the voice message as an example for explanation.
[0131] The chat application plays the voice message 311 in response to the received user operation.
[0132] S502, obtaining a proximity-to-light state.
[0133] Exemplarily, the proximity light driver determines the proximity light state based on the detection result of the proximity light sensor. To distinguish it from the proximity light state obtained by the algorithm, in the embodiment of the present application, the proximity light state obtained by the proximity light driver from the proximity light sensor is referred to as the physical proximity light state.
[0134] The proximity light state includes a distant state or a close state. If the proximity light sensor is blocked, it corresponds to the close state. If the proximity light sensor is not blocked, it corresponds to the distant state.
[0135] S503, detecting whether the handset is turned on.
[0136] Exemplarily, the proximity light drives the acquisition of the earpiece state to detect whether the earpiece is currently in an open state.
[0137] In one example, if the handset is in an on state, S508 is executed.
[0138] In another example, if the handset is in off state, S504 is executed.
[0139] S504, determining whether the approaching light state is the far-away state.
[0140] Exemplarily, the proximity light driver determines whether the acquired entity proximity light state is a distance state.
[0141] In one example, if the state is far away, S505 is executed.
[0142] In another example, if it is in the approaching state, S506 is executed.
[0143] S505: Determine whether the status value is true.
[0144] In the embodiment of the present application, the gesture assistance algorithm obtains the ACC (Accumulator) data of the mobile phone in real time after the handset or speaker is turned on, and calculates the state value based on the ACC data. Among them, the state value is used to indicate whether it is a proximity state. In the embodiment of the present application, in order to distinguish it from the physical proximity light state described above, the proximity light state obtained by the algorithm is called the algorithm proximity light state.
[0145] In one example, if the state value is true, it means that the algorithm proximity light state obtained by the gesture assistance algorithm based on the ACC data is the proximity state. In another example, if the state value is false, it means that the algorithm proximity light state obtained by the gesture assistance algorithm based on the ACC data is the distance state.
[0146] In the embodiment of the present application, the proximity light driver reads the state value of the output of the gesture assistance algorithm. In one example, if the state value is true, S506 is executed. In another example, if the state value is false, S507 is executed.
[0147] S506, determining to report the approaching state.
[0148] In the embodiment of the present application, if the physical proximity light state is the far state, and the algorithmic proximity light state is the near state, it means that there is a false alarm of the physical proximity light state, for example, the proximity light sensor described above mistakenly detects the near state as the far state. The proximity light driver can correct the physical proximity light state based on the algorithmic proximity light state to report the correct proximity light state.
[0149] S507, reporting of proximity to light status.
[0150] Exemplarily, the proximity light driver reports the proximity light status to the chat application according to the confirmed proximity light status.
[0151] S508: Acquire gesture lock status.
[0152] Exemplarily, the gesture assistance algorithm determines the gesture lock state based on the ACC data. In an embodiment of the present application, the gesture lock state includes a locked state and an unlocked state. Among them, the locked state is used to lock the proximity state, that is, when the gesture lock is locked, the proximity light state reported by the proximity light driver is the proximity state. In the unlocked state, the proximity light state reported by the proximity light driver to the chat application is the actually detected proximity light state, that is, the physical proximity light state, which can include a proximity state or a distance state.
[0153] Exemplarily, the proximity light driver reads the gesture lock state output by the gesture assistance algorithm.
[0154] S509: Determine whether the gesture lock is in a locked state.
[0155] In one example, if the gesture lock state is the locked state, S506 is executed.
[0156] In another example, if the gesture lock state is the unlocked state, S510 is executed.
[0157] S510, determining to report the current proximity light state.
[0158] Exemplarily, as described above, in the unlocked state, the proximity light state reported by the proximity light driver to the chat application is the actually detected proximity light state, that is, the physical proximity light state, which may include a proximity state or a distance state.
[0159] The following is a specific embodiment of Figure 5 The process shown is described in detail. Figure 6 For an exemplary flow chart of a method for playing a voice message, please refer to Figure 6 , including but not limited to the following steps:
[0160] S601, the application plays a voice message.
[0161] For example, Figure 3 As shown, the chat application receives the voice message and displays the voice message 311 in the chat application interface. The user can click the voice message 311 to trigger the chat application to play the voice message 311 through the speaker. In the embodiments of the present application, the default speaker plays the voice message as an example for explanation.
[0162] Exemplarily, in response to receiving an operation in which the user clicks on the voice message 311 , the chat application plays the voice message.
[0163] S602a, the application sends a speaker-opening instruction to AudioHal.
[0164] Exemplarily, the chat application determines that a voice message needs to be played, such as Figure 4c As shown, the chat application sends a speaker play instruction to Audioservice, which is used to instruct the speaker to play the current voice message. Audioservice sends a speaker play instruction to AudioHal, and AudioHal sends a speaker play instruction to the audio driver. In response to the received instruction, the audio driver calls the speaker to play the current audio data, that is, the voice content in the voice message. Among them, the display screen is in the bright screen state.
[0165] S602b, AudioHal sends a command to write the speaker opening status to Sensorevent.
[0166] For example, after AudioHal indicates that the speaker is turned on, it can be confirmed that the speaker is currently turned on. AudioHal sends a write speaker turn-on state instruction to Sensorevent to instruct Sensorevent to record that the speaker is currently turned on.
[0167] S602c, Sensorevnet records the speaker on status.
[0168] Exemplarily, in response to the received instruction to write the speaker on state, Sensorevent records that the speaker is currently on. For example, Sensorevent may be provided with a flag bit corresponding to the speaker state, where "1" indicates on and "0" indicates off. Before Sensorevent receives the speaker on state instruction, the flag bit of the speaker state is "0", that is, it is off. In response to the received instruction to write the speaker on state, Sensorevent switches the flag bit to "1" to indicate that the speaker is on.
[0169] S602, SenSorHal reads the speaker on status.
[0170] Exemplarily, SensorHal reads the data in Sensorevent in real time to obtain the status of the earpiece and the speaker (including open or closed). In this example, after Sensorevent records the speaker open state, SensorHal can detect the speaker state switch recorded in Sensorevent, that is, switching from the closed state to the open state.
[0171] S603, SensorHal sends instruction information to the gesture assistance algorithm.
[0172] Exemplarily, after SenSorHal detects that the speaker state is switched from off to on, it sends indication information to the gesture assistance algorithm, where the indication information includes speaker on state information for indicating that the speaker is on.
[0173] It should be noted that in the embodiment of the present application, SensorHal triggers the indication information when it detects the state switching of the speaker and / or the receiver. That is to say, after SensorHal currently sends the indication information, if the state of the speaker and the receiver does not change, for example, the receiver is currently in the off state and the speaker is always in the on state, SensorHal will not send the indication information to the gesture assistance algorithm.
[0174] S604, the gesture assistance algorithm records the speaker opening state.
[0175] Exemplarily, the gesture assistance algorithm determines that the speaker is currently turned on in response to the received indication information. The gesture assistance algorithm can record the speaker state as turned on. Optionally, the gesture assistance algorithm can also set a flag to record the speaker state and the earpiece state. The recording method can refer to Sensorevent, which will not be repeated here.
[0176] S605: The gesture assistance algorithm outputs a state value based on the ACC data.
[0177] For example, Figure 7 For an exemplary calculation process of the gesture assistance algorithm, please refer to Figure 7 , including but not limited to:
[0178] S701, obtain ACC data
[0179] Exemplarily, the gesture assistance algorithm may send a request message to the sensor driver to request ACC data. The sensor driver responds to the request of the gesture assistance algorithm and obtains detection data of the acceleration sensor and the gyroscope sensor. Optionally, the acceleration sensor and the gyroscope sensor may be always turned on, or may be restarted in response to the call of the sensor driver, which is not limited in this application.
[0180] S702, calculate the pitch (pitch angle), roll (roll angle) and handupJudge (hand-up judgement) values.
[0181] For example, pitch and roll can be used to describe the posture of the phone. The handupJudge value is used to describe the process variable of the phone from dynamic to static or static to dynamic. The specific calculation method can refer to the existing technology and will not be repeated in this application.
[0182] S703: Determine whether pitch, roll, and handupJudge meet a threshold, and the receiver or speaker is turned on.
[0183] Exemplarily, the gesture assistance algorithm compares the calculated pitch, roll and handupJudge with their respective corresponding threshold ranges. If pitch, roll and handupJudge all satisfy the threshold range, for example, pitch and roll satisfy the threshold range corresponding to the left hand holding the phone or the threshold range corresponding to the right hand holding the phone, and handupJudge is greater than 0, then further determine whether the receiver or speaker is in the on state. As described above, the gesture assistance algorithm may record the status of the speaker and / or receiver, and the gesture assistance algorithm may determine whether the receiver or speaker is turned on based on the recorded status. If all the above conditions are met, execute S704. If any condition is not met, the status value output is false.
[0184] S704, determining whether the last proximity light reporting state is a proximity state.
[0185] Exemplarily, the gesture assistance algorithm may read the proximity state last reported by the proximity light driver, which refers to the proximity light state actually reported by the proximity light driver to the chat application.
[0186] In an example, if the proximity light reporting state is the proximity state, the state value output is true.
[0187] In another example, if the approaching light reports a state of being far away, the state value output is false.
[0188] Still refer to Figure 6 In this example, the user is currently holding the phone, that is, the phone is in the far state. Correspondingly, the gesture assistance algorithm is based on ACC data, and the pitch, roll, and handupJudge obtained do not meet the threshold, so the state value output is false, which is used to indicate that the algorithm approaches the light state as the far state.
[0189] S606a, the application registers with SensorHal to monitor proximity light events.
[0190] Exemplarily, at the same time (or in no particular order) when the application executes S601a, the chat application sends a request to register to monitor proximity light to the Sensorservice. In response to the received request to register to monitor proximity light, the Sensorservice sends an activate message to the SensorHal.
[0191] S606b, SensorHal sends a trigger proximity light sensor instruction to the proximity light driver.
[0192] Exemplarily, in response to the received activate message, SensorHal sends a proximity light sensor trigger instruction to the proximity light driver, for instructing the sensor driver (specifically, the proximity light driver) to trigger (ie, start) the proximity light sensor.
[0193] S606c, the proximity light driving obtains the proximity light state.
[0194] For example, Figure 4a As shown, the user is currently holding the mobile phone, that is, the proximity light driver determines that the mobile phone is in a distant state based on the parameters detected by the proximity light sensor.
[0195] S607, the proximity light driver reads the receiver status.
[0196] Exemplarily, as described above, the gesture assistance records the status of the receiver and the speaker. The current status of the receiver recorded by the gesture assistance is off. That is, the gesture assistance algorithm records the status of the speaker and the receiver as off by default. For example, in S604, the gesture assistance algorithm records the speaker as on, while the receiver is still off.
[0197] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.
[0198] S608, the proximity light driver determines whether the earpiece is turned on.
[0199] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.
[0200] like Figure 5 If the handset is turned on, then S508 is executed; if the handset is turned off, then S504 is executed.
[0201] In this example, the proximity light driver detects that the earpiece is in the off state, and S609 is executed.
[0202] S609, the proximity light driver determines whether it is in the distance state.
[0203] Exemplarily, the proximity light driver makes a judgment based on the physical proximity light state acquired in S606c. Figure 5 As shown in S504, if the judgment is yes, execute S505, if the judgment is no, execute S506.
[0204] like Figure 6 As shown, in this example, in S606c, the physical proximity light state acquired by the proximity light driver is the away state, the proximity light driver determines that the current state is the away state (ie, the judgment is yes), and executes S610.
[0205] S610, the proximity light driver reads a state value from the gesture assistance algorithm.
[0206] For example, Figure 5 The process in goes to S505, corresponding to Figure 6 In the process, the proximity light driver reads the state value from the gesture assistance algorithm. It should be noted that the gesture assistance algorithm continues to calculate the output state value after S603 until the speaker and the receiver are turned off. The output state value read by the proximity light driver is the latest output state value calculated by the gesture assistance algorithm. Optionally, the gesture assistance algorithm can also set a calculation cycle, and its calculation cycle can be the same as the reading cycle of the proximity light driver, which is not limited in this application.
[0207] S611, the proximity light driver determines whether the state value is true.
[0208] For example, in Figure 5 In S505, if the judgment is yes, then S506 is executed, and if the judgment is no, then S510 is executed. Figure 6 As shown, the proximity light driver reads the status value as false. Figure 5 The process in will go to S510.
[0209] S612a, the proximity light driver determines and reports the distance state.
[0210] For example, Figure 5 In S510, the approaching light will be reported as the current physical approaching light state. That is, both the algorithm approaching light state and the physical approaching light state are the far away state.
[0211] S612b, the proximity light driver reports the distance state to SensorHal.
[0212] S612c, SensorHal reports the away state to the application.
[0213] For example, please refer to Figure 4b , the proximity light driver determines to report the away state to SensorHal. SensorHal reports the away state to Sensorservice. Sensorsevice sends the away state to the chat application.
[0214] When the chat application determines that the user is currently away, the screen continues to be lit and the voice message is played through the speaker, that is, the current voice message playback mode is maintained.
[0215] For example, during the voice playback process, the user continues to hold the phone in a distance state. During this process, each module executes cyclically. Figure 5 The process in . Figure 8 For an exemplary flow chart of a method for playing a voice message, please refer to Figure 8 , including but not limited to the following steps:
[0216] S801, the gesture assistance algorithm outputs a state value based on the ACC data.
[0217] Exemplarily, as described above, the gesture assistance algorithm continuously obtains ACC data and calculates the corresponding state value. In this example, since the mobile phone is in a far away state, Figure 7 still evaluates to false.
[0218] S802, the proximity light driver obtains a proximity light state.
[0219] For example, Figure 4a As shown, the user is currently holding the mobile phone, that is, the proximity light driver determines that the mobile phone is in a distant state based on the parameters detected by the proximity light sensor.
[0220] S803, approaching the optical drive to read the earpiece status.
[0221] Exemplarily, as described above, the gesture-assisted recording has the status of the receiver and the speaker. The current status of the receiver recorded by the gesture-assisted recording is the off status. That is, the gesture-assisted algorithm records the status of the speaker and the receiver as off by default. The gesture-assisted algorithm records the speaker as on, wherein the receiver status is still off.
[0222] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.
[0223] S804, the proximity light driver determines whether the handset is turned on.
[0224] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.
[0225] like Figure 5 If the handset is turned on, then S508 is executed; if the handset is turned off, then S504 is executed.
[0226] In this example, the proximity light driver detects that the earpiece is in the off state, and S805 is executed.
[0227] S805, the proximity light driver determines whether it is in the distance state.
[0228] Exemplarily, the proximity light driver makes a judgment based on the physical proximity light state acquired in S802. Figure 5 As shown in S504, if the judgment is yes, execute S505, if the judgment is no, execute S506.
[0229] like Figure 8 As shown, in this example, in S802, the physical proximity light state acquired by the proximity light driver is the away state, the proximity light driver determines that the current state is the away state, and executes S806.
[0230] S806, the proximity light driver reads a state value from the gesture assistance algorithm.
[0231] For example, Figure 5 The process in goes to S505, corresponding to Figure 6 In the example, the proximity light driver reads the state value from the gesture assistance algorithm. It should be noted that the gesture assistance algorithm continues to calculate the output state value after the speaker is turned on until the speaker and the receiver are turned off. The output state value read by the proximity light driver is the latest output state value calculated by the gesture assistance algorithm. Optionally, the gesture assistance algorithm can also set a calculation cycle, and its calculation cycle can be the same as the reading cycle of the proximity light driver, which is not limited in this application.
[0232] S807, the proximity light driver determines whether the state value is true.
[0233] For example, in Figure 5 In S505, if the judgment is yes, then S506 is executed, and if the judgment is no, then S510 is executed. Figure 8 As shown, the proximity light driver reads the status value as false. Figure 5 The process in will go to S510.
[0234] S808a, the proximity light driving determines and reports the distance state.
[0235] For example, Figure 5 In S510, the approaching light will be reported as the current physical approaching light state. That is, both the algorithm approaching light state and the physical approaching light state are the far away state.
[0236] S808b, the proximity light driver reports the distance state to SensorHal.
[0237] S808c, SensorHal reports the away state to the application.
[0238] For example, please refer to Figure 4b , the proximity light driver determines to report the away state to SensorHal. SensorHal reports the away state to Sensorservice. Sensorsevice sends the away state to the chat application.
[0239] When the chat application determines that the user is currently away, the screen continues to be lit and the voice message is played through the speaker, that is, the current voice message playback mode is maintained.
[0240] For example, the user Figure 4a The answering mode shown is switched to the answering mode shown in FIG. 4 , that is, the user holds the mobile phone to the ear to answer the voice message. Figure 9a to Figure 9b For an exemplary flow chart of a method for playing a voice message, please refer to Figure 9a to Figure 9b , including but not limited to:
[0241] S901, the gesture assistance algorithm outputs a state value based on the ACC data.
[0242] Exemplarily, as described above, the gesture assistance algorithm continuously obtains ACC data and calculates the corresponding state value. In this example, since the user holds the phone to his ear to answer the call, the gesture assistance algorithm determines yes when executing S703, that is, each parameter meets the threshold and the speaker is turned on.
[0243] In this example, since the proximity light driver has not reported the proximity state, when S704 is executed, the proximity light driver determines that the last proximity light driver report was the distance state, and the output state value is still false.
[0244] S902, the proximity light driver obtains a proximity light state.
[0245] Exemplarily, the user holds the mobile phone to his ear, and accordingly, the proximity light driver determines that the current proximity light state is the proximity state based on the detection result of the proximity light sensor.
[0246] S903, approaching the optical drive to read the receiver status.
[0247] Exemplarily, as described above, the gesture-assisted recording has the status of the receiver and the speaker. The current status of the receiver recorded by the gesture-assisted recording is the off status. That is, the gesture-assisted algorithm records the status of the speaker and the receiver as off by default. The gesture-assisted algorithm records the speaker as on, wherein the receiver status is still off.
[0248] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.
[0249] S904, the proximity light driver determines whether the earpiece is turned on.
[0250] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.
[0251] like Figure 5 If the handset is turned on, then S508 is executed; if the handset is turned off, then S504 is executed.
[0252] In this example, the proximity light driver detects that the earpiece is in the off state, and S905 is executed.
[0253] S905, determining whether the low beam driving is in the far state.
[0254] Exemplarily, the proximity light driver makes a judgment based on the physical proximity light state acquired in S902. Figure 5 As shown in S504, if the judgment is yes, execute S505, if the judgment is no, execute S506.
[0255] like Figure 8 As shown, in this example, in S902, the physical proximity light state obtained by the proximity light driver is the proximity state, and the proximity light driver determines that the current state is the distance state (ie, the judgment is no), and executes S906a. That is, corresponding to Figure 5 , the process will go to S506.
[0256] S906a, the proximity light driving determines and reports the proximity state.
[0257] For example, when the proximity light driver determines that the current state is far away, there is no need to read the algorithm proximity light state, and the proximity state can be reported directly.
[0258] S906b, the proximity light driver reports the proximity status to SensorHal.
[0259] S906c, SensorHal reports the proximity status to the application.
[0260] For example, please refer to Figure 4b , the proximity light driver determines to report the proximity status to SensorHal. SensorHal reports the proximity status to Sensorservice. Sensorsevice sends the proximity status to the chat application.
[0261] S907a, the application sends a receiver opening instruction to AudioHal.
[0262] For example, Figure 4b As shown, the handset play instruction is sent to Audioservice to instruct the handset to play the current voice message. Audioservice sends the handset play instruction to AudioHal, and AudioHal sends the handset play instruction to the audio driver. The audio driver responds to the received instruction and calls the handset (i.e. Figure 1 The receiver shown in FIG. 1 plays the current audio data, that is, the voice content in the voice message.
[0263] At the same time, the chat application sends an instruction message to the PoserManager (power management) module to instruct the start of the screen off process. The PoserManager module sends a screen off instruction to the hardware composer (HWC). The HWC sends the screen off instruction to the display driver. The display driver responds to the received screen off instruction and controls the display screen to turn off.
[0264] S907b, AudioHal sends a command to write the earpiece opening status to Sensorevent.
[0265] For example, after AudioHal indicates that the handset is turned on, it can be confirmed that the handset is currently turned on. AudioHal sends a write handset turn-on state instruction to Sensorevent to instruct Sensorevent to record that the handset is currently turned on. It should be noted that before receiving the speaker turn-off instruction, the speaker state recorded by Sensorevent and the gesture-assisted algorithm is still turned on.
[0266] S907c, Sensorevnet records the handset open status.
[0267] Exemplarily, in response to the received instruction to write the earpiece on state, Sensorevent records that the earpiece is currently on. For example, Sensorevent may be provided with a flag bit corresponding to the earpiece state, where "1" indicates on and "0" indicates off. Before Sensorevent receives the earpiece on state instruction, the flag bit of the speaker state is "0", that is, it is off. In response to the received instruction to write the earpiece on state, Sensorevent switches the flag bit to "1" to indicate that the earpiece is on.
[0268] S908, SensorHal reads the handset opening status.
[0269] Exemplarily, SensorHal reads the data in Sensorevent in real time to obtain the status of the earpiece and the speaker (including open or closed). In this example, after Sensorevent records the open state of the earpiece, SensorHal can detect the earpiece state switch recorded in Sensorevent, that is, switching from the closed state to the open state.
[0270] S909, SensorHal sends instruction information to the gesture assistance algorithm.
[0271] Exemplarily, after SenSorHal detects that the state of the earpiece is switched from off to on, it sends indication information to the gesture assistance algorithm, where the indication information includes earpiece on state information for indicating that the earpiece is in an on state.
[0272] It should be noted that in the embodiment of the present application, SensorHal triggers the indication information when it detects the state switching of the speaker and / or the receiver. That is to say, after SensorHal currently sends the indication information, if the state of the speaker and the receiver does not change, for example, the receiver is currently in the off state and the speaker is always in the on state, SensorHal will not send the indication information to the gesture assistance algorithm.
[0273] S910, the gesture assistance algorithm records the handset opening state.
[0274] Exemplarily, the gesture-assisted algorithm determines that the earpiece is currently in an open state in response to the received indication information. The gesture-assisted algorithm may record that the earpiece state is in an open state. Optionally, the gesture-assisted algorithm may also set a flag to record the speaker state and the earpiece state. The recording method may refer to Sensorevent, which will not be described here.
[0275] S911a, the gesture assistance algorithm outputs a state value based on the ACC data.
[0276] Still refer to Figure 7 , exemplarily, as described above, the gesture assistance algorithm continuously obtains ACC data and calculates the corresponding state value. In this example, since the user holds the phone to his ear to answer the call, when the gesture assistance algorithm executes S703, it is judged as yes, that is, each parameter meets the threshold value and the speaker is turned on.
[0277] In this example, since the proximity light driver has reported the proximity state (i.e., S906a~S906c), when S704 is executed, the proximity light driver determines that the last proximity light driver reported was the proximity state, and the output state value is true, that is, the algorithm proximity light state calculated by the gesture assistance algorithm is the proximity state.
[0278] S911b, the gesture assistance algorithm outputs the gesture lock state based on the ACC data.
[0279] Exemplarily, the gesture assistance algorithm continuously acquires ACC data after the speaker is turned on. In the above-described process, the gesture assistance algorithm may only calculate the state value. Optionally, the gesture assistance algorithm may also calculate the state value and gesture lock at the same time, which is not limited in this application.
[0280] In this example, the gesture assistance algorithm can start calculating the gesture lock state value after detecting that the handset is turned on. Optionally, the gesture assistance algorithm can also calculate the gesture lock state value when the proximity light driver needs to read the gesture lock state value (i.e., when executing S915), which is not limited in this application.
[0281] Fig.10 For an exemplary diagram of the gesture lock calculation process, please refer to Fig.10 , including but not limited to the following steps:
[0282] S1001, obtain ACC data.
[0283] S1002, calculate pitch, roll and handupJudge values.
[0284] Exemplarily, as described above, the gesture assistance algorithm acquires ACC data in real time and calculates corresponding pitch, roll and handupJudge values.
[0285] In one possible implementation, the gesture assistance algorithm may output a status value and a phone lock status value based on pitch, roll, and handupJudge.
[0286] In another possible implementation, the gesture assistance algorithm can execute a corresponding judgment process based on the calculation results of the pitch, roll and handupJudge values when the proximity light drive is called to output a status value and / or a mobile phone lock status value.
[0287] In the embodiment of the present application, an example is taken for explanation in which the gesture assistance algorithm continuously obtains the gesture lock state after detecting that the handset is turned on.
[0288] S1003, determining whether the current approaching light is in an approaching state.
[0289] Exemplarily, the gesture assistance algorithm obtains whether the entity proximity light state obtained by the proximity light driver is a proximity state.
[0290] In one example, if it is in the approaching state, S1004 is executed.
[0291] In another example, if the state is far away, S1005 is executed.
[0292] S1004, determine whether pitch, roll and handupJudge meet the threshold.
[0293] The specific process can be referred to S703 and will not be described again here.
[0294] In an example, if pitch, roll, and handupJudge meet the threshold, the gesture lock is locked, that is, the output gesture lock state is locked.
[0295] In another example, if pitch, roll, and handupJudge do not meet the threshold, the gesture lock is not locked, that is, the output gesture lock state is unlocked.
[0296] S1005, determine whether the status value is true.
[0297] For example, the gesture assistance algorithm may execute Figure 7 to obtain the status value.
[0298] In one example, if the state value is true, the gesture lock is locked, that is, the output gesture lock state is locked.
[0299] In another example, if the status value is false, S1006 is executed.
[0300] S1006, determine whether the current state is locked.
[0301] Exemplarily, the gesture assisting algorithm detects whether the gesture lock is currently in a locked state (ie, the output result of the last gesture lock determination process).
[0302] In one example, if the judgment is yes, execute S100,7.
[0303] In another example, if the judgment is no, that is, the gesture lock is not locked, then the unlocked state is maintained.
[0304] S1007: Determine whether pitch and roll meet a threshold.
[0305] In one example, if pitch and roll meet the threshold, the gesture lock is locked, that is, the output gesture lock state is locked.
[0306] In another example, if pitch and roll do not meet the threshold, the gesture lock is not locked, that is, the output gesture lock state is unlocked.
[0307] Please continue to refer to Figure 9a In this example, the user holds the phone to his ear to answer the call, and the gesture-assisted algorithm executes Fig.10 As shown in the process, specifically, the gesture assistance algorithm executes S1003, and determines that the current proximity light state is the proximity state, and then executes S1004. As described above, the gesture assistance algorithm obtains and calculates the pitch, roll and handupJudge values in real time. Accordingly, after the user raises his hand, the gesture assistance algorithm can determine that the conditions for answering at the ear are met based on the pitch, roll and handupJudge that have been obtained (that is, obtained before the handset is turned on), that is, S1004 judges to be yes, and the gesture lock is locked, that is, the proximity light state is locked to the proximity state. Among them, when the user picks up the phone and answers the call at the ear, the pitch and roll will change compared to the previous values, meeting the right-hand answering threshold range or the left-hand answering threshold range. In addition, since the user brings the phone to the ear from the distant state, the phone moves from the distant position to the ear, and the handupJudge value is greater than 0, that is, the preset threshold is met.
[0308] S912, the proximity light driver obtains a proximity light state.
[0309] For example, Figure 4b As shown, the user is currently holding the mobile phone to his ear to answer the call, that is, the proximity light driver determines that the mobile phone is in a proximity state based on the parameters detected by the proximity light sensor.
[0310] S913, the proximity light driver reads the receiver status from the gesture assistance algorithm.
[0311] Exemplarily, as described above, the gesture-assisted recording has the status of the receiver and the speaker. The current status of the receiver recorded by the gesture-assisted recording is the off status. That is, the gesture-assisted algorithm records the status of the speaker and the receiver as off by default. The gesture-assisted algorithm records the speaker as on, wherein the receiver status is still off.
[0312] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.
[0313] S914, the proximity light driver determines whether the earpiece is turned on.
[0314] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.
[0315] like Figure 5 If the handset is turned on, then S508 is executed; if the handset is turned off, then S504 is executed.
[0316] In this example, the proximity light driver detects that the handset is turned on, and S914 is executed. Figure 5 The process in goes to S508.
[0317] S915, the proximity light driver reads the gesture lock state value.
[0318] For example, corresponding Figure 5 In S508, if it is determined that the gesture lock state is a locked state, execute S506; if the gesture lock state is an unlocked state, execute S510.
[0319] Please continue to refer to Figure 9b , exemplary, as described above, the gesture assistance algorithm is Fig.10 In the process shown, the output gesture lock state is the lock state, that is, the proximity light lock is the proximity state.
[0320] S916a, the proximity light driver determines and reports the proximity state.
[0321] For example, as described above, when the gesture lock is locked, the proximity light state is locked as the proximity state. That is, no matter whether the physical proximity light state acquired by the proximity light driver is the proximity state or the distance state, the proximity light state reported by the proximity light driver to the chat application is the proximity state.
[0322] S916b, the proximity light driver reports the proximity status to SensorHal.
[0323] S916c, SensorHal reports the proximity status to the application.
[0324] For example, please refer to Figure 4b , the proximity light driver determines to report the proximity status to SensorHal. SensorHal reports the proximity status to Sensorservice. Sensorsevice sends the proximity status to the chat application.
[0325] When the user listens to the voice message, each module repeatedly executes S911a to S916c, so that the mobile phone is continuously in the screen-off state and the voice message is played using the receiver.
[0326] In the embodiment of the present application, after the user brings the phone to the ear to answer the call, the phone enters the anti-accidental touch mode, that is, the screen is turned off, and the voice message is played using the receiver. In some scenarios, if the user puts the phone down from the ear, the phone will turn off the anti-accidental touch mode, that is, the screen is turned on, and the voice message is played using the speaker. Fig.11 For a flow chart of an exemplary voice playback method, please refer to Fig.11 , including but not limited to:
[0327] S1101a, the gesture assistance algorithm outputs a state value based on the ACC data.
[0328] For example, after the user takes the phone away from his ear, the pitch, roll and handupJudge calculated by the gesture assistance algorithm will not meet the threshold. Figure 7 In the process shown, the gesture assistance algorithm outputs false.
[0329] S1001b, the gesture assistance algorithm outputs the gesture lock state based on the ACC data.
[0330] For example, in Fig.10 In the process shown, the gesture assistance algorithm executes S1003. Due to the influence of device performance or the reporting cycle of the proximity light driver, the proximity light driver may not have obtained the away state after the user takes the mobile phone away from the ear. Accordingly, the gesture assistance algorithm determines that the current proximity light state is the away state and executes S1005. Exemplarily, the gesture assistance algorithm obtains the state value, and as described above, the state value is judged to be false. The gesture assistance algorithm continues to execute S1006. The gesture assistance algorithm is currently in a locked state, then executes S1007. Accordingly, the gesture assistance algorithm judges based on pitch, roll and handupJudge that the threshold is not met, then releases the locked state, that is, outputs the gesture lock state as an unlocked state.
[0331] S1002, the proximity light driver obtains a proximity light state.
[0332] Exemplarily, the proximity light driver obtains that the physical proximity light state is a distance state.
[0333] S1003, the proximity light driver reads the receiver status from the gesture assistance algorithm.
[0334] Exemplarily, the current earpiece state recorded by the gesture assistance is an open state. The proximity light drive reads that the earpiece is in an open state.
[0335] S1104, the proximity light driver determines whether the earpiece is turned on.
[0336] S1105 , the proximity light driver reads the gesture lock state from the gesture assistance algorithm.
[0337] S1106a, the proximity light driver determines and reports the distance state.
[0338] For example, in Figure 5 In the process shown, the proximity light driver determines that the handset is turned on, and the state obtained by the gesture is unlocked. The process goes to S510, and the proximity light driver can determine to report the currently obtained entity proximity light state, that is, the away state.
[0339] S1106b, the proximity light driver reports the distance state to SensorHal.
[0340] S1106c, SensorHal reports the away status to the application.
[0341] Accordingly, the chat application responds to the received away state and can Figure 6 S601a starts to be executed, that is, the speaker is turned on to continue playing the voice message using the speaker, and the screen is lit.
[0342] For example, as described above, the proximity light driver may report abnormally, that is, when the user listens to a voice message at the ear, the proximity light sensor mistakenly detects the distance state. In this scenario, the proximity light driver can correct the physical proximity light detection result of the proximity light driver based on the gesture lock state of the gesture assistance algorithm to report the correct proximity state to the chat application to avoid false alarms. Fig.12 For an exemplary flow chart of voice message playback, please refer to Fig.12 , including but not limited to the following steps:
[0343] S1201a, the gesture assistance algorithm outputs a state value based on the ACC data.
[0344] Exemplarily, the gesture assistance algorithm performs Figure 7 In the process of , in this example, the gesture assistance algorithm determines that the threshold is met based on the calculated pitch, roll and handupJudge values, and the earpiece and speaker are in the on state. The gesture assistance algorithm determines that it is yes and executes S704. In this example, since the proximity light drive is a false alarm this time, and the last reported state is still the proximity state, the gesture assistance algorithm determines that the last reported proximity light state is the proximity state, and the judgment is yes, and the output state value is true.
[0345] S1201b, the gesture assistance algorithm outputs the gesture lock state based on the ACC data.
[0346] Exemplarily, the gesture assistance algorithm is based on ACC data and performs Fig.10 Please refer to the process in Fig.10, the gesture assistance algorithm executes S1003. In one example, S1202 may be executed before S1201b is executed, that is, the proximity light driver has obtained that the current entity proximity state is the distant state (that is, the state of false detection). Accordingly, the gesture assistance algorithm executes S1003, judges as no, and continues to execute S1005. The gesture assistance algorithm can obtain the output state value (that is, the value calculated in S1201a) as true. The gesture assistance algorithm determines that the gesture lock is locked.
[0347] In another example, due to the influence of device performance or the proximity light driver reporting cycle, the proximity light driver may not have obtained the physical proximity light state, and the current proximity light state is still the proximity state. Accordingly, the gesture assistance algorithm executes S1004, and based on pitch and roll, determines that the threshold is met, and further determines that the gesture lock is locked.
[0348] It should be noted that in the embodiment of the present application, after the gesture lock is locked, that is, when the user is answering the call by ear, since the acceleration of the mobile phone will not change, handupJudge may always be 0. Accordingly, in this scenario, the gesture assistance algorithm may not consider handupJudge when executing the state value judgment process and the gesture lock state judgment process. For example, when executing S1004, only pitch and roll may be judged without judging handupJudge.
[0349] S1202, the proximity light driver obtains a proximity light state.
[0350] Exemplarily, in this example, the case where the proximity light drive obtains an abnormal state, that is, it is actually a proximity state, while the proximity light drive obtains a distance state is taken as an example for explanation.
[0351] S1203, the proximity light driver reads the receiver status from the gesture assistance algorithm.
[0352] Exemplarily, the current earpiece state recorded by the gesture assistance is an open state. The proximity light drive reads that the earpiece is in an open state.
[0353] S1204, the proximity light driver determines whether the earpiece is turned on.
[0354] S1205 , the proximity light driver reads the gesture lock state from the gesture assistance algorithm.
[0355] S1206a, the proximity light driving determines and reports the proximity state.
[0356] For example, in Figure 5In the process shown, the proximity light driver determines that the handset is turned on, and the state obtained by the gesture is locked. The process goes to S506, and the proximity light driver can determine to report the proximity state. In other words, although the physical proximity light state obtained by the proximity light driver is the far state, because the gesture lock locks the proximity state, correspondingly, when the proximity light state detects that the gesture lock is locked, the far state originally to be reported is updated to the near state, thereby achieving timely correction of the false detection of the proximity light state, avoiding the problem of false alarms causing the phone to be played through the speaker when it is next to the user's ear, and the screen may be accidentally touched.
[0357] S1206b, the proximity light driver reports the proximity status to SensorHal.
[0358] S1206c, SensorHal reports the proximity status to the application.
[0359] For the specific description, please refer to the relevant content above, which will not be repeated here.
[0360] In an embodiment of the present application, after the voice message is played, the chat application detects that the voice message is played, and the chat application may stop calling the speaker or the earpiece, that is, the chat application may send an instruction to AudioHal to turn off the speaker and / or the earpiece. In response to the received instruction, AudioHal instructs the audio driver to turn off the earpiece or the speaker. In addition, AudioHal sends an indication to Sensorevent that the speaker and the earpiece are written to be turned off. In response to the received indication, Sensorevent records that the status of the earpiece and the speaker are both in the off state. SensorHal reads from Sensorevent that the status of the speaker and / or the earpiece is switched from the on state to the off state, and SensorHal sends a speaker off indication and / or an earpiece off indication to the gesture assistance algorithm. The gesture assistance algorithm may record that the status of the earpiece and / or the speaker is in the off state. In addition, the gesture assistance algorithm stops acquiring ACC data to reduce system power consumption.
[0361] In an embodiment of the present application, after the speaker is turned on, the gesture assistance algorithm starts to obtain ACC data and calculates the posture data (such as roll and pitch) and motion data (such as handup judge) of the electronic device, so as to prepare in advance the data required for calculating the gesture lock state. When the user puts the phone to his ear to answer the call, the proximity light driver detects the proximity state and reports it to the chat application. The chat application can then start the anti-mistouch process based on the proximity state, that is, instruct the phone to turn off the screen and switch to the earpiece to play the voice message. As mentioned above, the chat application needs to interact with each module to call the earpiece. Due to performance impact, the proximity light driver may not have obtained the earpiece opening state. In other words, Figure 5In the process shown, the process continues to S504, and at this time the receiver is already in the on state, that is, the receiver plays the voice message, and the screen is in the off state.
[0362] Before the proximity light driver receives the handset opening message, the proximity light driver can continue to obtain the state value output by the gesture assistance algorithm. At this time, the gesture assistance algorithm has determined that the phone is in a proximity state based on the posture data (i.e., the posture of the phone) and motion data (i.e., the dynamic process of answering the call at the ear). Figure 7 As shown, the gesture assistance algorithm executes S703 and judges yes, and the process goes to S704. Since the proximity light driver has reported the proximity state, the process also judges yes. Correspondingly, the output state value is true, which indicates that the result obtained by the proximity light state of the algorithm is the proximity state. In this example, if the entity proximity light abnormally reports the distance state, that is, in Figure 5 In the process, the process will go from S504 to S505. When executing S505, the proximity light driver can determine that the algorithm proximity light state is the proximity state based on the output state value of the gesture assistance algorithm. Accordingly, the proximity light driver will report the proximity state to realize the correction of the abnormal detection result of the physical proximity light state.
[0363] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0364] In one example, Fig.13 A schematic block diagram of a device 1300 according to an embodiment of the present application is shown. The device 1300 may include: a processor 1301 and a transceiver / transceiver pin 1302 , and optionally, a memory 1303 .
[0365] The various components of the device 1300 are coupled together via a bus 1304, wherein the bus 1304 includes a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, various buses are referred to as bus 1304 in the figure.
[0366] Optionally, the memory 1303 may be used for the instructions in the aforementioned method embodiment. The processor 1301 may be used to execute the instructions in the memory 1303, and control the receiving pin to receive a signal, and control the sending pin to send a signal.
[0367] The apparatus 1300 may be the electronic device or a chip of the electronic device in the above method embodiment.
[0368] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0369] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
[0370] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.
[0371] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.
[0372] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0373] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for playing a voice message, characterized in that: The method is applied to an electronic device, wherein the electronic device includes a display screen, a speaker, an earpiece, and a proximity light sensor, and the method includes: When the display screen is in a light-on state, receiving a click operation, wherein the click operation is used to play a voice message; In response to the click operation, the speaker plays the voice message; Based on the detection result of the proximity light sensor, acquiring a first proximity light state; Based on the first state data, acquiring a second proximity light state, wherein the state data is used to describe the state of the electronic device; In response to the first approaching light state and the second approaching light state being the far away state, the display screen continues to be in the screen-on state, and the speaker continues to play the voice message; In response to the user raising his hand to place the electronic device near his ear, acquiring a third proximity light state based on a detection result of the proximity light sensor; Based on the second state data, acquiring a fourth proximity light state; In response to the third proximity light state being the distant state and the fourth proximity light state being the approaching state, the display screen is in an off-screen state, and the earpiece plays the voice message.
2. The method according to claim 1, characterized in that The method further comprises: In response to the user continuously placing the electronic device near an ear, acquiring a fifth proximity light state based on a detection result of the proximity light sensor; Based on the third state data, acquiring a sixth proximity light state; In response to the fifth proximity light state being the distant state and the sixth proximity light state being the approaching state, the display screen continues to be in the off state, and the earpiece continues to play the voice message.
3. The method according to claim 1, characterized in that In response to the first approaching light state and the second approaching light state being the far away state, the display screen continues to be in the screen-on state, and the speaker continues to play the voice message, comprising: Detecting whether the handset is in an open state; If the handset is in the off state, determining whether the first approaching light state is the away state; If the first approaching light state is a far away state, determining whether the second approaching light state is an approaching state; If the second approaching light state is the far away state, determining that the current target approaching light state of the electronic device is the far away state; In response to the current target proximity light state of the electronic device being the far state, the display screen continues to be in the light screen state, and the speaker continues to play the voice message.
4. The method according to claim 1, characterized in that: In response to the third proximity light state being the far state and the fourth proximity light state being the approach state, the display screen is in a screen-off state, and the receiver plays the voice message, including: Detecting whether the handset is in an open state; If the handset is in the off state, determining whether the third approaching light state is the away state; If the third approaching light state is the far away state, determining whether the fourth approaching light state is the approaching state; If the fourth proximity light state is the proximity state, determining that the current target proximity light state of the electronic device is the proximity state; In response to the current target proximity light state of the electronic device being a proximity state, the display screen is in an off state, and the earpiece plays the voice message.
5. The method according to claim 2, characterized in that: In response to the fifth proximity light state being the far state and the sixth proximity light state being the approach state, the display screen continues to be in the screen-off state, and the receiver continues to play the voice message, including: Detecting whether the handset is in an open state; If the handset is in the on state, determining whether the sixth proximity light state is a proximity state; If the sixth proximity light state is the proximity state, determining that the current target proximity light state of the electronic device is the proximity state; In response to the current target proximity light state of the electronic device being a proximity state, the display screen is in an off state, and the earpiece plays the voice message.
6. The method according to claim 1, characterized in that The acquiring the second proximity light state based on the first state data includes: Based on the first state data, acquiring a gesture lock state; Based on the gesture lock state, the second proximity light state is acquired.
7. The method according to claim 6, characterized in that In response to the first proximity light state and the second proximity light state being the far state, the display screen continues to be in the screen-on state, and the speaker continues to play the voice message, including: in response to the gesture lock state being the unlocked state, determining that the second proximity light state is the same as the first proximity light state; In response to the first proximity light state being the distance state, the display screen continues to be in the screen-on state, and the speaker continues to play the voice message.
8. The method according to claim 1, characterized in that: The acquiring, based on the second state data, a fourth proximity light state comprises: Based on the second state data, acquiring a gesture lock state; Based on the gesture lock state, the fourth proximity light state is acquired.
9. The method according to claim 8, characterized in that In response to the third proximity light state being the far state and the fourth proximity light state being the approach state, the display screen being in the screen-off state, and the receiver playing the voice message, comprising: In response to the gesture lock state being the locked state, determining the fourth proximity light state to be the proximity state; In response to the fourth proximity light state being the proximity state, the display screen is in an off state, and the earpiece plays the voice message.
10. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device executes the method for playing a voice message according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method for playing a voice message according to any one of claims 1 to 9.
