Patent Description:
Most users, especially young people, now prefer to use headsets to listen to music, watch a video, listen to a book, or listen to the radio on electronic devices (such as smartphones, tablet computers, notebook computers, and/or audio players). In particular, some users like to listen to loud music or listen to music for a long time. In this case, the user's hearing will be at risk of impairment. A survey made by the World Health Organization shows that <NUM> billion young people (<NUM>-<NUM> years old) are at risk of hearing loss. Excessive volume of personal audio devices and continuous listening to music for a long time are important reasons for the risk. With popularization of electronic devices such as mobile phones and tablet computers worldwide, a quantity of people at risk of hearing loss and a quantity of people with impaired hearing increase year by year.

In a current audio play terminal device, the safety regulation EN50332 requires that when special test sound source is played, sound pressure at a maximum play level of a headset should be less than <NUM> dB (A-weighted), and sound pressure at a protection level should be less than <NUM> dB (A-weighted). The hearing protection means is undiversified. When the amplitude of the audio source heard by the user is greater than the amplitude of the special test sound source, the instantaneous sound pressure heard by the user may still be greater than <NUM> dB (A-weighted). When the instantaneous sound pressure heard by the user exceeds <NUM> dB (A-weighted), auditory nerve cells of the user will be impaired to a certain extent. Therefore, a solution needs to be provided to effectively protect the hearing of the user when the user uses a headset to listen to music, watch a video, listen to a book, or listen to the radio.

Patent application <CIT> teaches user hearing protection by real-time monitoring of the instantaneous sound pressure of the sound signal coming out of the earphones and the accumulated sound pressure over a period of time in the use of audio equipment.

This application provides a user hearing protection method, apparatus, and electronic device. This application further provides a computer readable storage medium, so as to protect a user's hearing when a user uses a headset to listen to music, watch a video, listen to a book, listen to the radio, play a game, or make a call.

The terms used in the implementations of this application are merely used to explain specific embodiments of this application, and are not intended to limit this application.

In a current audio play terminal device, the safety regulation EN50332 requires that when special test sound source is played, sound pressure at a maximum play level of a headset should be less than <NUM> dB (A-weighted), and sound pressure at a protection level should be less than <NUM> dB (A-weighted). The hearing protection means is undiversified. When an amplitude of the audio source heard by the user is greater than an amplitude of the special test sound source, the instantaneous sound pressure heard by the user may still be greater than <NUM> dB (A-weighted). When the instantaneous sound pressure heard by the user exceeds <NUM> dB (A-weighted), auditory nerve cells of the user will be impaired to a certain extent; not only the high instantaneous sound pressure will cause hearing impairment, but also a cumulative sound dose is generated when the user uses the headset for a long time on the terminal device. The current protection method cannot prevent the cumulative impairment effect caused by the long-term use of the headset.

To better protect the user's hearing, a new safety standard provides two optional safety requirement solutions. The first solution is consistent with existing requirements, and the second solution recommended in the new safety standard limits the sound dose generated by the cumulative effect because of listening to music for a long time. However, the current electronic device does not provide an effective technical means for the second solution.

<FIG> is a flowchart of a human ear hearing protection method in the related art. The technical solution provides a human ear hearing protection method, and the method includes: when a headset stops playing an audio signal, receiving collected ambient noise; analyzing the ambient noise to obtain a target noise sound pressure level; determining, based on a preset mapping relationship between a noise sound pressure level and a maximum output volume, a maximum output volume corresponding to the target noise sound pressure level; controlling a maximum volume of the audio signal output by the headset, so that the maximum volume is less than the maximum output volume; receiving actual sound pressure data in a human external auditory canal detected in real time; comparing the actual sound pressure data with a preset sound pressure threshold; and controlling a current volume of the audio output from the headset based on a comparison result. In this embodiment of the present invention, the ambient noise and the actual output volume of the headset can be combined to control the output volume of the headset in real time, so that the output volume of the headset can protect human ear hearing, without causing any impairment or affecting audio listening experience.

However, the foregoing solution has the following problems:.

This application provides a user hearing protection method. The method can protect a user's hearing, without adding a hardware component of an existing electronic device, when the user's hearing is impaired because of over-standard instantaneous sound pressure in a scenario in which the user uses a headset to listen to music, watch a video, listen to a book, listen to the radio, play a game, and/or make a call, or the like, or when hearing impairment is accumulated because the user uses a headset for a long time.

<FIG> is a flowchart of an embodiment of a user hearing protection method according to this application. As shown in <FIG>, the foregoing user hearing protection method may include the following steps:.

Step <NUM>: After an electronic device enables a hearing protection mode, when a current sound output mode of the electronic device is a headset output, obtain current-frame sound source data.

Specifically, the electronic device may obtain the current sound output mode based on a current register or parameter data of an audio channel. If the current sound output mode of the electronic device is a speaker or a headset, the electronic device automatically disables the hearing protection function and prompts a user that the current sound output mode is a non-headset mode; or if the current sound output mode of the electronic device is the headset output, the electronic device normally switches to the hearing protection mode to obtain the current-frame sound source data.

Step <NUM>: Obtain, based on the current-frame sound source data, sound pressure output by a headset connected to the electronic device.

That is, in this embodiment, the sound pressure output from the headset connected to the electronic device may be obtained based on the current-frame sound source data. No sound pressure sensor needs to be added to the headset cavity, and no headset data transmission interface or protocol needs to be changed.

The headset connected to the electronic device may be a headset connected to the electronic device by using a headset cable, or may be a Bluetooth headset connected to the electronic device by using Bluetooth. A specific form of the headset connected to the electronic device is not limited in this embodiment.

Step <NUM>: Compare the sound pressure with a predetermined sound pressure threshold.

In specific implementation, the predetermined sound pressure threshold may be set based on system performance, an implementation requirement, or the like. This embodiment imposes no limitation on a value of the predetermined sound pressure threshold.

Step <NUM>: If the sound pressure is greater than the predetermined sound pressure threshold, perform an instantaneous sound pressure over-standard warning and an instantaneous sound pressure over-standard protection operation.

The instantaneous sound pressure over-standard protection operation may be preset by a user of the electronic device. The instantaneous sound pressure over-standard protection operation may include: disabling play, reducing volume, or another operation set by the user. This embodiment imposes no limitation on a specific operation of the instantaneous sound pressure over-standard protection operation.

That is, when the sound pressure is greater than the predetermined sound pressure threshold, the electronic device performs an instantaneous sound pressure over-standard warning, and performs, on the electronic device and based on the operation preset by the user, an operation such as disabling play, reducing volume, or another option set by the user.

In the foregoing user hearing protection method, after the electronic device enables the hearing protection mode, when the current sound output mode of the electronic device is output by the headset, the current-frame sound source data is obtained; the sound pressure output by the headset connected to the electronic device is obtained based on the current-frame sound source data; the sound pressure is compared with a predetermined sound pressure threshold; if the sound pressure is greater than the predetermined sound pressure threshold, the instantaneous sound pressure over-standard warning is performed on the electronic device, and the instantaneous sound pressure over-standard protection operation is performed on the electronic device. In this way, the user's hearing can be protected when the instantaneous sound pressure exceeds a standard in scenarios in which the user uses the headset to listen to music, watch a video, listen to a book, listen to the radio, play a game, make a call, or the like.

<FIG> is a flowchart of still another embodiment of a user hearing protection method according to this application. As shown in <FIG>, in the embodiment shown in <FIG> of this application, step <NUM> includes the following steps:
Step <NUM>: Obtain a current usage scenario of a headset.

The current usage scenario of the headset may include: audio play, video play, gaming, making a call, or the like.

Step <NUM>: Obtain, based on current-frame sound source data and a sound effect change and a gain value that are of a channel corresponding to the usage scenario, a digital signal value output to a headset interface of an electronic device.

Step <NUM>: Obtain, based on the digital signal value and a digital-to-electrical conversion gain value of the electronic device, a voltage value output to the headset interface.

Step <NUM>: Obtain, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset.

Specifically, before the obtaining, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset, the method further includes: after the electronic device plays special voice source data, obtaining electrical signal time domain data at a headset interface of the electronic device, and obtaining acoustic signal time domain data output by the headset; and obtaining the electro-acoustic conversion coefficient of the headset based on the electrical signal time domain data and the acoustic signal time domain data.

Specifically, <FIG> is a schematic diagram of an embodiment of obtaining an electro-acoustic conversion coefficient in a user hearing protection method according to this application. As shown in <FIG>, after an electronic device plays special audio source data, a voltage measurement device may be used to obtain electrical signal time domain data Vt at a headset interface of the electronic device, and an artificial head test is performed to obtain acoustic signal time domain data Pt output by the headset; then Fast Fourier Transform (fast fourier transform, hereinafter referred to as fft) is separately performed on Vt and Pt to obtain electrical signal frequency domain data Vspec and acoustic signal time domain data Pspec; then the acoustic signal frequency domain data Pspec is converted into A-weighted acoustic signal frequency domain data PspecA by using an A-weighting network; and finally, a ratio of the A-weighted acoustic signal frequency domain data PspecA to the electrical signal frequency domain data Vspec is calculated. The ratio is an electro-acoustic conversion coefficient He2a(f).

In this embodiment, a headset matched with an electronic device is tested by using a head and torso simulator to obtain an electro-acoustic transfer function of the headset. The transfer function represents an accurate value of an electrical signal (output by the electronic device) received by the headset to an ear membrane simulation position (a sound pressure sensor is disposed in an ear of the head and torso simulator), and precision is relatively high.

In this way, the obtaining, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset may be as follows: converting the voltage value into electrical signal frequency domain data; obtaining acoustic signal frequency domain data based on the electrical signal frequency domain data and the electro-acoustic conversion coefficient; converting the acoustic signal frequency domain data into acoustic signal time domain data; and obtaining, based on the acoustic signal time domain data, the sound pressure output by the headset.

Specifically, <FIG> is a schematic diagram of an embodiment of obtaining sound pressure in a user hearing protection method according to this application. As shown in <FIG>, an FFT may be performed on the voltage value (that is, the electrical signal time domain data Vt), so as to convert the voltage value into the electrical signal frequency domain data Vspec; then the electrical signal frequency domain data Vspec is multiplied by the electrical acoustic conversion coefficient He2a(f) to obtain the time domain data PtA of the A-weighted acoustic signal; and finally, equivalent continuous sound level A is calculated based on the A-weighted acoustic signal time domain data PtA to obtain a calculated sound pressure level LPA.

In this embodiment, the sound pressure output from the headset connected to the electronic device may be obtained based on the current-frame sound source data, which is completely implemented by using software. No sound pressure sensor needs to be added to the headset cavity, and no headset data transmission interface or protocol needs to be changed.

<FIG> is a flowchart of still another embodiment of a user hearing protection method according to this application. As shown in <FIG>, in the embodiment shown in <FIG> of this application, after step <NUM>, the following steps may be further included:
Step <NUM>: Store sound pressure corresponding to current-frame sound source data.

Specifically, the sound pressure corresponding to the current-frame sound source data may be stored in a memory.

Step <NUM>: Determine, based on the stored historical sound pressure data, a sound dose accumulated to a current moment.

Specifically, the sound dose accumulated to the current moment may be calculated based on the historical sound pressure data stored in the memory and a sound dose calculation method.

Step <NUM>: Compare the sound dose with a predetermined sound dose standard value.

The predetermined sound dose standard value may be a sound dose standard value specified in an international standard or a domestic standard, or may be a user-defined sound dose standard value.

Step <NUM>: If the sound dose is greater than the predetermined sound dose standard value, perform sound dose over-standard warning and a sound dose over-standard protection operation.

The sound dose over-standard protection operation may be preset by a user of the electronic device, and the sound dose over-standard protection operation may include: reminding the user to pause using the headset mode to avoid hearing impairment, recommending the user to rest for X hours before using the headset mode, and performing an operation such as disabling play, reducing volume, or another option set by the user.

Further, after step <NUM>, if the sound dose is less than or equal to the predetermined sound dose standard value, or the sound dose is greater than the predetermined sound dose standard value, but the user forces the electronic device to continue play, the electronic device continues to play the next frame of sound source data, and returns to step <NUM>; or if the sound dose is greater than the predetermined sound dose standard value and the user chooses to disable play, this procedure ends. In addition, when the user removes the headset or disables play after normally using the terminal device, the hearing protection mode automatically exits.

This embodiment implements early warning and hearing protection for a user when a total sound dose exceeds a standard after music is listened continuously for a long time.

<FIG> is a flowchart of still another embodiment of a user hearing protection method according to this application. As shown in <FIG>, in the embodiment shown in <FIG> of this application, before step <NUM>, the following steps may be further included:
Step <NUM>: Detect operation information of a user of an electronic device.

The operation information may include: The user performs a tap, a long press, or another operation on an interface of the electronic device; or the operation information may include operation information entered by the user to the electronic device by using a voice.

Step <NUM>: Enable a hearing protection mode of the electronic device in response to the operation information.

That is, in specific implementation, the electronic device may detect a tap, a long press, or another operation performed by the user on the interface of the electronic device, or operation information entered by the user by using a voice, and then enable the hearing protection mode of the electronic device in response to the operation information.

Step <NUM>: Obtain and store an instantaneous sound pressure over-standard protection operation and a sound dose over-standard protection operation that are set by the user.

Specifically, after the electronic device enables the hearing protection mode, the electronic device may obtain and store the instantaneous sound pressure over-standard protection operation and the sound dose over-standard protection operation that are set by the user.

The instantaneous sound pressure over-standard protection operation may include: disabling play, reducing volume, or another operation set by the user. This embodiment imposes no limitation on a specific operation of the instantaneous sound pressure over-standard protection operation.

The sound dose over-standard protection operation may include: reminding the user to pause using the headset mode to avoid hearing impairment, recommending the user to rest for X hours before using the headset mode, and performing an operation such as disabling play, reducing volume, or another option set by the user.

The user hearing protection method provided in this application may be applied to an electronic device including a headset. The method can protect a user's hearing, without adding a hardware component of an existing electronic device, when the user's hearing is impaired because of over-standard instantaneous sound pressure in a scenario in which the user uses a headset to listen to music, watch a video, listen to a book, listen to the radio, play a game, and/or make a call, or when hearing impairment is accumulated because the user uses a headset for a long time.

The following uses a music play mode on an electronic device as an example to describe the user hearing protection method provided in this application. However, this embodiment of this application is not limited thereto, and is applied to any scenario in which a headset is used to watch a video, listen to a book, play a game, or make a call.

<FIG> are a flowchart of still another embodiment of a user hearing protection method according to this application. As shown in <FIG>, the foregoing user hearing protection method may include the following steps:
Step <NUM>: An electronic device enables a hearing protection mode.

Specifically, the electronic device may detect a tap, a long press, or another operation performed by a user of the electronic device on an interface of the electronic device, or operation information entered by the user by using a voice, and then enable the hearing protection mode of the electronic device in response to the operation information.

After the electronic device enables the hearing protection mode, the electronic device may obtain and store an instantaneous sound pressure over-standard protection operation and a sound dose over-standard protection operation that are set by the user.

Step <NUM>: Obtain a current sound output mode of the electronic device.

Specifically, the electronic device may obtain the current sound output mode based on a current register or parameter data of an audio channel. If the current sound output mode of the electronic device is a speaker or a headset, the electronic device automatically disables the hearing protection function and prompts a user that the current sound output mode is a non-headset mode; or if the current sound output mode of the electronic device is a headset output, the electronic device normally switches to the hearing protection mode to obtain current-frame sound source data.

Step <NUM>: Obtain the current-frame sound source data.

Specifically, the electronic device may obtain, based on a frame length T preconfigured by an algorithm, one frame of sound source data as an input for analysis.

Specifically, <FIG> is a flowchart of an embodiment of obtaining sound pressure output by a headset in a user hearing protection method according to this application. As shown in <FIG>, step <NUM> may include the following steps:.

Step <NUM>: Compare the sound pressure output by the headset connected to the electronic device with a predetermined sound pressure threshold. If the sound pressure is greater than the predetermined sound pressure threshold, step <NUM> is performed; or if the sound pressure is less than or equal to the predetermined sound pressure threshold, step <NUM> is performed.

Step <NUM>: Perform an instantaneous sound pressure over-standard warning and an instantaneous sound pressure over-standard protection operation. Then, step <NUM> is performed.

The instantaneous sound pressure over-standard protection operation may be preset by a user of the electronic device. The instantaneous sound pressure over-standard protection operation may include: disabling music play, reducing volume, or another operation set by the user. This embodiment imposes no limitation on a specific operation of the instantaneous sound pressure over-standard protection operation.

Step <NUM>: Store current sound pressure data.

Specifically, the current sound pressure data is stored in a memory as historical data.

Step <NUM>: Compare the sound dose with a predetermined sound dose standard value. Then, step <NUM> is performed.

The sound dose over-standard protection operation may be preset by a user of the electronic device, and the sound dose over-standard protection operation may include: reminding the user to pause using the headset mode to avoid hearing impairment, recommending the user to rest for X hours before using the headset to listen to music, and performing an operation such as disabling play, reducing volume, or another option set by the user.

Further, after step <NUM>, if the sound dose is less than or equal to the predetermined sound dose standard value, or the sound dose is greater than the predetermined sound dose standard value, but the user forces the electronic device to continue play, the electronic device continues to play the next frame of sound source data, and returns to step <NUM>; or if the sound dose is greater than the predetermined sound dose standard value and the user chooses to disable music play, this procedure ends. In addition, when the user removes the headset or disables play after normally using the terminal device, the hearing protection mode automatically exits.

It may be understood that some or all of the steps or operations in the foregoing embodiment are merely examples. In this embodiment of this application, other operations or variations of various operations may also be performed. In addition, the steps may be performed in an order different than the order presented in the foregoing embodiment, and it may not be necessary to perform all the operations in the foregoing embodiment.

The user hearing protection method provided in this embodiment of this application may be slightly modified to estimate the sound pressure distribution of the spatial sound field when a mobile phone, a smart sound box, or a smart large screen uses a speaker device to play music or a video. A difference is that, in this embodiment of this application, a headset is used, and an electro-acoustic conversion coefficient between an electrical signal output by the electronic device and sound pressure output by the headset needs to be established. However, when a mobile phone, a smart sound box, or a smart large screen uses a speaker device for playing, to estimate an external sound field, an electro-acoustic conversion coefficient between an electrical signal and each point in the external sound field space needs to be established.

<FIG> is a schematic structural diagram of an embodiment of a user hearing protection apparatus according to this application. As shown in <FIG>, the user hearing protection apparatus <NUM> may include: an obtaining module <NUM>, a comparison module <NUM>, and a protection module <NUM>. It should be understood that the user hearing protection apparatus <NUM> may be corresponding to an electronic device <NUM> shown in <FIG>. Functions of the obtaining module <NUM>, the comparison module <NUM>, and the protection module <NUM> may be implemented by a processor <NUM> in the electronic device <NUM> shown in <FIG>.

The obtaining module <NUM> is configured to: after the electronic device enables a hearing protection mode, when a current sound output mode of the electronic device is a headset output, obtain current-frame sound source data; and obtain, based on the current-frame sound source data, the sound pressure output by the headset connected to the electronic device.

The comparison module <NUM> is configured to the sound pressure with a predetermined sound pressure threshold.

The protection module <NUM> is configured to: if the sound dose is greater than the predetermined sound dose standard value, perform sound dose over-standard warning and a sound dose over-standard protection operation.

The user hearing protection apparatus <NUM> provided in the embodiment shown in <FIG> may be configured to execute the technical solution of the method embodiment shown in <FIG> of this application. For implementation principles and technical effects of the apparatus <NUM>, refer to related descriptions in the method embodiment.

<FIG> is a schematic structural diagram of another embodiment of a user hearing protection apparatus according to this application. Compared with the user hearing protection apparatus <NUM> shown in <FIG>, a difference lies in that in a user hearing protection apparatus <NUM> shown in <FIG>, an obtaining module <NUM> may include a scenario obtaining submodule <NUM>, a voltage value obtaining submodule <NUM>, and a sound pressure obtaining submodule <NUM>.

The scenario obtaining submodule <NUM> is configured to obtain a current usage scenario of the headset.

The voltage value obtaining submodule <NUM> is configured to obtain, based on the current-frame sound source data and a sound effect change and a gain value that are of a channel corresponding to the usage scenario, a digital signal value output to a headset interface of the electronic device; and obtain, based on the digital signal value and a digital-to-electrical conversion gain value of the electronic device, a voltage value output to the headset interface.

The sound pressure obtaining submodule <NUM> is configured to obtain, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset.

In a possible implementation, the user hearing protection apparatus <NUM> may further include: a storage module <NUM> and a determining module <NUM>.

The storage module <NUM> is configured to: after the obtaining module <NUM> obtains the sound pressure output by the headset connected to the electronic device, store the sound pressure corresponding to the current-frame sound source data.

The determining module <NUM> is configured to determine, based on the stored historical sound pressure data, a sound dose accumulated to a current moment.

The comparison module <NUM> is further configured to compare the sound dose with a predetermined sound dose standard value.

The protection module <NUM> is further configured to: when the sound dose is greater than the predetermined sound dose standard value, perform sound dose over-standard warning and a sound dose over-standard protection operation.

In a possible implementation, the user hearing protection apparatus <NUM> may further include: a detection module <NUM>, an enabling module <NUM>, an operation obtaining module <NUM>, and a storage module <NUM>.

The detection module <NUM> is configured to: before the obtaining module <NUM> obtains the current-frame sound source data, detect operation information of a user of an electronic device.

The enabling module <NUM> is configured to enable a hearing protection mode of the electronic device in response to the operation information detected by the detection module <NUM>.

The operation obtaining module <NUM> is further configured to obtain an instantaneous sound pressure over-standard protection operation and a sound dose over-standard protection operation that are set by the user.

The storage module <NUM> is configured to store the instantaneous sound pressure over-standard protection operation and the sound dose over-standard protection operation that are obtained by the obtaining module <NUM>.

In a possible implementation, the obtaining module <NUM> may further include: a coefficient obtaining submodule <NUM>.

The coefficient obtaining submodule <NUM> is configured to: before the sound pressure obtaining submodule <NUM> obtains the sound pressure output by the headset, and after the electronic device plays special sound source data, obtain electrical signal time domain data at a headset interface of the electronic device, and obtain acoustic signal time domain data output by the headset; and obtain an electro-acoustic conversion coefficient of the headset based on the electrical signal time domain data and the acoustic signal time domain data.

In a possible implementation, the sound pressure obtaining submodule <NUM> is specifically configured to: convert the voltage value into electrical signal frequency domain data, and obtain acoustic signal frequency domain data based on the electrical signal frequency domain data and the electro-acoustic conversion coefficient; and convert the acoustic signal frequency domain data into acoustic signal time domain data, and obtain, based on the acoustic signal time domain data, the sound pressure output by the headset.

It should be understood that the user hearing protection apparatus <NUM> may be corresponding to the electronic device <NUM> shown in <FIG>. Functions of the obtaining module <NUM>, the comparison module <NUM>, the protection module <NUM>, the storage module <NUM>, the determining module <NUM>, and the enabling module <NUM> may be implemented by the processor <NUM> in the electronic device <NUM> shown in <FIG>, and functions of the enabling module <NUM> may be implemented by an input unit <NUM> in the electronic device <NUM> shown in <FIG>.

The user hearing protection apparatus <NUM> provided in the embodiment shown in <FIG> may be configured to execute the technical solutions of the method embodiments shown in <FIG> of this specification. For implementation principles and technical effects of the apparatus <NUM>, refer to related descriptions in the method embodiments.

It should be understood that the division of the modules of the user hearing protection apparatuses shown in <FIG> and <FIG> is merely logical function division. In actual implementation, all or some of the modules may be integrated into one physical entity, or may be physically separated. In addition, all the modules may be implemented by software invoked by a processing element, or may be implemented by hardware; or some modules may be implemented by software invoked by a processing element, and some modules are implemented by hardware. For example, the protection module may be a separately disposed processing element, or may be integrated into a chip of the electronic device for implementation. The implementation of the other modules is similar. In addition, all or some of these modules may be integrated together, or may be implemented independently. In an implementation process, the steps in the foregoing methods or the foregoing modules may be implemented by using an integrated logical circuit of hardware in the processor element or an instruction in a form of software.

For example, the foregoing modules may be one or more integrated circuits configured to implement the foregoing methods, for example, one or more application specific integrated circuits (Application Specific Integrated Circuit, hereinafter referred to as ASIC), one or more digital signal processors (Digital Singnal Processor, hereinafter referred to as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, hereinafter referred to as FPGA). For another example, these modules may be integrated together, and implemented in a form of a System-On-a-Chip (System-On-a-Chip, hereinafter referred to as SOC).

<FIG> is a schematic structural diagram of an embodiment of an electronic device according to this application. As shown in <FIG>, the electronic device may include: a display unit; one or more processors; a memory; a single audio channel; an input unit; a plurality of application programs; and one or more computer programs.

The electronic device may be a mobile terminal (mobile phone), a smart screen, a drone, and an Intelligent Connected Vehicle (Intelligent Connected Vehicle, hereinafter referred to as ICV), a smart/intelligent car (smart/intelligent car), an in-vehicle device, or the like.

The foregoing one or more computer programs are stored in the foregoing memory, and the foregoing one or more computer programs include an instruction. When the instruction is executed by the foregoing device, the device is enabled to perform the following steps: after the electronic device enables a hearing protection mode, when a current sound output mode of the electronic device is a headset output, obtaining current-frame sound source data;.

In a possible implementation, when the instruction is executed by the device, that the device is enabled to perform the step of obtaining, based on the current-frame sound source data, sound pressure output by a headset connected to the electronic device includes:.

In a possible implementation, when the instruction is executed by the device, after the device is enabled to perform the step of obtaining, based on the current-frame sound source data, sound pressure output by a headset connected to the electronic device, the following steps are further performed:.

In a possible implementation, when the instruction is executed by the device, before the device is enabled to perform the step of obtaining current-frame sound source data, the following steps are further performed:.

In a possible implementation, when the instruction is executed by the device, before the device is enabled to perform the step of obtaining, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset, the following steps are further performed:.

In a possible implementation, when the instruction is executed by the device, that the device is enabled to perform the step of obtaining, based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset includes:.

The electronic device shown in <FIG> may be a terminal device or a circuit device disposed in the terminal device. The device may be configured to perform functions/steps in the methods provided in the embodiments shown in <FIG> of this application.

As shown in <FIG>, the electronic device <NUM> includes a processor <NUM> and a transceiver <NUM>. Optionally, the electronic device <NUM> may further include a memory <NUM>. The processor <NUM>, the transceiver <NUM>, and the memory <NUM> may communicate with each other by using an internal connection channel to transfer a control signal and/or a data signal. The memory <NUM> is configured to store a computer program, program code of a hearing protection algorithm, historical data of a hearing protection process, and user-defined data. The processor <NUM> is configured to invoke and run the computer program from the memory <NUM>, process information transmitted by the input unit <NUM> and the display unit <NUM>, and process an audio stream signal.

The memory <NUM> may be a read-only memory (read-only memory, ROM) or another type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or another type of dynamic storage device that can store information and instructions, may be an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory, CD-ROM) or another optical disk storage, an optical disk storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, and the like), a magnetic disk storage medium, or another magnetic storage device, or may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.

Optionally, the electronic device <NUM> may further include an antenna <NUM>, configured to send a radio signal output by the transceiver <NUM>.

The processor <NUM> and the memory <NUM> may be combined into a processing apparatus, and more commonly, are independent of each other. The processor <NUM> is configured to execute program code stored in the memory <NUM> to implement the foregoing functions. In specific implementation, the memory <NUM> may be integrated into the processor <NUM>, or may be independent of the processor <NUM>.

In addition, to improve functions of the electronic device <NUM>, the electronic device <NUM> may further include an input unit <NUM>, a display unit <NUM>, and an audio circuit <NUM>. The audio circuit <NUM> may further include a microphone <NUM>, and the audio circuit <NUM> may also be connected to a headset <NUM> or the like. The display unit <NUM> may include a display screen.

The input unit <NUM> and the display unit <NUM> are configured to implement interaction with a user, where the input unit <NUM> is used by the user to enable, stop, or customize the hearing protection function. The display unit <NUM> is configured to display output information of the hearing protection function.

The audio circuit <NUM> is configured to transmit and process an audio signal, so as to implement various operations such as filtering and power amplification. The headset <NUM> may implement electro-acoustic conversion, so as to convert an electrical signal output by the electronic device into an acoustic signal and output the acoustic signal to the user's ear.

Optionally, the electronic device <NUM> may further include a power source <NUM>, configured to supply power to various components or circuits in the terminal device.

It should be understood that the electronic device <NUM> shown in <FIG> can implement processes of the methods provided in the embodiments shown in <FIG> of this application. Operations and/or functions of the modules in the electronic device <NUM> are respectively intended to implement corresponding procedures in the foregoing method embodiments. For details, refer to descriptions in the method embodiments shown in <FIG> of this application. To avoid repetition, detailed descriptions are appropriately omitted herein.

It should be understood that the processor <NUM> in the electronic device <NUM> shown in <FIG> may be a System-On-a-Chip (SOC), and the processor <NUM> may include a central processing unit (Central Processing Unit, hereinafter referred to as CPU), and may further include another type of processor, for example, a graphics processing unit (Graphics Processing Unit, hereinafter referred to as GPU).

In conclusion, all processors or processing units in the processor <NUM> may cooperate with each other to implement the foregoing method procedures, and corresponding software programs of the processors or the processing units may be stored in the memory <NUM>.

This application further provides an electronic device. The device includes a storage medium and a central processing unit. The storage medium may be a non-volatile storage medium. A computer executable program is stored in the storage medium. The central processing unit is connected to the non-volatile storage medium, and the computer executable program is executed to implement the methods provided in the embodiments shown in <FIG> of this application.

In the foregoing embodiments, the processors used may include, for example, a CPU, a DSP, a microcontroller, or a digital signal processor, and may further include a GPU and an embedded neural-network processing unit (Neural-network Process Units, hereinafter referred to as NPU) and an image signal processor (Image Signal Processing, hereinafter referred to as ISP). The processors may further include a necessary hardware accelerator or logic processing hardware circuit, such as an ASIC or one or more integrated circuits configured to control execution of programs of the technical solutions in this application. In addition, the processor may have a function of operating one or more software programs, and the software programs may be stored in a storage medium.

An embodiment of this application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is run on a computer, the computer is enabled to perform the methods provided in the embodiments shown in <FIG> of this application.

An embodiment of this application further provides a computer program product, where the computer program product includes a computer program, and when the computer program is run on a computer, the computer is enabled to perform the methods provided in the embodiments shown in <FIG> of this application.

In the embodiments of this application, "at least one" means one or more, and "a plurality of" means two or more. The term "and/or" describes an association relationship between associated objects, and indicates that three relationships may exist. For example, A and/or B may indicate the following: Only A exists, both A and B exist, and only B exists, where A and B each may indicate a singular or plural form. The character "/" generally indicates that the associated objects are in an "or" relationship. "At least one of the following" or a similar expression thereof indicates any combination of the following, and includes any combination of one or more of the following. For example, at least one of a, b, or c may indicate a, b, c, a and b, a and c, b and c, or a and c, where a, b, and c may indicate a singular or plural form.

A person of ordinary skill in the art may be aware that the units and algorithm steps described in the embodiments disclosed in this specification can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions.

In the several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, the function may be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in the form of a software product. The software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, hereinafter referred to as ROM), a random access memory (Random Access Memory, hereinafter referred to as RAM), a magnetic disk, or an optical disc.

Claim 1:
A user hearing protection method, comprising:
enabling, by an electronic device, a hearing protection mode, if a current sound output mode of the electronic device is a headset mode, obtaining (<NUM>) current-frame sound source data;
obtaining (<NUM>), based on the current-frame sound source data, sound pressure output by a headset connected to the electronic device;
comparing (<NUM>) the sound pressure with a predetermined sound pressure threshold; and
if the sound pressure is greater than the predetermined sound pressure threshold, performing (<NUM>) an instantaneous sound pressure over-standard warning and an instantaneous sound pressure over-standard protection operation;
wherein the obtaining (<NUM>), based on the current-frame sound source data, sound pressure output by a headset connected to the electronic device comprises:
obtaining (<NUM>) a current usage scenario of the headset by a scenario obtaining submodule (<NUM>) of an obtaining module (<NUM>), wherein the current usage scenario comprises audio play, video play, gaming, or making a call;
obtaining (<NUM>), based on the current-frame sound source data and a sound effect change and a gain value that are of a channel corresponding to the usage scenario, a digital signal value output to a headset interface of the electronic device;
obtaining (<NUM>), based on the digital signal value and a digital-to-electrical conversion gain value of the electronic device, a voltage value output to the headset interface; and
obtaining (<NUM>), based on the voltage value and an electro-acoustic conversion coefficient of the headset, sound pressure output by the headset.