CN116708958A - Motor control method and electronic equipment - Google Patents

Motor control method and electronic equipment Download PDF

Info

Publication number
CN116708958A
CN116708958A CN202211444629.6A CN202211444629A CN116708958A CN 116708958 A CN116708958 A CN 116708958A CN 202211444629 A CN202211444629 A CN 202211444629A CN 116708958 A CN116708958 A CN 116708958A
Authority
CN
China
Prior art keywords
motor
abnormal sound
electronic device
electronic equipment
acceleration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211444629.6A
Other languages
Chinese (zh)
Inventor
刘铁良
苏俊峰
杜军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211444629.6A priority Critical patent/CN116708958A/en
Publication of CN116708958A publication Critical patent/CN116708958A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P23/00Arrangements or methods for the control of AC motors characterised by a control method other than vector control
    • H02P23/04Arrangements or methods for the control of AC motors characterised by a control method other than vector control specially adapted for damping motor oscillations, e.g. for reducing hunting
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P23/00Arrangements or methods for the control of AC motors characterised by a control method other than vector control
    • H02P23/20Controlling the acceleration or deceleration

Abstract

The application discloses a motor control method and electronic equipment, wherein the method comprises the following steps: detecting whether the electronic equipment shakes, judging whether the motor is in a working state or not under the condition that the electronic equipment shakes, and if the motor is in the working state, controlling the motor to keep the working state; if the motor is in a non-working state, the position of the rotor in the motor is controlled to be fixed. Therefore, the rotor in the motor does not shake along with the shaking of the electronic equipment, abnormal sound can not be generated, normal operation of the motor can be guaranteed while the abnormal sound of the motor is avoided, and user experience is improved.

Description

Motor control method and electronic equipment
Technical Field
The present application relates to the field of terminals, and in particular, to a motor control method and an electronic device.
Background
Most electronic devices today are equipped with at least one motor, which is mounted in a corresponding module of the electronic device. Taking a motor in the camera module as an example, a lens and the like are arranged around the motor, and the motor is used for being matched with the lens to realize a focusing function. Specifically, the mover in the motor has a certain active space in the camera module, and the active space is used for pushing the lens to move through the mover vibration when the camera is in operation (when the motor is in a working state), so as to realize a focusing function.
However, when the camera application is turned off (the motor is in a non-operating state), if the electronic device is shaken, the mover vibrates in the active space along with the shaking of the electronic device, so that the mover collides with surrounding components in the camera module to generate abnormal sounds.
How to solve the above technical problems, i.e. to avoid abnormal sound of the motor, is a problem to be solved.
Disclosure of Invention
The application discloses a motor control method and electronic equipment, wherein the method comprises the following steps: judging whether the motor is in a working state or not under the condition that the shaking of the electronic equipment is detected, and if the motor is in the working state, controlling the motor to keep the working state; if the motor is in a non-working state, the position of the rotor in the motor is controlled to be fixed. Therefore, the rotor in the motor does not shake along with the shaking of the electronic equipment, abnormal sound can not be generated, normal operation of the motor can be guaranteed while the abnormal sound of the motor is avoided, and user experience is improved.
In a first aspect, the present application provides a motor control method applied to an electronic device including a camera module including a motor and a lens; when the motor is electrified, the mover in the motor moves to drive the lens to move; the method comprises the following steps: when the electronic equipment runs a camera application, controlling the motor to be electrified so that a rotor in the motor is fixed at a first position; when detecting a change in focal length applied by the camera, controlling a mover in the motor to move to a second position, the second position being different from the first position; when the electronic equipment is detected to shake in the process of running the camera application by the electronic equipment, continuing to execute focusing service of the camera application by controlling the position of a rotor in the motor; controlling the motor to be powered down after the electronic equipment stops running the camera application; after the electronic device stops running the camera application, when the electronic device is detected to shake, the motor is controlled to be electrified, so that the rotor in the motor is fixed at a third position, and the third position is the same as or different from the first position.
After the method provided by the first aspect is implemented, on the premise that the motor is ensured to normally execute focusing service of camera application, the rotor in the motor can be prevented from shaking when the electronic equipment shakes by controlling the position of the rotor in the motor, so that abnormal sound generated by the motor is avoided, the service life of the motor is prolonged, and user experience is improved.
With reference to the method provided in the first aspect, after the electronic device stops running the camera application, and in a process that the electronic device controls the motor to be powered on, so that the mover in the motor is fixed at the third position, the electronic device is in any one of the following situations: the method comprises the steps of screen extinguishing, screen locking interface displaying, screen unlocking interface displaying or application interface outside the camera application displaying.
Therefore, when the electronic equipment is in various scenes, the abnormal sound is avoided by controlling the fixed position of the rotor of the motor when the electronic equipment is detected to shake.
In combination with the method provided in the first aspect, when the electronic device is detected to shake, the electronic device continues to execute a focusing service of the camera application by controlling a position of a mover in the motor, or controls the motor to be powered on, so that the mover in the motor is fixed at a third position, and specifically includes: the electronic equipment detects abnormal sound scenes; after detecting that the electronic equipment enters an abnormal sound scene, the electronic equipment judges the current state of the motor; when the current state of the motor is determined to be the working state, the motor is controlled to be continuously in the working state; when the current state of the motor is determined to be a non-working state, controlling the motor to be in a abnormal sound eliminating state; the abnormal sound scene detection means that the electronic equipment is subjected to shaking detection; detecting entering an abnormal sound scene refers to detecting shaking of the electronic equipment; the working state comprises a state that the motor is powered on and executes focusing service of the camera application by controlling the position of a rotor in the motor; the non-working state comprises a state that the motor is powered down; the abnormal sound eliminating state comprises a state that the motor is electrified and the rotor in the motor is fixed at a third position.
Therefore, when the electronic equipment detects that the abnormal sound scene is entered, the current state can be further judged to determine how to control the motor, namely, determine the target state of the motor, and then the motor can be controlled to be in a state of eliminating the abnormal sound on the premise that the executing work of the motor is not affected, so that the abnormal sound generated by the motor is avoided, the service life of the motor is prolonged, and the user experience is improved.
In combination with the method provided in the first aspect, after the electronic device controls the motor to be powered on so that the mover in the motor is fixed in the third position, the method further includes: and when the electronic equipment is not detected to shake, controlling the motor to be powered down.
Therefore, when the electronic equipment stops shaking, abnormal sound cannot be generated by the motor, and the motor is controlled to be powered down, so that the waste of power consumption of the electronic equipment can be avoided.
In combination with the method provided in the first aspect, when the electronic device is not detected to shake, the motor is controlled to be powered down, which specifically includes: the electronic equipment detects abnormal sound scenes; after detecting that the electronic equipment exits from the abnormal sound scene, the electronic equipment judges the current state of the motor; when the current state of the motor is determined to be the abnormal sound eliminating state, the motor is controlled to be in a non-working state; the abnormal sound scene detection means that the electronic equipment is subjected to shaking detection; detecting that the electronic equipment exits from the abnormal sound scene means that the electronic equipment is not detected to shake; the abnormal sound eliminating state comprises a state that the motor is electrified and the rotor in the motor is fixed at a third position; the non-operating state includes a state in which the motor is powered on and a focusing service of the camera application is performed by controlling a position of a mover in the motor.
Therefore, when the electronic equipment detects that the abnormal sound scene is exited, the current state can be further judged to determine how to control the motor, namely, determine the target state of the motor, and then the motor can be controlled to be in a non-working state, namely, in a power-down state on the premise that the work being executed by the motor is not influenced, so that abnormal sound generated by the motor is avoided, and the user experience is improved.
In combination with the method provided in the first aspect, after the electronic device controls the motor to be powered on so that the mover in the motor is fixed in the third position, the method further includes: when the camera application runs, the focusing service of the camera application is executed by controlling the position of the rotor in the motor; and when the camera application is not running, continuing to control the motor to be electrified so that the rotor in the motor is fixed at the third position.
Thus, after the position of the control motor is fixed when the electronic equipment shakes, if the camera application runs, the motor can still normally execute the focusing service of the camera application.
With reference to the method provided in the first aspect, when the camera application is running, then the focusing service of the camera application is executed by controlling the position of the mover in the motor; and when the camera application is not running, continuing to control the motor to be electrified so that the mover in the motor is fixed at the third position, wherein the method specifically comprises the following steps of: the electronic equipment judges whether the camera application service notification exists or not; under the condition of the service notification of the camera application, the electronic equipment controls the motor to be in a working state; under the condition that the service notification of the camera application is not available, the electronic equipment controls the motor according to the last abnormal sound scene detection result; when the last abnormal sound scene detection result is that the abnormal sound scene is entered, controlling the motor to be in an abnormal sound eliminating state; when the last abnormal sound scene detection result is that the abnormal sound scene is exited, controlling the motor to be in a non-working state; wherein a business notification with the camera application characterizes the camera application as running; no service notification of the camera application characterizes that the camera application stops running; the detection result is that entering an abnormal sound scene means that the electronic equipment is detected to shake; the detection result is that the electronic equipment is not detected to shake after the abnormal sound scene is exited; the working state comprises a state that the motor is powered on and executes focusing service of the camera application by controlling the position of a rotor in the motor; the abnormal sound eliminating state comprises a state that the motor is electrified and the rotor in the motor is fixed at the third position. The non-operating state includes a state in which the motor is powered on and a focusing service of the camera application is performed by controlling a position of a mover in the motor.
Therefore, the electronic equipment can detect the service notification of the camera application in real time, respond to the service notification in time when the service notification of the camera application exists, and control the motor according to the abnormal sound scene detection result when the service notification of the camera application does not exist, so that the motor is in a state of eliminating abnormal sound in time when the service notification of the camera application does not exist and the electronic equipment enters the abnormal sound scene, thereby avoiding the abnormal sound generated by the motor and improving the user experience.
In combination with the method provided in the first aspect, the electronic device shaking specifically includes: the degree of shake of the electronic device is greater than or equal to a threshold.
Therefore, when the shaking degree is insufficient to cause abnormal sound to the motor, the motor is controlled to be in an abnormal sound eliminating state, and power consumption of the electronic equipment is saved.
In combination with the method provided in the first aspect, the shaking degree of the electronic device is determined according to a plurality of accelerations acquired by the low-power consumption sensor.
Therefore, the shaking degree of the electronic equipment can be measured according to a plurality of accelerations in one section by detecting the acceleration of the electronic equipment in real time, and the feasibility of the scheme is improved.
With reference to the method provided in the first aspect, the threshold includes a first threshold and a second threshold, where the first threshold and the second threshold are preset in the electronic device after being determined by the following methods: collecting acceleration of the second equipment in a plurality of shaking scenes; comparing the first acceleration with the second acceleration to determine the first threshold and the second threshold; the first acceleration is the acceleration acquired under the condition that abnormal sound occurs to the motor in the second equipment, and the second acceleration is the acceleration acquired under the condition that abnormal sound does not occur to the motor in the second equipment; wherein the first threshold and the second threshold satisfy the following condition: the first threshold value is less than or equal to the number of times that the acceleration occurs in the first acceleration is greater than a first value, and the first threshold value is greater than the number of times that the acceleration occurs in the second acceleration is greater than the first value; the first value is a median of the peak value in the first acceleration and the peak value in the second acceleration; the second threshold value is less than or equal to the number of times the peak in the first acceleration occurs, and is greater than the number of times the peak in the second acceleration occurs.
Therefore, a more accurate threshold value of the shaking degree which can cause the motor to generate abnormal sound can be obtained through a strict analysis process, the motor can be detected in advance to generate abnormal sound, and the motor can be prevented from being controlled to be electrified under the scene that the motor cannot generate abnormal sound, so that the power consumption of electronic equipment is saved.
With reference to the method provided in the first aspect, the threshold includes a first threshold and a second threshold, where the first threshold and the second threshold are preset in the electronic device after being determined by the following methods: controlling the second device to shake at a first acceleration and a first shake frequency; under the condition that abnormal sound does not appear in the motor in the second equipment, gradually increasing acceleration and shaking frequency, and controlling the second equipment to shake until abnormal sound appears in the motor in the second equipment; and determining a first threshold according to a second acceleration when abnormal sound occurs to the motor in the second device, and determining the second threshold according to a second shaking frequency when abnormal sound occurs to the motor in the second device.
Therefore, a more accurate threshold value of the shaking degree which can cause the motor to generate abnormal sound can be obtained through an actual measurement mode, the abnormal sound which can be generated by the motor can be detected in advance, and the power consumption of the electronic equipment can be saved by controlling the motor to power on under the scene that the motor cannot generate abnormal sound.
In a second aspect, the present application provides an electronic device comprising a motor, a memory, one or more processors; the memory is coupled to the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors call to cause the electronic device to perform the method as described in any of the first aspects.
In a third aspect, the present application provides a chip for application to an electronic device, the chip comprising one or more processors for invoking computer instructions to cause the electronic device to perform the method as described in any of the first aspects.
In a fourth aspect, the present application provides a computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform a method as described in any of the first aspects.
Drawings
Fig. 1 is a schematic diagram of a motor in a camera module according to an embodiment of the application;
fig. 2 is a diagram of a hardware architecture of an electronic device according to an embodiment of the present application;
Fig. 3 is a software architecture diagram of an electronic device according to an embodiment of the present application;
FIG. 4 is a flow chart of a motor control method according to an embodiment of the present application;
fig. 5A to fig. 5I are schematic diagrams illustrating acceleration changes of a group of electronic devices under different shake scenes according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
The term "User Interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which enables conversion between an internal form of information and a form acceptable to the user. The user interface is a source code written in a specific computer language such as java, extensible markup language (extensible markup language, XML) and the like, and the interface source code is analyzed and rendered on the electronic equipment to finally be presented as content which can be identified by a user. A commonly used presentation form of the user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be a visual interface element of text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc., displayed in a display of the electronic device.
Nowadays, more and more electronic devices are provided with at least one motor. Taking a mobile phone as an example, the mobile phone is usually provided with a vibration motor, and the vibration motor can be used for prompting incoming call vibration and also can be used for generating different vibration feedback effects under other different application scenes, such as time reminding, receiving information, alarm clock, games, videos and the like. And with the upgrade of the functions of the mobile phone application, the camera application needs to configure a motor on the camera module in order to provide the focusing function, and the motor may be, for example, an Auto Focus (AF) motor or may also be called as other names, and its main function is to provide the focusing function for the camera application, including Auto focusing, manual focusing, and so on.
Next, taking a motor in a camera as an example, the composition structure of the motor in the camera module will be briefly described.
Fig. 1 schematically illustrates a structure of a motor in a camera module.
As shown in fig. 1, the camera module mainly includes: motor, lens. The motor mainly comprises a rotor and a stator, and other components in the camera module, such as a shell and the like, are further arranged around the motor. The stator is a coil winding, and the coil winding is respectively connected with a spring piece up and down. Typically, the camera module further includes a photosensitive element, a driving chip, etc., which are not shown in fig. 1, and are not shown here.
When the motor in fig. 1 is an AF motor, when the camera application is started, the electronic device controls the motor to work, that is, the electronic device controls the AF motor to be electrified, that is, the coil winding is electrified, under the condition that the coil winding is electrified, the electrified coil winding is influenced by ampere force in a magnetic field to enable the spring piece to move, and further enable the mover to vibrate in an active space to push the lens to move, when the lens moves to different positions, the camera of the electronic device captures images with different definition, and after the electronic device acquires the position of the lens corresponding to the image with definition higher than the highest preset value through a corresponding algorithm, the mover is controlled to be static so as to keep the lens at the position, and the AF motor realizes the automatic focusing process.
When the motor is powered down, that is, when the coil is not energized, no current flows in the magnetic field, and the spring piece and the mover are not controlled by the ampere force to vibrate, but the mover is not fixed, so that the mover can shake in the movable space when the body shakes, and collide with surrounding modules such as a shell, and abnormal sound is generated.
In other possible examples, when the motor is a vibration motor, the motor structure shown in fig. 1 may be other, but there is usually a certain active space for the sub-unit to vibrate, and other modules of the electronic device are arranged outside the active space, so the present application will not be described in detail.
Through analysis of fig. 1, it can be known that, when the motor is in a working state, since the electronic device powers on the motor, the mover in the motor can be controlled to be in a set position, and the set position is that the electronic device enables the motor to be in a controllable position according to service requirements, and in general, the mover in the motor cannot be separated from the set position due to the influence of shaking of the machine body, so that abnormal noise cannot be generated due to shaking. Under the condition that the motor is in a non-working state, as the electronic equipment is not electrified or the electrified current is smaller, the mover in the motor cannot be controlled to be in a set position, so that under the condition that the electronic equipment shakes, the mover in the motor can be influenced by the shaking of the machine body to shake in the movable space, and therefore the mover collides with surrounding modules to generate abnormal noise.
In order to solve the technical problems, the application provides a motor control method and electronic equipment, wherein the method comprises the following steps: detecting whether the shaking degree of the electronic equipment is greater than or equal to a threshold value, judging whether the motor is in a working state or not under the condition that the shaking degree of the electronic equipment is greater than or equal to the threshold value, and controlling the motor to keep the working state if the motor is in the working state; if the motor is in a non-working state, the position of the rotor in the motor is controlled to be fixed. Therefore, the rotor in the motor does not shake along with the shake of the electronic equipment, and abnormal sound cannot be generated.
Therefore, after the motor control method and the electronic equipment provided by the application are adopted, the following beneficial effects can be brought:
whether the electronic equipment enters an abnormal sound scene is detected in real time, and under the condition that the abnormal sound scene is detected, the motor can be controlled not to shake along with the shake of the electronic equipment, so that abnormal sound can not be generated, and better use experience is provided for a user. Moreover, by implementing the method provided by the application, the aim of eliminating abnormal sound of the motor can be fulfilled under the condition that the normal work of the motor in the service is not influenced, thereby ensuring the service experience of the user.
In some embodiments, the electronic device may employ a low power sensor to collect motion data of the electronic device, and determine, according to the motion data, that a degree of shake of the electronic device is greater than or equal to a threshold. In order to realize some common functions, the Sensor hub already controls the Sensor to collect the motion data of the electronic equipment, and the common functions such as calculating the motion steps and raising the hand to lighten the screen are realized by analyzing the motion data.
In some embodiments, the motor control method provided by the application is applicable to various motors installed in electronic equipment, including but not limited to vibration motors, motors in camera modules (e.g., AF motors), and the like.
By the implementation of the mode, abnormal sound can be avoided from being generated by various motors arranged in the electronic equipment.
The low-power consumption Sensor is a Sensor mounted on a Sensor hub (Sensor hub), and the Sensor hub is a chip independent of a CPU (central processing unit), so that the Sensor hub can automatically control the acceleration Sensor to acquire motion data of the electronic equipment in real time under the condition that the CPU is dormant. That is, the electronic device does not need to wake up the CPU to control the sensor operation.
Next, the form and the software and hardware architecture of the electronic device according to the present application will be described.
The electronic device may be a mounted deviceOr other operating system, such as cell phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (mobile personal computer, UMPC), netbooks, as well as cellular telephones, personal digital assistants (personal digital assistant, PDA), augmented reality (augmented reality, AR) devices, virtual Reality (VR) devices, artificial intelligence (artificial intelligence, AI) devices, wearable devices, vehicle-mounted devices, smart home devices, and/or smart city devices, among others.
Fig. 2 shows a schematic hardware configuration of the electronic device 100.
As shown in fig. 2, the electronic device 100 may include: processor 110, external memory interface 120, internal memory 130, display screen 140, camera 150, sensor module 160, motor 170, mobile communication module 180, wireless communication module 190. Wherein the sensor module includes, but is not limited to: an acceleration sensor 160A, a gyro sensor 160B, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown in FIG. 2, or may combine certain components, or split certain components, or a different arrangement of components. The components shown in fig. 2 may be implemented in hardware, software, or a combination of software and hardware. For example, the electronic device 100 may also include audio modules not shown in fig. 2, such as speakers, receivers, microphones, earphone interfaces, keys, indicators, and subscriber identity module (subscriber identification module, SIM) card interfaces, among others. The sensor module 160 may further include a pressure sensor, a barometric sensor, a magnetic sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I5C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
In the embodiment of the present application, the processor 110 may be configured to receive a detection result of the shake degree of the electronic device (hereinafter may also be referred to as a detection result of an abnormal sound scene) sent by the sensor module 160, so that the processor 110 determines how to control the motor according to the detection result and the current state of the motor, where the control manner specifically includes:
In addition, the processor 110 may be configured to determine how to control the motor to respond to the corresponding service according to the specific service notification and the current state of the motor after receiving the service notification initiated by the application or the service module, where the control manner specifically includes:
for a specific implementation method of determining the target state of the motor according to whether the service of the calling motor is started or not and the current running state of the motor after the processor 110 receives the detection result of the abnormal sound scene, reference may be made to the description of the method embodiment hereinafter, which is not repeated herein.
The internal memory 130 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM).
The random access memory may include a static random-access memory (SRAM), a dynamic random-access memory (dynamic random access memory, DRAM), a synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), a double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc.;
The nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. divided according to an operation principle, may include single-level memory cells (SLC), multi-level memory cells (MLC), triple-level memory cells (TLC), quad-level memory cells (QLC), etc. divided according to a storage specification, may include universal FLASH memory (english: universal FLASH storage, UFS), embedded multimedia memory cards (embedded multi media Card, eMMC), etc. divided according to a storage specification.
The random access memory may be read directly from and written to by the processor 110, may be used to store executable programs (e.g., machine instructions) for an operating system or other on-the-fly programs, may also be used to store data for users and applications, and the like.
The nonvolatile memory may store executable programs, store data of users and applications, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect external non-volatile memory to enable expansion of the memory capabilities of the electronic device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external nonvolatile memory.
In an embodiment of the present application, the memory may store a truth table for determining the target state of the motor.
Specifically, after the processor 110 receives the detection result of the abnormal sound scene of the motor, in combination with the current running state of the motor, the target state can be queried from the truth table pre-stored in the memory, and the motor is controlled to be in the target state. The contents of this truth table can be found in particular in table 1 below. Reference is also made to the description of the method flows S401-S408 below with respect to the specific application method of table 1.
Specifically, after the processor 110 receives the service notification initiated by the upper layer application or the service module, in combination with the detection result of the abnormal sound scene of the motor, the target state can be queried from the truth table pre-stored in the memory, and the motor is controlled to be in the target state. The contents of this truth table can be found in particular in table 2 below. Reference is also made to the description of the method flows S409-S411 below with respect to the specific application method of table 2.
Table 1 is one implementation of a truth table. The truth table shown in table 1 reflects the target states corresponding to the motor in different states, and when the electronic device 100 receives different abnormal sound scene detection results.
TABLE 1
As shown in table 1, the motor target state or the current state includes at least three states, i.e., an operating state (referred to as Normal), a non-operating state (referred to as Close), and an abnormal sound cancellation state (referred to as vibration). The abnormal sound scene detection results comprise two types: enter/be in an abnormal sound scene (denoted as a vibration enable), exit/not be in an abnormal sound scene (denoted as a vibration disable).
The working state means that the electronic equipment controls the motor to be electrified, and controls the motor to execute corresponding operation according to specific service notification, and when the specific service notification is different, the corresponding operation executed by the motor is also different. That is, as long as the motor is in an operational state, the motor is powered on and provides corresponding services to the application or service module, wherein the services provided by the motor depend on the specific service notification. When the service notification is initiated by the camera application, the service notification may be a focusing service of the camera application, and generally the focusing service includes two types, the first is that the focusing service initiated by the camera application is focused to a default fixed focal length in a stage of just starting to run after the camera application is started, and in this case, the motor is in a working state specifically including: after the AF motor is powered on, the mover in the AF motor directly moves to a default position (also referred to as a first position) so that the lens in the camera module is at a default fixed focal length. The second means that, in the running process of the camera application, if the auto-focusing function is started, the focusing service initiated by the camera application is to enter an auto-focusing mode, and in this case, the motor is in a working state specifically includes: after the AF motor is electrified, the mover in the AF motor is vibrated to push the lens in the camera module to move so as to acquire images acquired by the lenses at different positions, and after determining that the definition of the images is higher than the position (also called as a second position) of the lens corresponding to the focal length of the lens when the definition of the images is higher than a preset value, the mover is controlled to stop vibrating and fix the lens at the focal length.
The non-working state is that the electronic equipment controls the motor to be powered down, the position of the rotor in the motor is not controlled, and the rotor can shake according to external factors such as shaking of the machine body, so that abnormal sound is generated. For example, in a scene shot by the camera application, when the service notification initiated by the camera application is to exit the autofocus mode, the AF motor is in a non-working state specifically includes: and after the mover in the AF motor is restored to a default position, controlling the AF motor to be powered down, or directly controlling the AF motor to be powered down when the mover of the AF motor is positioned at a position after successful focusing.
The abnormal sound eliminating state is a state that when the electronic equipment detects that the motor enters an abnormal sound scene and the current state of the motor is not a working state, the motor is controlled to be electrified, and the position of a rotor in the motor is fixed. For example, in a scenario where the camera application is not started and the AF motor is in a non-working state, when the abnormal sound scenario detection result indicates that the motor enters the abnormal sound scenario, the AF motor is in the abnormal sound eliminating state specifically includes: after the AF motor is electrified, a rotor in the AF motor is positioned at a fixed position, which can be called a third position, and can be specifically any position in an activity space where the action is positioned, so that the rotor cannot shake randomly and shake, and abnormal sound cannot be generated.
It can be seen that, the working state and the abnormal sound eliminating state refer to the motor power-on state, but the specific states of the motor are different after the motor is powered on, specifically, the working state refers to the service notification initiated by the upper layer application or service, so that the motor power-on is controlled, the mover in the motor is in a set position, and then the event indicated by the service notification is executed. However, the abnormal sound eliminating state means that the motor is controlled to be electrified due to the fact that the notice of entering the abnormal sound scene is received, so that the position of a rotor in the motor is fixed, and abnormal sound generated by shaking of the motor is avoided.
With continued reference to table 1, under different abnormal sound scene detection results, the rules for controlling the motor by the processor 110 are as follows:
(1) When entering or being in an abnormal sound scene, if the current motor is in a working state, controlling the motor to keep the working state; if the motor is in a non-working state, controlling the position of a rotor in the motor to be fixed; if the position of the mover in the motor is fixed, the position of the mover in the motor is continuously controlled.
(2) When the motor exits or is not in the abnormal sound scene, if the current motor is in the working state, the motor is controlled to be in the working state continuously; if the motor is in a non-working state, continuing to control the motor to be in the non-working state; if the position of the mover in the motor is fixed, the motor is controlled to be switched to a non-operating state. Therefore, after the motor exits from the abnormal sound scene, the motor can continue to work normally, and the normal service of the electronic equipment is not affected.
Table 2 is one implementation of a truth table. The truth table shown in table 2 reflects the target states corresponding to different abnormal sound scene detection results and when the electronic device 100 receives different service notifications.
TABLE 2
As shown in table 2, the service notification includes: notification of entering a traffic scenario (denoted as normable), notification of exiting a traffic scenario (denoted as normable). Wherein the notification of entering/exiting the service scenario may include a specific service type, etc., which is not limited by the embodiment of the present application.
With continued reference to table 2, the rules for determining the target state from the contents described in table 2 are specifically as follows:
(1) After receiving the notice of entering the service scene, the target state is the working state no matter whether the latest received abnormal sound scene detection result indicates that the motor is/is not in the abnormal sound scene. Therefore, the motor can normally execute the operation corresponding to the service notification, and the normal use experience of the user is ensured.
(2) After receiving a notice of exiting the service scene, if the latest received abnormal sound scene detection result indicates that the motor is in an abnormal sound scene, the target state is an abnormal sound eliminating state; if the latest received abnormal sound scene detection result indicates that the motor is not in an abnormal sound scene, the target state is a non-working state.
In one embodiment, the contents described in table 1 and table 2 may be stored in one table, or may be stored in two tables, which is not limited in this embodiment of the present application.
The electronic device 100 implements display functions through a GPU, a display screen 140, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 140 is used to display images, videos, and the like. The display screen 140 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD). The display panel may also be manufactured using organic light-emitting diode (OLED), active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (flex-emitting diode), mini, micro-OLED, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 140, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 150, a video codec, a GPU, a display screen 140, an application processor, and the like.
The ISP is used to process the data fed back by the camera 150. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 150.
The camera 150 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 may include 1 or N cameras 150, N being a positive integer greater than 1.
When the camera 150 is a tele camera, the tele camera may also cooperate with the AF motor to achieve an auto-focusing function, and the exemplary description of fig. 1 may be referred to above for the constituent structures of the tele camera (corresponding to the lens in fig. 1) and the AF motor, which is not repeated herein.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The sensor module 160 includes a sensor hub, a sensor mounted in the CPU, and the like. The sensor mounted in the sensor hub may be, for example, an acceleration sensor 160A or the like.
The acceleration sensor 160A may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The gyro sensor 160B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 160B. The gyro sensor 160B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 160B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 160B may also be used for navigation, somatosensory of a game scene.
In the embodiment of the application, the Sensor hub is equivalent to a micro-program controller (Microprogrammed Control Unit, MCU), and a plurality of Sensor drivers can be run on the MCU for connecting and processing data from various Sensor devices, so that the centralized control of the sensors is realized, and the load of a central processing unit (Central Processing Unit, CPU) is reduced.
It will be appreciated that the name sensor hub is merely exemplary, and is MCU in nature, the function of which is described in detail below, and the application is not limited to the name sensor hub.
Next, two basic functions included in Sensor hub are specifically described:
(1) Sensor hub control sensors collect data.
Sensor hub may support mounted sensors including, but not limited to, acceleration sensors. That is, a driver for controlling the operation of the acceleration Sensor is operated in the Sensor hub. Because the Sensor hub is a chip independent of the CPU, the Sensor hub can still automatically control the acceleration Sensor to collect the motion data of the electronic equipment in real time under the condition that the CPU is dormant. In addition, the low-level Chip of Sensor hub is smaller than the System On Chip (SOC) of CPU, so the Sensor hub is adopted to control the operation of the Sensor, and the power consumption of the electronic equipment can be greatly reduced.
(2) The Sensor hub receives and processes the data acquired by the Sensor.
The Sensor hub may receive data collected by sensors mounted thereon, including but not limited to motion data of the electronic device collected by acceleration sensors. Then, the algorithm module in the Sensor hub can fuse the data of different sensors according to the requirement so as to realize the function that can only be realized by combining various Sensor data, for example, the Sensor hub Motion module can realize the shake scene detection function after respectively acquiring the Motion data of the electronic equipment according to the acceleration Sensor and the gyroscope Sensor for fusion. Or the algorithm module in Sensor hub realizes the corresponding function according to the need only according to one kind of Sensor data. For example, the sensor hub Motion module collects Motion data of the electronic device according to the acceleration sensor to achieve a shake scene detection function.
Notably, after the Sensor hub is based on the introduced motion data of the electronic device, the Sensor hub can automatically detect the shaking scene without reporting an Application Processor (AP) in the CPU to judge by the CPU. Under the condition that the Sensor hub detects the shaking scene, the Sensor hub sends the shaking scene to the CPU in an inter-core communication mode, the CPU further combines the service of the motor to determine the target state of the motor, and controls the motor to be in the target state, so that the motor in the target state cannot shake along with shaking of the electronic equipment, and abnormal sound cannot be generated.
The first function of Sensor hub is a function already provided by most electronic devices at present, that is, most electronic devices need to collect motion data of the electronic devices in real time through an acceleration Sensor, so as to realize some common functions, such as realizing an automatic turning function of a screen, for example, controlling characters or objects in a game to move along a rotation direction of a mobile phone through rotating the electronic devices in a game scene, and the like.
The second function of the Sensor hub is to realize the function newly added by the motor control method provided by the application, and the motion data required by the newly added function, namely the motion data acquired by the current electronic equipment in order to realize other common functions in real time, that is, the data acquired by the Sensor hub control acceleration Sensor can be multiplexed into different algorithm modules for realizing different functions. Therefore, the motion data of the acquired electronic equipment in the motor control method can be directly multiplexed with the motion data acquired in the prior art, so that the motion data does not need to be acquired again, and the power consumption of the electronic equipment is reduced.
The motor 170 may include one or more, for example, a motor in a camera module such as an AF motor, a vibration motor that generates a vibration cue, and the like. Reference may be made to the foregoing description for the structure and operation of the AF motor, which is not repeated here. The vibration motor can be used for incoming call vibration prompt and touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 170 may also correspond to different vibration feedback effects by touching different areas of the display screen 140. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
It can be seen that when the types of motors are different, the operating states of the motors are specifically different. Specifically, taking an AF motor as an example, when a camera application or a camera service module of the electronic device initiates a service notification, for example, when the service notification is to enter an auto-focusing mode, controlling the AF motor to be in a working state specifically means controlling the AF motor to be powered on and realizing an auto-focusing function of the camera through vibration. Taking the vibration motor as an example, when a short message, a telephone application or a notification service module of the electronic equipment initiates a service notification, for example, when the service notification is in a play alert tone mode, the vibration motor is controlled to be in a working state, specifically, the vibration motor is controlled to be powered on and corresponding alert tones are output through vibration.
In addition, when the motors of the electronic devices are of the same type, the working states of the control motors can be different specifically due to different specific service notices. Taking a vibration motor as an example, when a specific service notification is that a short message prompt tone is output, controlling the vibration motor to be in a working state specifically means controlling the motor to be electrified and vibrating with smaller intensity so as to output a smaller prompt tone; when the specific service notification is to output the incoming call prompt tone, the control of the vibration motor in the working state specifically means that the motor is controlled to be electrified and vibrate with larger intensity and specific frequency to output the larger and rhythmic prompt tone.
The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 180, the wireless communication module 190, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 180 may provide a solution for wireless communication including 5G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 180 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 180 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 180 may amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate the electromagnetic waves. In some embodiments, at least some of the functional modules of the mobile communication module 180 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 180 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 140. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 180 or other functional module, independent of the processor 110.
The wireless communication module 190 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 190 may be one or more devices that integrate at least one communication processing module. The wireless communication module 190 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 190 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 180 of electronic device 100 are coupled, and antenna 2 and wireless communication module 190 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
The motor control method provided by the present application is described below with reference to a software architecture of an electronic device exemplarily shown in fig. 3.
As shown in fig. 3, the software architecture includes an application layer, an application framework layer, a hardware abstraction layer (Hardware Abstraction Layer, HAL), and a kernel layer.
Wherein, camera application (Camera app) in the application program, camera service (Camera service) in the application program framework layer, camera provider in the HAL layer, camera Driver in the kernel layer and the like run in a CPU in the electronic device. And Sensor services (Sensor services) in the application framework layer, sensor hub motion in the kernel layer, run on Sensor hub in the electronic device. The description of Sensor hub may be specifically referred to the foregoing description, and is not repeated herein.
The Camera app can execute corresponding tasks according to user operation, specifically, if a user starts a Camera application and starts an automatic focusing function, the Camera app can send shooting instructions, automatic focusing instructions and the like to a Camera Driver through Camera service and Camera provider, so that the Camera Driver controls the Camera to acquire images, and controls the AF motor to realize the automatic focusing function.
In the embodiment of the application, the Cameraprovider is an independent process which can be automatically started after the electronic equipment is started, namely, the system is started. The camera provider can send a command for detecting the abnormal sound scene to the Sensor hub motion through the Sensor service in an inter-core communication mode, and can also receive a result detected by the Sensor hub motion returned by the Sensor service in an inter-core communication mode.
After the Camera provider receives the result that the electronic device enters the abnormal sound scene, the Camera provider can acquire the service of the current Camera from the Camera service of the upper layer, and the target state of the AF motor is determined according to the service of the current Camera, so that abnormal sound of the AF motor is avoided.
Regarding a specific implementation method of Sensor hubmotion to detect abnormal sound scenes and a specific implementation method of camera provider to determine the target state of the AF motor, reference may be made to detailed description of a method flow, which is not repeated herein.
It will be appreciated that the software architecture of the electronic device 100 shown in fig. 3 is only an example, and that the software architecture of the alternative electronic device 100 may further include the following modules not shown:
the application layer may include a series of application packages, and may also include, for example, applications for cameras, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. For example, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. may also be included.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The kernel layer is the layer between the hardware and the HAL. The kernel layer may also contain, for example, display drivers, audio drivers.
Next, the motor control method provided by the present application will be described in detail with reference to the method flow shown in fig. 4.
As shown in fig. 4, the method flow includes the steps of:
stage one (S401): and preprocessing, namely acquiring conditions of the electronic equipment entering the abnormal sound scene, and presetting the conditions in the electronic equipment.
S401, presetting a condition corresponding to an abnormal sound scene in Sensor hub motion of the electronic device.
Specifically, the condition corresponding to the abnormal sound scene may be preset in the electronic device by a developer, for example, preset in a Sensor hub motion module of the electronic device. The condition is used for judging whether the condition corresponds to the abnormal sound scene or not according to the motion data of the electronic equipment by the subsequent Sensor hub motion module, if so, the electronic equipment is considered to enter or be in the abnormal sound scene, otherwise, the electronic equipment is considered to not enter or be in the abnormal sound scene and whether to exit the abnormal sound scene or not.
From the above analysis, it is known that abnormal sound of the motor is caused when the electronic device is in a shaking scene. However, in daily life, there are many shaking scenes of the electronic device, some shaking scenes may not cause abnormal motor sound, and some shaking scenes may cause abnormal motor sound. Therefore, a developer can simulate experiments of the electronic equipment in different shaking scenes for many times, so as to measure shaking scenes with high abnormal sound probability of the motor, collect motion data of the electronic equipment in the shaking scenes with high abnormal sound probability of the motor, and obtain conditions corresponding to the abnormal sound scenes by analyzing the characteristics of the motion data.
Next, a specific method for a developer to obtain conditions corresponding to abnormal sound scenes through a large number of experiments is described.
1. Firstly, motion data of the electronic equipment under various shaking scenes (including rapid shaking scenes which cause abnormal noise and other shaking scenes which do not cause abnormal noise) are collected.
The sloshing scene may include, but is not limited to: the handheld electronic device can shake rapidly, shake the handheld electronic device slowly, run down the building quickly, run down the building slowly, run down the building with the handheld electronic device, run the electronic device in a pocket, walk the electronic device in the pocket, place the electronic device on a desktop, pick the electronic device up from the desktop, and the like.
In the process of acquiring the motion data of the electronic equipment in different shaking scenes, the motor abnormal sound of the electronic equipment in which shaking scene can be tested.
In one possible implementation manner, a developer may test whether the AF motor generates abnormal sound by simulating that the electronic device is in the above different shaking scenes for a plurality of times with the AF motor generating abnormal sound as a test target.
In another possible implementation manner, a developer may test whether the abnormal sound occurs in the vibration motor by simulating that the electronic device is in the above different shaking scenes for a plurality of times with the abnormal sound occurring in the vibration motor as a test target.
The test result shows that the shaking scene with higher abnormal sound probability of the motor is the hand-held electronic equipment to shake rapidly, and under the condition that the abnormal sound probability of the motor is lower or abnormal sound cannot occur in other shaking scenes, the motion data of the electronic equipment in the shaking scene with higher abnormal sound probability of the motor is analyzed to determine the conditions corresponding to the abnormal sound scene.
It will be appreciated that the results of the test resulting in abnormal motor sound may be different for different electronic devices, or different types of motors, and the application is not limited to the results of the test, depending on the test object, such as the electronic device, the motor, etc.
The motion data of the electronic device may be acceleration collected by an acceleration sensor, or may include data collected by more other sensors, as examples, but the embodiments of the present application are not limited in this respect.
The embodiment of the application only takes the motion data of the acceleration of the electronic equipment as an example to introduce the characteristics of the acceleration of the electronic equipment under different shaking scenes. Specifically, acceleration of the electronic equipment is continuously collected under different shaking scenes by adopting an acceleration sensor with the working frequency of 100Hz, and acceleration change curves under different shaking scenes are drawn based on collected data. Reference is made in particular to the description of fig. 5A-5I below.
Referring to fig. 5A-5I, fig. 5A-5I schematically illustrate acceleration profiles of a set of electronic devices under different shake scenarios.
As shown in fig. 5A, fig. 5A illustrates a graph of acceleration of the electronic device with time, which is generated in three directions of x, y, and z, respectively, in a scene where the handheld electronic device is rapidly shaken.
Similarly, fig. 5B, 5C, 5D, 5E, 5F, 5G, 5H, and 5I illustrate curves of acceleration of the electronic device in the x, y, and z directions over time, respectively, in a scenario in which the handheld electronic device is being cranked slowly, the handheld electronic device is being downstairs quickly, the handheld electronic device is being downstairs slowly, the handheld electronic device is being downstairs, the electronic device is being run in a pocket, the electronic device is being walked in a pocket, the electronic device is being placed on a table, and the electronic device is being lifted from the table.
The x-direction shown in fig. 5A-5I is a direction parallel to the short-side screen of the electronic device, the y-direction is a direction parallel to the long-side screen of the electronic device, and the z-direction is a direction perpendicular to the screen of the electronic device. The horizontal axis is time, the unit is second, the vertical axis is acceleration in the corresponding direction, the unit is g x m/s 2, wherein g is gravity acceleration, and the value of g is 9.8.
It can be understood that the acceleration change curves of the electronic device shown in fig. 5A-5I under different shaking scenes are merely examples, and the acceleration change curves of the electronic device under different shaking scenes may be collected differently for different electronic devices or different acceleration sensors, so that the drawn curves are slightly different, which is not limited in the embodiment of the present application.
2. Finally, comparing and analyzing the shaking degree represented by the motion data of the electronic equipment in the shaking scene with higher abnormal sound probability and in other shaking scenes without abnormal sound or with lower abnormal sound probability, and determining the conditions which are met by the shaking degree of the electronic equipment when the abnormal sound of the motor possibly occurs.
Specifically, the shaking degree of the electronic device needs to be larger than a first value under a shaking scene with higher abnormal sound occurrence probability through analysis, the shaking degree of the electronic device needs to be smaller than a second value under other shaking scenes without abnormal sound occurrence probability or with lower abnormal sound occurrence probability through analysis, a certain value between the first value and the second value is used as a condition met by the shaking degree of the electronic device under the abnormal sound scene of the motor, and the condition is that the shaking degree needs to be larger than or equal to a certain value (also called a threshold) between the first value and the second value.
The method determines the threshold value and detects the abnormal sound scene based on the threshold value, so that the electronic equipment can detect the abnormal sound possibly occurring in advance, and timely implement corresponding measures for eliminating the abnormal sound, thereby effectively avoiding the abnormal sound. That is, the detected abnormal sound scene according to the present application includes: abnormal sound has not occurred but is most likely to occur next. In one possible implementation manner, the number of values for representing the shaking degree may be two, where the first number refers to the number of times that the acceleration is greater than a specific value by analyzing the acceleration change condition in a period of time; the second numerical value is to determine the times of occurrence of the peak or the trough of the acceleration, namely the times of shaking of the electronic equipment by analyzing the change condition of the acceleration within a period of time.
Correspondingly, when two values for representing the shaking degree can be provided, the finally determined threshold value which is greater than or equal to the shaking degree of the electronic equipment and is possibly generated when the abnormal sound of the motor is generated also comprises two threshold values, and the threshold values can be respectively called a first threshold value and a second threshold value.
Next, a method for determining the first threshold and the second threshold is illustrated in conjunction with the acceleration change of the electronic device in the shake scenarios shown in fig. 5A-5I.
In the embodiment of the application, the electronic device can determine the unique characteristics of a scene (i.e. abnormal sound scene) of the rapid shaking of the handheld electronic device by taking the characteristics of acceleration in any one direction of x, y and z directions as an analysis object or the characteristics of composite acceleration in any plurality of directions as an analysis object, and the unique characteristics can be taken as conditions of the abnormal sound scene, and can specifically refer to the main vibration direction of a rotor in a motor in an active space.
Taking an AF motor as an example, the AF motor is used to make the mover vibrate along the z direction to push the tele lens to move in the direction perpendicular to the screen of the electronic device (z direction) so as to achieve the purpose of automatic focusing, and as can be seen, the active space of the mover in the AF motor is mainly in the z direction, so that the unique characteristics of the abnormal sound scene are determined mainly by analyzing the characteristics of acceleration in the z direction, specifically as follows:
by comparing and analyzing the time-dependent acceleration curve in the z direction in fig. 5A with the time-dependent acceleration curves in the z direction in fig. 5B to 5I, it can be known that:
In a case where the handheld electronic device is rapidly shaken, a time-dependent acceleration profile of the electronic device in the z-direction has a stable characteristic, for example, in the acceleration profile every 2s, the number of times that the amplitude of the acceleration is greater than a specific value (for example, 40 g) is much greater than 20 times, and the number of times that the peak or trough of the acceleration occurs is greater than or equal to 20 times.
That is, in the acceleration change curve shown in fig. 5A, that is, the degree of shake is greater than the first value, including the degree of shake having an acceleration amplitude greater than the specific value being greater than the third value and the frequency of shake being greater than the fourth value, when the degree of shake is characterized by the number of times of shake having an amplitude greater than the specific value and the frequency of shake (the number of times of occurrence of the peak or trough within the fixed period of time).
In other scenarios than rapid shaking of the handheld electronic device, the acceleration profile of the electronic device in the z-direction over time is not characterized as stable, e.g. in every 2s of acceleration profile the number of times the amplitude of the acceleration is larger than a specific value (e.g. 40 g) is not fixed and is less than 15 times and the number of times the peak or trough of the acceleration occurs is less than 10 times.
That is, in the acceleration change curves shown in fig. 5B to 5I, when the degree of shake is characterized by the number of times the magnitude of shake is larger than a specific value and the frequency of shake (the number of times the peak or trough occurs within a fixed period of time), the degree of shake is smaller than the second value, including the number of times the magnitude of acceleration is larger than a specific value is smaller than the fifth value, and the frequency of shake is smaller than the sixth value.
In the embodiment of the application, the electronic device for the developer to perform the above test may also be referred to as a second device.
The above only describes a method for obtaining a threshold value of the shaking degree, and in another possible manner, the developer may also obtain the threshold value by:
the second device is controlled to shake at a first acceleration and a first shake frequency. Specifically, the first acceleration is a set of continuously varying accelerations during a certain period of time, and the wobble frequency refers to the number of occurrences of peaks or troughs of acceleration during the certain period of time.
In the previous shaking process, if the motor in the second equipment does not generate abnormal sound, gradually increasing acceleration and shaking frequency, and controlling the second equipment to shake until the motor in the second equipment generates abnormal sound;
and determining a first threshold according to a second acceleration when abnormal sound occurs to the motor in the second device, and determining a second threshold according to a second shaking frequency when abnormal sound occurs to the motor in the second device.
To sum up, in order to ensure that a scene in which abnormal noise may occur can be detected in advance, the positioning the adjustment satisfied by the shaking degree to be between the first value and the second value includes: the number of times the acceleration amplitude is greater than a specific value is set between a third value and a fifth value, referred to as a first threshold, and the frequency of shake is positioned between a fourth value and a sixth value, referred to as a second threshold. Wherein the specific value refers to a magnitude smaller than the acceleration at the peak in fig. 5A and larger than the acceleration at the peak in fig. 5B-5I.
The embodiment of the present application is not limited to the first to sixth values and the specific numerical values of the respective threshold values. Only under the condition that the acceleration sensor with the working frequency of 100Hz is adopted to collect the acceleration of the electronic equipment, the data sliding window of 2s can be taken as a reference, namely, the specific value is determined to be 40g by detecting 200 groups of accelerations within 2s, the first threshold value can be 16 times, and the second threshold value can be 11 times.
In the motor control method provided by the application, the first stage is usually executed by a developer before the electronic equipment leaves the factory, and the second stage and the third stage are executed after the electronic equipment is started after the electronic equipment leaves the factory.
Stage two (S402-S405) detecting whether the electronic device enters and exits the abnormal sound scene in real time.
S402: the camera provider of the electronic device sends Sensor hub motion an instruction to detect an abnormal sound scene.
Specifically, after the electronic device is started, each service module in the electronic device starts to be started, including a camera provider. For a specific description of the camera provider, reference may also be made to the description of the foregoing software architecture, which is not repeated herein. After the electronic equipment is started, the camera provider can automatically start an independent process, specifically, the camera provider can send an instruction for detecting the abnormal sound scene to the sensor through an inter-core communication mode, and then the sensor sends an instruction for detecting the abnormal sound scene to Sensor hub motion.
Preferably, after the electronic device is started, the self-started camera provider process of the electronic device is a resident process, and the resident process can be implemented to respond to the detection result of the abnormal sound scene in real time, so that when the electronic device enters the abnormal sound scene, corresponding response measures, such as controlling the motor to be in an abnormal sound eliminating state, are timely made.
In the embodiment of the application, after the electronic equipment is started, no matter the electronic equipment is in a screen-off state, a screen-locking interface is displayed, an unlocked interface is displayed, or an application interface is displayed, the camera provider of the electronic equipment can control the responding module to detect abnormal sound scenes, and corresponding responding measures are made according to the detection result.
Alternatively, sensor hub motion is merely an example, and the Cameraprovider of the electronic device may send an instruction to other modules controlling the low-power motor to detect the abnormal sound scene, which is not limited by the present application.
S403: the Sensor hub motion of the electronic device sends instructions to the sensor for gathering motion data of the electronic device.
Specifically, in one implementation manner, when Sensor hub motion receives an instruction for detecting an abnormal sound scene, the corresponding sensor is controlled to collect motion data of the electronic device, in another implementation manner, sensor hub motion receives an instruction for detecting an abnormal sound scene, and then required motion data can be directly obtained from other modules in the sensor rhub, where the motion data are obtained by controlling the sensor to collect motion data when the sensor rhub runs other services. For example, when the electronic device is started, the corresponding modules in the sensor rhub control the acceleration sensor to collect the acceleration of the electronic device when the sensor rhub automatically runs the services of lifting the hand, brightening the screen, calculating the number of exercise steps, and the like. In the embodiment of the application, the acceleration sensor is used for collecting the acceleration of the electronic device, in another possible implementation manner, sensor hub motion can also control more sensors to collect the motion data of other different electronic devices, for example, control the gyroscope to sense and collect the angular velocity of the electronic device, so as to determine the motion gesture of the electronic device.
S404: the sensor of the electronic device periodically reports the acquired motion data of the electronic device to Sensor hub motion.
Specifically, the sensor in the embodiment of the present application is specifically an acceleration sensor with a working frequency of 100Hz, and the acceleration sensor may periodically report the collected acceleration of the electronic device to Sensor hub motion, where the period may be, for example, 2s or other periods. That is, the acceleration sensor sends a set of data to Sensor hub motion every 2s for the subsequent Sensor hub motion detection of whether the electronic device enters an abnormal sound scene.
S405: and Sensor hub motion of the electronic equipment judges whether the conditions corresponding to the abnormal sound scene are met according to the motion data.
Specifically, each time the Sensor hub motion of the electronic device receives the motion data of a group of electronic devices, it determines, according to the condition corresponding to the preset abnormal sound scene, whether the condition corresponding to the abnormal sound scene is met, that is, whether the electronic device is in the abnormal sound scene.
In view of the conditions of the abnormal sound scene described in S401, when Sensor hub motion receives a set of acceleration data within 2S from this time, the set of acceleration data is compared with the pre-stored data conforming to the abnormal sound scene to determine whether the electronic device is in the abnormal sound scene. In a specific embodiment, a time-dependent change curve of acceleration in the z direction can be drawn through the received set of data, so as to determine whether the shaking degree represented by the set of data is greater than or equal to a pre-stored threshold value, including whether the frequency of the acceleration is greater than a specific value is greater than a first threshold value, and whether the shaking frequency is greater than a second threshold value, and if the two conditions are met, sensor hub motion considers that the electronic device is detected to be in/enter an abnormal sound scene, otherwise, considers that the current electronic device is not in/exits the abnormal sound scene.
It can be understood that the abnormal sound scene detection in S404 is executed every time the data reported by the sensor is received by the Sensor hub motion, so that the purpose of detecting the abnormal sound scene in real time can be achieved.
Optionally, sensor hub motion clears the detected data after each detection of motion data of a group of electronic devices, thereby relieving the storage pressure of Sensor hub.
Therefore, the Sensor hub provided by the application can acquire the motion data of the electronic equipment, and directly judge whether the current electronic equipment enters the abnormal sound scene according to the motion data and the conditions of combining with the preset abnormal sound scene, and the acquired motion data is not required to be reported to the CPU or the AP in the CPU for judgment, so that the CPU is prevented from being awakened under the condition that the abnormal sound scene is not detected, and the purpose of saving the power consumption of the electronic equipment is achieved.
And step three (S406-S409), controlling the motor to avoid abnormal sound when the abnormal sound scene is detected.
S406: and Sensor hub motion of the electronic equipment returns a detection result of the abnormal sound scene to the Cameraprovider.
In one implementation, sensor hub motion returns an abnormal scene detection result to the Camera provider only if the detection result is switched. The abnormal sound scene detection results include a vibration enable (entering an abnormal sound scene), and a vibration disable (exiting an abnormal sound scene) as shown in the foregoing table 1.
For example, when Sensor hub motion detects that the electronic device does not enter the abnormal sound scene according to the previous set of data (e.g., within 0-2 s), if the electronic device is detected to enter the abnormal sound scene according to the current set of data (e.g., within 2-4 s), the abnormal sound scene detection result is returned to the Camera provider. For another example, in the case that Sensor hub motion detects that the electronic device enters the abnormal sound scene according to the previous set of data (for example, within 2-4 s), if it is detected that the electronic device still enters the abnormal sound scene according to the current set of data (for example, within 4-6 s), the detection result of the abnormal sound scene is not returned to the Camera provider.
In another possible implementation manner, sensor hub motion may return the result obtained by each abnormal sound scene detection to the Camera provider. Comprising the following steps: and detecting that the current electronic equipment enters the abnormal sound scene and does not enter the abnormal sound scene.
In another possible implementation manner, sensor hub motion may return the result of detecting that the electronic device enters the abnormal sound scene every time to the Camera provider, but not return the detection result of detecting that the electronic device does not enter the abnormal sound scene.
S407: and the camera provider of the electronic equipment determines the target state of the motor according to the abnormal sound scene detection result and the current state of the motor.
Specifically, a truth table for determining the target state of the motor is preset in the Camera provider of the electronic device, and specifically, as can be seen from the description of the foregoing table 1, when the Camera provider of the electronic device receives the abnormal sound scene detection result, the target state of the motor can be queried from the prestored truth table in combination with the current state of the motor.
As can be understood from the contents shown in table 1, specific rules for determining the motor target state include:
(1) When the received detection result is that the shaking degree is greater than or equal to a threshold value (which can also be called that the electronic equipment enters or is in an abnormal sound scene),
if the current state of the motor is the working state, the target state is the working state;
if the current state of the motor is not the working state, the target state is the abnormal sound eliminating state, namely the state that the position of a rotor in the motor is fixed;
if the current state of the motor is the abnormal sound eliminating state, the target state is the abnormal sound eliminating state.
(2) When the received detection result is that the shaking degree is smaller than a threshold value (which can also be called that the electronic equipment exits or is not in an abnormal sound scene),
if the current state of the motor is the working state, the target state is the working state;
if the current state of the motor is a non-working state, the target state is a non-working state;
If the current state of the motor is the abnormal sound eliminating state, the target state is the non-working state.
S408: the camera provider of the electronic device controls the AF motor to be in a target state.
In one implementation, the Camera provider of the electronic device may control the AF motor in the Camera module in the hardware layer through the Camera driver of the kernel layer, so that the AF motor is in a target state.
When the target state is a working state, the Camera provider of the electronic equipment can control the AF motor in the Camera module in the hardware layer to be electrified through the Camera drive of the kernel layer, so that a rotor in the motor is positioned at a set position, and further, an event indicated by service notification is executed. The service notification herein refers to a service notification initiated by an upper layer application or a service, for example, the service notification sent by the upper layer camera application to the camera provider through the camera device may be specifically a service notification entering into auto-focus.
When the target state is a non-working state, the Camera provider of the electronic equipment can control the AF motor in the Camera module in the hardware layer to be powered down through the Camera drive of the kernel layer, so that the position of a rotor in the motor is not controlled.
When the target state is the abnormal sound eliminating state, the Camera provider of the electronic equipment can control the AF motor in the Camera module in the hardware layer to be electrified through the Camera drive of the kernel layer, and the position of the rotor in the AF motor is fixed. The present application is not limited to this fixed position. For example, as shown in fig. 1, the position fixing of the mover in the control AF motor may be any position such as the lowest, the topmost, or the middle of the control mover in the active space. When the electronic equipment controls the motor to be in the abnormal sound eliminating state, the electronic equipment can be in any one of the following conditions: the method comprises the steps of screen extinguishing, screen locking interface displaying, screen unlocking interface displaying and camera application external application interface displaying.
It will be appreciated that the above-described S401-S408 only describes a method of controlling an AF motor, and when controlling other types of motors such as a vibration motor, the control method is similar thereto, except that the module for initiating detection of abnormal sounds of the vibration motor is no longer a camera provider, but a module for docking the vibration motor, and an initiator of a service for the vibration motor is no longer a camera application or a camera device, but an application or notification service of a short message, a telephone, an alarm clock, or the like.
Optionally, after the motor is controlled to be in the abnormal sound eliminating state in S408, the motor control method provided by the present application further includes the following steps:
s409, the Camera provider of the electronic device receives the service notification sent by the Camera service.
Specifically, when the Camera app of the electronic device receives the operation of the user to generate the service, or when the Camera service spontaneously generates the service, the Camera app may send a service notification to the Camera provider directly through the Camera service, or the Camera service may send the service notification to the Camera provider directly.
The service notification includes: notification of entry into the business scenario, notification of exit from the business scenario. The notification of entering/exiting the service scenario may include a specific service type, for example, a notification of entering auto-focus service, which is not limited in the embodiment of the present application.
S410, the Camera provider of the electronic equipment determines the target state of the motor according to the service notification and the latest abnormal sound scene detection result.
Specifically, a truth table for determining the target state of the motor is preset in the Camera provider of the electronic device, and specifically, as can be seen from the description of the foregoing table 2, after the Camera provider of the electronic device receives the service notification, the target state of the motor can be queried from the prestored truth table in combination with the latest received abnormal sound scene detection result.
As can be understood from the contents shown in table 2, specific rules for determining the motor target state include:
(1) When a notice of entering a service scene is received, the target state is a working state no matter whether the latest received abnormal sound scene detection result indicates that the motor is/is not in the abnormal sound scene.
(2) When receiving a notice of exiting a service scene, if the latest received abnormal sound scene detection result indicates that the motor is in an abnormal sound scene, the target state is an abnormal sound eliminating state; if the latest received abnormal sound scene detection result indicates that the motor is not in an abnormal sound scene, the target state is a non-working state.
S411: the Camera provider of the electronic device controls the AF motor to be in a target state.
The specific implementation of S411 is the same as the specific implementation described in S408, and is not repeated here.
It will be understood that the above-described S409-S411 merely describes a method of controlling an AF motor, and when controlling other types of motors such as a vibration motor, the control method is similar thereto, differing only in that a module for initiating a service notification is no longer a Camera application or a Camera device, but an application or a notification service of a short message, a telephone, an alarm clock, or the like, and a module that receives a service notification is no longer a Camera provider, but a module that controls a HAL layer of a vibration motor.
It should be understood that each step in the above method embodiments provided by the present application may be implemented by an integrated logic circuit of hardware in a processor or an instruction in software form. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The present application also provides an electronic device, which may include: memory and a processor. Wherein the memory is operable to store a computer program; the processor may be operative to invoke a computer program in said memory to cause the electronic device to perform the method of any of the embodiments described above.
The application also provides a chip system comprising at least one processor for implementing the functions involved in the method performed by the electronic device in any of the above embodiments.
In one possible design, the system on a chip further includes a memory to hold program instructions and data, the memory being located either within the processor or external to the processor.
The chip system may be formed of a chip or may include a chip and other discrete devices.
Alternatively, the processor in the system-on-chip may be one or more. The processor may be implemented in hardware or in software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general purpose processor, implemented by reading software code stored in a memory.
Alternatively, the memory in the system-on-chip may be one or more. The memory may be integral with the processor or separate from the processor, and embodiments of the present application are not limited. The memory may be a non-transitory processor, such as a ROM, which may be integrated on the same chip as the processor, or may be separately provided on different chips, and the type of memory and the manner of providing the memory and the processor are not particularly limited in the embodiments of the present application.
Illustratively, the system-on-chip may be a field programmable gate array (field programmable gate array, FPGA), an application specific integrated chip (application specific integrated circuit, ASIC), a system on chip (SoC), a central processing unit (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), a microcontroller (micro controller unit, MCU), a programmable controller (programmable logic device, PLD) or other integrated chip.
The present application also provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions), which when executed, causes a computer to perform the method performed by the electronic device in any of the embodiments described above.
The present application also provides a computer-readable storage medium storing a computer program (which may also be referred to as code, or instructions). The computer program, when executed, causes a computer to perform the method performed by the electronic device in any of the embodiments described above.
The embodiments of the present application may be arbitrarily combined to achieve different technical effects.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part 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, the processes or functions in accordance with the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
In summary, the foregoing description is only exemplary embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention should be included in the protection scope of the present invention.

Claims (14)

1. A motor control method, wherein the method is applied to an electronic device comprising a camera module, the camera module comprising a motor and a lens; when the motor is electrified, the mover in the motor moves to drive the lens to move; the method comprises the following steps:
when the electronic equipment runs a camera application, controlling the motor to be electrified so that a rotor in the motor is fixed at a first position;
Controlling a mover in the motor to move to a second position when a change in focal length of the camera application is detected, the second position being different from the first position;
when the electronic equipment is detected to shake in the process of running the camera application by the electronic equipment, continuing to execute focusing service of the camera application by controlling the position of a rotor in the motor;
controlling the motor to be powered down after the electronic equipment stops running the camera application;
and after the electronic equipment stops running the camera application, when the electronic equipment is detected to shake, controlling the motor to be electrified so that a rotor in the motor is fixed at a third position, wherein the third position is the same as or different from the first position.
2. The method of claim 1, wherein after the electronic device stops running the camera application and during the electronic device controlling the motor to power up such that the mover in the motor is fixed in a third position, the electronic device is in any of: the method comprises the steps of screen extinguishing, screen locking interface displaying, screen unlocking interface displaying or application interface outside the camera application displaying.
3. The method according to claim 1 or 2, wherein when the electronic device is detected to shake, the electronic device continues to perform a focusing service of the camera application by controlling a position of a mover in the motor, or controls the motor to be powered up so that the mover in the motor is fixed in a third position, specifically comprising:
the electronic equipment detects abnormal sound scenes;
after detecting that the electronic equipment enters an abnormal sound scene, the electronic equipment judges the current state of the motor;
when the current state of the motor is determined to be a working state, controlling the motor to be in the working state continuously;
when the current state of the motor is determined to be a non-working state, controlling the motor to be in an abnormal sound eliminating state;
the abnormal sound scene detection means that the electronic equipment is subjected to shaking detection; detecting entering an abnormal sound scene refers to detecting shaking of the electronic equipment;
the working state comprises a state that the motor is powered on and the focusing service of the camera application is executed by controlling the position of a rotor in the motor;
the non-working state comprises a state that the motor is powered down;
The abnormal sound eliminating state comprises a state that the motor is electrified and the mover in the motor is fixed at a third position.
4. A method according to any one of claims 1-3, characterized in that after the electronic device controls the motor to be powered up such that the mover in the motor is fixed in a third position, the method further comprises:
and when the electronic equipment is not detected to shake, controlling the motor to be powered down.
5. The method of claim 4, wherein when the electronic device is not detected to shake, controlling the motor to be powered down comprises:
the electronic equipment detects abnormal sound scenes;
after detecting that the electronic equipment exits from the abnormal sound scene, the electronic equipment judges the current state of the motor;
when the current state of the motor is determined to be the abnormal sound eliminating state, controlling the motor to be in a non-working state;
the abnormal sound scene detection means that the electronic equipment is subjected to shaking detection; detecting to exit the abnormal sound scene means that the electronic equipment is not detected to shake;
the abnormal sound eliminating state comprises a state that the motor is electrified and the mover in the motor is fixed at a third position;
The non-operating state includes a state in which the motor is powered on and a focusing service of the camera application is performed by controlling a position of a mover in the motor.
6. The method of any one of claims 1-5, wherein after the electronic device controls the motor to power up such that a mover in the motor is fixed in a third position, the method further comprises:
when the camera application runs, executing focusing service of the camera application by controlling the position of a rotor in the motor;
and when the camera application is not running, continuing to control the motor to be electrified so that the mover in the motor is fixed at the third position.
7. The method of claim 6, wherein when the camera application is running, then performing a focus service of the camera application by controlling a position of a mover in the motor; and when the camera application is not running, continuing to control the motor to be electrified so that the mover in the motor is fixed at the third position, wherein the method specifically comprises the following steps of:
the electronic equipment judges whether the service notification of the camera application exists or not;
under the condition of the service notification of the camera application, the electronic equipment controls the motor to be in a working state;
Under the condition that the service notification of the camera application is not available, the electronic equipment controls a motor according to the last abnormal sound scene detection result; when the last abnormal sound scene detection result is that the abnormal sound scene is entered, controlling the motor to be in an abnormal sound eliminating state; when the last abnormal sound scene detection result is that the abnormal sound scene is exited, controlling the motor to be in a non-working state;
wherein a business notification for the camera application characterizes the camera application as running; no service notification of the camera application characterizes that the camera application stops running;
the detection result is that entering an abnormal sound scene means that the electronic equipment is detected to shake; the detection result is that the electronic equipment is not detected to shake after the abnormal sound scene is exited;
the working state comprises a state that the motor is powered on and the focusing service of the camera application is executed by controlling the position of a rotor in the motor;
the abnormal sound eliminating state comprises a state that the motor is electrified and the mover in the motor is fixed at the third position;
the non-operating state includes a state in which the motor is powered on and a focusing service of the camera application is performed by controlling a position of a mover in the motor.
8. The method according to any one of claims 1-7, wherein the electronic device shaking specifically comprises: the shaking degree of the electronic equipment is larger than or equal to a threshold value.
9. The method of claim 8, wherein the degree of sloshing of the electronic device is determined from a plurality of accelerations acquired by a low power sensor.
10. The method according to claim 8 or 9, wherein the threshold value comprises a first threshold value and a second threshold value, the first threshold value and the second threshold value being preset in the electronic device after being determined by:
collecting acceleration of the second equipment in a plurality of shaking scenes;
comparing the first acceleration with the second acceleration to determine the first threshold and the second threshold; the first acceleration is the acceleration acquired under the condition that abnormal sound occurs to the motor in the second equipment, and the second acceleration is the acceleration acquired under the condition that abnormal sound does not occur to the motor in the second equipment;
wherein the first threshold and the second threshold satisfy the following condition: the first threshold value is smaller than or equal to the number of times that the acceleration is larger than a first value in the first acceleration, and the first threshold value is larger than the number of times that the acceleration is larger than the first value in the second acceleration; the first value is a median of the peak value in the first acceleration and the peak value in the second acceleration;
The second threshold value is smaller than or equal to the number of times the peak value in the first acceleration occurs, and is larger than the number of times the peak value in the second acceleration occurs.
11. The method according to claim 8 or 9, wherein the threshold value comprises a first threshold value and a second threshold value, the first threshold value and the second threshold value being preset in the electronic device after being determined by:
controlling the second device to shake at a first acceleration and a first shake frequency;
gradually increasing acceleration and shaking frequency under the condition that abnormal sound does not occur to a motor in the second equipment, and controlling the second equipment to shake until abnormal sound occurs to the motor in the second equipment;
and determining a first threshold according to a second acceleration when abnormal sound occurs to the motor in the second equipment, and determining the second threshold according to a second shaking frequency when abnormal sound occurs to the motor in the second equipment.
12. An electronic device comprising a motor, a memory, one or more processors; the memory is coupled with the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors invoke to cause the electronic device to perform the method of any of claims 1-11.
13. A chip for application to an electronic device, characterized in that the chip comprises one or more processors for invoking computer instructions to cause the electronic device to perform the method according to any of claims 1-11.
14. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-11.
CN202211444629.6A 2022-11-18 2022-11-18 Motor control method and electronic equipment Pending CN116708958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211444629.6A CN116708958A (en) 2022-11-18 2022-11-18 Motor control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211444629.6A CN116708958A (en) 2022-11-18 2022-11-18 Motor control method and electronic equipment

Publications (1)

Publication Number Publication Date
CN116708958A true CN116708958A (en) 2023-09-05

Family

ID=87844005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211444629.6A Pending CN116708958A (en) 2022-11-18 2022-11-18 Motor control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116708958A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117451173A (en) * 2023-12-18 2024-01-26 荣耀终端有限公司 Motor detection method and related equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014176274A (en) * 2013-03-13 2014-09-22 Tamron Co Ltd Standing wave type ultrasonic motor, and lens unit and camera having the motor
US20180152620A1 (en) * 2016-11-28 2018-05-31 Olympus Corporation Focus adjustment device, focus adjustment method, and non-transitory storage medium for storing focus adjustment programs
CN111432102A (en) * 2020-04-01 2020-07-17 Oppo广东移动通信有限公司 Camera, electronic device and camera control method
CN112839177A (en) * 2021-01-20 2021-05-25 北京小米移动软件有限公司 Lens control method, lens control device and storage medium
CN114721108A (en) * 2020-12-18 2022-07-08 北京小米移动软件有限公司 Driving device, method, apparatus and medium for eliminating lens impact noise
CN114915720A (en) * 2021-02-09 2022-08-16 华为技术有限公司 Method for focusing and powering off shooting module, electronic equipment and readable medium
CN115132224A (en) * 2021-03-25 2022-09-30 北京小米移动软件有限公司 Abnormal sound processing method, device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014176274A (en) * 2013-03-13 2014-09-22 Tamron Co Ltd Standing wave type ultrasonic motor, and lens unit and camera having the motor
US20180152620A1 (en) * 2016-11-28 2018-05-31 Olympus Corporation Focus adjustment device, focus adjustment method, and non-transitory storage medium for storing focus adjustment programs
CN111432102A (en) * 2020-04-01 2020-07-17 Oppo广东移动通信有限公司 Camera, electronic device and camera control method
CN114721108A (en) * 2020-12-18 2022-07-08 北京小米移动软件有限公司 Driving device, method, apparatus and medium for eliminating lens impact noise
CN112839177A (en) * 2021-01-20 2021-05-25 北京小米移动软件有限公司 Lens control method, lens control device and storage medium
CN114915720A (en) * 2021-02-09 2022-08-16 华为技术有限公司 Method for focusing and powering off shooting module, electronic equipment and readable medium
CN115132224A (en) * 2021-03-25 2022-09-30 北京小米移动软件有限公司 Abnormal sound processing method, device, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117451173A (en) * 2023-12-18 2024-01-26 荣耀终端有限公司 Motor detection method and related equipment

Similar Documents

Publication Publication Date Title
WO2020000448A1 (en) Flexible screen display method and terminal
CN110543287B (en) Screen display method and electronic equipment
US20180007315A1 (en) Electronic device and image capturing method thereof
CN108028891B (en) Electronic apparatus and photographing method
CN112351156B (en) Lens switching method and device
CN113806105B (en) Message processing method, device, electronic equipment and readable storage medium
CN116360725B (en) Display interaction system, display method and device
CN117063461A (en) Image processing method and electronic equipment
US20170244890A1 (en) Electronic device and method for controlling operation thereof
CN114125130A (en) Method for controlling communication service state, terminal device and readable storage medium
CN115333941B (en) Method for acquiring application running condition and related equipment
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN116708958A (en) Motor control method and electronic equipment
CN115119048B (en) Video stream processing method and electronic equipment
CN117130773A (en) Resource allocation method, device and equipment
CN114006698B (en) token refreshing method and device, electronic equipment and readable storage medium
CN108124098B (en) Electronic device and method for auto-focusing
CN114500732B (en) Interface display method, electronic equipment and storage medium
CN116156044A (en) Equipment cooperation method and related device
CN116592756B (en) Detection method for included angle of folding screen and electronic equipment
CN115513571B (en) Control method of battery temperature and terminal equipment
CN116723382B (en) Shooting method and related equipment
CN116795476B (en) Wallpaper deleting method and electronic equipment
CN117687501A (en) Display method for switching horizontal screen and vertical screen and related device
CN116668997A (en) Positioning method, user interface and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination