Noise reduction method and electronic equipment
By controlling the motor of the camera module in an electronic device to adjust the lens position, the noise problem caused by the resonance of the speaker and the camera module lens is solved, and noise reduction and user experience are achieved.
Patent Information
- Application Number
- CN202411725088.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-22
AI Technical Summary
In electronic devices, when the camera module is close to the speaker, the speaker will resonate with the lens of the camera module when playing audio, causing the lens to shake and hit the inner wall of the camera module to cause noise, affecting the user experience.
By introducing a noise reduction method in the electronic device, in response to the volume change of the speaker, the motor of the camera module is powered on or off, and the position of the lens is adjusted to avoid the lens shaking and hitting the inner wall causing noise.
Effectively reduces the noise of electronic devices and improves the user experience, especially when the speakers play audio at a higher volume.
Smart Images

Figure CN119865697A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of noise reduction, and in particular to a noise reduction method and electronic equipment. Background Art
[0002] At present, electronic devices such as mobile phones include speakers and camera modules. Usually, at least one speaker is distributed on the electronic device, so that sound can be propagated in all directions through the speaker to form a three-dimensional sound field.
[0003] However, when the camera module is designed to be located close to one of the speakers, when the speaker plays audio, it will resonate with the lens in the camera module, causing the lens to shake and hit the inner wall of the camera module, causing a lot of noise and affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a noise reduction method and an electronic device, which are used to reduce the noise of the electronic device and improve the user experience.
[0005] To achieve the purpose, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a noise reduction method is provided, which is applied to an electronic device, wherein the electronic device includes a camera module and a speaker, the camera module includes a motor and a lens, the motor is used to control the movement of the lens, and the method includes: in response to a first operation, the electronic device does not power on the motor, and the lens is in an initial position; the first operation is used to control the speaker to play a first audio at a first volume; in response to a second operation, the electronic device powers on the motor, and controls the lens to leave the initial position through the motor; the second operation is used to control the speaker to play the first audio at a second volume; the second volume is greater than the first volume.
[0007] In the above noise reduction method, when the speaker plays the first audio at the second volume, the electronic device powers on the motor, and the electronic device controls the lens to leave the initial position through the motor. When the speaker plays the audio at a higher volume, the motor of the camera module is powered on, and the lens is controlled to leave the initial position through the motor, so as to avoid the lens from hitting the inner wall of the camera module during the shaking process and causing noise. This improves the problem that when the speaker plays the audio at a higher volume, the resonance between the lens and the camera module causes the lens to shake and hit the inner wall of the camera module, causing a lot of noise and affecting the user experience, thereby reducing the noise of the electronic device and improving the user experience.
[0008] In an implementation manner of the first aspect, when the motor controls the lens to leave the initial position, the method further includes: in response to the first operation, the electronic device controls the lens to move to the initial position through the motor and cuts off power to the motor.
[0009] In this implementation method, after the electronic device adjusts the volume of the speaker to below the preset volume, it indicates that the resonance between the speaker and the lens becomes smaller, and the noise generated by the lens shaking and hitting the inner wall of the camera module is reduced. At this time, the electronic device controls the lens to move to the initial position through the motor and cuts off the power to the motor, which can reduce power consumption.
[0010] In an implementation of the first aspect, when the motor controls the lens to leave the initial position, the method further includes: in response to a third operation, the electronic device controls the lens to move to the initial position through the motor and cuts off power to the motor; the third operation is used to control not playing the first audio through the speaker.
[0011] In this implementation, after the electronic device stops playing the first audio through the speaker, it indicates that the resonance between the speaker and the lens disappears, and the noise generated by the lens shaking and hitting the inner wall of the camera module disappears. At this time, the electronic device controls the lens to move to the initial position through the motor and cuts off the power to the motor, which can reduce power consumption.
[0012] In an implementation manner of the first aspect, not playing the first audio through the speaker includes: the electronic device stops playing the first audio through the speaker, or the electronic device plays the first audio through other devices.
[0013] In this implementation, there are two situations in which the electronic device does not play the first audio through the speaker: 1) switching the playback device, such as headphones, Bluetooth speakers, etc.; 2) ending the playback of the first audio, both of which can make the resonance between the speaker and the lens disappear, and the noise generated by the lens shaking and hitting the inner wall of the camera module disappear, thereby reducing power consumption.
[0014] In an implementation manner of the first aspect, when the motor controls the lens to leave the initial position, the method also includes: in response to a fourth operation, the electronic device controls the lens to move to the initial position through the motor and cuts off the power of the motor; the fourth operation is used to control the start of a target application, and the target application is used to occupy the camera module; the electronic device powers on the motor and controls the movement of the lens through the motor according to the focusing distance.
[0015] The electronic device powers on the motor, controls the lens to leave the initial position through the motor, and controls the lens to move to the initial position through the motor, and then powers off the motor, which is achieved through the noise reduction module. The electronic device powers on the motor, and controls the movement of the lens through the motor according to the focus distance, which is achieved through the camera module. When the motor controls the lens to leave the initial position, it indicates that the noise reduction module is occupying the camera module at this time, and the noise reduction module is calling the driver to control the movement of the lens through the motor to perform noise reduction. In response to starting the target application that occupies the camera module, it indicates that the camera module also needs to occupy the camera module, and the camera module needs to focus by controlling the movement of the lens through the motor.
[0016] In this implementation, since the priority of the camera module is higher than that of the noise reduction module, the noise reduction module first stops noise reduction and stops occupying the camera module, controls the lens to move to the initial position through the motor, and cuts off the power of the motor. Then the camera module starts shooting again, occupies the camera module, powers on the motor, and controls the movement of the lens through the motor according to the focusing distance, thereby effectively solving the conflict problem between the noise reduction module and the camera module.
[0017] In an implementation of the first aspect, when the movement of the lens is controlled by a motor according to the focus distance, the method also includes: in response to a fifth operation, the electronic device plays the first audio at a second volume through a speaker, the electronic device controls the lens to move to an initial position through a motor, and cuts off power to the motor; the fifth operation is used to control the closing of a target application, or to switch the target application to the background; the electronic device powers on the motor, and controls the lens to leave the initial position through the motor.
[0018] In this implementation, when the lens is controlled to move by a motor according to the focus distance, it indicates that the camera module is occupying the camera module, and the camera module is focusing by controlling the lens movement by a motor. In response to closing the target application occupying the camera module or switching the target application occupying the camera module to the background, it indicates that the camera module is going to stop shooting and stop occupying the camera module. At this time, it is detected that the electronic device is playing the first audio through the speaker at a second volume, indicating that the noise reduction module still needs to occupy the camera module. Since the priority of the camera module is higher than the priority of the noise reduction module, the starting position of the noise reduction module occupying the camera module is at the initial position. Therefore, the camera module can be responded to stop shooting first, the lens is controlled to move to the initial position by the motor, the motor is powered off, and then the noise reduction module is responded to for noise reduction, the motor is powered on, and the lens is controlled to leave the initial position by the motor. That is to say, the camera module first controls the lens to move to the initial position by the motor, the motor is powered off, and then the noise reduction module powers on the motor, and the lens is controlled to leave the initial position by the motor, thereby solving the conflict problem between the noise reduction module and the camera module.
[0019] In an implementation of the first aspect, when the movement of the lens is controlled by a motor according to the focus distance, the method also includes: in response to a fifth operation, the electronic device plays the first audio at a first volume through a speaker or the electronic device does not play the first audio through the speaker, the electronic device controls the lens to move to an initial position through a motor, and cuts off power to the motor; the fifth operation is used to control the closing of the target application, or switch the target application to the background.
[0020] In this implementation, when the movement of the lens is controlled by a motor according to the focus distance, it indicates that the camera module is occupying the camera module for shooting, and the camera module is focusing by controlling the movement of the lens through a motor. In response to closing the target application occupying the camera module or switching the target application occupying the camera module to the background, it indicates that the camera module is going to stop shooting and stop occupying the camera module. At this time, it is detected that the electronic device is playing the first audio through the speaker at a first volume or the electronic device is not playing the first audio through the speaker, indicating that the noise reduction module does not need noise reduction and does not need to occupy the camera module. Since neither the camera module nor the noise reduction module needs to occupy the camera module, it is possible to directly respond to the camera module stopping shooting and occupying the camera module, control the lens to move to the initial position through the motor, and cut off the power to the motor, thereby reducing power consumption.
[0021] In an implementation manner of the first aspect, the second volume is greater than a preset volume, and the first volume is less than or equal to the preset volume.
[0022] In this implementation, by comparing the second volume being greater than the preset volume and the first volume being less than or equal to the preset volume, it is shown that when the volume of the speaker is less than or equal to the preset volume, the resonance between the speaker and the motor lens is not large, resulting in a small amount of noise, and therefore, no measures need to be taken to reduce the noise of the speaker. When the volume of the speaker is greater than the preset volume, the resonance between the speaker and the lens is large, resulting in a large amount of noise, and therefore, corresponding measures need to be taken to reduce the noise, that is, by controlling the lens to leave the initial position by powering on the motor to avoid the noise caused by the lens shaking and hitting the inner wall of the camera module, thereby improving the user experience.
[0023] In an implementation manner of the first aspect, the first audio includes music, a ringtone, an alarm, a video call, or a cellular call.
[0024] In this implementation, when the volume of the audio is greater than the preset volume, the audio such as the prompt sound and the camera sound lasts for a short time, so the resonance between the speaker and the lens is not obvious, and the noise generated is not obvious. The first audio is set to be music, ringing, alarm, video call or cellular call, etc., which lasts for a relatively long time. When the speaker plays the first audio, the resonance with the lens is obvious, and the noise generated is also obvious. At this time, noise reduction can reduce power consumption.
[0025] In a second aspect, an electronic device is provided, comprising a memory and one or more processors, wherein a computer program code is stored in the memory, and the computer program code comprises computer instructions, which, when executed by the processor, enable the electronic device to perform the noise reduction method as described in the first aspect and any embodiment thereof.
[0026] In a third aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the noise reduction method as described in the first aspect and any embodiment thereof.
[0027] In a fourth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the noise reduction method as described in the first aspect and any embodiment thereof.
[0028] Among them, the technical effects brought about by the design methods of the second, third and fourth aspects can refer to the technical effects brought about by the different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A possible structural diagram of an electronic device provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of the structure of the back of an electronic device of a related technology provided by the prior art;
[0031] Figure 3 A schematic structural diagram of a camera module of a related technology provided in an embodiment of the present application;
[0032] Figure 4 A flowchart of a noise reduction method provided in an embodiment of the present application;
[0033] Figure 5 A flowchart of a noise reduction method provided in an embodiment of the present application;
[0034] Figure 6 A flowchart of a noise reduction method provided in an embodiment of the present application through a system calling function;
[0035] Figure 7 A schematic diagram of a possible software structure of an electronic device provided in an embodiment of the present application;
[0036] Figure 8 A flow comparison diagram of a camera module or a noise reduction module occupying a camera module in software provided in an embodiment of the present application;
[0037] Fig. 9 A flowchart for determining whether a noise reduction module needs to call to stop occupying the first motor drive or the second motor drive in software provided in an embodiment of the present application;
[0038] Fig.10 A software noise reduction module calls a first motor drive flow chart through a camera service and a camera manager provided in an embodiment of the present application;
[0039] Fig.11 A flowchart of a software noise reduction module calling a first motor driver based on a camera manager provided in an embodiment of the present application;
[0040] Fig.12 A flowchart of a software noise reduction module calling a first motor drive based on a camera provided interface in a camera manager provided in an embodiment of the present application;
[0041] Fig.13 A flowchart of a noise reduction module calling a second motor driver or a camera module calling a first motor driver in software provided in an embodiment of the present application;
[0042] Fig.14 A schematic diagram of several situations when a noise reduction module or a camera module occupies a camera module is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. It can be understood by those skilled in the art that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. 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 design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way for easy understanding. The terms "coupling" and "connection" involved in the embodiments of the present application should be understood in a broad sense, for example, it can refer to a physical direct connection, or it can refer to an indirect connection achieved by an electronic device, such as a connection achieved by a resistor, an inductor, a capacitor or other electronic devices.
[0044] A loudspeaker, commonly known as a horn, is a transducer device that converts electrical signals into sound signals.
[0045] A camera compact module (CCM) is a device that converts light gathered by a lens into electrical signals through a CMOS or CCD integrated circuit, which are then converted into digital image signals by an internal image processor (ISP) and output to a digital signal processor (DSP) for processing and conversion into standard GRB, YUV and other format image signals.
[0046] The embodiment of the present application provides an electronic device, which is an electronic device having a camera module and a speaker. The electronic device can be mobile or fixed. The electronic device can be deployed on land (for example, indoors or outdoors, handheld or vehicle-mounted, etc.), on the water (for example, ships, etc.), or in the air (for example, airplanes, balloons, and satellites, etc.). The electronic device can be called user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent or terminal device, etc. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a smart bracelet, a smart screen, a smart watch, a virtual reality (VR) device, an augmented reality (AR) device, a terminal in industrial control, a terminal in self-driving, a terminal in remote medical, a terminal in smart grid, a terminal in transportation safety, a terminal in smart city, a terminal in smart home, etc. The embodiments of the present application do not limit the specific type and structure of the electronic device. A possible structure of the electronic device is described below.
[0047] Take the mobile phone as an example, Figure 1 A possible structure of the electronic device 100 is shown. The electronic device 100 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, a mobile communication module 250, a wireless communication module 260, an antenna 251, an antenna 261, an audio module 270, a speaker 2, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera module 293, a camera module 1, a display screen 294, and a subscriber identification module (SIM) card interface 295. Optionally, in some embodiments, an audio digital signal processor (ADSP) 243 is also included.
[0048] It is to be understood that the structure illustrated in the embodiment of the present application does 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 components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0049] The processor 210 may include one or more processing units, for example, the processor 210 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, and a neural-network processing unit (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. For example, the processor 210 may be an application processor AP. Alternatively, the processor 210 may be integrated in a system on chip (SoC). Alternatively, the processor 210 may be integrated in an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a micro-controller unit (MCU) in an IC chip.
[0050] The processor 210 may also be provided with a memory for storing computer instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store computer instructions or data that the processor 210 has just used or circulated. If the processor 210 needs to use the computer instructions or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0051] In some embodiments, the processor 210 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 USB interface, etc.
[0052] ADSP 243 can be coupled with audio module 270 and sensor module 280, and ADSP 243 can be used to process audio signals and sensor data. When the processor is in a dormant state, ADSP 243 can still keep working, thereby reducing the power consumption of the electronic device.
[0053] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the embodiment, or a combination of multiple interface connection methods.
[0054] The external memory interface 220 can be used to connect an external memory card, such as a micro SanDisk (Micro SD) card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0055] The internal memory 221 may be used to store computer executable program codes, which include computer instructions. The processor 210 executes various functional applications and data processing of the electronic device 100 by running the computer instructions stored in the internal memory 221. In addition, the internal memory 221 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.
[0056] The memory involved in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0057] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 270, the speaker 2, the receiver 272, the microphone 273, the headphone interface 274 and the application processor.
[0058] The button 290 includes a power button, a volume button, etc. The button 290 may be a mechanical button. It may also be a touch button. The electronic device 100 may receive a button input and generate a key signal input related to the user settings and function control of the electronic device 100. The motor 291 may generate a vibration prompt. The motor 291 may be used for an incoming call vibration prompt or for touch vibration feedback. The indicator 292 may be an indicator light, which may be used to indicate the charging status, the change in power, or may be used to indicate messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect a SIM card. The SIM card may be inserted into or removed from the SIM card interface 295 to achieve contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0059] The electronic device 100 can realize the shooting function through the ISP, the camera module 293, the video codec, the GPU, the display screen 294 and the application processor. The ISP is used to process the data fed back by the camera module 293. In some embodiments, the ISP can be set in the camera module 293. The camera module 293 is used to capture a static image or a video. In some embodiments, the electronic device 100 may include 1 or N camera modules 293, where N is a positive integer greater than 1. The camera module 293 may include multiple camera modules 1.
[0060] In the embodiment of the present application, when the camera module 1 and the speaker 2 are located close to each other, when the speaker 2 plays audio at a high volume, the speaker 2 may resonate with the camera module 1, causing an impact inside the camera module 1 and generating noise.
[0061] The electronic device 100 can realize the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute computer instructions to generate or change display information.
[0062] The power management module 240 is used to receive charging input from a charger. The charger may be a wireless charger, such as a wireless charging base, other electronic devices 100 with reverse wireless charging function, etc. The power management module 240 may receive wireless charging input through a wireless charging coil 242 of the electronic device. The charger may also be a wired charger, for example, the power management module 240 may receive charging input from a wired charger through the USB interface 230. The power management module 240 is also called a charging chip.
[0063] The power management module 240 is used to connect to the battery 241. The power management module 240 receives input from the battery 241 and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera module 293, and the wireless communication module 260. The power management module 240 can also be used to monitor parameters such as the capacity of the battery 241, the number of cycles of the battery 241, and the health status (leakage, impedance) of the battery 241. In some other embodiments, the power management module 240 can also be set in the processor 210.
[0064] The wireless communication function of the electronic device 100 can be implemented through the antenna 251, the antenna 261, the mobile communication module 250, the wireless communication module 260, the modem processor, etc.
[0065] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The wireless communication module 260 can provide solutions for wireless communications 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 technology (NFC), infrared technology (IR), etc., applied to the electronic device 100.
[0066] In the related technology, such as Figure 2 As shown, at least one speaker 2, for example four, is provided on the electronic device 100. The electronic device 100 is also provided with at least one camera module 1, which is usually a rear camera module 1, and one of the camera modules 1 is located closer to one of the speakers 2.
[0067] For example, as shown in the attached Figure 3As shown, the camera module 1 includes a lens 11, a motor 12, an infrared filter 13, an image sensor (sensor) 14 and a circuit board (PCB) 15. Since the wavelength range of light recognized by the human eye is between 320nm-760nm, the human eye cannot see light exceeding 320nm-760nm. The infrared filter 13 filters out the non-visible light of the human eye to avoid color cast and ripple phenomena and improve color reproduction. The lens 11 collects the light filtered by the infrared filter 13 to the image sensor 14. The image sensor 14 converts the optical signal into an electrical signal. The circuit board 15 is used to connect each component to the processor and complete the transmission of raw data between the image sensor 14 and the processor.
[0068] The working principle of the camera module 1 is:
[0069] During the focusing process of the camera module 1, the processor applies currents of different magnitudes to the motor 12. The motor 12 controls the lens 11 to move the corresponding displacement according to the magnitude of the current, adjusts the focusing distance of the object, and thus realizes the automatic focusing of the camera module 1 on the object. After the focusing is completed, the lens 11 collects the light reflected by the object, and after filtering out the invisible light of the human eye through the infrared filter 13, it is collected on the image sensor 14. The image sensor 14 converts the light signal into an electrical signal, processes it on the processor, and converts it into an image signal in a standard red, green, blue RGB, YUV, etc. format.
[0070] The motor 12 includes an offset motor and a mid-mounted motor. In the offset motor, the lens 11 is located at a position off-center of the offset motor, usually at the bottom of the motor 12. In the mid-mounted motor, the lens 11 is usually located at the center of the mid-mounted motor.
[0071] As attached Figure 2 , Attachment Figure 3 As shown, in the offset motor, since the lens 11 is at the bottom of the motor 12, it directly contacts the inner wall (including the bottom wall) of the camera module 1 or is very close to the inner wall (including the bottom wall) of the camera module 1. When the motor 12 is in a power-off state, when the speaker 2 is playing audio, since the speaker 2 is close to the camera module 1, the vibration of the sound will resonate with the lens 11 of the camera module 1, and the resonance will cause the lens 11 to shake, and the shaking of the lens 11 will cause the lens 11 to hit the inner wall of the camera module 1, causing noise, affecting the user experience.
[0072] The noise level is related to the volume played by the speaker 2. The louder the volume, the greater the resonance amplitude, and the louder the noise generated by the lens 11 hitting the inner wall of the camera module 1; the smaller the volume, the smaller the resonance amplitude, and the smaller the noise generated by the lens 11 hitting the inner wall of the camera module 1. For example, see Table 1 below (in Table 1, the volume level corresponds to the volume; small means small noise; large means large noise; large means large noise).
[0073] Table 1 The noise level corresponding to the speaker playing different audio at different volume levels
[0074] MMI audio source Fast frequency sweep Vocals Piano music Alarm Notification Tone Short Video Movie 15 levels of volume Very large Very large Very large Very large Very large Very large Very large Very large 14 levels of volume Very large Very large Very large Very large Very large Very large Very large Very large 13 levels of volume Very large Very large Very large Very large Very large Very large Very large Very large 12 levels of volume Larger Larger Larger Larger Larger Very large Very large Very large 11 levels of volume Larger Larger Larger Larger Larger Larger Very large Very large 10 levels of volume Larger Larger Larger Larger Larger Larger Larger Larger 9 levels of volume Larger Larger Larger Small Larger Larger Larger Larger 8 levels of volume Small Small Small Small Small Larger Larger Larger 7 levels of volume Small Small Small Small Small Larger Small Larger 6 levels of volume Small Small Small Small Small Small Small Small 5 levels of volume Small Small Small Small Small Small Small Small 4 levels of volume Small Small Small Small Small Small Small Small 3 levels of volume Small Small Small Small Small Small Small Small 2 levels of volume Small Small Small Small Small Small Small Small Volume level 1 Small Small Small Small Small Small Small Small
[0075] It can be seen from Table 1 above that: although the noise levels corresponding to different audios played by the speaker 2 are different, when playing the same audio, the louder the volume played by the speaker 2, the louder the noise. The lower the volume played by the speaker 2, the lower the noise. Therefore, when the speaker 2 plays audio at a higher volume, due to resonance with the lens 11 of the camera module 1, the lens 11 will hit the inner wall of the camera module 1, causing a lot of noise, affecting the user experience.
[0076] To this end, a noise reduction method is provided in an embodiment of the present application. Based on the noise reduction method provided in an embodiment of the present application, when the speaker plays audio at a high volume, the motor of the camera module is powered on to prevent the lens from shaking and hitting the inner wall of the camera module to cause noise, thereby reducing the noise of the electronic device and improving the user experience.
[0077] In the noise reduction method provided in the embodiment of the present application, the camera module may be the camera module 1 in the electronic device 100, and the speaker may be the speaker 2 in the electronic device 100. Taking the motor as a biased motor and the position of at least one camera module and at least one speaker being close as an example, the noise reduction method of the present application is specifically described.
[0078] For example, as shown in the attached Figure 4 As shown, the noise reduction method is applied to an electronic device 100, the electronic device 100 includes a camera module 1 and a speaker 2, the camera module 1 includes a motor 12 and a lens 11, the motor 12 is used to control the movement of the lens 11, and the method may include steps S401-S404:
[0079] Step S401 : the electronic device 100 plays audio through the speaker 2 .
[0080] Step S402 , the electronic device 100 determines whether the volume of the speaker 2 is greater than a preset volume.
[0081] The preset volume can be set according to actual needs. For example, it can be obtained by counting multiple volume levels of the speaker 2 when playing audio, such as counting the mean or median of multiple volume levels when the speaker 2 resonates with the motor 12 when playing audio; it can also be set according to empirical values, such as 9 levels or 11 levels.
[0082] If the volume of the speaker 2 is less than or equal to the preset volume, step S403 is executed. If the volume of the speaker 2 is greater than the preset volume, step S404 is executed.
[0083] Step S403 : the electronic device 100 does not power on the motor 12 , and the lens 11 is at the initial position.
[0084] The initial position refers to the position close to the circuit board 15 along the radial direction of the lens 11, which is at the bottom of the motor 12. In the process of controlling the movement of the lens 11, first, the processor in the camera module 1 sends a code value to the motor 12, such as 0-1024. The code value is pre-set in the processor, and each code value corresponds to a current value. The larger the code value, the larger the current value, and the smaller the code value, the smaller the current value. Secondly, after receiving the code value, the motor 12 controls the displacement corresponding to the movement of the lens 11 according to the current corresponding to the code value.
[0085] In a possible implementation, the processor of the rear camera module 1 can set different code values for the target position according to the posture of the camera module 1. For example, relative to the ground, when the camera module 1 is facing downward, the initial position of the lens 11 is at the top of the motor 12. In the process of controlling the lens 11 to move toward the target position, since the thrust is in the same direction as gravity, the thrust required when reaching the target position is smaller, so the code value of the target position is smaller, for example, 4; when the camera module 1 is facing upward, the initial position of the lens 11 is at the bottom of the motor 12. In the process of controlling the lens 11 to move toward the target position, since the thrust is in the opposite direction of gravity, the thrust required when reaching the target position is larger, so the code value of the target position is larger, for example, 8. The embodiment of the present application does not limit the setting size of the code value of the target position.
[0086] In a possible implementation, the function of the motor 12 may be focusing, or focusing and anti-shake. The function of the motor 12 in controlling the lens is not limited in the embodiment of the present application.
[0087] The volume of the speaker 2 is less than or equal to the preset volume. In other words, the electronic device 100 plays audio through the speaker 2 at the first volume. The first volume is less than or equal to the preset volume. At this time, the electronic device 100 does not power on the motor 12, and the lens 11 is in the initial position. In other words, when the volume of the speaker 2 is less than or equal to the preset volume, the resonance generated by the speaker 2 and the lens 11 is not large, resulting in a small noise, and no measures can be taken to reduce the noise of the electronic device 100, thereby reducing power consumption.
[0088] In step S404 , the electronic device 100 powers on the motor 12 and controls the lens 11 to leave the initial position through the motor 12 .
[0089] The volume of the speaker 2 is greater than the preset volume. In other words, the electronic device 100 plays audio through the speaker 2 at a second volume. The second volume is greater than the preset volume. At this time, the electronic device 100 powers on the motor 12 and controls the lens 11 to leave the initial position through the motor 12. In other words, when the volume of the speaker 2 is greater than the preset volume, the resonance generated by the speaker 2 and the lens 11 is greater, resulting in greater noise. Therefore, corresponding measures need to be taken to reduce the noise of the electronic device 100, that is, power on the motor 12, and control the lens 11 to leave the initial position through the motor 12 to avoid the lens 11 from hitting the inner wall of the camera module 1 during shaking, thereby reducing the noise of the electronic device 100 and improving the user experience.
[0090] In one possible implementation, the motor 12 controls the lens 11 to leave the initial position and stops after reaching the target position. The target position can be a center position or a non-center position at a certain distance from the center position of the camera module 1. The embodiment of the present application does not limit the specific position of the target position.
[0091] In one possible implementation, the audio includes music, ringing, alarm, video call, cellular call, camera sound and prompt sound, etc. The embodiment of the present application does not limit the type of audio.
[0092] During the audio playback process, on the one hand, some audio playback time is short, the impact of noise is small, and the effect of reducing noise after using the above noise reduction method is not obvious. On the other hand, if the electronic device 100 is still executing the above noise reduction method after the noise is eliminated, it will cause high power consumption. Further, in order to better reduce the noise of the electronic device 100, the embodiments of the present application can consider the above factors.
[0093] In the following embodiments of the present application, the noise reduction method of the present application is specifically described by taking factors such as the type of audio played and noise elimination into consideration.
[0094] For example, as shown in the attached Figure 5As shown, the noise reduction method includes steps S501-S509:
[0095] Step S501: the electronic device 100 plays audio.
[0096] Step S502: The electronic device 100 determines whether the audio is the first audio.
[0097] When the volume of the audio is greater than the preset volume, the prompt sound, camera sound and other audios last for a short time, the resonance between the speaker 2 and the lens 11 is not obvious, and the noise generated by the lens 11 shaking and hitting the inner wall of the camera module 1 is not obvious. Therefore, the solution of the embodiment of the present application does not need to consider the noise impact caused by the prompt sound, camera sound and other audios.
[0098] In one possible implementation, audio that does not include prompt sounds, camera sounds, etc. can be set as the first audio. The first audio includes music, ringing, alarms, video calls, and cellular calls that last longer than a preset time. The embodiment of the present application does not limit the type of the first audio.
[0099] The preset time can be set according to actual needs. For example, it can be obtained by counting the duration of multiple audios when the speaker 2 plays different audios, such as counting the minimum duration of multiple audios when the speaker 2 plays different audios and the electronic device 100 generates a large noise; it can also be set according to an empirical value, such as 5s.
[0100] If the audio is not the first audio, step S503 is executed. If the audio is the first audio, step S504 is executed.
[0101] Step S503 : the electronic device 100 does not power on the motor 12 , and the lens 11 is at the initial position.
[0102] This step is the same as step S403 and will not be described again here.
[0103] Step S504 : the electronic device 100 determines whether to play the first audio through the speaker 2 .
[0104] Step S504 is to determine whether the playback device is speaker 2. Since the fundamental reason for the noise is that the speaker 2 is close to the camera module 1, it is a necessary condition to determine that the speaker 2 is playing. Only when the speaker 2 is playing can the electronic device 100 generate noise. If the first audio is not played through the speaker 2, step S503 is executed. If the first audio is played through the speaker 2, step S505 is executed.
[0105] Step S505 , the electronic device 100 determines whether the volume of the speaker 2 is greater than a preset volume.
[0106] It is a necessary condition to determine whether the volume of the speaker 2 is greater than the preset volume. Only when the volume of the speaker 2 is greater than the preset volume, the electronic device 100 generates a loud noise. If the volume of the speaker 2 is less than or equal to the preset volume, step S503 is executed. If the volume of the speaker 2 is greater than the preset volume, step S506 is executed.
[0107] In step S506 , the electronic device 100 powers on the motor 12 .
[0108] When the volume of the speaker 2 is greater than the preset volume, the resonance generated by the speaker 2 and the lens 11 is relatively large, resulting in a relatively large noise generated by the lens 11 shaking and hitting the inner wall of the camera module 1. Therefore, corresponding measures need to be taken to reduce the noise generated by the lens 11 shaking and hitting the inner wall of the camera module 1. At this time, the motor 12 needs to be powered on first to prepare for the next step S507.
[0109] In step S507 , the electronic device 100 controls the lens 11 to leave the initial position through the motor 12 .
[0110] After the motor 12 is powered on, in order to prevent the lens 11 from shaking and hitting the inner wall of the camera module 1 to generate noise, the electronic device 100 controls the lens 11 to move away from the initial position through the motor 12 .
[0111] In step S508 , the electronic device 100 determines whether the volume of the speaker 2 is less than or equal to a preset volume or whether the first audio is not played through the speaker 2 .
[0112] After the motor 12 is powered on and the lens 11 is controlled by the motor 12 to leave the initial position, the electronic device 100 determines whether the volume of the speaker 2 is less than or equal to the preset volume or whether the first audio is not played through the speaker 2, that is, whether the electronic device 100 adjusts the volume of the speaker 2 to below the preset volume, or the electronic device 100 stops playing the first audio through the speaker 2, or the electronic device 100 plays the first audio through other devices. If so, execute step S509, otherwise, execute step S507.
[0113] In step S509 , the electronic device 100 controls the lens 11 to move to the initial position through the motor 12 , and cuts off the power of the motor 12 .
[0114] If the electronic device 100 adjusts the volume of the speaker 2 to below the preset volume, or the electronic device 100 stops playing the first audio through the speaker 2, or the electronic device 100 plays the first audio through other devices, it indicates that the resonance between the speaker 2 and the lens 11 causes the lens 11 to shake and hit the inner wall of the camera module 1, and the noise generated becomes smaller or the noise disappears. The electronic device 100 controls the lens 11 to move to the initial position through the motor 12 and cuts off the power to the motor 12.
[0115] In a possible implementation, the other device may be a headset or a Bluetooth speaker, and the embodiment of the present application does not limit the type of the other device.
[0116] The noise reduction method described in the above steps S501-S509 first determines whether it is the first audio, whether it is played through the speaker 2, and whether the volume is greater than the preset volume, to determine whether to power on the motor 12 and control the lens 11 to leave the initial position through the motor 12; secondly, it determines whether the speaker 2 has turned down the volume or switched the device to play, to determine whether to control the lens 11 to move to the initial position through the motor 12, and to power off the motor 12. In this way, the power consumption can be reduced on the basis of reducing the noise of the electronic device 100 and improving the user experience.
[0117] In the embodiment of the present application, the electronic device 100 powers on or off the motor and controls the movement of the lens 11 through the motor 12, which can be implemented in software. Figure 6 As shown, it can be implemented by a system call function in software. Specifically, when the power-on condition of the motor 12 is met, the electronic device 100 powers on the motor 12 through the system call function in software, and controls the lens 11 to leave the initial position through the motor 12. When the power-off condition of the motor 12 is met, the electronic device 100 controls the lens 11 to move to the initial position through the motor 12 through the system call function in software, and powers off the motor 12.
[0118] Furthermore, the noise reduction method in the embodiment of the present application can be implemented in software. The software system of the electronic device 100 can 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 a software system with a layered architecture as an example. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces.
[0119] Embodiments of the present invention In the following embodiments, a layered architecture is used Taking the system as an example, the software structure of the electronic device 100 is exemplarily described. Figure 7 As shown, The system is divided into four layers, from top to bottom: application layer, application framework layer, hardware abstraction layer and kernel layer.
[0120] Among them, the application layer can include a series of application packages. The application package can include applications such as camera application (application, app), audio application (application, app), etc. The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions. The application framework layer can include input services, camera services, audio services, etc.
[0121] The input service is used to detect the input module of the mobile phone (such as the touch screen driver), and convert the parameters input by the input module into usable events, and pass them to the relevant modules of the upper layer. For example, the input service is used to detect the touch screen of the mobile phone through the touch screen driver, and convert the touch parameters generated by the touch operation input by the touch screen into usable events, and pass them to the upper layer app. For example, the touch operation can include the input of the setting operation, etc.
[0122] The camera service can provide camera services, which can be used for input of the camera app, such as input for setting operations, etc. The camera service implements the scheduling work of the camera app by interacting with the input service (such as touch screen camera input).
[0123] The audio service can provide audio services, and the audio service can be used for the input of the audio app, such as the input of the first setting operation, the mode specifying operation, and the second setting operation. The audio service implements the scheduling work of the audio app by interacting with the input service (such as the touch screen playback input and the volume key input).
[0124] The hardware abstraction layer runs in user space, encapsulates kernel layer drivers, and provides a calling interface to the upper layer. The hardware abstraction layer at least includes the camera manager, audio manager, etc.
[0125] The camera manager is used to store and retrieve data from the camera app and make the data accessible to the application. The data can include videos and images, browsing album history, etc.
[0126] The audio manager is used to store and retrieve audio app data and make it accessible to applications. This data can include video, music, the sound of calls made and received, browsing audio history, etc.
[0127] The kernel layer is the layer between hardware and software. The kernel layer includes at least sensor driver, camera module driver, camera driver, audio driver, etc.
[0128] In the embodiment of the present application, the noise reduction module includes an audio service of the application framework layer and an audio manager of the hardware abstraction layer, and the camera module includes a camera service of the application framework layer, a camera manager of the hardware abstraction layer, and a camera driver of the kernel layer. Both the noise reduction module and the camera module can call the camera driver, occupying the camera module 1.
[0129] In the following embodiments of the present application, the software system of the layered architecture of the electronic device 100 is taken as an example to illustrate the noise reduction process thereof.
[0130] In the embodiment of the present application, all applications with camera functions can occupy the camera module 1. The application with camera function occupies the camera module 1, which actually means that the camera module corresponding to the camera app occupies the camera module. In a possible implementation, the application with camera function can be a camera app or a payment app (for example, face recognition). The embodiment of the present application does not limit the type of application with camera function.
[0131] The embodiment of the present application takes the camera module as an example to illustrate the noise reduction process. Figure 8 The process of the camera module driving the camera module 1 shown in (a) in the figure. When the camera module wants to occupy the camera module 1, first, the camera service of the application framework layer calls the Open() function to create a path to occupy the camera module 1, power on the camera module 1, initialize the read and write registers, etc. Then, the camera service calls the Configstream() function to configure the data stream; secondly, the camera service passes the information of occupying the camera module 1 to the camera manager of the hardware abstraction layer; then, the camera manager sends the information of occupying the camera module 1 to the corresponding camera driver of the kernel layer according to the driver information (including the camera driver, etc.) provided by the kernel layer; finally, after receiving the above-mentioned information of occupying the camera module 1, the camera driver issues a driving instruction, and the motor 12 in the camera module 1 controls the movement of the lens 11 according to the driving instruction.
[0132] Among them, the camera drive includes a first motor drive, a sensor drive and an electrically erasable programmable read-only memory (EEPROM) drive. The first motor drive is used to drive the motor 12 to operate. Similarly, in a possible implementation, the function of the motor 12 can be focus, or it can be focus and anti-shake, as long as it can control the movement displacement of the lens 11. The embodiment of the present application does not limit the function of the motor 12. The sensor drive is used to drive the sensor for detection. The eeprom drive is used to drive the camera module 1 to save the calibration data, so as to facilitate the calibration of the camera module 1.
[0133] In the noise reduction method of the embodiment of the present application, the electronic device 100 controls the lens 11 to leave the initial position or return to the initial position through the motor 12, which is realized by calling the driver of the noise reduction module. Figure 8 As shown in (b), the noise reduction module calling the driver can be implemented in two ways: 1) calling the first motor driver in the camera driver in the camera module through the audio service of the application framework layer; 2) adding a second motor driver independent of the camera driver in the kernel layer, and the audio manager of the hardware abstraction layer calls the second motor driver.
[0134] Before the noise reduction module calls the first motor drive or the second motor drive, it is necessary to first determine whether the noise reduction module needs noise reduction. To determine whether noise reduction is needed, it is necessary to first determine whether the noise reduction module meets the noise reduction conditions.
[0135] In the embodiments of the present application, audio includes call audio and media audio. Call audio refers to audio played in response to a call, and media audio refers to audio played in response to media. Call audio includes audio played through calls such as video calls and cellular calls. Media audio includes audio played through media such as music, ringtones, and alarms. Since the playback of call audio is implemented in the kernel layer of the software with a layered architecture, and the playback of media audio is implemented in the application framework layer and kernel layer of the software with a layered architecture, the two have different implementation methods in software, and therefore need to be analyzed separately.
[0136] The embodiment of the present application takes the playing of call audio and media audio as an example to illustrate the process of determining whether the noise reduction module needs noise reduction.
[0137] For example, as shown in the attached Fig. 9 As shown, the process of determining whether the noise reduction module needs noise reduction includes the following steps S901-S914.
[0138] Among them, steps S901-S905 are for playing call audio, and the noise reduction module sets the first state flag bit to 0 or 1. Steps S906-S911 are for playing media audio, and the noise reduction module sets the second state flag bit to 0 or 1. Steps S912-S914, based on the values of the first state flag bit and the second state flag bit, determine whether noise reduction is needed. Among them, whether noise reduction is needed includes needing noise reduction, not needing noise reduction, and stopping noise reduction. When the first audio is played through the speaker 2 at a second volume greater than the preset volume, noise reduction is needed; when at least one of the three conditions of playing through the speaker 2, the volume of the audio played is the second volume greater than the preset volume, and the audio played is the first audio is not satisfied, noise reduction is not needed; after the first audio is played through the speaker 2 at a second volume greater than the preset volume, the noise reduction is stopped when other devices are switched to play the first audio or the first audio is stopped or the volume of the first audio is adjusted below the preset volume.
[0139] Step S901, the noise reduction module plays / turns off the call audio, switches the playback device of the call audio, or adjusts the volume of the call audio.
[0140] Step S901 is at the kernel layer. When playing call audio or switching the playback device of call audio to speaker 2 or increasing the volume of call audio, it is necessary to determine whether noise reduction is required or not. When closing call audio or switching the playback device of call audio to other playback devices or reducing the volume of call audio, it is necessary to determine whether noise reduction needs to be stopped. At the kernel layer, playing call audio is achieved by calling the open() function, closing call audio is achieved by calling the close() function, and adjusting the volume of call audio is achieved by calling the setvolumeindex() function.
[0141] Step S902: The noise reduction module determines whether the call audio is the first audio.
[0142] Step S902 is at the kernel layer. First, determine whether the call audio is the first audio. Among them, in the call audio, the first audio includes video calls or cellular calls, etc. Because when the audio lasts for a short time, the resonance between the speaker 2 and the lens 11 is not obvious, and the noise generated by the shaking of the lens 11 and the inner wall of the camera module 1 is not obvious, this step is to determine whether the duration of the call audio is greater than the preset time. If the call audio is not the first audio, execute step S905. If the call audio is the first audio, execute step S903.
[0143] Step S903: the noise reduction module determines whether to play the first audio through speaker 2.
[0144] Step S903 is at the kernel layer. Secondly, determine whether the first audio is played through speaker 2. The basis for this step is that only when the first audio is played through speaker 2 can it resonate with lens 11, causing lens 11 to shake and hit the inner wall of camera module 1 to generate noise. If the first audio is not played through speaker 2, that is, the first audio is played through other devices, step S905 is executed. If the first audio is played through speaker 2, step S904 is executed.
[0145] Step S904: the noise reduction module determines whether the volume of the speaker 2 is greater than a preset volume.
[0146] Step S904 is in the kernel layer. Finally, it is determined whether the volume of the speaker 2 is greater than the preset volume. The basis for this step is that only when the volume of the speaker 2 is greater than the preset volume, the lens 11 shaking and hitting the inner wall of the camera module 1 can produce unacceptable noise. Then, step S905 is executed.
[0147] Step S905: the noise reduction module sets the first state flag to 0 or 1.
[0148] Step S905 is at the kernel layer. Since the steps of playing the call audio are all completed at the kernel layer, no communication between layers is required. Therefore, it is not necessary to set the parameters before issuing the instruction, that is, the step of setting the parameters is omitted, and the step of setting the status flag is directly entered. Among them, the noise reduction module can store the judgment result on the target memory, and the first status flag is used to indicate whether the noise reduction module needs noise reduction. The value of 1 indicates that the noise reduction module needs noise reduction, and the value of 0 indicates that the noise reduction module does not need noise reduction or stops noise reduction. The target register can be a config register or a watchdog register, which is not limited in the embodiment of the present application. The noise reduction module sets the first status flag to 0 or 1 according to the judgment results of steps S901-S904. If the judgment results of steps S901-S904 are all yes, the first status flag is set to 1, and the noise reduction module needs noise reduction; if at least one of the judgment results of steps S901-S904 is no, the first status flag is set to 0, and the noise reduction module does not need noise reduction or stops noise reduction. Then, step S912 is executed.
[0149] Step S906: The noise reduction module plays / turns off the media audio, switches the playback device of the media audio, or adjusts the volume of the media audio.
[0150] Step S906 is at the application framework layer. Similarly, when playing media audio or switching the playback device of media audio to speaker 2 or increasing the volume of media audio, it is necessary to determine whether noise reduction is needed or not. When turning off media audio or switching the playback device of media audio to another playback device or reducing the volume of media audio, it is necessary to determine whether noise reduction needs to be stopped. At the application framework layer, playing / turning off media audio, switching the playback device of media audio or adjusting the volume of media audio are implemented by calling the function audiotrack().
[0151] Step S907: The noise reduction module determines whether the media audio is the first audio.
[0152] Step S907 is in the application framework layer. Similarly, this step is to determine whether to play the media audio. When the audio duration is short, the resonance between the speaker 2 and the lens 11 is not obvious, and the noise generated by the lens 11 shaking and hitting the inner wall of the camera module 1 is not obvious. This step is to determine whether the duration of the call audio is greater than the preset time. Among them, in the media audio, the first audio includes music, ringing or alarm clock, etc. If the media audio is not the first audio, execute step S910. If the audio is the first audio, execute step S908.
[0153] Step S908: the noise reduction module determines whether to play the first audio through speaker 2.
[0154] Step S908 is at the application framework layer. Similarly, when the first audio is not played through the speaker 2, that is, when the first audio is played through other devices, step S910 is executed. When the first audio is played through the speaker 2, step S909 is executed.
[0155] Step S909: the noise reduction module determines whether the volume of the speaker 2 is greater than a preset volume.
[0156] Step S909 is at the application framework layer. Similarly, then, step S911 is executed.
[0157] Step S910: The noise reduction module sets the parameters of the second state flag.
[0158] Step S910 is in the application framework layer. Since the parameters for setting the second state flag in step S910 of the media audio and the second state flag to 0 or 1 in step S911 are respectively located in the application framework layer and the kernel layer, communication is required between different layers. Therefore, the noise reduction module needs to set the parameters of the second state flag in the application framework layer according to the judgment results of the above steps S906-S909 and send the first instruction to the kernel layer. Among them, the parameters of the second state flag include a character string, which is used to characterize the judgment results of steps S906-S909. The first instruction is used to instruct to set the second state flag to 0 or 1 according to the parameters of the second state flag. Then, execute step S911.
[0159] Step S911: The noise reduction module sets the second state flag to 0 or 1.
[0160] Step S911 is at the kernel layer. Among them, the noise reduction module can store the judgment result on the target memory, and the first state flag is used to indicate whether the noise reduction module needs noise reduction. A value of 1 indicates that the noise reduction module needs noise reduction, and a value of 0 indicates that the noise reduction module does not need noise reduction or stops noise reduction. The target register can be a config register or a watchdog register, which is not limited in the embodiment of the present application. After receiving the first instruction, the noise reduction module sets the second state flag to 0 or 1 according to the parameters of the second state flag indicated by the first instruction. If the judgment results of steps S906-S909 are all yes, the second state flag is set to 1, and if at least one of the judgment results of steps S906-S909 is no, the second state flag is set to 0. Then, execute step S912.
[0161] Step S912: The noise reduction module determines whether at least one of the first state flag and the second state flag is 1.
[0162] Step S912 is at the kernel layer. Step S912 is a joint judgment of the call audio and the media audio. In the call audio and the media audio, if the status flag bit of at least one audio is 1, step S913 is executed. Otherwise, step S914 is executed.
[0163] Step S913: the noise reduction module needs to reduce noise.
[0164] Step S913 is at the kernel layer. When the status flag bit of at least one audio is 1, it indicates that the noise reduction module is responding to the electronic device 100 playing the first audio through the speaker 2 at a second volume greater than the preset volume, and noise reduction is required at this time, the motor 12 is powered on, and the lens 11 is controlled by the motor 12 to leave the initial position.
[0165] Step S914: the noise reduction module does not need to reduce noise or stops reducing noise.
[0166] Step S914 is at the kernel layer. When the status flags of the call audio and the media audio are both 0 (the first status flag is 0 and the second status flag is 0), there are two cases: the first case, the audio being played is not the first audio or is played through other playback devices or the volume is less than the preset volume; the second case, when the speaker 2 is playing the first audio at a second volume greater than the preset volume, the electronic device 100 stops playing the first audio or switches to other playback devices to play or adjusts the volume below the preset volume. In the first case, the noise reduction module does not respond and noise reduction is not required. In the second case, the noise reduction module responds to the above operation and needs to stop noise reduction. At this time, the noise reduction module controls the lens 11 to move to the initial position through the motor 12, cuts off the power to the motor 12, and stops noise reduction.
[0167] In an embodiment of the present application, when playing audio (including call audio and media audio, etc.), the process of determining whether noise reduction is needed and the process of playing the audio are executed synchronously, and the two run independently without affecting each other.
[0168] The process of determining whether noise reduction is needed described in the above steps S901-S914 is the first half of the noise reduction method. In the first half, the noise reduction module determines the call audio and the media audio separately. The noise reduction module determines the call audio at the kernel layer to determine whether the first audio is played through the speaker 2 at a second volume greater than the preset volume; the noise reduction module determines the media audio in the application framework to determine whether the first audio is played through the speaker 2 at a second volume greater than the preset volume. The noise reduction module determines whether noise reduction is needed based on the above determination results of the call audio and the media audio at the kernel layer.
[0169] After the noise reduction module determines whether noise reduction is needed, then, in the second half of the noise reduction method, the noise reduction module needs to determine whether to execute the action of occupying, not occupying, or stopping occupying the camera module 1 according to the above judgment result. Among them, when noise reduction is needed, the noise reduction module occupies the camera module 1; when noise reduction is not needed, the noise reduction module does not occupy the camera module 1; when noise reduction is stopped, the noise reduction module stops occupying the camera module 1. In the embodiment of the present application, two schemes of occupying the camera module 1 are described in detail.
[0170] First, the embodiment of the present application takes the software system of the layered architecture of the electronic device 100 as an example to illustrate the process of the first scheme of occupying the camera module 1.
[0171] In a possible embodiment, for example, as shown in the attached Fig.10As shown, in the process of powering on the electronic device 100, at the hardware abstraction layer, the camera module registers a first callback function for calling the first motor driver. After the noise reduction module has determined that noise reduction is needed, the noise reduction module calls the first callback function through the audio service of the application framework layer, and the noise reduction module sends a first message indicating the need for noise reduction to the camera service of the camera module at the application framework layer through the audio service of the application framework layer. The camera service sends the received first information to the camera manager at the hardware abstraction layer. Based on the received first information, the camera manager sends a second instruction for instructing the call of the first motor driver to the first motor driver in the camera driver at the kernel layer. After receiving the second instruction, the first motor driver performs noise reduction and occupies the camera module 1.
[0172] In the embodiment of the present application, the camera manager includes a camera providing interface and a camera motor providing interface. The camera providing interface is used to provide an interface to the camera service to call upward, maintain normal communication with the camera service, and provide communication with the camera motor downward. The camera motor providing interface is used to maintain normal communication with the camera providing interface upward, and control the camera drive through the interface downward.
[0173] In a possible embodiment, the audio service of the noise reduction module can directly send information through the camera manager to issue instructions. Fig.11 As shown, in the process of powering on the electronic device 100, in the hardware abstraction layer, the camera module registers a second callback function for calling the first motor driver. After the noise reduction module has determined that noise reduction is needed, the noise reduction module calls the second callback function through the audio service of the application framework layer. The noise reduction module sends the second information indicating the need for noise reduction to the camera manager of the camera module in the hardware abstraction layer through the audio service of the application framework layer. The camera providing interface sends the received second information to the camera motor providing interface in the hardware abstraction layer. The camera motor providing interface sends a third instruction for instructing the call of the first motor driver to the first motor driver in the camera driver in the kernel layer based on the received second information. After receiving the third instruction, the first motor driver performs noise reduction and occupies the camera module 1.
[0174] Since the camera motor providing interface has more than just the first motor driving service, the camera providing interface sends the third instruction to the first motor driving through the camera motor providing interface, which is a complex solution and will cause the operation of other services on the camera motor providing interface, resulting in high power consumption. In order to simplify the solution, in the embodiment of the present application, the camera providing interface may not send the third instruction to the first motor driving through the camera motor providing interface, but directly send the fourth instruction to the first motor driving.
[0175] In a possible embodiment, for example, as shown in the attached Fig.12 As shown, in the process of powering on the electronic device 100, in the hardware abstraction layer, the camera module registers a third callback function for calling the first motor driver. After the noise reduction module has determined that noise reduction is needed, the noise reduction module calls the third callback function through the audio service of the application framework layer. The noise reduction module uses the audio service of the application framework layer, and the camera provides an interface in the hardware abstraction layer of the camera module to send the third information indicating the need for noise reduction. The camera provides an interface that sends the received third information to the camera motor providing interface in the hardware abstraction layer. The camera motor provides an interface that sends a fourth instruction to the first motor driver in the camera driver to indicate the call of the first motor driver based on the received third information. After receiving the fourth instruction, the first motor driver performs noise reduction and occupies the camera module 1.
[0176] Since the first solution needs to call the first motor driver of the camera module through the audio service of the noise reduction module to perform noise reduction, it not only involves the communication between the processes in the two modules, but also involves the communication between software layers. During the communication process, the noise reduction module needs to apply for resources from the process of the camera module, and although the first solution only needs to call the first motor driver in the camera driver, it needs to call the entire camera driver during the calling process to make the entire camera module run, so it will cause a lot of power consumption and affect the user experience.
[0177] In order to reduce power consumption and improve user experience, the embodiment of the present application proposes the second solution. Further, the embodiment of the present application takes the software system of the layered architecture of the electronic device 100 as an example to illustrate the process of the second solution of occupying the camera module 1.
[0178] For example, as shown in the attached Fig.13 As shown, an independent second motor driver is added in the kernel layer, and the second motor driver is used to perform noise reduction when called by the noise reduction module, thereby occupying the camera module 1. Similarly, in the process of powering on the electronic device 100, a fourth callback function for calling the second motor driver is registered in the hardware abstraction layer. After the electronic device 100 has determined that noise reduction is required, the noise reduction module calls the fourth callback function through the audio manager of the hardware abstraction layer, and the audio manager sends a fifth instruction to the second motor driver in the kernel layer for instructing the call of the second motor driver. After receiving the fifth instruction, the second motor driver performs noise reduction and occupies the camera module 1.
[0179] On the one hand, since the first solution needs to issue instructions through the interface of the hardware abstraction layer, the information is sent by calling functions through the audio service of the application framework layer. The second solution is to issue instructions directly without going through interfaces. The farther the distance between layers is, the more information needs to be transmitted and the more complicated the solution is. Therefore, the instructions are issued by calling functions through the audio manager of the hardware abstraction layer.
[0180] On the other hand, when the camera module calls the first motor drive, the camera module 1 can be occupied. However, since the second solution is that the noise reduction module performs noise reduction by calling the newly added independent second motor drive, the camera module 1 can be occupied. In this way, for example, as shown in the attached Fig.13 As shown, when the noise reduction module preempts the camera module 1, a conflict will occur. In order to resolve the conflict, the noise reduction module and the camera module need to communicate with each other to understand the state of the motor 12 and the trigger conditions for the state transition of the noise reduction module and the camera module. Therefore, it is necessary to analyze several possible situations in which the noise reduction module preempts the camera module 1.
[0181] In the following embodiments of the present application, the state of the motor 12 and the triggering conditions for the state transition of the noise reduction module and the camera module are taken as examples to specifically illustrate several situations in which the noise reduction module of the present application preempts the camera module 1.
[0182] In the embodiment of the present application, for example, see the following Table 2 (wherein the first row and the first column respectively represent the state of the motor 12, the triggering conditions for the state transition of the noise reduction module and the camera module, and the actions when the triggering conditions for the state transition of the noise reduction module and the camera module are executed in the state of the motor 12. The second to fifth columns of the first row represent the triggering conditions for the state transition of the noise reduction module and the camera module, the second to fifth rows of the first column represent the state of the motor 12, and the remaining tables represent the actions when the triggering conditions for the state transition of the noise reduction module and the camera module are executed in the state of the motor 12. The camera module is in shooting mode, which means that the camera The module is about to take pictures and occupy camera module 1; the camera module is in stop shooting mode, which means the camera module is about to stop taking pictures and stop occupying camera module 1; the noise reduction module is in noise reduction mode, which means the noise reduction module is about to perform noise reduction and occupy camera module 1; the noise reduction module is in stop noise reduction mode, which means the noise reduction module is about to stop noise reduction and stop occupying camera module 1; the noise reduction module flag is power-on (audio_on), which means the noise reduction module is performing noise reduction and motor 12 is in power-on state; the noise reduction module flag is power-off (audio_off), which means the noise reduction module has stopped noise reduction and motor 12 is in power-off state.
[0183] Table 2 Corresponding actions of motor 12 when the noise reduction module and camera module states are switched
[0184]
[0185]
[0186] Referring to Table 2 above, according to the state sequence of the motor 12 from top to bottom in the first column, and according to the triggering conditions of the state transition of the noise reduction module and the camera module in the first row, the corresponding actions are as follows:
[0187] In the second row, according to the order of the second column to the fifth column in the same row, it can be known that: 1) when the motor 12 is in the power-off state, there are four situations:
[0188] 11) When the camera module is in shooting mode, it indicates that the camera module is about to shoot, occupying the camera module 1. At this time, the noise reduction module has no action, the camera module responds, the camera module shoots, occupies the camera module 1, and powers on the motor 12, and controls the movement of the lens 11 through the motor 12 according to the focus distance.
[0189] 12) When the camera module is in the stop shooting mode, it indicates that the camera module is about to stop shooting and stop occupying the camera module 1. Since the motor 12 itself is in a power-off state, the camera module has never been enabled to shoot from beginning to end, and there is no situation of stopping shooting, so this scene does not exist.
[0190] 13) When the noise reduction module is in the noise reduction mode, it indicates that the noise reduction module is about to perform noise reduction and occupy the camera module 1. At this time, the noise reduction module responds, and after the noise reduction module sets the flag bit to audio_on, the noise reduction module performs noise reduction, powers on the motor 12, and controls the lens 11 to leave the initial position through the motor 12; the camera module does not move.
[0191] 14) When the noise reduction module is in the stop noise reduction mode, it indicates that the noise reduction module is about to stop noise reduction and stop occupying the camera module 1. Since the motor 12 itself is in a power-off state, the noise reduction module has never enabled noise reduction from the beginning to the end, and there is no situation of stopping noise reduction. Therefore, this scene does not exist.
[0192] In the third row, according to the order of the second column to the fifth column in the same row, it can be known that: 2) when the motor 12 is in the running state where the noise reduction module is reducing noise, there are four situations:
[0193] 21) When the camera module is in shooting mode, it indicates that the camera module is about to shoot and occupy the camera module 1. Since the priority of the camera module is higher than that of the noise reduction module, the camera module needs the lens 11 to be in the initial position when occupying the camera module 1. Therefore, the noise reduction module needs to stop noise reduction first, control the lens 11 to move to the initial position through the motor 12, cut off the power of the motor 12, and then respond to the camera module. The camera module shoots, powers on the motor 12, and controls the movement of the lens 11 through the motor 12 according to the focus distance.
[0194] 22) When the camera module is in the stop shooting mode, it indicates that the camera module is about to stop shooting and stop occupying the camera module 1. Since the camera module has never started shooting from the beginning to the end, there is no situation of stopping shooting, so the scene does not exist.
[0195] 23) When the noise reduction module is in noise reduction mode, it indicates that the noise reduction module is about to perform noise reduction and occupy camera module 1. This is a scene where the noise reduction module performs repeated noise reduction, so the scene does not exist. Neither the noise reduction module nor the camera module is in action.
[0196] 24) When the noise reduction module is in the stop noise reduction mode, it indicates that the noise reduction module is about to stop noise reduction and stop occupying the camera module 1. This is a scenario where the noise reduction module switches from the noise reduction mode to the stop noise reduction mode. At this time, the noise reduction module sets the flag bit to audio_off, stops noise reduction, controls the lens 11 to move to the initial position through the motor 12, and cuts off the power to the motor 12; the camera module does not move.
[0197] In the fourth row, according to the order of the second column to the fifth column in the same row, it can be known that: 3) when the motor 12 is in the operating state where the camera module is shooting, there are four situations:
[0198] 31) When the camera module is in shooting mode, it indicates that the camera module is about to shoot, occupying camera module 1. This is a scene that the camera module repeatedly shoots, so this scene does not exist. The noise reduction module and the camera module are inactive.
[0199] 32) When the camera module is in the stop shooting mode, it indicates that the camera module is about to stop shooting and stop occupying the camera module 1. This is a scene where the camera module switches from the shooting mode to the stop shooting mode. Since the priority of the camera module is higher than that of the noise reduction module, it is necessary to consider the state of the noise reduction module, that is, whether the state bit is audio_on or audio_off.
[0200] When the status bit of the noise reduction module is audio_on, it indicates that the noise reduction module is reducing noise and the motor 12 is powered on. Since the lens 11 needs to return to the initial position before the noise reduction module can start working, the camera module is responded to first, and then the noise reduction module is responded to. The camera module stops shooting, controls the lens 11 to move to the initial position through the motor 12, and powers off the motor 12. Then the noise reduction module performs noise reduction, powers on the motor 12, and controls the lens 11 to leave the initial position through the motor 12.
[0201] When the status bit of the noise reduction module is audio_off, it indicates that the noise reduction module has stopped noise reduction and the motor 12 is in a power-off state. At this time, the noise reduction module has no action and directly responds to the camera module. The camera module stops shooting and controls the lens 11 to move to the initial position through the motor 12, and the motor 12 is powered off.
[0202] 33) When the noise reduction module is in noise reduction mode, it indicates that the noise reduction module is about to perform noise reduction and occupy camera module 1. The noise reduction module wants to occupy camera module 1. Since the priority of the camera module is higher than that of the noise reduction module, the noise reduction module only sets the flag bit to audio_on, and neither the noise reduction module nor the camera module takes any action;
[0203] 34) When the noise reduction module is in the stop noise reduction mode, it indicates that the noise reduction module is about to stop noise reduction and stop occupying camera module 1. When it is detected that the noise reduction module is about to stop noise reduction, since the priority of the camera module is higher than that of the noise reduction module, the camera module is occupying camera module 1 at this time, therefore, the noise reduction module only sets the flag bit to audio_off, and neither the noise reduction module nor the camera module takes any action.
[0204] From the above 12 situations, we can see that in many cases, the scene does not exist and there is no action. There are only five situations where there is action, as shown in the following example. Fig.14 As shown, it includes the following five situations S1-S5:
[0205] S1: When the motor 12 is in a power-off state, the camera module is in a shooting mode.
[0206] When the motor 12 is in a power-off state, when the camera module is in shooting mode and is about to shoot, occupying the camera module 1. At this time, the noise reduction module does not act, the camera module responds, the camera module shoots, occupies the camera module 1, and the motor 12 is powered on, and the lens 11 is controlled by the motor 12 to move and control the lens according to the focus distance. This situation belongs to the situation that the motor 12 responds to the camera module about to shoot and occupies the camera module 1 when it is in a power-off state. In this case, there is no conflict, and only the camera module responds.
[0207] S2: When the motor 12 is in a power-off state, the noise reduction module is in a noise reduction mode.
[0208] When the motor 12 is in a power-off state, when the noise reduction module is in the noise reduction mode and is about to perform noise reduction, occupying the camera module 1. At this time, the camera module does not act, the noise reduction module responds, the noise reduction module sets the flag bit to audio_on, and the noise reduction module performs noise reduction, and the motor 12 is powered on, and the lens 11 is controlled by the motor 12 to leave the initial position. This situation belongs to the situation that the motor 12 responds in the power-off state that the noise reduction module is about to perform noise reduction, and occupies the camera module 1. In this case, there is no conflict, and only the noise reduction module responds.
[0209] S3: When the motor 12 is in the running state where the noise reduction module is reducing noise, the camera module is in the shooting mode.
[0210] Specifically, when the camera module is about to shoot and occupies the camera module 1, it is detected that noise reduction is required and is being performed. Since the priority of the camera module is higher than that of the noise reduction module, the camera module needs to move the lens 11 to the initial position before it can start shooting. Therefore, the noise reduction module first stops noise reduction, controls the lens 11 to move to the initial position through the motor 12, and cuts off the power of the motor 12. Then, it responds to the camera module, and the camera module shoots, and the motor 12 is powered on. The movement of the lens 11 is controlled by the motor 12 according to the focus distance. In this case, there is a conflict, and the action is performed according to the priority. Since the priority of the camera module is higher than that of the noise reduction module, when responding to the action of the camera module, that is, starting the target application occupying the camera module 1, the electronic device 100 controls the lens 11 to move to the initial position through the motor 12, and cuts off the power of the motor 12. Then, the electronic device 100 powers on the motor 12 and controls the movement of the lens 11 through the motor 12 according to the focus distance.
[0211] S4: When the motor 12 is in the running state where the noise reduction module is reducing noise, the noise reduction module is in the stop noise reduction mode.
[0212] When the motor 12 is in the running state where the noise reduction module is performing noise reduction, the noise reduction module stops noise reduction at this time, which is a scenario where the noise reduction module switches from the noise reduction mode to the stop noise reduction mode. The noise reduction module sets the flag bit to audio_off, stops noise reduction, controls the lens 11 to move to the initial position through the motor 12, and cuts off the power to the motor 12; the camera module does not move. This situation is a situation where the noise reduction module switches from the noise reduction mode to the stop noise reduction mode, that is, the motor 12 is powered on and then off. In this case, there is no conflict, and only the noise reduction module responds.
[0213] S5: When the motor 12 is in the running state that the camera module is photographing, the camera module is in the stop photographing mode.
[0214] When the motor 12 is in the running state where the camera module is shooting, the camera module stops shooting at this time. This is a scenario where the camera module switches from shooting mode to stop shooting mode. Since the priority of the camera module is higher than that of the noise reduction module, it is necessary to consider the state of the noise reduction module at this time, that is, the state bit of the noise reduction module is audio_on or audio_off.
[0215] When the status bit of the noise reduction module is audio_on, it indicates that the noise reduction module is reducing noise and the motor 12 is powered on. Since the lens 11 needs to return to the initial position before the noise reduction module can start working, the camera module is responded to first, and then the noise reduction module is responded to. The camera module stops shooting, controls the lens 11 to move to the initial position through the motor 12, and turns off the power of the motor 12. Then the noise reduction module performs noise reduction, powers on the motor 12, and controls the lens 11 to leave the initial position through the motor 12. In this case, there is a conflict, and the action is performed according to the priority level. Since the priority of the camera module is higher than that of the noise reduction module, in response to closing the target application (the application occupying the camera module 1), or switching the target application to the background operation, and the electronic device 100 plays the first audio through the speaker 2 at the second volume, the electronic device 100 controls the lens 11 to move to the initial position through the motor 12, and turns off the power of the motor 12; then the electronic device 100 powers on the motor 12 and controls the lens 11 to leave the initial position through the motor 12.
[0216] When the status bit of the noise reduction module is audio_off, it indicates that the noise reduction module has stopped noise reduction and the motor 12 is in a power-off state. At this time, the noise reduction module has no action and directly responds to the camera module. The camera module stops shooting, controls the lens 11 to move to the initial position through the motor 12, and cuts off the power of the motor 12. In this case, there is a conflict, and actions are taken according to the priority. Since the priority of the camera module is higher than the priority of the noise reduction module, in response to closing the target application (the application occupying the camera module 1), or switching the target application to the background operation, and the electronic device 100 plays the first audio through the speaker 2 at the first volume or the electronic device 100 does not play the first audio through the speaker 2, the electronic device 100 controls the lens 11 to move to the initial position through the motor 12, and the motor 12 is powered off.
[0217] The two noise reduction schemes (the first scheme and the second scheme) provided in the embodiments of the present application can both power on the motor of the camera module to prevent the noise caused by the lens shaking and hitting the inner wall of the camera module when the speaker plays audio at a high volume, thereby improving the problem that the speaker plays audio at a high volume, thereby resonating with the lens in the camera module, causing the lens of the camera module to shake and hit the inner wall of the camera module, causing a lot of noise and affecting the user experience, thereby reducing the noise of the electronic equipment and improving the user experience.
[0218] It is understandable that, in order to implement 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. In this embodiment, the electronic device can be divided into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, which is only a logical function division, and there may be other division methods in actual implementation.
[0219] An embodiment of the present application also provides an electronic device, which may include one or more processors and memories.
[0220] The memory is coupled to the processor, and the memory is used to store instructions executable by the one or more processors. For example, the memory and the processor may be coupled together via a bus.
[0221] The memory stores computer program codes, which include computer instructions. When the computer instructions are executed by the processor, the electronic device executes the noise reduction method in the embodiment of the present application.
[0222] Among them, the processor can be a processor or a controller, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the present disclosure. The above-mentioned processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessors, and the like.
[0223] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The above bus may be divided into an address bus, a data bus, a control bus, etc.
[0224] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the processor executes the computer program code, the electronic device executes the relevant method steps in the method embodiment.
[0225] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the relevant method steps in the above method embodiment.
[0226] Among them, the electronic device, computer storage medium or computer program product provided in this application 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.
[0227] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0228] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0229] The units described above as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit. The functions of the above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0230] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that makes the contribution or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0231] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A noise reduction method, characterized in that: The method is applied to an electronic device, wherein the electronic device includes a camera module and a speaker, the camera module includes a motor and a lens, the motor is used to drive the lens to move, and the method includes: In response to a first operation, the electronic device does not power on the motor, and the lens is in an initial position; the first operation is used to control the speaker to play a first audio at a first volume; In response to a second operation, the electronic device powers on the motor and drives the lens to leave the initial position through the motor; the second operation is used to control the speaker to play the first audio at a second volume; the second volume is greater than the first volume.
2. The noise reduction method according to claim 1, characterized in that: In the case where the motor drives the lens to leave the initial position, the method further includes: In response to the first operation, the electronic device drives the lens to move to the initial position via the motor and cuts off power to the motor.
3. The noise reduction method according to claim 1, characterized in that: In the case where the motor drives the lens to leave the initial position, the method further includes: In response to a third operation, the electronic device drives the lens to move to the initial position through the motor and cuts off power to the motor; the third operation is used to control not playing the first audio through the speaker.
4. The noise reduction method according to claim 3, characterized in that: The not playing the first audio through the speaker includes: The electronic device stops playing the first audio through the speaker, or the electronic device plays the first audio through other devices.
5. The noise reduction method according to claim 1, characterized in that: In the case where the motor drives the lens to leave the initial position, the method further includes: In response to a fourth operation, the electronic device drives the lens to move to the initial position through the motor and cuts off the power of the motor; the fourth operation is used to control the start of a target application, and the target application is used to occupy the camera module; The electronic device powers on the motor and drives the lens to move through the motor according to the focus distance.
6. The noise reduction method according to claim 5, characterized in that: In the case where the motor is used to drive the lens to move according to the focus distance, the method further includes: In response to the fifth operation, the electronic device plays the first audio at the second volume through the speaker, the electronic device drives the lens to move to the initial position through the motor, and cuts off the power of the motor; the fifth operation is used to control closing the target application, or switching the target application to the background; The electronic device powers on the motor and drives the lens to leave the initial position through the motor.
7. The noise reduction method according to claim 5, characterized in that: In the case where the motor is used to drive the lens to move according to the focus distance, the method further includes: In response to the fifth operation, the electronic device plays the first audio at the first volume through the speaker or does not play the first audio through the speaker, the electronic device drives the lens to the initial position through the motor and cuts off power to the motor; the fifth operation is used to control the closing of the target application, or switch the target application to the background.
8. The noise reduction method according to any one of claims 1 to 7, characterized in that: The second volume is greater than a preset volume, and the first volume is less than or equal to the preset volume.
9. The noise reduction method according to any one of claims 1 to 8, characterized in that: The first audio includes music, ringing, alarm, video call or cellular call.
10. An electronic device, characterized in that: The electronic device comprises a memory and one or more processors, wherein the memory stores computer program code, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the noise reduction method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on the electronic device, the electronic device executes the noise reduction method according to any one of claims 1 to 9.
12. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device executes the noise reduction method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Camera module, control method of camera module, and electronic device
CN107734228A
Electronic equipment and damping method for electronic equipment
CN112565494A
Driving device, method and equipment for eliminating impact noise of lens and medium
CN114721108A
Cited By
Noise reduction method and electronic device
WO2026113502A1