Control method for camera module, accidental-touch prevention method, and related device

By controlling the power supply of the camera motor by detecting the operating power of the speaker, the resonance and impact problems of the camera module during vibration are solved, thus protecting the device and improving the photographic effect.

WO2026012271A1PCT designated stage Publication Date: 2026-01-15HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/106909
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-09
Filing Date
2025-07-03
Publication Date
2026-01-15

AI Technical Summary

Technical Problem

When electronic devices vibrate, the internal components of the camera module are prone to resonance and impact, resulting in abnormal noises and damage, which affects the photography effect.

Method used

By detecting the current and voltage signals of the speaker, it is determined whether its operating power exceeds the threshold. If it does, the camera motor is powered on to secure the internal components and prevent resonance.

Benefits of technology

It effectively suppresses resonance and impact of internal components in the camera module, protects the components from damage, and improves photography effects and lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025106909_15012026_PF_FP_ABST
    Figure CN2025106909_15012026_PF_FP_ABST
Patent Text Reader

Abstract

A control method for a camera module, an accidental-touch prevention method, and a related device, which can suppress the resonance of components within the camera module to the greatest extent when a loudspeaker of an electronic device plays sound, thereby avoiding abnormal noise and preventing damage to the components. The electronic device comprises a main chip, a loudspeaker module and a camera module, wherein the loudspeaker module comprises a Smart PA and a loudspeaker, and the camera module comprises a camera motor. The control method for a camera module comprises: a main chip controlling a loudspeaker to play sound; a Smart PA detecting a first signal of the loudspeaker, wherein the first signal comprises a first current signal and a second voltage signal; the Smart PA sending the first signal to the main chip; on the basis of the first signal, the main chip determining the current operating power of the loudspeaker; and after determining that the current operating power is greater than a first threshold value, the main chip controlling a camera motor to power on.
Need to check novelty before this filing date? Find Prior Art

Description

A control method, an anti-accidental touch method, and related equipment for a camera module.

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese Patent Application No. 202410913307.4, filed on July 9, 2024, entitled "A Control Method, Anti-accidental Touch Method and Related Equipment for a Camera Module", the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of terminal technology, and in particular to a control method, a method for preventing accidental touches, and related equipment for a camera module. Background Technology

[0004] Photography is a feature found in most electronic devices. Furthermore, to improve image quality, the camera module of an electronic device may include a camera motor to move the lens and achieve autofocus. When the camera motor is not powered on, the components inside the camera module (e.g., the lens) are in a loose state. In this state, if the electronic device vibrates, the components inside the camera module may shake and impact, producing abnormal noises and potentially damaging the components, thus affecting image quality. Summary of the Invention

[0005] This application provides a control method, an anti-accidental touch method, and related equipment for a camera module, which can suppress the resonance of internal components of the camera module when the electronic device vibrates (e.g., when a speaker plays sound), avoid abnormal noise, and protect the components from damage.

[0006] Firstly, a control method for a camera module is provided, applicable to electronic devices. Exemplarily, the electronic device may be a mobile phone, tablet computer, etc. The electronic device includes a main chip, a speaker module, and a camera module. The speaker module includes a smart power amplifier (Smart PA) and a speaker, and the camera module includes a camera. The method includes: the main chip controlling the speaker to play sound; the Smart PA detecting a first signal from the speaker, the first signal including a first current signal and a second voltage signal; the Smart PA sending the first signal to the main chip; the main chip determining the current operating power of the speaker based on the first signal; and the main chip controlling the camera motor to power on when it determines that the current operating power of the speaker is greater than a first threshold.

[0007] In this embodiment, the main chip can detect the current operating power of the speaker. If the current operating power of the speaker is greater than a first threshold, the camera motor is powered on. In this way, resonance of the internal components of the camera module due to speaker vibration can be avoided, thus preventing abnormal noise and protecting the internal components of the camera module from damage.

[0008] In one possible design, before powering on the camera motor, the method further includes: the main chip determining that the camera application in the electronic device is in a turned-off state.

[0009] In this embodiment, the main chip can detect the current operating power of the speaker. If the current operating power of the speaker is greater than a first threshold, and the camera application is currently off, then the camera motor is powered on. This is because when the camera application is off, autofocus is not required, so the camera motor is powered off. To prevent resonance of internal components in the camera module due to speaker vibration, the camera motor needs to be powered on to protect the components.

[0010] In one possible design, the method further includes: the main chip receiving a startup command from a camera application; the main chip stopping powering on the camera motor; and the main chip starting the camera application.

[0011] In this embodiment, after the main chip powers on the camera motor based on the speaker's current operating power, if it receives a camera application launch command, the main chip can stop powering on the camera motor to avoid interfering with the camera application's autofocus. After the camera application launches, it will power on the camera motor again to enable autofocus.

[0012] In one possible design, the Smart PA detects the first signal of the horn by: the Smart PA periodically detecting the first signal of the horn according to a detection cycle.

[0013] In this embodiment, the Smart PA can periodically detect the I / V signal of the speaker to monitor the current operating power of the speaker in real time. Once the current operating power of the speaker is greater than a first threshold, the camera motor is powered on to protect the internal components of the camera module from damage.

[0014] In one possible design, before the Smart PA periodically detects the first signal of the speaker according to a detection cycle, the method further includes: the main chip determining the detection cycle based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications; the main chip sending a notification message to the Smart PA, the notification message indicating the detection cycle.

[0015] In this embodiment, the main chip can determine an appropriate detection cycle based on the current operating state of the electronic device. For example, if the electronic device has a large remaining battery power, a shorter detection cycle can be used; if the remaining battery power is low, a longer detection cycle can be used to avoid rapid power loss. Similarly, if the electronic device is under high operating load, a longer detection cycle can be used to avoid increasing the load and causing operational lag; if the operating load is low, a shorter detection cycle can be used to accurately and in real-time monitor the speaker's current operating power. In short, this method ensures timely speaker detection while avoiding power waste.

[0016] In one possible design, the main chip determines a detection cycle based on the current operating state of the electronic device, including: the main chip determining a first application currently playing sound through the speaker; the main chip determining the detection cycle based on historical data of the first application, wherein the historical data reflects the frequency at which the speaker power reached the first threshold when the first application played sound through the speaker in the past.

[0017] In this embodiment, the main chip can determine the detection period of the speaker I / V signal based on historical data of the first application (the application currently playing sound through the speaker), so as to avoid the detection period being too long and thus not being timely, and the detection period being too short and thus wasting power.

[0018] In one possible design, the method further includes: the Smart PA detecting a second signal from the speaker, the second signal including a second current signal and a second voltage signal; the Smart PA sending the second signal to the main chip; the main chip determining the current operating power of the speaker based on the second signal; and the main chip stopping powering the camera motor when it determines that the current operating power is less than or equal to the first threshold.

[0019] In this embodiment, the main chip can detect the current operating power of the speaker in real time. If the current operating power of the speaker is less than a first threshold, it will stop powering the camera motor to avoid wasting power.

[0020] In one possible design, the electronic device includes a first storage space, which is detected by a camera motor driver chip in the electronic device. When the main chip determines that the current operating power is greater than a first threshold, it controls the camera motor to power on, including: when the main chip determines that the current operating power is greater than the first threshold, it writes first data into the first storage space; when the camera motor driver chip detects that the first data has been written into the first storage space, it controls the camera motor to power on.

[0021] In this embodiment, when the main chip determines that the current operating power of the speaker is greater than a first threshold, it writes first data into the first storage space. When the first data is detected by the camera motor driver chip, it controls the camera motor to power on, thereby preventing resonance of the internal components of the camera module due to speaker vibration and protecting the components.

[0022] In one possible design, the method further includes: the main chip updating the first data in the first storage space according to the current operating power of the speaker.

[0023] In this embodiment, the first data written to the first storage space differs depending on the current operating power of the speaker. This allows the camera motor driver chip to read different first data and then apply different currents to the camera motor coil based on the different first data, flexibly adjusting the current magnitude and improving the accuracy of camera module control.

[0024] In one possible design, controlling the power-on of the camera motor includes: controlling the coil of the camera motor to pass a first current, the first current being positively correlated with the current operating power of the speaker.

[0025] In this embodiment, if the current operating power of the speaker is high, a larger current is supplied to the coil of the camera motor to avoid the current being too small, resulting in insufficient torque from the camera motor to protect the device; if the current operating power of the speaker is low, a smaller current is supplied to the coil of the camera motor to avoid excessive power consumption due to a large current.

[0026] Secondly, a control method for a camera module is also provided, applicable to a main chip. The main chip is connected to a speaker module and a camera module respectively. The speaker module includes a Smart PA and a speaker, and the camera module includes a camera motor. The method includes: the main chip controlling the speaker to play sound; the main chip receiving a first signal sent by the Smart PA, the first signal including a first current signal and a first voltage signal from the speaker; the main chip determining the current operating power of the speaker based on the first signal; and the main chip controlling the camera motor to power on when the current operating power is greater than a first threshold.

[0027] In one possible design, before powering on the camera motor, the method further includes: the main chip determining that the camera application in the electronic device is in a turned-off state.

[0028] In one possible design, the method further includes: the main chip receiving a startup command from a camera application; the main chip stopping powering on the camera motor; and the main chip starting the camera application.

[0029] In one possible design, the method further includes: the main chip determining a detection cycle for the speaker based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications; the main chip sending a notification message to the Smart PA, the notification message indicating the detection cycle.

[0030] In one possible design, the main chip determines a detection cycle based on the current operating state of the electronic device, including: the main chip determining a first application currently playing sound through the speaker; the main chip determining the detection cycle based on historical data of the first application, wherein the historical data reflects the frequency at which the speaker power reached the first threshold when the first application played sound through the speaker in the past.

[0031] In one possible design, the method further includes: the main chip receiving a second signal sent by the Smart PA, the second signal including a second current signal and a second voltage signal of the speaker; the main chip determining the current operating power of the speaker based on the second signal; and the main chip stopping powering the camera motor when it determines that the current operating power is less than or equal to the first threshold.

[0032] In one possible design, the electronic device includes a first storage space, which is detected by a camera motor driver chip in the electronic device. When the main chip determines that the current operating power is greater than a first threshold, it controls the camera motor to power on, including: when the main chip determines that the current operating power is greater than the first threshold, it writes first data into the first storage space; when the camera motor driver chip detects that the first data has been written into the first storage space, it controls the camera motor to power on.

[0033] In one possible design, the method further includes: the main chip updating the first data in the first storage space according to the current operating power of the speaker.

[0034] In one possible design, controlling the power-on of the camera motor includes: controlling the coil of the camera motor to pass a first current, the first current being positively correlated with the current operating power of the speaker.

[0035] Thirdly, a control method for a camera module is also provided, applicable to a Smart PA, which is connected to a speaker and a main chip. The method includes: the Smart PA detecting a first signal from the speaker, the first signal including a first current signal and a first voltage signal; the Smart PA sending a first signal to the main chip, the first signal used to determine the current operating power of the speaker, the current operating power used to decide whether to power on the camera motor.

[0036] In one possible design, the current operating power is used to decide whether to power on the camera motor, including: powering on the camera motor when the current operating power is greater than a first threshold; and stopping powering on the camera motor when the current operating power is less than or equal to the first threshold.

[0037] In one possible design, the Smart PA detects the first signal of the horn by: the Smart PA periodically detecting the first signal of the horn according to a detection cycle.

[0038] In one possible design, before the Smart PA periodically detects the first signal of the speaker according to a detection cycle, the method further includes: the Smart PA receiving a notification message sent by the main chip, the notification message indicating the detection cycle, the detection cycle being determined based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications.

[0039] Fourthly, a method for preventing accidental touches is also provided, applicable to electronic devices. For example, the electronic device may be a mobile phone, tablet computer, etc. The electronic device includes a main chip, a speaker module, and an accelerometer sensor. The speaker module includes a smart power amplifier (Smart PA) and a speaker. The method includes: the main chip controlling the speaker to play sound; the Smart PA detecting a first signal from the speaker, the first signal including a first current signal and a first voltage signal; the Smart PA sending the first signal to the main chip; the main chip determining the current operating power of the speaker based on the first signal; and when the main chip determines that the current operating power is greater than a first threshold, increasing the acceleration threshold value of the accelerometer sensor. The acceleration threshold value is used to trigger the main chip to execute a first response action when the first acceleration collected by the accelerometer sensor is greater than or equal to the acceleration threshold value.

[0040] In this embodiment, it is considered that the electronic device will vibrate during the sound playback process of the speaker. When the electronic device vibrates, the accelerometer will collect the acceleration. If the acceleration reaches a threshold value, it will trigger the electronic device to respond. It should be understood that this triggering is a false triggering caused by speaker vibration. To avoid false triggering, in this embodiment, the main chip can detect the current operating power of the speaker. If the current operating power of the speaker is greater than a first threshold, the acceleration threshold value of the accelerometer will be increased to avoid false triggering.

[0041] In one possible design, the first response action includes at least one of: taking a screenshot, switching between portrait and landscape modes, and counting steps.

[0042] In one possible design, the Smart PA detects the first signal of the horn by: the Smart PA periodically detecting the first signal of the horn according to a detection cycle.

[0043] In one possible design, before the Smart PA periodically detects the first signal of the speaker according to a detection cycle, the method further includes: the main chip determining the detection cycle based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications; the main chip sending a notification message to the Smart PA, the notification message indicating the detection cycle.

[0044] In one possible design, the main chip determines a detection cycle based on the current operating state of the electronic device, including: the main chip determining a first application currently playing sound through the speaker; the main chip determining the detection cycle based on historical data of the first application, wherein the historical data reflects the frequency at which the speaker power reached the first threshold when the first application played sound through the speaker in the past.

[0045] In one possible design, the method further includes: the Smart PA detecting a second signal of the horn, the second signal including a second current signal and a second voltage signal; the Smart PA sending the second signal to the main chip; the main chip determining the current operating power of the horn based on the second signal; and the main chip restoring the acceleration threshold value of the accelerometer when it determines that the current operating power is less than or equal to the first threshold.

[0046] In this embodiment, the main chip can detect the current operating power of the horn in real time. If the current operating power of the horn is greater than a first threshold, the acceleration threshold of the accelerometer is increased to avoid false triggering. If the current operating power of the horn is less than or equal to the first threshold, the acceleration threshold of the accelerometer is restored to respond to acceleration in a timely manner.

[0047] Fifthly, a method for preventing accidental touches is also provided, applicable to a main chip. The main chip is connected to a speaker module and an accelerometer, respectively. The speaker module includes a Smart PA and a speaker. The method includes: the main chip controlling the speaker to play sound; the main chip receiving a first signal sent by the Smart PA, the first signal including a first current signal and a first voltage signal from the speaker; the main chip determining the current operating power of the speaker based on the first signal; and when the main chip determines that the current operating power is greater than a first threshold, increasing the acceleration threshold value of the accelerometer. The acceleration threshold value is used to trigger the main chip to execute a first response action when the first acceleration collected by the accelerometer is greater than or equal to the acceleration threshold value.

[0048] In one possible design, the first response action includes at least one of: taking a screenshot, switching between portrait and landscape modes, and counting steps.

[0049] In one possible design, the method further includes: the main chip determining a detection cycle based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications; the main chip sending a notification message to the Smart PA, the notification message indicating the detection cycle.

[0050] In one possible design, the main chip determines a detection cycle based on the current operating state of the electronic device, including: the main chip determining a first application currently playing sound through the speaker; the main chip determining the detection cycle based on historical data of the first application, wherein the historical data reflects the frequency at which the speaker power reached the first threshold when the first application played sound through the speaker in the past.

[0051] In one possible design, the method further includes: the main chip receiving a second signal sent by the Smart PA, the second signal including a second current signal and a second voltage signal of the speaker; the main chip determining the current operating power of the speaker based on the second signal; and the main chip restoring the acceleration threshold value of the accelerometer when it determines that the current operating power is less than or equal to the first threshold.

[0052] Sixthly, a method for preventing accidental touches is also provided, applicable to a Smart PA (Smart Power Amplifier). The Smart PA is connected to a speaker and a main chip, respectively, and the main chip is connected to an accelerometer. The method includes: the Smart PA detecting a first signal from the speaker, the first signal including a first current signal and a first voltage signal; the Smart PA sending a first signal to the main chip, the first signal used to determine the current operating power of the speaker, the current operating power used to adjust the acceleration threshold value of the accelerometer, the acceleration threshold value used to trigger the main chip to execute a first response action when the first acceleration collected by the accelerometer is greater than or equal to the acceleration threshold value.

[0053] In one possible design, the current operating power is used to adjust the acceleration threshold of the accelerometer, including: when the current operating power is greater than a first threshold, the acceleration threshold of the accelerometer is increased; when the current operating power is less than or equal to the first threshold, the acceleration threshold of the accelerometer is restored.

[0054] In one possible design, the first response action includes at least one of: taking a screenshot, switching between portrait and landscape modes, and counting steps.

[0055] In one possible design, the Smart PA detects the first signal of the horn by: the Smart PA periodically detecting the first signal of the horn according to a detection cycle.

[0056] In one possible design, before the Smart PA periodically detects the first signal of the speaker according to a detection cycle, the method further includes: the Smart PA receiving a notification message sent by the main chip, the notification message indicating the detection cycle; the detection cycle is determined based on the current operating state of the electronic device, the current operating state including at least one of current operating load, current remaining battery power, and currently running applications.

[0057] In a seventh aspect, an electronic device is also provided, comprising: a main chip, a speaker module, and a camera module, wherein the speaker module includes a Smart PA and a horn, and the camera module includes a camera motor; wherein,

[0058] The main chip is used to perform the method described in the second aspect above;

[0059] The Smart PA is used to perform the method described in the third aspect above.

[0060] Eighthly, an electronic device is also provided, comprising: a main chip, a speaker module, and an accelerometer sensor; the speaker module includes a Smart PA and a horn; and the accelerometer sensor is used to collect acceleration.

[0061] The main chip is used to perform the method described in the fifth aspect above;

[0062] The Smart PA is used to perform the method described in the sixth aspect above.

[0063] Ninthly, a chip is also provided, which is capable of performing the method as described in the second aspect above, or capable of performing the method as described in the fifth aspect above.

[0064] In a tenth aspect, a power amplifier is also provided, which is capable of performing the method as described in the third aspect above; or, is capable of performing the method as described in the sixth aspect above.

[0065] Eleventhly, a computer-readable storage medium is also provided for storing a computer program that, when run on a computer, causes the computer to perform the methods provided in any one of the first, second, third, fourth, fifth, or sixth aspects described above.

[0066] In a twelfth aspect, a computer program product is also provided, comprising a computer program that, when run on a computer, causes the computer to perform the methods provided in any of the first, second, third, fourth, fifth, or sixth aspects described above.

[0067] For the technical effects that can be achieved in the second to twelfth aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the first aspect mentioned above. This application will not repeat them here. Attached Figure Description

[0068] Figure 1 is a schematic diagram of an electronic device provided in an embodiment of this application;

[0069] Figure 2 is a schematic diagram of a camera module provided in an embodiment of this application;

[0070] Figure 3 is a flowchart illustrating a control method for a camera module provided in an embodiment of this application;

[0071] Figure 4 is another schematic diagram of an electronic device provided in an embodiment of this application;

[0072] Figure 5 is another schematic diagram of an electronic device provided in an embodiment of this application;

[0073] Figure 6 is a schematic diagram of the process for preventing accidental triggering provided in an embodiment of this application;

[0074] Figure 7 is another schematic diagram of an electronic device provided in an embodiment of this application;

[0075] Figure 8 is another schematic diagram of an electronic device provided in an embodiment of this application;

[0076] Figure 9 is another schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0077] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0078] The embodiments of this application involve at least one, including one or more; where "multiple" means two or more. Furthermore, it should be understood that in the description of this specification, terms such as "first," "second," and "third" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order. For example, the first node and the second node do not represent the degree of importance or order of the two, but are merely for descriptive distinction. In the embodiments of this application, "and / or" merely describes the relationship, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0079] The directional terms mentioned in the embodiments of this application, such as "up", "down", "left", "right", "inner", and "outer", are only for reference to the directions in the accompanying drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of this application, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0080] References to "one embodiment," "in some examples," or "some embodiments" as described in the embodiments of this application mean that one or more embodiments of this specification include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in some examples," "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0081] The technical solutions provided in this application are applicable to electronic devices. The electronic device can be any device with a camera module and a speaker module. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, personal computer (PC), ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other portable devices; or it can be a wearable device such as a watch or bracelet; or it can be an in-vehicle device mounted in a vehicle; or it can be a virtual reality (VR) device, augmented reality (AR) device, mixed reality (MR) device, etc. In short, this application does not limit the specific type of electronic device. The operating system (OS) of the electronic device can be any type of operating system, such as Android. System, HarmonyOS system, system, system, system, system, system, Systems, etc.

[0082] Please refer to Figure 1, which is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device includes a main chip, a camera module, and a speaker module.

[0083] A camera module is used to realize the photographic function of an electronic device. For example, as shown in Figure 1, a camera module may include a lens assembly and a camera motor. It should be noted that only two components related to the embodiments of this application are listed here. In fact, a camera module may include more components, such as a photosensitive element, a flash, and other components. The lens assembly includes one or more lenses. The lens assembly may be a movable design. For example, the lens assembly can move its position under the control of the camera motor to achieve autofocus. Optionally, the movement of the lens assembly may include 2-axis translation, 3-axis translation, 5-axis translation, 6-axis translation, etc., which are not limited in the embodiments of this application. 2-axis translation may include translation in the x-axis and y-axis directions. 3-axis translation may include translation in the x-axis, y-axis, and z-axis directions. 5-axis translation may include translation in the x-axis and y-axis directions, as well as translation along the pitch axis, yaw axis, and roll axis. Six-axis translation can include translation along the x, y, and z axes, as well as translation along the pitch, yaw, and roll axes. A camera motor controls the movement of the lens assembly to achieve autofocus. Optionally, the camera motor can be a mechanical motor, an electronically actuated motor, a ring ultrasonic motor, a voice coil motor (VCM), etc., without limitation. For ease of understanding, this text primarily uses a voice coil motor (VCM) as an example. For example, please refer to Figure 2, which is a schematic diagram of a camera module. The camera module includes a voice coil motor (VCM) and a lens carrier. The voice coil motor (VCM) includes a motor coil and magnetic components. The motor coil is wound around the outer surface of the lens carrier. Magnetic components are fixed on both sides of the lens carrier. Magnetic components can include S-class and N-class magnetic components for generating a magnetic field. The lens carrier is connected to an upper and lower spring sheet, respectively. The upper and lower spring sheets are elastic and deformable. When no current flows through the motor coil, the internal components of the camera module (e.g., the lens carrier) are in a loose state, also known as a non-secured state. When current flows through the motor coil, the internal components of the camera module (e.g., the lens carrier) are in a secured state. This is because when current flows through the motor coil, under the electromagnetic induction of the magnetic components, the motor coil generates torque. This torque causes the spring sheets (e.g., the upper and lower spring sheets) to stretch, thereby moving the lens carrier to a position, for example, moving the lens carrier to the base position and pressing it tightly against the base, thus securing the lens carrier. When no current flows through the motor coil, the magnetic components do not generate electromagnetic induction, so the motor coil does not generate torque, and the spring sheets (e.g., the upper and lower spring sheets) are not stretched. Therefore, the lens carrier is prone to wobbling, i.e., in a non-secured or loose state. It should be noted that Figure 2 is only an example of a camera module and is not a limitation on the camera module. The camera module may have other structures, and the embodiments of this application are not limited thereto.

[0084] A speaker module is used to implement the audio playback function of an electronic device. For example, as shown in Figure 1, a speaker module may include a power amplifier (PA) and a speaker. It should be noted that only two devices related to the embodiments of this application are listed here. In fact, a speaker module may include more devices, which are not listed in this embodiment. In addition, Figure 1 shows the power amplifier located inside the camera module as an example. Optionally, the power amplifier may also be located outside the speaker module, for example, the power amplifier may be integrated into the main chip. For ease of understanding, the text mainly uses the example of the power amplifier being located inside the speaker module. In order to meet the concept of thin and light electronic devices, the speaker may be a small speaker (also called a mini speaker). The power amplifier can be used to drive the small speaker to emit a louder sound. For example, the power amplifier can increase the power of the audio signal to be played, and the loudness of the audio signal after the power increase is increased when played through the speaker. Optionally, the power amplifier increasing the power of the audio signal to be played may include: the power amplifier converting the audio signal to be played from a digital signal to an analog signal, and performing a boost process on the analog signal, and the power of the signal after the boost process is increased. In this embodiment, the power amplifier can be a smart power amplifier (smart PA) or other power amplifiers, without limitation. This article mainly uses a smart PA as an example for illustration. The smart PA has a current / voltage (I / V) feedback function for real-time detection of the speaker's I / V signal. The I / V signal includes an I signal and a V signal. The I signal is used to indicate the speaker's operating current. The V signal is used to indicate the speaker's operating voltage. In this embodiment, the smart PA can send the speaker's I / V signal to the main chip. The main chip can calculate the speaker's current operating power based on the I and V signals. The main chip can compare the speaker's current operating power with a power threshold. If it is higher than the power threshold, the camera motor is powered on to keep the internal components of the camera module in a secure state, thereby suppressing resonance in the camera module.

[0085] The main chip, responsible for processing various tasks within an electronic device, can be understood as the nerve center and command center of the device. For example, the main chip can be a system-on-chip (SOC). For instance, the main chip may include one or more processors. Specifically, it may integrate one or more of the following processors: Central Processing Unit (CPU), Image Signal Processor (ISP), Digital Signal Processor (DSP), Application Processor (AP), Modem Processor, Graphics Processing Unit (GPU), Baseband Processor, and Neural-Network Processing Unit (NPU). The main chip can run various applications (APPs), such as instant messaging applications, camera applications, audio playback applications, and video playback applications. The main chip is connected to the camera module and speaker model, respectively. For example, the main chip can receive the I / V signal sent by the smart PA and determine the current operating power of the speaker based on the I / V signal. If the current operating power is higher than the power threshold, the main chip can control the camera motor to power on so that the internal components of the camera module are in a tight state to suppress the resonance of the camera module.

[0086] The following text continues to use the electronic device shown in Figure 1 as an example to illustrate the technical solution provided by the embodiments of this application.

[0087] As mentioned earlier, when the camera motor is not powered on (i.e., no current flows through the motor coil), the internal components of the camera module are in a loose or unsecured state. In this state, if the electronic device vibrates, the internal components of the camera module (e.g., the lens carrier) will be driven and collide with the inner wall, producing abnormal noise and potentially damaging the components, affecting the lifespan of the camera module and the image quality. Vibration in electronic devices can be caused by various reasons, such as receiving incoming calls or new messages, or the speaker playing sound. Other reasons exist, but will not be listed here. This article primarily focuses on vibration caused by the speaker playing sound.

[0088] To protect the camera module from damage during speaker playback, one solution involves the electronic device continuously monitoring the volume. If the volume exceeds a preset level, the camera motor is powered on to keep the module secure. However, this solution is not suitable for all electronic devices. For example, some devices have high-performance speakers that vibrate only slightly at higher volumes, preventing resonance in the camera module. Because the volume has reached the preset level, the device may mistakenly interpret this as a power-up, resulting in wasted power. Conversely, some devices have inferior speakers that produce strong vibrations at lower volumes, causing resonance in the camera module. Because the volume is below the preset level, the device may mistakenly interpret this as a power-up, leading to collisions between internal components and reduced lifespan. Therefore, the aforementioned method of comparing the volume to a preset level to determine motor power is inaccurate.

[0089] To improve accuracy, this application provides a control method for a camera module. For example, during the process of a speaker playing sound, the electronic device can detect the current operating power of the speaker in real time. If the current operating power is greater than a power threshold, the camera motor is powered on to prevent collisions between internal components of the camera module. In other words, in this application embodiment, the electronic device determines whether to power on the camera motor based on the speaker's power level. Compared to volume level, speaker power can more accurately reflect the intensity of speaker vibration. Therefore, the technical solution provided in this application embodiment can improve the accuracy of camera motor control.

[0090] The implementation principle of the camera module control method provided in the embodiments of this application is described below with reference to the accompanying drawings.

[0091] For example, please refer to Figure 3, which is a flowchart illustrating a control method for a camera module according to an embodiment of this application. This method can be applied to the electronic device shown in Figure 1, optionally including the camera module shown in Figure 2. As shown in Figure 3, the process includes:

[0092] S300, sound is playing from the speaker.

[0093] It is understood that S300 may include: a main chip controlling a speaker to play sound. For example, a first application runs on the main chip, and in response to a trigger condition (a trigger condition used to trigger the first application to play sound), the main chip controls the speaker to play the sound of the first application. The first application can be any application with sound playback requirements, such as an audio playback application (e.g., ), video playback applications (e.g. ), short video applications (e.g. Of course, it can also be used in other applications, such as instant messaging applications (e.g., SMS, phone calls, etc.). In short, the type of the first application is not limited in the embodiments of this application. Furthermore, the first application can be a third-party application or a system application, without limitation. As mentioned above, when the main chip runs the first application, it controls the speaker to play the sound of the first application in response to a trigger condition. The first application is... For example, the triggering condition may include receiving an operation to play a song in the first application. If the first application is an SMS application, the triggering condition may include receiving a new message. If the first application is a phone application, the triggering condition may include receiving an incoming call.

[0094] The S301 Smart PA monitors the speaker's I / V signals in real time. The I / V signals include the I signal (current signal) and the V signal (voltage signal).

[0095] The implementation principle of the Smart PA's detection of the speaker's I / V signals will not be explained in detail in this article. For example, the Smart PA includes a detection circuit for detecting the speaker's I / V signals.

[0096] In some embodiments, the Smart PA can periodically detect the I / V signal of the speaker according to a certain detection cycle. It should be understood that the detection cycle should not be too long or too short. If the detection cycle is too long, i.e., the detection frequency is too low, the I / V signal of the speaker will not be detected in time, resulting in untimely protection of the camera module. If the detection cycle is too short, i.e., the detection frequency is too high, it will consume more power, which may affect normal user operation. One possible approach is that the Smart PA can determine a suitable detection cycle before detecting the I / V signal of the speaker, and then periodically detect the I / V signal of the speaker based on the determined detection cycle. Optionally, the Smart PA determining the detection cycle can include two cases. Case 1: The Smart PA determines the detection cycle itself. Case 2: The main chip determines the detection cycle and then sends a notification message to the Smart PA to notify it of the detection cycle. The following will use Case 2 as an example to illustrate several ways the main chip determines the detection cycle. It should be noted that the methods for determining the detection cycle listed below can also be applied to Case 1.

[0097] Method 1: Determine the detection cycle based on the currently running application. The currently running application is the one currently playing sound through the speaker. As mentioned in S300, when the main chip runs the first application, it controls the speaker to play the sound of the first application in response to a trigger condition. Therefore, the currently running application is the first application. Thus, the main chip can determine the detection cycle based on the first application.

[0098] One possible approach is that the electronic device stores an application list, which includes the identifiers of one or more applications. These applications are those that have historically "used the speaker to play sound with a power level exceeding a power threshold." Optionally, the application list also includes the number or frequency of times these applications have historically "used the speaker to play sound with a power level exceeding a power threshold." For example, "historically" can be understood as a time period of a preset duration, such as 1 day, 2 days, 12 hours, etc., without limitation. For example, the application list can be seen in Table 1 below:

[0099] Table 1: Application List

[0100] The main chip can determine the detection cycle based on the first application and the application list (e.g., Table 1 above). One possible approach is for the main chip to determine if the identifier of the first application exists in the application list (e.g., Table 1 above). If it exists, the detection cycle is determined to be the first cycle; if it does not exist, the detection cycle is determined to be the second cycle, with the first cycle being longer than the second cycle. In other words, a higher detection cycle can be used for applications in the application list to protect the camera module in a timely manner; a lower detection cycle can be used for applications not included in the application list to avoid excessive power consumption due to frequent detection. Another possible approach is for the main chip to determine if the identifier of the first application exists in the application list (e.g., Table 1 above). If it exists, the number of times the first application has historically "used the speaker to play sound and the speaker power is higher than the power threshold" can be determined from the application list, and then the detection cycle is determined based on this number. For example, the electronic device may also store a correspondence between the number of times "used the speaker to play sound and the speaker power is higher than the power threshold" has historically occurred and the detection cycle. For example, the correspondence can be found in Table 2 below:

[0101] Table 2:

[0102] Therefore, after the electronic device determines the number of times in the history of the first application that "sound was played using a speaker and the speaker power was higher than the power threshold", it determines the corresponding detection period based on the number of times and the above correspondence (e.g., Table 2 above).

[0103] Method 2: Determine the detection cycle based on the current operating load. For example, the current operating load can be described by at least one of CPU utilization and memory resource utilization. For instance, when the current operating load is high, a shorter detection cycle can be used to avoid increasing the load and causing device lag; when the current operating load is low, a longer detection cycle can be used to protect the camera module in a timely manner. One possible approach is that the electronic device stores a correspondence between the current operating load and the detection cycle, and the electronic device determines the detection cycle based on the current operating load and the correspondence.

[0104] Method 3: Determine the detection cycle based on the current remaining battery power. For example, when the remaining battery power is high, a longer detection cycle can be used to protect the camera module in a timely manner; when the remaining battery power is low, a shorter detection cycle can be used to prevent the device from shutting down due to rapid power consumption. One possible approach is to store a correspondence between the current remaining battery power and the detection cycle in the electronic device, and then determine the detection cycle based on the current remaining battery power and this correspondence.

[0105] Method 4: Determine the testing cycle based on system configuration. In other words, the testing cycle is pre-configured by the system, such as the default configuration when the electronic device leaves the factory, or the default configuration when the Smart PA leaves the factory.

[0106] Method 5: Determine the detection cycle based on user operation. That is, the detection cycle can be set by the user. For example, the electronic device can provide a setting entry for setting the detection cycle of the speaker's I / V signals. This setting entry can be located anywhere within the electronic device, such as in the device's settings application, the control center, or the negative one screen; this embodiment does not limit the location.

[0107] The above lists five methods for determining the detection cycle. In practical applications, other methods can also be used to determine the detection cycle, which will not be listed in detail in this application. Furthermore, the above five methods can be used individually or in combination. For example, method one can be combined with any one of methods two through five. Taking the combination of method one and method two as an example, the electronic device prioritizes method one, that is, determining whether the currently running application is in the application list (e.g., Table 1 above). If the electronic device determines that the currently running application does not exist in the application list, then method two is used, that is, determining the detection cycle based on the current operating load.

[0108] S302, the Smart PA sends the speaker's I / V signals to the main chip.

[0109] S303, the main chip determines the current operating power of the speaker based on the speaker's I / V signal.

[0110] As mentioned earlier, I / V signals can include current signals and voltage signals. The main chip can calculate the speaker's current operating power, which is the product of current and voltage, based on the current and voltage signals.

[0111] In step S304, the main chip determines whether the speaker's current operating power exceeds the power threshold. If so, it executes step S305; otherwise, it continues with step S304.

[0112] In some embodiments, the power threshold can be a fixed value, such as an empirical value. For example, before an electronic device leaves the factory, it can be tested how much speaker power will cause the camera module to resonate. The tested speaker power is the power threshold, and the power threshold is stored in the electronic device.

[0113] S305, the main chip, controls the power-on of the camera motor.

[0114] Optionally, S305 may include: supplying a first current to the motor coil. As mentioned above, when current is supplied to the motor coil, under the electromagnetic induction of the magnetic device, the motor coil generates torque, causing the spring sheet to stretch, thereby moving the lens carrier. It should be understood that the larger the current supplied to the motor coil, the greater the torque generated, and the more secure the lens carrier, but the more power is consumed. In order to have sufficient torque without excessive power consumption, the main chip can determine the magnitude of the first current before supplying it to the motor coil. Optionally, the determination of the first current may include at least one of the following methods.

[0115] Method 1: Determine the first current based on the speaker's current operating power. For example, when the speaker's current operating power is high, the first current is larger to ensure sufficient torque; when the speaker's current operating power is low, the first current is smaller to avoid wasting power. For example, the electronic device can store the correspondence between speaker power and current values. An example of this correspondence is shown in Table 3 below:

[0116] Table 3: Correspondence between speaker power and camera motor coil current

[0117] Therefore, after determining the current operating power of the speaker, the electronic device determines the first current based on the current operating power of the speaker and the above correspondence (for example, Table 3 above).

[0118] Method 2: Determine the first current based on the target position of the lens carrier. The target position is the final position the lens carrier needs to move to. For example, the target position could be a position close to the base or another position. The electronic device can store the correspondence between target positions and currents, and based on this correspondence, the first current corresponding to the target position of the lens carrier can be determined.

[0119] Method 3: Determine the first current based on the system configuration. In other words, the first current is pre-configured by the system, for example, it's configured before the electronic device leaves the factory.

[0120] The above lists several ways to determine the first current. In practical applications, other methods can also be used to determine the first current, which will not be listed one by one in the embodiments of this application.

[0121] As mentioned earlier, the camera motor is used to enable autofocus in the camera application. To avoid interfering with the normal operation of the camera application, optionally, before S305, the main chip can determine whether the camera application is currently running. If the camera application is not currently running, S305 is executed; if the camera application is currently running, S305 is not executed. This is because when the camera application is running, the camera motor is already powered on and used for autofocus, so S305 is not required.

[0122] Optionally, after S305, if the main chip determines that the conditions are met, it can stop powering on the camera motor. Optionally, the conditions may include:

[0123] Condition a: A startup command from the camera application is received. This is because starting the camera application requires handing over control of the camera motor to the application for autofocus. Therefore, when the main chip receives the startup command from the camera application, it stops powering on the camera motor. After the main chip starts the camera application, the camera application can then power on the camera motor again to achieve autofocus.

[0124] Condition b: Determine that the speaker's current operating power decreases to less than or equal to the power threshold. As mentioned earlier, the Smart PA periodically detects the speaker's IV / signal according to the detection cycle, so the main chip can determine the speaker's current operating power in real time. Once the speaker's current operating power is less than or equal to the power threshold, it stops powering the camera motor to avoid wasting power.

[0125] Figure 4 is another schematic diagram of an electronic device provided in one embodiment of this application. If Figure 1 above is understood as a schematic diagram of the hardware structure of the electronic device, Figure 4 can be understood as a schematic diagram of the software structure of the electronic device. As shown in Figure 4, the software system of the electronic device can adopt a layered architecture, and of course, it can also adopt an event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which are not limited in this embodiment. The text uses a layered architecture as an example for explanation. A layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. As shown in Figure 4, the electronic device includes five layers, from top to bottom: application (APP) layer, application framework (FWK) layer, hardware abstraction layer (HAL), kernel layer, and hardware layer. It should be noted that Figure 4 uses five layers as an example. In actual applications, the electronic device can include more or fewer layers, and the positional relationship between the layers can be adjusted. The modules contained in each layer can also be moved to other layers. In addition, the name of each layer is not limited in this embodiment.

[0126] As shown in Figure 4, the software system of an electronic device can include two parts: the left half is the audio part, and the right half is the camera part. Each part can include one or more software modules, which are deployed in one or more of the five layers shown in Figure 4. For example, the audio part includes a first application, audio services, a Smart PA driver, Smart PA, a speaker, and a Smart PA algorithm, which are deployed in different layers. The camera part includes a camera application, a first node, a second node, a camera motor driver, a camera motor, etc., which are also deployed in different layers.

[0127] As shown in Figure 4, the application layer may include one or more applications, such as a first application and a camera application. The first application may be an application that requires playing sound through a speaker; please refer to the previous description for more information about the first application.

[0128] As shown in Figure 4, the FWK layer can include an audio server. The audio server can be used to manage audio resources for various applications in the application layer. For example, the audio server can be responsible for starting or stopping the playback of audio resources in an application. Furthermore, the audio server can also be responsible for format conversion and volume control of audio resources. For instance, when the audio server receives a playback command for audio resources from the first application, it calls the Smart PA driver in the kernel layer to drive the speaker to play the audio resource.

[0129] As shown in Figure 4, the HAL layer may include a Smart PA algorithm, a first node, and a second node. The Smart PA algorithm is maintained by the left half (i.e., the audio part), while the first and second nodes are maintained by the right half (i.e., the camera part). The Smart PA algorithm receives the speaker's I / V signal sent by the Smart PA and then calculates the speaker's current operating power based on the I / V signal. The Smart PA algorithm can write data to the first node. For example, when the Smart PA algorithm determines that the speaker's current operating power is greater than a power threshold, it can write data to the first node. Optionally, the data can be a numerical value, such as an index value, which can be binary or decimal, without limitation.

[0130] Optionally, the Smart PA algorithm can write data to the first node in either method A or method B.

[0131] In Method A, the Smart PA algorithm determines that when the speaker's current operating power is greater than the power threshold, it writes the first data to the first node. The value of the first data is a fixed value. In this method, regardless of how much the speaker's current operating power is higher than the power threshold, a fixed value, such as 1 or 0, is written to the first node.

[0132] In Method B, when the Smart PA algorithm determines that the current operating power of the speaker is greater than a power threshold, it determines the value of the first data based on the current operating power and then writes the first data to the first node. In this method, the value of the first data can be different depending on the current operating power of the speaker. For example, the higher the current operating power of the speaker, the higher the value of the first data, and vice versa. One possible approach is that the electronic device stores a correspondence between speaker power and the value of the first data. After the Smart PA algorithm determines the current operating power of the speaker, it determines the value of the first data based on the current operating power and the aforementioned correspondence, and then writes the first data to the first node.

[0133] The second node is used to detect the first node. If the Smart PA algorithm writes data to the first node using method A above, i.e., the value of the written data is a fixed value, the second node only needs to detect whether data has been written to the first node. When the second node detects that data has been written to the first node, it can call the camera motor driver to power on the camera motor. If the Smart PA algorithm writes data to the first node using method B above, i.e., the value of the written data changes dynamically with the current operating power of the speaker, the second node is used to detect whether data has been written to the first node and reads the value of the written data when it is determined that data has been written to the first node. After reading the value of the data, the second node determines the first current based on the value. For example, the electronic device stores a correspondence between the value of the data written to the first node and the current of the camera motor coil. The second node can determine the first current based on the value and the correspondence. After determining the first current, the second node calls the camera motor driver to supply the first current to the motor coil.

[0134] Optionally, the first node can be one or more threads, or one or more processes.

[0135] Optionally, the second node can be one or more threads, or one or more processes.

[0136] Optionally, the first node and the second node can be two independent nodes, or two parts of the same node. Optionally, the first node can correspond to a storage space, and the second node writes data to the first node, that is, the second node writes data into the storage space. The storage space is detected by the second node. Assuming that the second node is located on the camera motor driver chip, the camera motor driver chip is used to detect the storage space. If it detects that data has been written into the storage space, it reads the value of the written data, determines a first current based on the value, and then controls the motor coil to flow with the first current.

[0137] As shown in Figure 4, the kernel layer can include a Smart PA driver and a camera motor driver. The Smart PA driver is used to drive the Smart PA. The camera motor driver is used to power on the camera motor.

[0138] As shown in Figure 4, the hardware layer includes a Smart PA, a speaker, and a camera motor. The Smart PA drives the speaker to play sound. The camera motor moves the lens assembly.

[0139] The following description, in conjunction with Figure 4, illustrates the software and hardware workflow of the technical solution provided in the embodiments of this application.

[0140] During operation, the first application, in response to a trigger condition (used to trigger the first application to play sound), calls the audio service in the FWK layer. The audio service calls the Smart PA driver in the kernel layer, which drives the speaker to play the first application's audio resources. While the speaker is playing sound, the Smart PA periodically detects the speaker's I / V signals according to a certain detection cycle and passes the I / V signals to the Smart PA algorithm in the HAL layer. The Smart PA algorithm calculates the speaker's current operating power based on the I / V signals. The Smart PA algorithm determines whether the speaker's current operating power is greater than a power threshold; if so, the Smart PA algorithm writes data to the first node. When the second node detects that data has been written to the first node, it reads the value of the written data and then determines the first current based on that value. After determining the first current, the second node calls the camera motor driver in the kernel layer to supply the first current to the motor coil.

[0141] Optionally, the second node can also be used to detect whether the camera application is running. For example, when the second node detects that data has been written to the first node, it can determine whether the camera application is running. If the camera application is not running, the second node determines the first current based on the value of the data written to the first node, and then calls the camera motor driver in the kernel layer to pass the first current through the motor coil; if the camera application is running, the second node will not call the camera motor driver in the kernel layer.

[0142] It should be understood that after the second node calls the camera motor driver in the kernel layer to supply the first current to the motor coil, it can also detect whether the camera application has started. If the second node detects that the camera application has started, it calls the camera motor driver in the kernel layer to stop supplying current to the motor coil. In this way, after the camera application starts, it can call the camera motor driver in the kernel layer to power on the camera motor and achieve autofocus.

[0143] As mentioned earlier, the Smart PA periodically detects the speaker's I / V signal according to a certain detection cycle. Therefore, the Smart PA algorithm can calculate the speaker's current operating power in real time and write data to the first node in real time. The second node detects the data written in the first node in real time. When the Smart PA algorithm determines that the speaker's current operating power is less than or equal to the power threshold, it stops writing data to the first node. When the second node detects that no data has been written to the first node, it can call the camera motor driver in the kernel layer to stop the current flowing through the motor coil.

[0144] Please refer to Figure 5, which is another schematic diagram of an electronic device provided in one embodiment of this application. As shown in Figure 5, the electronic device includes a main chip, an accelerometer, and a speaker module. For details regarding the main chip and speaker module, please refer to the relevant description in Figure 1 above. Optionally, the electronic device may also include a camera module (not shown in Figure 5).

[0145] An accelerometer is used to detect the acceleration of an electronic device in various directions and send the acceleration in each direction to the main chip. Optionally, the directions may include one or more of the following: x-axis, y-axis, z-axis, pitch axis, yaw axis, and roll axis.

[0146] The main chip responds based on acceleration in various directions. These responses can include: taking screenshots, switching between portrait and landscape modes, and counting steps. Taking screenshots as an example, the main chip determines when a fingertip taps the screen based on the acceleration in each direction. For instance, considering acceleration along the x, y, and z axes, a fingertip tap is determined when the acceleration along the x-axis exceeds threshold 1, the acceleration along the y-axis exceeds threshold 2, and the acceleration along the z-axis exceeds threshold 3. Thresholds 1, 2, and 3 can be pre-configured in the electronic device.

[0147] It should be noted that electronic devices may vibrate while the speaker is playing sound. When an electronic device vibrates, the accelerometer will collect the acceleration in various directions. If the vibration is strong, the acceleration collected by the accelerometer in various directions may reach the threshold values ​​(such as threshold values ​​1, 2, and 3 mentioned above), which may cause the electronic device to trigger falsely, such as accidentally taking a screenshot, thus affecting the user experience.

[0148] To avoid false triggering, in this embodiment of the application, during the process of the speaker playing sound, the electronic device can detect the current operating power of the speaker in real time. If the current operating power is greater than the power threshold, the electronic device can increase the acceleration threshold value in each direction to avoid false triggering.

[0149] For example, please refer to Figure 6, which is a schematic flowchart of a device control method provided in an embodiment of this application. This flowchart can be applied to the electronic device shown in Figure 5. As shown in Figure 6, the flowchart includes:

[0150] S600, sound is playing from the speaker.

[0151] The S601 Smart PA monitors the speaker's I / V signals in real time. The I / V signals include the I signal (current signal) and the V signal (voltage signal).

[0152] The S602 Smart PA sends the speaker's I / V signals to the main chip.

[0153] The S603 main chip determines the current operating power of the speaker based on the speaker's I / V signals.

[0154] In step S604, the main chip determines whether the speaker's current operating power exceeds the power threshold. If so, it executes step S605; otherwise, it continues with step S604.

[0155] Optionally, the implementation principles of S600 to S604 are the same as those of S300 to S304 in Figure 3 above, and will not be repeated here.

[0156] S605, the main chip increases the acceleration threshold.

[0157] As mentioned earlier, the accelerometer can collect acceleration in various directions, including one or more of the following: the x-axis, y-axis, z-axis, pitch axis, yaw axis, and roll axis. The main chip can increase the acceleration threshold value in at least one of these directions. For ease of understanding, the following explanation uses the main chip increasing the acceleration threshold value in the x-axis direction as an example. It should be understood that the principle is the same for threshold values ​​in other directions. One possible approach is for the main chip to determine the target threshold value for acceleration in the x-axis direction based on the current operating power of the horn, and then adjust the current threshold value for acceleration in the x-axis direction to the target threshold value. For example, the electronic device stores a correspondence between horn power and the target threshold value for acceleration in the x-axis direction, and determines the target threshold value for acceleration in the x-axis direction based on the current operating power of the horn and this correspondence.

[0158] The S606 is an accelerometer that collects acceleration in various directions.

[0159] In S607, the main chip compares the acceleration data in each direction with the threshold value. If the data is higher than the threshold value, S608 is executed; otherwise, S607 is executed again.

[0160] It should be understood that the threshold value in S607 is the same as the target threshold value mentioned above.

[0161] S608 responded.

[0162] Optionally, the response may include: screenshot, landscape / portrait switching, step counting, etc.

[0163] Optionally, after S608, if the main chip determines that the speaker's current operating power has decreased to less than or equal to the power threshold, the acceleration threshold value is restored.

[0164] Figure 7 is another schematic diagram of an electronic device provided in one embodiment of this application. If Figure 1 above is understood as a schematic diagram of the hardware structure of the electronic device, Figure 7 can be understood as a schematic diagram of the software structure of the electronic device. As shown in Figure 7, the software system of the electronic device can adopt a layered architecture, and of course, it can also adopt an event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which are not limited in this embodiment. The text uses a layered architecture as an example for explanation. A layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. As shown in Figure 7, the electronic device includes five layers, from top to bottom: application layer, FWK layer, HAL, kernel layer, and hardware layer. It should be noted that Figure 7 uses five layers as an example. In actual applications, the electronic device can include more or fewer layers, and the positional relationship between the layers can be adjusted. The modules contained in each layer can also be moved to other layers. In addition, the name of each layer is not limited in this embodiment.

[0165] As shown in Figure 7, the software system of an electronic device can include two parts: the left half is the audio section, and the right half is the accelerometer sensor section. The audio section is described in Figure 4, and the accelerometer sensor section is described below.

[0166] As shown in Figure 7, the HAL layer includes a third node and a fourth node. Both the third and fourth nodes are maintained by the accelerometer sensor. The Smart PA algorithm can write data to the third node. For example, when the Smart PA algorithm determines that the current operating power of the horn is greater than the power threshold, it can write data to the third node. Optionally, the Smart PA algorithm can write data to the third node in the same way as the Smart PA algorithm writes data to the first node in Figure 4 above, including methods A and B, which will not be repeated for the sake of brevity.

[0167] The fourth node can be used to detect the third node. If the Smart PA algorithm writes data to the first node using method A above, i.e., the value of the written data is a fixed value, then the fourth node only needs to detect whether data has been written to the third node. When the fourth node detects that data has been written to the third node, it can raise the acceleration threshold values ​​in each direction. If the Smart PA algorithm writes data to the first node using method B above, i.e., the value of the written data changes dynamically with the current operating power of the horn, then the fourth node is used to detect whether data has been written to the third node and reads the specific value of the written data when it is determined that data has been written to the third node. When the fourth node reads the value of the data, it determines the target threshold value of acceleration in each direction based on the value. For example, the electronic device stores a correspondence between the value of the data written in the third node and the target threshold value of acceleration in each direction. The fourth node can determine the target threshold value of acceleration in each direction based on the value and the correspondence. The fourth node raises the acceleration threshold value in each direction to the target threshold value.

[0168] Optionally, the third node can be one or more threads, or one or more processes.

[0169] Optionally, the fourth node can be one or more threads, or one or more processes.

[0170] Optionally, the third and fourth nodes can be two independent nodes, or they can be two parts of the same node.

[0171] As shown in Figure 7, the kernel layer can include a Smart PA driver and an accelerometer driver. The Smart PA driver is used to drive the Smart PA. The accelerometer driver is used to acquire the acceleration in various directions collected by the accelerometer.

[0172] As shown in Figure 7, the hardware layer includes a Smart PA, a speaker, and an accelerometer. The Smart PA is used to drive the speaker to play sound. The accelerometer is used to collect the acceleration of the electronic device in various directions.

[0173] The following description, in conjunction with Figure 7, illustrates the software and hardware workflow of the technical solution provided in the embodiments of this application.

[0174] During operation, the first application, in response to a trigger condition (the trigger condition used to trigger the first application to play sound), calls the audio service in the FWK layer. The audio service calls the Smart PA driver in the kernel layer, which drives the speaker to play the first application's audio resources. While the speaker is playing sound, the Smart PA periodically detects the speaker's I / V signals according to a certain detection cycle and passes the I / V signals to the Smart PA algorithm in the HAL layer. The Smart PA algorithm calculates the speaker's current operating power based on the I / V signals. The Smart PA algorithm determines whether the speaker's current operating power is greater than a power threshold; if so, the Smart PA algorithm writes data to the third node. When the fourth node detects that data has been written to the third node, it reads the value of the written data and then determines the target threshold value for acceleration in each direction based on the value. The fourth node raises the acceleration threshold values ​​in each direction to the target threshold value.

[0175] After the accelerometer in the hardware layer collects the acceleration of the electronic device in various directions, it sends the acceleration in each direction to the fourth node through the accelerometer driver. The fourth node compares the acceleration in each direction with the corresponding target threshold value. If it is greater than the threshold value, it responds, such as taking a screenshot; otherwise, it does not respond.

[0176] Please refer to Figure 8, which is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device can be one of the electronic devices listed above, such as the electronic device shown in Figure 1 or Figure 5. As shown in Figure 8, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0177] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has just used or is repeatedly used. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.

[0178] In some embodiments, the processor 110 can execute the camera module control method provided in the embodiments of this application. For example, the processor 110 can receive I / V signals sent by the Smart PA, the I / V signals including the current signal and voltage signal of the speaker. The processor 110 determines the current operating power of the speaker based on the I / V signals; if the current operating power is greater than a first threshold, the processor 110 controls the power-on of the camera motor so that the camera motor drives the lens assembly to move to a preset position.

[0179] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0180] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0181] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0182] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0183] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0184] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0185] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0186] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0187] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0188] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.

[0189] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0190] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0191] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the electronic device to communicate with networks and other devices via wireless communication technology.

[0192] The display screen 194 is used to display the application's interface, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1.

[0193] The electronic device 100 can perform shooting functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor. The ISP is used to process the data fed back by the camera 193.

[0194] In this embodiment, the camera 193 may include a camera motor and a lens assembly, not shown in FIG8. For example, the camera 193 has the structure shown in FIG2. The camera motor, under the control of the processor 110, can drive the lens assembly to move its position.

[0195] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application program. The data storage area may store data generated during the use of the electronic device (e.g., images, videos, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, general-purpose flash memory, etc.

[0196] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external memory card.

[0197] Electronic devices can implement audio functions such as music playback and recording through audio modules 170, speakers 170A, receivers 170B, microphones 170C, headphone jacks 170D, and application processors.

[0198] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0199] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls and other external playback scenarios through one or more speakers 170A.

[0200] In this embodiment, the electronic device also includes a power amplifier (not shown in FIG8) for driving the speaker 170A to play sound. The power amplifier is, for example, a Smart PA. The Smart PA can detect the speaker's I / V signal in real time and send the I / V signal to the processor 110 so that the processor 110 can determine the speaker's current operating power.

[0201] The receiver 170B, also known as a "handpiece," can be one or more, and is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0202] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0203] The 170D headphone jack is used to connect wired headphones.

[0204] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.

[0205] The gyroscope sensor 180B can be used to determine the motion attitude of an electronic device. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization.

[0206] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0207] The magnetic sensor 180D includes a Hall effect sensor. Electronic devices can use the magnetic sensor 180D to detect the opening and closing of a flip cover.

[0208] The 180E accelerometer can detect the magnitude of acceleration in various directions (e.g., x-axis, y-axis, z-axis) of electronic devices. When the electronic device is stationary, it can detect the magnitude and direction of gravity.

[0209] In this embodiment, the processor 110 can receive I / V signals sent by the Smart PA, which include the speaker's current and voltage signals. Based on the I / V signals, the processor 110 determines the speaker's current operating power; if the current operating power is greater than a first threshold, the processor 110 increases the threshold values ​​for acceleration in each direction to avoid false triggering.

[0210] The 180F distance sensor is used to measure distance. Electronic devices can measure distance using infrared or laser.

[0211] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device emits infrared light outward through the LED. The electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device. When insufficient reflected light is detected, the electronic device can determine that no object is near the electronic device.

[0212] An ambient light sensor 180L is used to detect ambient light levels. Electronic devices can adaptively adjust the brightness of the display screen 194 based on the detected ambient light levels.

[0213] The fingerprint sensor 180H is used to collect fingerprints.

[0214] The 180J temperature sensor is used to detect temperature.

[0215] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event.

[0216] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords.

[0217] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. The electronic device can receive button inputs and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device.

[0218] It is understood that the components shown in Figure 8 do not constitute a specific limitation on the electronic device. The electronic device in the embodiments of the present invention may include more or fewer components than those shown in Figure 8. Furthermore, the combination / connection relationships between the components in Figure 8 can also be adjusted and modified.

[0219] Figure 9 is a schematic diagram of the structure of an electronic device 900 provided in an embodiment of this application. The electronic device 900 can be one of the electronic devices described above (e.g., the electronic device shown in Figure 1 or Figure 5). As shown in Figure 9, the electronic device 900 may include: one or more processors 901; one or more memories 902; a communication interface 903; and one or more computer programs 904. These devices can be connected via one or more communication buses 905. The one or more computer programs 904 are stored in the memory 902 and configured to be executed by the one or more processors 901. The one or more computer programs 904 include instructions. For example, when the electronic device 900 is one of the electronic devices described above, the instructions can be used to perform relevant steps of the electronic device as described in the corresponding embodiments above, such as performing relevant steps of the electronic device in Figure 3 or Figure 6. The communication interface 903 is used to enable communication between the electronic device 900 and other devices; for example, the communication interface can be a transceiver.

[0220] In the embodiments provided above, the methods provided by the embodiments of this application are described from the perspective of an electronic device (e.g., a mobile phone) as the executing entity. To implement the functions of the methods provided in the embodiments of this application, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is implemented in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.

[0221] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)). Where there is no conflict, the solutions in the above embodiments can be combined.

[0222] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0223] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0224] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0225] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0226] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope and intent of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and variations.

Claims

1. A control method for a camera module, characterized in that, The method is applicable to an electronic device, the electronic device including a main chip, a speaker module, and a camera module, the speaker module including a smart power amplifier (Smart PA) and a speaker, the camera module including a camera motor, and the method comprising: The main chip controls the speaker to play sound; The Smart PA detects a first signal from the speaker, the first signal including a first current signal and a second voltage signal; The Smart PA sends the first signal to the main chip; The main chip determines the current operating power of the speaker based on the first signal; When the main chip determines that the current operating power is greater than a first threshold, it controls the camera motor to power on.

2. The method according to claim 1, characterized in that, Before powering on the camera motor, the method further includes: The main chip determines that the camera application in the electronic device is turned off.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The main chip receives the startup command from the camera application; The main chip stops powering on the camera motor; The main chip launches the camera application.

4. The method according to any one of claims 1-3, characterized in that, The Smart PA detects the first signal from the speaker, including: The Smart PA periodically detects the first signal of the horn according to the detection cycle.

5. The method according to claim 4, characterized in that, Before the Smart PA periodically detects the first signal of the horn according to the detection cycle, the method further includes: The main chip determines the detection cycle based on the current operating status of the electronic device, wherein the current operating status includes at least one of the following: current operating load, current remaining battery power, and currently running application. The main chip sends a notification message to the Smart PA, the notification message being used to indicate the detection cycle.

6. The method according to claim 5, characterized in that, The main chip determines the detection cycle based on the current operating state of the electronic device, including: The main chip determines the first application currently playing sound through the speaker; The main chip determines the detection cycle based on the historical data of the first application, wherein the historical data reflects the frequency at which the speaker power reached the first threshold when the first application played sound through the speaker in the past.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: The Smart PA detects a second signal from the speaker, the second signal including a second current signal and a second voltage signal; The Smart PA sends the second signal to the main chip; The main chip determines the current operating power of the speaker based on the second signal; When the main chip determines that the current operating power is less than or equal to the first threshold, it stops powering the camera motor.

8. A control method for a camera module, characterized in that, The method is applicable to a main chip, which is connected to a speaker module and a camera module respectively. The speaker module includes a Smart PA and a speaker, and the camera module includes a camera motor. The main chip controls the speaker to play sound; The main chip receives a first signal sent by the Smart PA, the first signal including a first current signal and a first voltage signal from the speaker; The main chip determines the current operating power of the speaker based on the first signal; When the main chip determines that the current operating power is greater than a first threshold, it controls the camera motor to power on.

9. A control method for a camera module, characterized in that, The method, applicable to a smart power amplifier (Smart PA) connected to a speaker and a main chip, includes: The Smart PA detects a first signal from the speaker, the first signal including a first current signal and a first voltage signal; The Smart PA sends the first signal to the main chip. The first signal is used to determine the current operating power of the speaker. The current operating power is used to decide whether to power on the camera motor.

10. A method for preventing accidental touches, characterized in that, The method is applicable to an electronic device, the electronic device including a main chip, a speaker module, and an accelerometer, the speaker module including a smart power amplifier (Smart PA) and a speaker, the method comprising: The main chip controls the speaker to play sound; The Smart PA detects a first signal from the speaker, the first signal including a first current signal and a first voltage signal; The Smart PA sends the first signal to the main chip; The main chip determines the current operating power of the speaker based on the first signal; When the main chip determines that the current operating power is greater than the first threshold, it increases the acceleration threshold value of the acceleration sensor. The acceleration threshold value is used to trigger the main chip to execute a first response action when the first acceleration collected by the acceleration sensor is greater than or equal to the acceleration threshold value.

11. A method for preventing accidental touches, characterized in that, Applicable to a main chip, the main chip being connected to a speaker module and an accelerometer respectively, the speaker module including a Smart PA and a speaker, the method comprising: The main chip controls the speaker to play sound; The main chip receives a first signal sent by the Smart PA, the first signal including a first current signal and a first voltage signal from the speaker; The main chip determines the current operating power of the speaker based on the first signal; When the main chip determines that the current operating power is greater than the first threshold, it increases the acceleration threshold value of the acceleration sensor. The acceleration threshold value is used to trigger the main chip to execute a first response action when the first acceleration collected by the acceleration sensor is greater than or equal to the acceleration threshold value.

12. A method for preventing accidental touches, characterized in that, The method is applicable to a smart power amplifier (Smart PA), wherein the Smart PA is connected to a speaker and a main chip, and the main chip is connected to an accelerometer. The Smart PA detects a first signal from the speaker, the first signal including a first current signal and a first voltage signal; The Smart PA sends the first signal to the main chip. The first signal is used to determine the current operating power of the speaker. The current operating power is used to adjust the acceleration threshold value of the acceleration sensor. The acceleration threshold value is used to trigger the main chip to execute a first response action when the first acceleration collected by the acceleration sensor is greater than or equal to the acceleration threshold value.

13. An electronic device, characterized in that, include: The system includes a main chip, a speaker module, and a camera module. The speaker module includes a Smart PA and a speaker, and the camera module includes a camera motor. The main chip is used to perform the method as described in claim 8; The Smart PA is used to perform the method as described in claim 9.

14. An electronic device, characterized in that, include: The system includes a main chip, a speaker module, and an accelerometer. The speaker module includes a Smart PA and a horn, and the accelerometer is used to collect acceleration data. The main chip is used to perform the method as described in claim 11; The Smart PA is used to perform the method as described in claim 12.

15. A chip, characterized in that, The chip is capable of performing the method as described in claim 8, or the method as described in claim 11.

16. A power amplifier, characterized in that, The power amplifier is capable of performing the method as described in claim 9; or, is capable of performing the method as described in claim 12.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 12.

18. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method for inhibiting vibration noise of camera in electronic device

    CN108012058A

  • Camera module and control method thereof, electronic equipment and storage medium

    CN109981938A

  • Knocking sensor algorithm and knock sensor thereof

    CN112129399A

  • Camera control method and device, storage medium and terminal

    CN115134522A

  • Control method and electronic equipment

    CN115243125A