A method of driving a motor and a terminal device
By controlling the output voltage strategy of the vibration chip, the linear motor can reach and maintain its maximum amplitude in a short time, which solves the problem of insufficient vibration intensity in the scenario of rapid start and stop of the linear motor and improves the user experience.
Patent Information
- Application Number
- CN202510473950.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-11-22
AI Technical Summary
In existing technologies, linear motors cannot effectively alert users when the vibration intensity does not reach its maximum value during rapid start-stop scenarios, resulting in users not perceiving the vibration and affecting the user experience.
By controlling the vibration chip to output a first voltage to make the motor amplitude reach its maximum value in a short time, and outputting a second voltage to maintain the maximum value when the vibration ends, the vibration is quickly stopped by using a reverse voltage, ensuring that the amplitude is maintained or reduced within the required time.
It enables the linear motor to reach its maximum amplitude in a short time, improving the user's vibration sensation, ensuring the vibration alert effect, reducing vibration trailing, and enhancing the user experience.
Smart Images

Figure CN120566994B_ABST
Abstract
Description
[0001] This application is a divisional application, the original application number is 202211466439.4, the original application date is 2022.11.22, and the original application is incorporated by reference in this application. TECHNICAL FIELD
[0002] The present application relates to the technical field of motor driving, and in particular to a method for driving a motor and a terminal device. BACKGROUND
[0003] At present, in order to improve the user experience when using the terminal device, when the user performs certain operations on the terminal, the terminal can prompt the user through vibration. For example, when the user uses the terminal to play games, the terminal can vibrate when the user performs a preset operation to give the user tactile feedback and make the user have an immersive experience. The vibration of the terminal is realized by the vibration of the motor installed in the terminal. The motor can be divided into a nonlinear motor and a linear motor. Compared with the nonlinear motor which is controlled by on-off electricity and only has two modes of start and stop, the linear motor can be driven by a pulse voltage signal, and according to the period, amplitude and frequency of the pulse voltage signal, the linear motor can vibrate in different ways and with different intensities to bring the user a rich vibration experience.
[0004] In the prior art, considering the adaptability of the nonlinear motor and the linear motor, when some third-party applications have vibration requirements, a general vibration interface provided by the operating system can be called to send a vibration request to the motor drive to make the motor drive output a driving voltage with a rated frequency and a rated voltage to continuously drive the motor to vibrate. Under the action of the driving voltage, the vibration intensity of the linear motor gradually increases to the maximum intensity and remains at the maximum intensity for continuous vibration. For some very short vibrations, the vibration intensity of the linear motor has not reached the maximum and needs to stop vibrating, which will result in weak vibration intensity and the user may not perceive the vibration. SUMMARY
[0005] The embodiments of the present application provide a method for driving a motor and a terminal device, which can improve the amplitude of the linear motor in a short time.
[0006] To achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a method for driving a motor is provided, applied to a terminal device including a vibration chip and a motor, the motor being a linear motor. The method includes: receiving a first vibration event for triggering vibration of the motor, wherein the first vibration event can include receiving an operation of a user unlocking the terminal device, receiving an operation of a user making an online payment, receiving an operation of a user entering a face, receiving an operation of a user releasing a skill, receiving a call request, or a current time matching a preset time, etc. In response to the first vibration event, the vibration chip is controlled to output a first voltage to the motor within a first time length, so that the amplitude of the motor reaches a maximum value at the end of the first time length, and the vibration chip is controlled to output a second voltage to the motor starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value; wherein the first voltage and the second voltage are in the same direction, and the absolute value of the first voltage is greater than the absolute value of the second voltage. In this way, the amplitude of the motor can quickly reach the maximum value under the action of the first voltage, and then remain at the maximum value under the action of the second voltage. That is, the amplitude of the motor can reach the maximum value even in the case of a very short vibration time, so as to bring obvious vibration feeling to the user and improve the user experience.
[0008] In an implementation form of the first aspect, in response to the first vibration event, the vibration chip is controlled to output the first voltage to the motor within the first time length, so that the amplitude of the motor reaches the maximum value at the end of the first time length, and the vibration chip is controlled to output the second voltage to the motor starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value, further including: in response to the first vibration event, obtaining a vibration parameter of the motor; in the case that the vibration parameter does not include a vibration time length, the vibration chip is controlled to output the first voltage to the motor within the first time length, so that the amplitude of the motor reaches the maximum value at the end of the first time length, and the vibration chip is controlled to output the second voltage to the motor starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value. It can be understood that, according to the actual setting of the application, the vibration parameter can include or not include the vibration time length. In the case that the vibration parameter does not include the vibration time length, the terminal device can first control the motor to start quickly, and then control the motor to stop vibrating.
[0009] In an embodiment provided in the first aspect, the method further comprises: controlling the vibration chip to output a third voltage to the motor when a preset time period from the terminal device receiving the first vibration event ends, so as to make the amplitude of the motor decrease from the maximum value to 0 within a second time period; wherein the third voltage is opposite to the second voltage, the absolute value of the third voltage is greater than the absolute value of the second voltage, and the preset time period is greater than the first time period. Generally, each vibration event can correspond to a theoretical vibration time period, for example, the theoretical vibration time period corresponding to the first vibration event is the preset time period, that is, the terminal device needs to control the motor to stop vibrating after the preset time period from receiving the first vibration event starts, so the terminal device controls the vibration chip to output the third voltage to the motor when the preset time period ends, so as to make the motor stop vibrating. For example, the terminal device receives the first vibration event at 10:00, which requires the motor to stop vibrating after 1 minute, and the terminal device can output the third voltage to the motor at 10:01 to control the motor to stop vibrating. Meanwhile, compared with the method of stopping outputting the voltage to make the motor stop vibrating, the embodiment can make the motor stop vibrating quickly and reduce vibration tailing by outputting the third voltage opposite to the second voltage and greater than the second voltage.
[0010] In an embodiment provided in the first aspect, the method further comprises: controlling the vibration chip to output a third voltage to the motor when the actual vibration time period of the motor reaches a first value, so as to make the amplitude of the motor decrease from the maximum value to 0 within a second time period; wherein the third voltage is opposite to the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage. That is, the terminal device can obtain the actual vibration time period of the motor in real time, and output the third voltage to the motor to make the motor stop vibrating when the actual vibration time period reaches the first value, so as to reduce the case that the actual vibration time period of the motor is too short to be perceived by the user. In addition, the first value can be the theoretical vibration time period corresponding to the first vibration event (i.e., the aforementioned preset time period), or the first value can be other parameters, which will be described in detail below, and will not be repeated here. Meanwhile, compared with the method of stopping outputting the voltage to make the motor stop vibrating, the embodiment can make the motor stop vibrating quickly and reduce vibration tailing by outputting the third voltage opposite to the second voltage and greater than the second voltage.
[0011] In an embodiment of the first aspect, in response to the first vibration event, the vibration chip is controlled to output the first voltage to the motor in the first time period so that the amplitude of the motor reaches the maximum value at the end of the first time period, and the vibration chip is controlled to output the second voltage to the motor starting from the end of the first time period so that the amplitude of the motor remains at the maximum value, and further comprising: in response to the first vibration event, obtaining a vibration parameter of the motor; in the case that the vibration parameter comprises a vibration time period, the vibration chip is controlled to output the first voltage to the motor in the first time period so that the amplitude of the motor reaches the maximum value at the end of the first time period, and the vibration chip is controlled to output the second voltage to the motor in the vibration time period starting from the end of the first time period so that the amplitude of the motor remains at the maximum value, and the vibration chip is controlled to output a third voltage to the motor starting from the end of the vibration time period so that the amplitude of the motor decreases from the maximum value to 0 in a second time period; wherein the third voltage is opposite to the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage. It can be understood that, in the case that the vibration parameter comprises the vibration time period, the terminal device is clear about the time period during which the motor needs to vibrate, and thus the second voltage can be output to the motor in the vibration time period starting from the end of the first time period, so that the actual vibration time period of the motor can reach the vibration time period included in the vibration parameter.
[0012] In an embodiment of the first aspect, the vibration chip is controlled to output the first voltage to the motor in the first time period so that the amplitude of the motor reaches the maximum value at the end of the first time period, and the vibration chip is controlled to output the second voltage to the motor in the vibration time period starting from the end of the first time period so that the amplitude of the motor remains at the maximum value, and the vibration chip is controlled to output a third voltage to the motor starting from the end of the vibration time period so that the amplitude of the motor decreases from the maximum value to 0 in a second time period, and further comprising: if the vibration time period is less than a second value, the vibration chip is controlled to output the first voltage to the motor in the first time period so that the amplitude of the motor reaches the maximum value at the end of the first time period, and the vibration chip is controlled to output the second voltage to the motor in the vibration time period starting from the end of the first time period so that the amplitude of the motor remains at the maximum value, and the vibration chip is controlled to output the third voltage to the motor starting from the end of the vibration time period so that the amplitude of the motor decreases from the maximum value to 0 in the second time period. In this way, for vibration events with a vibration time period greater than or equal to a second value and vibration events with a vibration time period less than the second value, the terminal device can adopt different driving methods to control the motor vibration. For vibration events with a vibration time period greater than or equal to a second value, the amplitude of the motor is less affected by the vibration time period, and thus the motor can be driven in a conventional manner. For vibration events with a vibration time period less than the second value, the amplitude of the motor is greatly affected by the vibration time period, and the smaller the vibration time period, the smaller the amplitude of the motor, i.e., the user is less likely to perceive the vibration, and thus the amplitude of the motor can be quickly brought to the maximum value to reduce the impact of the vibration time period on the amplitude, giving the user a clear vibration feeling.
[0013] In an implementation of the first aspect, the first vibration event comprises one of: receiving an operation of a user unlocking the terminal device, receiving an operation of a user making an online payment, receiving an operation of a user entering a face, receiving an operation of a user releasing a skill, receiving a request of an incoming call, or a current time matching a preset time.
[0014] In an implementation of the first aspect, the terminal device comprises a first application, a vibration service, a vibration hardware abstraction layer (HAL) and a vibration driver; the vibration HAL comprises a type judging module, a first interface and a second interface; in response to the first vibration event, the vibration chip is controlled to output a first voltage to the motor within a first time duration, so that an amplitude of the motor reaches a maximum value at the end of the first time duration, and the vibration chip is controlled to output a second voltage to the motor starting from the end of the first time duration, so that the amplitude of the motor is kept at the maximum value; further comprising: in response to the first vibration event, the first application sends a vibration request to the vibration service; the vibration service sends the vibration request to the type judging module, the vibration request comprising vibration parameters; the type judging module judges whether the motor is a linear motor; in a case where a type of the vibration parameters indicates that the vibration interface is the first interface, the type judging module sends the vibration request and a message indicating that the motor is a linear motor to the first interface; the first interface sends the vibration request to the second interface; the second interface updates the vibration parameters based on a first parameter, the first parameter being used to describe a vibration waveform generated by the motor under the action of the first voltage within the first time duration; the second interface sends the first vibration parameters to the vibration driver, the first vibration parameters being the vibration parameters updated based on the first parameter; the vibration driver writes the first vibration parameters to the vibration chip; the vibration chip outputs the first voltage to the motor within the first time duration, so that the amplitude of the motor reaches the maximum value at the end of the first time duration, and outputs the second voltage to the motor starting from the end of the first time duration, so that the amplitude of the motor is kept at the maximum value.
[0015] In an implementation of the first aspect, the second interface updating the vibration parameters based on the first parameter further comprises: in a case where the vibration parameters do not comprise a vibration duration, the second interface updates the vibration parameters based on the first parameter.
[0016] In an implementation of the first aspect, the method further comprises: the first application sends a request of stopping vibration to the vibration service at the end of a preset time duration starting from receiving the first vibration event; the vibration service sends the request of stopping vibration to the first interface; the first interface sends a second parameter to the vibration driver, the second parameter being used to describe a vibration waveform generated by the motor under the action of a third voltage within a second time duration; the vibration driver writes the second parameter to the vibration chip; and the vibration chip outputs the third voltage to the motor, so that the amplitude of the motor decreases from the maximum value to 0 within the second time duration.
[0017] In an embodiment provided in the first aspect, the method further comprises: in response to receiving the vibration request, the second interface starts a first timer to obtain a third time length; in response to receiving the request to stop the vibration, the first interface starts a second timer to obtain a fourth time length; and the first interface sends the second parameter to the vibration driver, further comprising: when the actual vibration time length of the motor reaches a first value, the first interface sends the second parameter to the vibration driver, the first value being a difference between the third time length and the fourth time length.
[0018] In an embodiment provided in the first aspect, the method further comprises: in a case where the vibration parameter comprises a vibration time length, the second interface updates the vibration parameter based on the first parameter and the second parameter, the second parameter being used to describe a vibration waveform generated by the motor under the action of the third voltage for the second time length; the second interface sends the second vibration parameter to the vibration driver, the second vibration parameter being the vibration parameter updated based on the first parameter and the second parameter; the vibration driver writes the second vibration parameter to the vibration chip; and the vibration chip outputs the first voltage to the motor within the first time length, so that the amplitude of the motor reaches a maximum value at the end of the first time length, and outputs the second voltage to the motor within the vibration time length starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value, and outputs the third voltage to the motor starting from the end of the vibration time length, so that the amplitude of the motor decreases from the maximum value to 0 within the second time length; wherein the third voltage is opposite to the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage.
[0019] In an embodiment provided in the first aspect, in a case where the vibration parameter comprises a vibration time length, the second interface updates the vibration parameter based on the first parameter and the second parameter, further comprising: in a case where the vibration parameter comprises the vibration time length and the vibration time length is less than a second value, the second interface updates the vibration parameter based on the first parameter and the second parameter.
[0020] In an embodiment provided in the first aspect, the method further comprises: the first interface determines whether the vibration time length is less than a second value; and the first interface sends the vibration request to the second interface, further comprising: if the vibration time length is less than the second value, the first interface sends the vibration request to the second interface.
[0021] In an embodiment provided in the first aspect, in response to the first vibration event, the first application sends the vibration request to the vibration service, comprising: in response to the first vibration event, the first application sends a request to open the motor to the vibration service; the vibration service detects whether the motor exists, and sends a detection result to the first application; and if the detection result indicates that the motor exists, the first application sends the vibration request to the vibration service.
[0022] In a second aspect, the present application provides a chip system, which comprises one or more interface circuits and one or more processors. The interface circuits and the processors are interconnected by wires. The chip system can be applied to an electronic device comprising a communication module and a memory. The interface circuit is configured to receive a signal from the memory of the electronic device and send the received signal to the processor, the signal comprising computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device can perform the method as described in the first aspect and any possible implementation thereof.
[0023] In a third aspect, the present application provides a computer readable storage medium, which comprises computer instructions. When the computer instructions are executed on a terminal device (such as a mobile phone), the terminal device performs the method as described in the first aspect and any possible implementation thereof.
[0024] In a fourth aspect, the present application provides a computer program product, which, when executed on a terminal device, causes the terminal device to perform the method as described in the first aspect and any possible implementation thereof.
[0025] In a fifth aspect, the present application provides a terminal device, which comprises a memory and one or more processors; the memory is coupled to the processor; wherein the memory is configured to store computer program code, the computer program code comprising computer instructions; when the computer instructions are executed by the processor, the terminal device performs the method as described in the first aspect and any possible implementation thereof.
[0026] The technical effects brought by any implementation of the fourth aspect to the fifth aspect can be referred to the technical effects brought by different implementations of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is a waveform diagram of a driving voltage signal S1 and a vibration acceleration signal S2 of a linear motor;
[0028] Figure 2 is a waveform diagram of a driving voltage signal S3 and a vibration acceleration signal S4 of a linear motor;
[0029] Figure 3 is a structural schematic diagram of a terminal device provided by an embodiment of the present application;
[0030] Figure 4 is a software module architecture schematic diagram of a terminal device provided by an embodiment of the present application;
[0031] Figure 5 is an interaction schematic diagram between software modules provided by an embodiment of the present application;
[0032] Figure 6 Flowchart of a method for driving a motor according to an embodiment of the present application Figure 1 ;
[0033] Figure 7 Waveform diagram of a driving voltage signal S5 and a vibration acceleration signal S6 according to an embodiment of the present application
[0034] Figure 8 Flowchart of a method for driving a motor according to an embodiment of the present application Figure 2 ;
[0035] Figure 9 Flowchart of a method for driving a motor according to an embodiment of the present application Figure 3 ;
[0036] Figure 10 Time node diagram of a motor vibration process according to an embodiment of the present application
[0037] Figure 11 Flowchart of a method for driving a motor according to an embodiment of the present application Figure 4 ;
[0038] Figure 12 Another time node diagram of a motor vibration process according to an embodiment of the present application DETAILED DESCRIPTION
[0039] Exemplary embodiments of the present application are described herein with reference to the accompanying drawings, which are meant to be exemplary and not limiting. Therefore, it should be recognized that many modifications and variations of the exemplary embodiments described herein can be made without departing from the scope and spirit of the application. Also, for the purpose of clarity and the brevity, the description below omits the description of well-known functions and structures.
[0040] For the sake of clear and concise description of the following embodiments, first give a brief introduction of the related art.
[0041] Nonlinear motor, also known as rotor motor. Rotor motor can include core motor and flat motor, which are driven by the rotation of the shaft after the power is turned on to rotate the eccentric mass block (also known as rotor) on the shaft to generate vibration.
[0042] Linear motor is a mechanism that generates periodic motion of the mass block by driving the magnetic steel through the changing electromagnetic field generated by the pulse voltage signal. Wherein, the frequency and amplitude of the pulse voltage signal are different, and the vibration intensity of the linear motor is different.
[0043] The resonance frequency, which can also be referred to as the natural frequency, refers to a frequency point at which the linear motor can resonate. When the frequency of the driving voltage is the resonance frequency, the linear motor can vibrate at the resonance frequency and has the maximum amplitude, i.e., the maximum vibration intensity.
[0044] At present, in addition to prompting the user through the sound mode, the terminal can also prompt the user through the vibration mode to improve the user experience of the terminal. For example, for the conference scene, when the user performs certain operations on the mobile phone, in order to avoid the mobile phone prompt sound causing interference to other users in the conference scene, the mobile phone can prompt the user through the vibration mode. For another example, when the mobile phone receives an incoming call request, in order to prompt the user to respond to the incoming call request in time, the mobile phone can prompt the user through the ringing and vibration modes. In particular, when the user performs certain operations in the terminal, in order to improve the user experience, the terminal can provide vibration feedback in time when detecting the operation of the user. In some scenarios, the terminal vibrates for a short time, i.e., the terminal performs short-time vibration at this time. At this time, the vibration time of the terminal should not be too long, so as not to affect the user experience. That is, the linear motor in the terminal needs to be able to start and stop quickly.
[0045] However, considering that the non-linear motor and the linear motor can be simultaneously adapted, when some third-party applications have vibration requirements, a general vibration interface provided by the operating system can be called to issue vibration parameters, so that the vibration chip outputs a driving voltage with a rated frequency and a rated voltage to drive the motor to vibrate. Figure 1 As shown in FIG. 1, it is a waveform diagram of a driving voltage signal S1 and a vibration acceleration signal S2 of a linear motor. The driving voltage signal S1 is the driving voltage output by the vibration chip to the linear motor, and the duration is 0-500 ms. The vibration acceleration signal S2 is used to indicate the vibration acceleration of the linear motor under the action of the driving voltage signal S1. In addition, the frequency of the driving voltage signal S1 is the resonance frequency f0 of the linear motor, and correspondingly, the frequency of the vibration acceleration signal S2 is also the resonance frequency f0 of the linear motor. According to the formula Figure 1It can be seen that, under the action of the driving voltage signal S1, the vibration process of the linear motor from starting to stopping can include three stages, namely: starting stage P1, steady stage P2 and braking stage P3. In the starting stage P1 and the steady stage P2, the vibration chip stably outputs the driving voltage signal S1. After the driving voltage signal S1 is stopped outputting, the braking stage P3 is entered. Among them, in the starting stage P1 (0-80 ms), the amplitude of the vibration acceleration signal S2 starts to increase from 0 to the maximum value (for example, 0.65V), indicating that the amplitude of the linear motor gradually increases. In the steady stage P2 (80-500 ms), the amplitude of the vibration acceleration signal S6 continuously remains at the maximum value, indicating that the amplitude of the linear motor remains at the maximum value. In the braking stage P3 (500-710 ms), the amplitude of the vibration acceleration signal S2 gradually decreases from the maximum value to 0, indicating that the linear motor performs damped vibration until the vibration stops.
[0046] It can be seen that, under the action of the driving voltage, the amplitude (also can be called vibration intensity) of the linear motor gradually increases to the maximum value and remains at the maximum value with time; after not receiving the driving voltage, the linear motor ends the vibration with damped oscillation. For those scenes where the linear motor needs to be quickly started and stopped, the vibration intensity of the linear motor needs to be stopped before reaching the maximum value. Exemplarily, Figure 2 A waveform diagram of a driving voltage signal S3 and a vibration acceleration signal S4 of a linear motor is shown. Among them, the driving voltage signal S3 is the driving voltage output by the vibration chip to the linear motor, and its duration is 0-50 ms. The vibration acceleration signal S4 is used to indicate the vibration acceleration generated by the linear motor under the action of the driving voltage signal S3. According to the driving voltage signal S3, the vibration acceleration signal S4 can be divided into three stages, namely: starting stage P1, steady stage P2 and braking stage P3. Figure 2 It can be seen that the vibration chip outputs the driving voltage signal S3 to the linear motor from the 0th second, and stops outputting the driving voltage signal S3 at the 50th ms. At the same time, the amplitude of the vibration acceleration signal S4 increases during the 0th-50th ms, and gradually decreases to 0 from the 50th ms. Compared with the driving voltage signal S1 and the vibration acceleration signal S2, Figure 1 and Figure 2 It can be seen that the linear motor first enters the starting stage P1 (0-50 ms) under the action of the driving voltage signal S3, and then directly enters the braking stage P3 (50-189 ms) due to the disappearance of the driving voltage signal S3. That is, the vibration amplitude of the linear motor has not reached the maximum value yet, and it starts to decrease.
[0047] It can be seen that in the scene where the linear motor needs to be quickly started and stopped, there is a problem in the prior art that the user cannot perceive the vibration due to the too small amplitude of the linear motor during the quick start and stop process of the linear motor, and the user cannot be reminded through vibration.
[0048] In view of this, this application provides a method for driving a motor, applied to a terminal device including a linear motor. The terminal device can provide a first voltage to the linear motor when it starts, causing the amplitude of the linear motor to quickly reach its maximum value under the action of the first voltage. Thus, the linear motor can vibrate at its maximum amplitude, making the vibration more easily perceived by the user, effectively alerting the user and improving the user experience.
[0049] It should be noted that the terminal device described in this embodiment can be a mobile phone, tablet computer, personal communication service (PCS) phone, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc., and no specific limitation is made here.
[0050] Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 3 As shown, the terminal device may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
[0051] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated into one or more processors. The processor 210 can be the nerve center and command center of the terminal device. The processor 210 can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0052] The memory can also be provided in the processor 210, for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can hold instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor 210, thus improving the efficiency of the system.
[0053] In some embodiments, the processor 210 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0054] The external memory interface 220 can be configured to connect with an external memory card, such as a micro SD card, to expand the memory capacity of the terminal device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0055] The internal memory 221 can be configured to store computer-executable program code including instructions. The processor 210 executes various function applications and data processing of the terminal device by running the instructions stored in the internal memory 221. For example, in the embodiments of the present application, the processor 210 can execute the instructions stored in the internal memory 221, and the internal memory 221 can include a program storage area and a data storage area.
[0056] The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), a configuration file of the motor 291, etc. The data storage area can store data (such as audio data, a phone book, etc.) created during use of the terminal device, etc. In addition, the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0057] The charging management module 240 is configured to receive a charging input from a charger. The charger can be a wireless charger or a wired charger. The charging management module 240 can charge the battery 242 and also supply power to the terminal device through the power management module 241.
[0058] The power management module 241 is configured to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives an input from the battery 242 and / or the charging management module 240 to supply power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260, etc. In some embodiments, the power management module 241 and the charging management module 240 can also be arranged in the same device.
[0059] The wireless communication function of the terminal device can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, a modem processor, and a baseband processor, etc. In some embodiments, the antenna 1 and the mobile communication module 250 of the terminal device are coupled, and the antenna 2 and the wireless communication module 260 are coupled, so that the terminal device can communicate with a network and other devices through a wireless communication technology.
[0060] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0061] The mobile communication module 250 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied in the terminal device. The mobile communication module 250 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation.
[0062] The mobile communication module 250 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves radiated through antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 250 can be arranged in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 can be arranged in the same device.
[0063] The wireless communication module 260 can provide a solution for wireless communication including WLAN (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied in the terminal device.
[0064] The wireless communication module 260 can be one or more devices integrated with at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 can also receive signals to be transmitted from the processor 210, perform frequency modulation and amplification on the signals, and convert them into electromagnetic waves radiated through antenna 2.
[0065] The terminal device can realize audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, the application processor, etc. For example, music playing, recording, etc.
[0066] The sensor module 280 can include a pressure sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor, etc. The terminal device can collect various data through the sensor module 280.
[0067] The terminal device implements a display function through a GPU, a display screen 294, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs that execute program instructions to generate or change display information.
[0068] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel.
[0069] The terminal device can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor, etc. The ISP is used to process data fed back by the camera 293. The camera 293 is used to capture still images or videos. In some embodiments, the terminal device can include 1 or N cameras 293, N being a positive integer greater than 1.
[0070] The key 290 includes a power-on key, a volume key, etc. The key 290 can be a mechanical key. It can also be a touch key. The motor 291 can generate a vibration prompt. The motor 291 can be used for incoming call vibration prompt, and also can be used for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate a charging state, a power change, and also can be used to indicate a message, a missed call, a notification, etc. The SIM card interface 295 is used to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 295 to realize contact and separation with the terminal device. The terminal device can support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 295 can support a Nano SIM card, a Micro SIM card, a SIM card, etc.
[0071] It can be understood that the interface connection relationship between the modules shown in the embodiments is only illustrative and does not constitute a structural limitation on the terminal device. In other embodiments, the terminal device can include more or fewer modules than those provided in the above embodiments, and the modules can also use different interface connection methods or a combination of multiple interface connection methods.
[0072] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Embodiments of the present application exemplarily illustrate the software structure of the terminal device by taking the layered architecture of the Android system as an example.
[0073] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through interfaces. In some embodiments, the Android system can include an application layer, an application framework layer, an Android runtime and system library, a hardware abstraction layer (HAL), and a kernel layer. It should be noted that the embodiments of the present application are exemplified by taking the Android system as an example, and as long as the functions of various functional modules are similar to those of the embodiments of the present application, the schemes of the present application can also be implemented in other operating systems (such as the Hongmeng system, the IOS system, etc.).
[0074] The application layer can include a series of application packages. As shown in Figure 4 The application packages can include camera applications, galleries, calendars, calls, maps, navigation, WLANs, settings, music, lock screen applications, short messages, and the like. Of course, the application layer can also include other application packages, such as third-party applications such as payment applications, shopping applications, bank applications, chat applications, or financial management applications, and the like, which are not limited by the present application.
[0075] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. For example, it can include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, a vibrator service, and the like, which are not limited by the embodiments of the present application. The vibrator service is used to provide services related to vibration support.
[0076] The system library can include a plurality of functional modules. For example, a surface manager, media libraries, OpenGL ES, SGL, and the like.
[0077] The surface manager is used to manage the display subsystem and provides fusion of 2D and 3D layers for multiple applications.
[0078] The media library supports a variety of commonly used audio, video format playback and recording, and static image files, etc. The media library can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0079] OpenGL ES is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0080] SGL is a drawing engine for 2D drawing.
[0081] The android runtime includes a core library and a virtual machine. The android runtime is responsible for scheduling and management of the android system. The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of object life cycle, stack management, thread management, security and exception management, and garbage collection, etc.
[0082] The HAL layer is a wrapper for the Linux kernel driver, providing an interface upwards and shielding the implementation details of the underlying hardware.
[0083] The HAL layer can include a vibrator HAL, a camera HAL, etc.
[0084] The vibrator HAL can include a type judgment module, a general vibration interface, a self-developed vibration interface, and a 4D vibration interface, etc. The type judgment module can determine whether the motor is a linear motor or a nonlinear motor by reading the configuration file of the motor.
[0085] The general vibration interface, the self-developed vibration interface, and the 4D vibration interface can all interact with the vibration driver of the kernel layer. The difference is that the three vibration interfaces can handle different vibration parameters. For the contents of the vibration parameters handled by the three vibration interfaces, see S604 and related descriptions, which are not repeated here.
[0086] The kernel layer is the layer between hardware and software. The kernel layer at least contains display driver, audio driver, camera driver, vibration driver, etc. Among them, the vibration driver is a program that allows high-level computer software to interact with hardware, that is, a set of programs that drive the motor to work.
[0087] The hardware layer includes memory, vibration chip and motor, etc. Among them, the vibration chip is used to output a driving voltage to the motor to drive the motor to vibrate. The motor is used to vibrate to bring the user a vibration feeling.
[0088] The following describes the software modules involved in the method for driving the motor provided by the embodiments of the present application and the interaction between the modules. As shown in Figure 5 application programming interface (API) interface to interact with the vibration service in the application framework layer, and the vibration service can interact with the vibration HAL in the HAL layer. The vibration HAL can include a type judgment module, a general vibration interface, a self-developed vibration interface, and a 4D vibration interface. The type judgment module can read the configuration information of the motor to determine the motor type (including a linear motor and a nonlinear motor). When the type judgment module determines that the motor type is a linear motor, it can interact with the vibration driver in the kernel layer through the general vibration interface, the self-developed vibration interface, or directly through the self-developed vibration interface or the 4D vibration interface. When the type judgment module determines that the motor type is a nonlinear motor, it can directly interact with the vibration driver in the kernel layer through the general vibration interface. The vibration driver can configure the vibration chip in the hardware layer to make the vibration chip output a driving voltage to drive the motor to vibrate.
[0089] The method for driving the motor provided by the present application will be described below with reference to the accompanying drawings.
[0090] In an optional implementation, the terminal device receives a first vibration event, and the first vibration event is used to trigger the motor to vibrate. The first vibration event includes receiving a user operation of unlocking the terminal device, receiving a user online payment operation, receiving a user face input operation, receiving a user skill release operation, receiving an incoming call request, or a current time matching a preset time, and the like.
[0091] In response to the first vibration event, the vibration chip is controlled to output a first voltage to the motor within a first time length, so that the amplitude of the motor reaches a maximum value at the end of the first time length; and the vibration chip is controlled to output a second voltage to the motor starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value, the first voltage and the second voltage are in the same direction, and the absolute value of the first voltage is greater than the absolute value of the second voltage. The first voltage and the second voltage are both alternating currents, and the absolute value of the first voltage is greater than the absolute value of the second voltage, which means that the amplitude of the first voltage is greater than the amplitude of the second voltage. The first voltage and the second voltage are in the same direction, which means that the current directions of the first voltage and the second voltage are the same at the end of the first time length.
[0092] In this way, the amplitude of the motor can quickly reach the maximum value under the action of the first voltage, and then remain at the maximum value under the action of the second voltage. That is, the amplitude of the motor can also reach the maximum value in the case of a very short vibration time, so as to bring obvious vibration to the user and improve the user experience.
[0093] In this embodiment, in response to the first vibration event, the terminal device can acquire a vibration parameter of the motor. The vibration parameter is used to indicate a vibration manner of the motor. According to whether the vibration parameter includes a vibration duration or not, the application can provide different methods to drive the motor to vibrate.
[0094] In an optional implementation, in the case where the vibration parameter includes the vibration duration, the terminal device can control the vibration chip to output a first voltage to the motor within a first duration, so that the amplitude of the motor reaches a maximum value at the end of the first duration; the terminal device can also control the vibration chip to output a second voltage to the motor within the vibration duration starting from the end of the first duration, so that the amplitude of the motor remains at the maximum value, and control the vibration chip to output a third voltage to the motor starting from the end of the vibration duration, so that the amplitude of the motor decreases from the maximum value to 0 within a second duration. The third voltage is opposite to the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage. It can be understood that the third voltage is also alternating current, and the third voltage opposite to the second voltage can mean that the current directions of the third voltage and the second voltage are the same at the end of the vibration duration. The absolute value of the third voltage greater than the absolute value of the second voltage can mean that the amplitude of the third voltage is greater than the amplitude of the second voltage.
[0095] In the case where the vibration parameter does not include the vibration duration, the terminal device can control the vibration chip to output the first voltage to the motor within the first duration, so that the amplitude of the motor reaches the maximum value at the end of the first duration; and control the vibration chip to output the second voltage to the motor starting from the end of the first duration, so that the amplitude of the motor remains at the maximum value.
[0096] It can be understood that, in the case where the vibration parameter includes the vibration duration, the terminal device is clear about the duration for which the motor needs to vibrate, and therefore can control the vibration chip to output the second voltage to the motor within the vibration duration starting from the end of the first duration, so that the actual vibration duration of the motor can reach the vibration duration included in the vibration parameter. In the case where the vibration parameter does not include the vibration duration, the terminal device is not clear about the duration for which the motor needs to vibrate, and can control the motor to start quickly first and then control the motor to stop vibrating later.
[0097] To implement the method for driving the motor provided in the application, the application provides a method for driving a motor. The method is used to illustrate the process in which a terminal device controls a motor to vibrate in the case where a vibration parameter includes a vibration duration. As shown in Figure 6 Figure 6 The method for driving the motor provided in the application includes the following steps: Figure 1
[0098] S601, in response to receiving a first vibration event, a first application sends a request to open a motor to a vibration service.
[0099] The first application can receive a first vibration event and send a request to open the motor to the vibration service after receiving the first vibration event. The first vibration event can be different according to different actual application scenarios. For example, when the first application is a lock screen application, the first vibration event can be receiving an operation of unlocking the terminal device by a virtual key by a user. For another example, when the first application is a game application, the first vibration event can be receiving an operation of releasing a game skill by a user. For another example, when the first application is a call application, the first vibration event can be receiving a call request. For another example, when the first application is an alarm application, the first vibration event can be that the current time is consistent with a preset time set by a user.
[0100] The first application can call a preset API interface to send a request to open the motor to the vibration service.
[0101] S602, the vibration service detects whether the motor exists.
[0102] Optionally, the vibration service can detect whether the terminal device has the motor through a vibrator.hasVibrator() function.
[0103] It can be understood that, for the first application, it is not clear whether the terminal device includes the motor. Therefore, it is necessary to determine whether the terminal device has the motor before sending the vibration request.
[0104] S603, the vibration service sends the detection result to the first application.
[0105] The detection result can include true or false. If the detection result is false, the vibration service notifies the first application that the terminal device does not have the motor. If the detection result is true, the vibration service notifies the first application that the terminal device has the motor, and the first application can execute S604 and subsequent steps.
[0106] Optionally, the vibration service can also detect whether the motor is in an idle state. The detection result also includes information that the motor is in an idle state or is not in an idle state. If the detection result indicates that the terminal device has the motor and the motor is in an idle state, the first application can execute S604 and subsequent steps. If the detection result indicates that the terminal device does not have the motor or the motor is not in an idle state, the first application can determine that the motor is not available.
[0107] S604, the first application sends a vibration request to the vibration service.
[0108] The vibration parameter is used to indicate a vibration mode required by the first application. In the embodiment, the vibration parameter includes different contents according to a vibration interface called by the first application. The vibration interface called by the first application can include a general vibration interface (also referred to as a first interface), a native vibration interface (also referred to as a second interface), and a 4D vibration interface.
[0109] The general vibration interface can also be referred to as a Google vibration interface, and can control a linear motor and a nonlinear motor through a vibration drive. For an application calling the general vibration interface, the vibration parameter sent by the application can include a vibration type, a vibration duration, a sleep duration, and other parameters that can be used by the linear motor and the nonlinear motor. The sleep duration can refer to a time interval between two vibrations.
[0110] The native vibration interface is a vibration interface developed by a device manufacturer, and can control a linear motor through a vibration drive. For an application calling the native vibration interface, the vibration parameter sent by the application can include a name of a vibration waveform and a sleep duration, and other information. A terminal device stores a description file of a plurality of vibration waveforms designed by a developer in advance, each vibration waveform has a different name, the native vibration interface can find a corresponding description file through the received name of the vibration waveform, and obtain vibration waveform data based on the description file. The vibration waveform data is used to describe the vibration waveform. The vibration mode is relatively complex and cannot be implemented by a nonlinear motor.
[0111] The 4D vibration interface can be a vibration interface jointly developed by a device manufacturer and a third party, and can control a linear motor through a vibration drive. For an application calling the 4D vibration interface, the vibration parameter sent by the application includes a waveform ID and waveform file data. The waveform file data is used to indicate a storage address of a description file. Similar to the native vibration interface, the vibration mode implemented by the 4D vibration interface is relatively complex and is not suitable for a nonlinear motor.
[0112] The first application can call a preset API interface to send a vibration request to the vibration service.
[0113] S605, the vibration service sends the vibration request to the type judgment module.
[0114] The description of the vibration request is described in S604, and is not repeated here.
[0115] S606, the type judgment module obtains motor type information.
[0116] In the embodiment, the type judging module can read a configuration file from a preset storage address. The configuration file includes configuration information of the motor, which can include motor type information, resonance frequency of the motor, etc. The motor type can include a linear motor (e.g., identified as 1) and a nonlinear motor (e.g., identified as 2).
[0117] In S607, the type judging module judges whether the motor is a linear motor.
[0118] For example, if the motor type information is 1, the type judging module can judge that the motor is a linear motor; if the motor type information is 2, the type judging module can judge that the motor is a nonlinear motor.
[0119] The following takes the type judging module judging that the motor is a linear motor as an example for description, and after S607, S608-S615 are further included:
[0120] In S608, the type judging module determines a vibration interface according to the vibration parameter.
[0121] Specifically, the type judging module can determine the vibration interface according to the type of the vibration parameter. For example, if the vibration parameter includes vibration duration and sleep duration, it can be determined that the vibration interface is a general vibration interface. If the vibration parameter includes the name of the vibration waveform and the sleep duration, it can be determined that the vibration interface is a native vibration interface. If the vibration parameter includes the waveform ID and the waveform file data, it can be determined that the vibration interface is a 4D vibration interface.
[0122] The following takes the type judging module determining that the vibration interface is a general vibration interface as an example for description.
[0123] In S609, the type judging module sends a vibration request and a message indicating that the motor is a linear motor to the general vibration interface.
[0124] In S610, the general vibration interface judges whether the vibration duration is less than a second value.
[0125] The second value can be determined according to multiple tests, and is the time duration required for the linear motor to change from an amplitude of 0 to a maximum value under the action of a rated voltage. For example, the second value can be 100 milliseconds.
[0126] In the embodiment, if the general vibration interface judges that the vibration duration is less than the second value, S611 can be executed; if the general vibration interface judges that the vibration duration is greater than or equal to the second value, the general vibration interface can directly send the vibration request to the vibration driver to control the motor to vibrate through the vibration driver. For example, after the vibration driver receives the vibration request, it can directly control the vibration chip to output a second voltage to the motor, so that the motor vibrates according to the waveform shown in the vibration acceleration signal S2. Figure 1
[0127] S611, the general vibration interface sends a vibration request to the self-developed vibration interface.
[0128] S612, the self-developed vibration interface updates the vibration parameters based on the first parameters and the second parameters.
[0129] The first parameters are used to describe the vibration waveform generated by the linear motor under the action of the first voltage for a first duration, and the first voltage is used to increase the amplitude of the motor from 0 to the maximum value within the first duration. The second parameters are used to describe the vibration waveform generated by the linear motor under the action of the third voltage for a second duration, and the third voltage is used to reduce the amplitude of the motor from the maximum value to 0 within the second duration. Optionally, the first duration and the second duration can be 1-1.5 (including 1 and 1.5) times of the resonance period. The first duration and the second duration can be the same or different, which is not limited here. The resonance period is the inverse of the natural frequency of the linear motor. The first voltage can be obtained from multiple tests, which can make the linear motor vibrate to the maximum amplitude within the first duration. The third voltage can be obtained from multiple tests, which can make the vibration amplitude of the linear motor change from the maximum value to 0 (make the linear motor stop vibrating quickly) within the second duration.
[0130] S613, the self-developed vibration interface sends the updated vibration parameters (also called second vibration parameters) to the vibration driver.
[0131] S614, the vibration driver writes the updated vibration parameters into the vibration chip.
[0132] S615, the vibration chip outputs the first voltage to the motor within the first duration to make the amplitude of the motor reach the maximum value at the end of the first duration, and outputs the second voltage to the motor within the vibration duration from the end of the first duration to make the amplitude of the motor remain at the maximum value, and outputs the third voltage to the motor from the end of the vibration duration to make the amplitude of the motor decrease from the maximum value to 0 within the second duration.
[0133] The absolute value of the first voltage is greater than the absolute value of the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage. The direction of the first voltage is the same as that of the second voltage, and the direction of the third voltage is opposite to that of the second voltage. That is, the vibration chip first outputs the first voltage for the first duration, then outputs the second voltage for the vibration duration, and finally outputs the third voltage for the second duration.
[0134] Figure 7A waveform diagram of a driving voltage signal S5 and a vibration acceleration signal S6 is shown. The driving voltage signal S5 is the driving voltage output by the vibration chip, and the vibration acceleration signal S6 is the vibration acceleration of the linear motor under the action of the driving voltage signal S1. As shown in Figure 7 The first time length can be 10 milliseconds, the vibration time length can be 26 milliseconds, and the third time length can be 9 milliseconds. The driving voltage signal S5 outputs a first voltage during T1, a second voltage during T2, and a third voltage during T3. Under the action of the first voltage, the amplitude of the vibration acceleration signal S6 reaches a maximum value in a very short time (for example, 10 milliseconds), indicating that the amplitude of the linear motor reaches a maximum value from 0 in 10 milliseconds; under the action of the second voltage, the amplitude of the vibration acceleration signal S6 is continuously maintained at the maximum value, indicating that the amplitude of the motor is maintained at the maximum value. Under the action of the third voltage, the amplitude of the vibration acceleration signal S6 decreases from the maximum value to 0 in a very short time (for example, 9 milliseconds), indicating that the motor stops vibrating quickly.
[0135] It can be seen that in the case where the vibration parameter includes the vibration time length, the terminal device can first determine whether the vibration time length is less than the second value. If the vibration time length is less than the second value, the vibration chip is controlled to output a first voltage to the motor within a first time length, so that the amplitude of the motor reaches a maximum value at the end of the first time length, and the vibration chip is controlled to output a second voltage to the motor within the vibration time length from the end of the first time length, so that the amplitude of the motor is maintained at the maximum value, and the vibration chip is controlled to output a third voltage to the motor from the end of the vibration time length, so that the amplitude of the motor decreases from the maximum value to 0 within a second time length. In this way, the amplitude of the linear motor can quickly reach a maximum value under the action of the first voltage and be maintained at the maximum value under the action of the second voltage, so that the user can more easily perceive the vibration, improve the user experience, and avoid the problem that the motor amplitude is small due to the short vibration time length, so that the user cannot perceive the vibration. In addition, after the actual vibration time length of the motor reaches the vibration time length required by the first application, the terminal device can output a high voltage (i.e., the third voltage) opposite to the original driving voltage (i.e., the second voltage), so that the motor stops vibrating quickly, reduces vibration tailing, and avoids the discomfort of the user caused by the vibration tailing.
[0136] In an alternative embodiment, the terminal device can also not determine whether the vibration time length is less than the second value. After receiving the first vibration event, the vibration chip is directly controlled to output a first voltage to the motor within a first time length, so that the amplitude of the motor reaches a maximum value at the end of the first time length, and the vibration chip is controlled to output a second voltage to the motor within the vibration time length from the end of the first time length, so that the amplitude of the motor is maintained at the maximum value, and the vibration chip is controlled to output a third voltage to the motor from the end of the vibration time length, so that the amplitude of the motor decreases from the maximum value to 0 within a second time length. In this case, Figure 6The flowchart shown may exclude S610. That is, after receiving the vibration request from the type determination module, the general vibration interface can directly send a vibration request to the self-developed vibration interface and execute S612 and subsequent steps without determining whether the vibration duration is less than the second value. Specifically, S610 determines whether the vibration duration is less than the second value. This allows for pre-emptive differentiation of whether the terminal device might experience insufficient vibration duration leading to a weak vibration sensation. If the terminal device determines that the vibration duration is less than the second value, it indicates a problem of insufficient vibration due to a short duration. Therefore, a first voltage can be output to increase the motor's amplitude from 0 to its maximum value within a short time (e.g., the first duration). If the terminal device determines that the vibration duration is greater than or equal to the second value, it indicates that the vibration duration may be sufficient for the user to perceive the vibration, without needing the motor to quickly reach its maximum amplitude. This approach allows the user to clearly feel the vibration while reducing resource waste caused by unnecessary processes.
[0137] It should be noted that if the type determination module in S608 determines that the vibration interface is a native vibration interface or a 4D vibration interface, the type determination module can send a vibration request to the corresponding vibration interface. After receiving the vibration request, the corresponding vibration interface can directly pass the vibration parameters to the vibration driver, which then writes the vibration parameters into the vibration chip, causing the vibration chip to output voltage according to the configuration of the vibration parameters, thereby realizing motor vibration.
[0138] In one alternative implementation, the motor may also be a nonlinear motor. The following is in conjunction with... Figure 8 The following explanation uses the example of the type determination module identifying a motor as a non-linear motor. Figure 8 A flowchart illustrating a method for driving a motor provided in this application. Figure 2 .like Figure 8 As shown, after S607, the methods for driving the motor also include S616 to S620.
[0139] S616, the type determination module sends a vibration request and a message indicating that the motor is a non-linear motor to the general vibration interface.
[0140] For a description of the vibration request, please refer to the relevant content in S604, which will not be repeated here.
[0141] S617, a universal vibration interface, extracts usable parameters from vibration parameters.
[0142] The available parameters can include parameters applicable to the non-linear motor, such as a vibration duration, a sleep duration, and the like. Specifically, the universal vibration interface can remove parameters not applicable to the non-linear motor from the vibration parameters and retain parameters applicable to the non-linear motor to control the non-linear motor. It should be noted that the parameters applicable to the non-linear motor refer to parameters that can be used to control the non-linear motor, and the parameters not applicable to the non-linear motor refer to parameters that cannot be used to control the non-linear motor, such as parameters related to a vibration waveform in S604.
[0143] For example, if the vibration parameters sent by the first application include a name of a vibration waveform and a sleep duration, the universal vibration interface can remove the name of the vibration waveform and retain the sleep duration as the available parameters.
[0144] In S618, the universal vibration interface sends the available parameters to the vibration driver.
[0145] In S619, the vibration driver writes the available parameters to the vibration chip.
[0146] In S620, the universal vibration interface outputs a second voltage to the motor.
[0147] In this embodiment, if the terminal device determines that the motor is a non-linear motor, the terminal device does not need to determine the vibration interface according to the type of the vibration parameters, but can directly extract parameters applicable to the non-linear motor (i.e., available parameters) from the vibration parameters, and configure the vibration chip based on the available parameters to make the vibration chip output a driving voltage (i.e., a second voltage) to make the non-linear motor vibrate. It can be understood that the non-linear motor does not support rich vibration due to its own object characteristics, and by extracting parameters applicable to the non-linear motor from the vibration parameters, the problem that the non-linear motor cannot vibrate due to the inadaptability of the vibration parameters to the non-linear motor can be avoided, and efficient and stable control of the motor can be achieved.
[0148] It has been described above that, in the case where the vibration parameters do not include a vibration duration, the terminal device can control the vibration chip to output a first voltage to the motor in a first duration, so that the amplitude of the motor reaches a maximum value at the end of the first duration, and output a second voltage to the motor starting from the end of the first duration, so that the amplitude of the motor remains at the maximum value.
[0149] Optionally, the terminal device can also control the vibration chip to output a third voltage to the motor when the preset duration from the start of the first vibration event received by the terminal device ends, so that the amplitude of the motor decreases from its maximum value to 0 within a second duration. Typically, each vibration event can have a preset theoretical vibration duration; for example, the theoretical vibration duration corresponding to the first vibration event is a preset duration. For instance, if the terminal device receives the first vibration event at 10:00, and this first vibration event requires the motor to stop vibrating after 1 minute, the terminal device can output a third voltage to the motor at 10:01 to control the motor to stop vibrating.
[0150] Figure 9 A flowchart illustrating a method for driving a motor provided in this application. Figure 3 This describes the process by which the terminal device controls the motor to vibrate and stops vibrating when the vibration duration does not include vibration parameters. For example... Figure 9 As shown, the method for driving a motor provided in this embodiment includes: S901 to S919.
[0151] S901, in response to receiving the first vibration event, the first application sends a request to the vibration service to turn on the motor.
[0152] S902, Vibration service detects the presence of a motor.
[0153] S903, the vibration service sends the test results to the first application.
[0154] S904, the first application sends a vibration request to the vibration service.
[0155] S905, the vibration service sends a vibration request to the type determination module.
[0156] S906, the type determination module obtains motor type information.
[0157] S907, the type determination module determines whether the motor is a linear motor.
[0158] S908, the type determination module determines the vibration interface based on the vibration parameters.
[0159] S909, the type determination module sends a vibration request and a message indicating that the motor is a linear motor to the general vibration interface.
[0160] S910, the general vibration interface sends vibration requests to the self-developed vibration interface.
[0161] Among them, with Figure 6Compared with the flow shown, in this embodiment, the vibration parameter does not include the vibration duration, so the general vibration interface can not need to determine whether the vibration duration is less than the second value after receiving the vibration request. In the case where it is determined that the motor is a linear motor, the general vibration interface can directly send a vibration request to the self-developed vibration interface after receiving the vibration request, so that the motor can quickly vibrate at the maximum amplitude through the self-developed vibration interface.
[0162] S911, the self-developed vibration interface updates the vibration parameter based on the first parameter.
[0163] According to S612, the first parameter is a parameter for controlling the amplitude of the linear motor to reach the maximum value from 0 within the first duration, and the second parameter is a parameter for making the amplitude of the linear motor change from the maximum value to 0 within the second duration. Since the vibration parameter does not include the vibration duration, the terminal device is not clear about when to control the motor to stop vibrating, so the self-developed vibration interface does not need to update the vibration parameter based on the second parameter, but only updates the vibration parameter based on the first parameter, so that the motor can quickly vibrate at the maximum amplitude.
[0164] S912, the self-developed vibration interface sends the updated vibration parameter (which can also be called the first vibration parameter) to the vibration driver.
[0165] S913, the vibration driver writes the updated vibration parameter into the vibration chip.
[0166] S914, the vibration chip outputs a first voltage to the motor within the first duration, so that the amplitude of the motor reaches the maximum value at the end of the first duration, and outputs a second voltage to the motor starting from the end of the first duration, so that the amplitude of the motor remains at the maximum value.
[0167] In this way, under the action of the first voltage, the amplitude of the motor quickly reaches the maximum value from 0; under the action of the second voltage, the amplitude of the motor remains at the maximum value.
[0168] S915, the first application sends a request to stop vibration to the vibration service.
[0169] Specifically, the first application can send a request to stop vibration to the vibration service at the end of a preset time when the first application sends a vibration request to the vibration service. For example, the first application sends a vibration request to the vibration service at 9:10, and the preset time is 2 minutes, so the first application sends a request to stop vibration to the vibration service at 9:12. The request to stop vibration is used to trigger the motor to stop vibrating.
[0170] S916, the vibration service sends a request to stop vibration to the general vibration interface.
[0171] S917, the general vibration interface sends the second parameter to the vibration driver.
[0172] The description of the second parameter can be referred to S612, which is not repeated here.
[0173] S918, the vibration drive writes the second parameter into the vibration chip.
[0174] S919, the vibration chip outputs the third voltage to the motor.
[0175] Simple comparison Figure 6 and Figure 9 It can be seen that Figure 6 the method of driving the motor shown in Figure 9 is similar to the method of driving the motor shown in Figure 6 The difference between the two is that Figure 9 is to control the motor to stop vibrating by setting the vibration duration, while Figure 6 is to control the motor to stop vibrating by stopping the vibration request. The same parts of the two can be referred to and the related description, which is not repeated here.
[0176] Figure 10 shows the time node diagram of the terminal device driving the motor vibration process in Figure 9 . Wherein t1 is the time when the first application sends the request to open the motor (i.e. the time corresponding to S901), t2 is the time when the first application sends the request to stop vibrating (i.e. the time corresponding to S915), t3 is the time when the vibration chip outputs the first voltage to control the motor to vibrate (i.e. the time corresponding to S914), t4 is the time when the vibration chip outputs the third voltage to control the motor to stop vibrating (i.e. the time corresponding to S919). The time difference between t3 and t1 is ΔT1, ΔT1 is used to represent the time used to control the motor to vibrate. The time difference between t4 and t2 is ΔT2, ΔT2 is used to represent the time used to control the motor to stop vibrating. The time difference between t2 and t1 is ΔT3, ΔT3 is used to represent the vibration duration requested by the first application. The time difference between t4 and t3 is ΔT4, ΔT4 is used to represent the actual vibration duration of the motor.
[0177] It can be seen that since the terminal device needs to perform more operations from sending the request to open the motor by the first application to the vibration chip outputting the voltage to drive the motor to vibrate (i.e. from S901 to S914), and only needs to perform fewer operations from sending the request to stop vibrating by the first application to the vibration chip outputting the voltage to drive the motor to stop vibrating (i.e. from S915 to S919), i.e. ΔT1 is greater than ΔT2. This will cause ΔT4 to be less than ΔT3, i.e. the actual vibration duration of the motor (i.e. ΔT4) is less than the vibration duration requested by the first application (i.e. ΔT3). The actual vibration duration of the motor is too short, which may cause the user to not easily perceive the vibration, affecting the user experience.
[0178] In an alternative embodiment, to avoid the actual vibration duration of the motor (i.e. the actual vibration duration of the motor) being too short, the terminal device can control the vibration chip to output a third voltage to the motor when the actual vibration duration of the motor reaches a first value, so that the amplitude of the motor decreases from the maximum value to 0 within a second duration. Optionally, the first value can be the time difference between the time when the terminal device generates the vibration request and the time when the terminal device generates the request to stop the vibration. Alternatively, the first value can be another parameter. Another embodiment in which the terminal device controls the vibration chip to output a third voltage to the motor when the actual vibration duration of the motor is greater than the first value is described below.
[0179] In Figure 9 Based on the flowchart shown in the figure, the embodiment provides another method for driving a motor. Figure 11 The flowchart of a method for driving a motor provided by the present application is shown in Figure 4 .
[0180] In comparison Figure 11 With Figure 9 It can be seen that Figure 11 The method for driving a motor provided by the present application is similar to the method for driving a motor provided by Figure 9 The difference is that: Figure 11 The method for driving a motor provided by the present application further comprises S1101, S1102 and S1103. The details of S1101, S1102 and S1103 will be described below. For the same content of the two embodiments, please refer to Figure 9 and the related description, which will not be repeated here.
[0181] S1101, start the first timer from the self-developed vibration interface, and obtain a third duration.
[0182] It should be noted that S1101 can be executed earlier than S911 or at the same time as S911, and no specific limitation is made here.
[0183] Understandably, after the self-developed vibration interface starts the first timer, the third duration starts to increase in real time from 0.
[0184] After the vibration service sends a request to stop the vibration to the general vibration interface, the general vibration interface can also execute S1102 and S1103.
[0185] S1102, the general vibration interface starts the second timer, and obtains a fourth duration.
[0186] Similarly, after the general vibration interface starts the second timer, the fourth duration starts to increase in real time from 0.
[0187] S1103, the general vibration interface judges whether the actual vibration duration is greater than or equal to the difference between the third duration and the fourth duration.
[0188] If the general vibration interface determines that the actual vibration duration is greater than or equal to the difference between the third and fourth durations, then S917 (i.e., sending the second parameter to the vibration drive) can be executed; if the general vibration interface determines that the actual vibration duration is less than the difference between the third and fourth durations, then the second timer can be waited for to continue counting, and S1103 can be executed again until the actual vibration duration is greater than or equal to the difference between the third and fourth durations. Understandably, in this embodiment, the first value is the difference between the third and fourth durations.
[0189] Figure 12 Images (a) and (b) show the terminal device using... Figure 9 , Figure 10 The diagram shows the timeline of the process driving the motor vibration. Here, t3 is the moment when the vibration chip outputs the first voltage to control the motor vibration (i.e., the moment corresponding to S914), and t4 is... Figure 9 The vibration chip outputs a third voltage to control the timing of when the motor stops vibrating (i.e., Figure 9 (The time corresponding to S919 in the middle), t5 is the time when the self-developed vibration interface receives the vibration request, t6 is the time when the general vibration interface receives the request to stop vibration, and t7 is the time when the self-developed vibration interface receives the request to stop vibration. Figure 11 The vibration chip outputs a third voltage to control the timing of when the motor stops vibrating (i.e., Figure 11 (The time corresponding to S919 in the middle). Δt5 is the third duration obtained by the first timer, and Δt6 is the fourth duration obtained by the second timer. The time difference between time t4 and time t3 is Δt4, which is used to characterize the time difference between time t4 and time t3. Figure 9 The flowchart shown illustrates the actual vibration duration of the motor when controlling its vibration. The time difference between time t7 and time t3 is Δt4', where Δt4' is used to characterize the vibration duration. Figure 11 The flowchart shown illustrates the actual vibration duration of the motor when controlling its vibration.
[0190] contrast Figure 12 As shown in (a) and (b), by judging whether the actual vibration duration is greater than or equal to the difference between the third and fourth durations, and only continuing to execute S917 when the actual vibration duration is greater than or equal to the difference between the third and fourth durations, the actual vibration duration of the motor can be changed from Δt4 to Δt4', which increases the actual vibration duration of the motor, so as to bring a clear vibration to the user and improve the user experience.
[0191] Some embodiments of the present application provide a terminal device, which can include a memory and one or more processors. The memory and the processors are coupled. The memory is configured to store computer program codes including computer instructions. When the processors execute the computer instructions, the terminal device can perform each function or step of the terminal device in the above method embodiments. The structure of the terminal device can refer to the structure of the terminal device shown in Figure 3 the structure of the terminal device.
[0192] Embodiments of the present application also provide a motor, which can be used to realize the vibration waveform under various configuration parameters in the above embodiments, and the terminal device installed with the motor can perform each function or step of the terminal device in the above method embodiments.
[0193] Embodiments of the present application also provide a computer readable storage medium, which includes computer instructions, when the computer instructions run on the above terminal device, make the terminal device perform each function or step of the terminal device in the above method embodiments.
[0194] Embodiments of the present application also provide a computer program product, when the computer program product runs on the terminal device, makes the terminal device perform each function or step of the terminal device in the above method embodiments.
[0195] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional module is taken as an example for illustration, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0196] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.
[0197] The units described as separate components may or may not be physically separate, and the components displayed as units may be a physical unit or multiple physical units, that is, may be located in one place, or also can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0198] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0199] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical scheme of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0200] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of driving a motor, characterized by, The method is applied to a terminal device including a vibration chip and a motor, and includes the following steps: receiving a vibration event for triggering the motor to vibrate; when the vibration parameter corresponding to the vibration event includes a vibration duration, controlling the vibration chip to output a first voltage to the motor within a first duration, so that the amplitude of the motor reaches a maximum value at the end of the first duration; controlling the vibration chip to output a second voltage to the motor from the end of the first duration, so that the amplitude of the motor remains at the maximum value within the vibration duration; and controlling the vibration chip to output a third voltage to the motor from the end of the vibration duration, so that the amplitude of the motor decreases from the maximum value to 0 within a second duration; and when the vibration parameter corresponding to the vibration event does not include a vibration duration, controlling the vibration chip to output a fourth voltage to the motor within a first duration, so that the amplitude of the motor reaches a maximum value at the end of the first duration; controlling the vibration chip to output a fifth voltage to the motor from the end of the first duration, so that the amplitude of the motor remains at the maximum value; and controlling the vibration chip to output a sixth voltage to the motor from the end of a preset duration starting from receiving the vibration event, so that the amplitude of the motor decreases from the maximum value to 0 within a second duration.
2. The method of claim 1, wherein, The first voltage and the second voltage are in the same direction, and the absolute value of the first voltage is greater than the absolute value of the second voltage.
3. The method according to claim 1 or 2, characterized in that, The third voltage and the second voltage are in opposite directions, and the absolute value of the third voltage is greater than the absolute value of the second voltage.
4. The method according to any one of claims 1 to 3, characterized in that, The fourth voltage is the same as the first voltage, the fifth voltage is the same as the second voltage, and the sixth voltage is the same as the third voltage.
5. The method according to any one of claims 1 to 4, characterized in that, The vibration duration does not include the first duration.
6. The method according to any one of claims 1 to 5, characterized in that, The motor is a linear motor.
7. The method according to any one of claims 1 to 6, characterized in that, The preset duration is greater than the first duration.
8. The method according to any one of claims 1 to 7, characterized in that, The vibration duration is less than a second value.
9. The method according to any one of claims 1 to 8, characterized in that, The vibration event includes one of the following: receiving an operation of a user unlocking the terminal device, receiving an operation of a user online payment, receiving an operation of a user entering a face, receiving an operation of a user releasing a skill, receiving a call request, or a current time matching a preset time.
10. The method according to any one of claims 1 to 9, characterized in that, When the vibration parameter corresponding to the vibration event includes a vibration duration, the method further includes, controlling the vibration chip to output a third voltage to the motor when the actual vibration duration of the motor reaches a first value, so that the amplitude of the motor decreases from the maximum value to 0 within a second duration.
11. The method according to any one of claims 1 to 10, characterized in that, The terminal device includes a first application, a vibration service, a vibration HAL, and a vibration driver; wherein the vibration HAL includes a type judgment module, a first interface, and a second interface; receiving a vibration event for triggering the motor to vibrate, including: in response to the vibration event, the first application sends a vibration request to the vibration service; the vibration service sends the vibration request to the type judgment module, the vibration request including the vibration parameter; controlling the vibration chip to output a first voltage to the motor in a first time length, so that an amplitude of the motor reaches a maximum value at the end of the first time length; and controlling the vibration chip to output a second voltage to the motor from the end of the first time length, so that the amplitude of the motor remains at the maximum value in a vibration time length, comprising: the type judgment module judges whether the motor is a linear motor; in a case where the type of the vibration parameter indicates that the vibration interface is the first interface, the type judgment module sends the vibration request and a message indicating that the motor is a linear motor to the first interface; the first interface sends the vibration request to the second interface; the second interface updates the vibration parameter based on a first parameter, the first parameter being used to describe a vibration waveform generated by the motor vibrating under the action of the first voltage for the first time length; the second interface sends the vibration parameter to the vibration drive, the vibration parameter being the vibration parameter updated based on the first parameter; the vibration drive writes the vibration parameter into the vibration chip; and the vibration chip outputs a first voltage to the motor in a first time length, so that an amplitude of the motor reaches a maximum value at the end of the first time length, and outputs a second voltage to the motor from the end of the first time length, so that the amplitude of the motor remains at the maximum value.
12. The method of claim 11, wherein, the second interface updates the vibration parameter based on a first parameter, the method further comprising: in a case where the vibration parameter does not include a vibration time length, the second interface updates the vibration parameter based on the first parameter.
13. The method of claim 12, wherein, the method further comprising: the first application sends a request to stop vibration to the vibration service at the end of a preset time length starting from receiving the vibration event; the vibration service sends the request to stop vibration to the first interface; the first interface sends a second parameter to the vibration drive, the second parameter being used to describe a vibration waveform generated by the motor vibrating under the action of a third voltage for a second time length; the vibration drive writes the second parameter into the vibration chip; and the vibration chip outputs the third voltage to the motor, so that the amplitude of the motor decreases from the maximum value to 0 in the second time length.
14. The method of claim 13, wherein, the method further comprising: in response to receiving the vibration request, the second interface starts a first timer to obtain a third time length; in response to receiving the request to stop vibration, the first interface starts a second timer to obtain a fourth time length; the first interface sending the second parameter to the vibration drive further comprises: when an actual vibration time length of the motor reaches a first value, the first interface sends the second parameter to the vibration drive, the first value being a difference between the third time length and the fourth time length.
15. The method of claim 12, wherein, the method further comprising: in a case where the vibration parameter includes the vibration time length, the second interface updates the vibration parameter based on the first parameter and a second parameter, the second parameter being used to describe a vibration waveform generated by the motor vibrating under the action of a third voltage for a second time length; The second interface sends a second vibration parameter to the vibration drive, the second vibration parameter being an updated vibration parameter based on the first parameter and the second parameter; The vibration drive writes the second vibration parameter to the vibration chip; The vibration chip outputs a first voltage to the motor within the first time length, so that the amplitude of the motor reaches the maximum value at the end of the first time length, and outputs a second voltage to the motor within the vibration time length starting from the end of the first time length, so that the amplitude of the motor remains at the maximum value, and outputs a third voltage to the motor starting from the end of the vibration time length, so that the amplitude of the motor decreases from the maximum value to 0 within the second time length. The third voltage is opposite to the second voltage, and the absolute value of the third voltage is greater than the absolute value of the second voltage.
16. The method of claim 15, wherein, In the case that the vibration parameter includes the vibration time length, the second interface updates the vibration parameter based on the first parameter and the second parameter, further comprising: In the case that the vibration parameter includes the vibration time length and the vibration time length is less than a second value, the second interface updates the vibration parameter based on the first parameter and the second parameter.
17. The method of claim 16, wherein, The method further comprises: The first interface determines whether the vibration time length is less than a second value; The first interface sends the vibration request to the second interface, further comprising: If the vibration time length is less than the second value, the first interface sends the vibration request to the second interface.
18. The method of claim 11, wherein, In response to the vibration event, the first application sends a vibration request to the vibration service, further comprising: In response to the vibration event, the first application sends a request to open a motor to the vibration service; The vibration service detects whether there is a motor and sends a detection result to the first application; If the detection result indicates that there is a motor, the first application sends the vibration request to the vibration service.
19. A terminal device, comprising: The terminal device comprises a vibration chip, a linear motor, a memory and one or more processors; the memory is coupled to the processor; The vibration chip is configured to drive the linear motor to vibrate; the memory is configured to store computer program code, the computer program code comprising computer instructions; when the computer instructions are executed by the processor, the terminal device executes the method according to any one of claims 1-18.
20. A computer-readable storage medium, characterized in that, The computer program product comprises computer instructions; When the computer instructions run on the terminal device, the terminal device executes the method according to any one of claims 1-18.
Citation Information
Patent Citations
Mobile terminal vibration motor control method and mobile terminal
CN106059440A
Motor vibration control method and device and computer readable storage medium
CN110380664A