Vibration method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202510185658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-15
- Publication Date
- 2025-06-27
AI Technical Summary
The motor vibration mode in existing electronic devices is fixed, resulting in the consistent vibration effect felt by users in different scenarios and poor user experience.
By setting at least two motors in the electronic device, changing the vibration mode according to the screen direction, and dynamically adjusting the vibration mode in response to different application scenarios and operations.
It realizes dynamic adjustment of vibration mode according to the screen direction and application scenarios, improves the user experience, and enhances the diversity and three-dimensionality of vibration.
Smart Images

Figure CN120223803A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202011475685.7, the filing date of the original application is December 15, 2020, and the entire content of the original application is incorporated herein by reference. Technical Field
[0002] Embodiments of the present application relate to vibration technology, and in particular, to a vibration method, apparatus, electronic device, and readable storage medium. Background Art
[0003] An electronic device can vibrate when receiving information or a call, or can vibrate in response to a specific scenario of a game. The reason why the electronic device vibrates is that the electronic device includes a motor, and the vibration of the motor enables the user to feel the vibration of the electronic device.
[0004] Currently, one motor is provided in the electronic device, and the motor vibrates in a fixed vibration mode, resulting in the same vibration effect of the electronic device felt by the user in any scenario, and the user experience is poor. Summary of the Invention
[0005] Embodiments of the present application provide a vibration method, apparatus, electronic device, and readable storage medium, in which the vibration mode of the motor can be changed to adapt to the screen direction of the electronic device, improving the user experience.
[0006] In a first aspect, embodiments of the present application provide a vibration method, which is applied to an electronic device, and the electronic device includes at least two motors. The method may include: in response to a first operation, the electronic device enters a first application scenario, and in response to the electronic device entering the first application scenario and the screen direction of the electronic device being a first screen direction, the at least two motors vibrate in a first vibration mode. In response to a second operation, the screen direction of the electronic device is switched from the first screen direction to a second screen direction, and the at least two motors vibrate in a second vibration mode, and the first vibration mode is different from the second vibration mode.
[0007] Wherein, the first operation and the second operation may both be operations of the user or operations of components of the electronic device. The first application scenario may include at least one of the following scenarios: the scenario of the interface displayed by the electronic device, the scenario of vibrating following music, the scenario of playing audio, the scenario of the user's operation on the interface of the electronic device, or the external environment where the electronic device is located. That is, in embodiments of the present application, when the electronic device is in the first application scenario and the screen direction of the electronic device is the first screen direction, the at least two motors vibrate in the first vibration mode. When the electronic device is in the first application scenario and the screen direction of the electronic device is switched from the first screen direction to the second screen direction, the at least two motors vibrate in a second vibration mode different from the first vibration mode.
[0008] In the embodiments of the present application, the vibration mode of the motor can be changed according to the screen orientation of the electronic device, which can improve the user experience.
[0009] In a possible implementation manner, in response to the second operation, the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, and the interface displayed on the electronic device rotates following the screen orientation of the electronic device, and the at least two motors vibrate in the second vibration mode.
[0010] In this way, not only can the vibration mode of the motor be changed according to the screen orientation of the electronic device, but also the interface displayed on the electronic device rotates following the screen orientation of the electronic device, so as to achieve the effect of adapting the vibration feeling to the user according to the user's vision, and improve the user experience.
[0011] In a possible implementation manner, in response to the second operation, the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, and the audio channels of the audio played by the electronic device change following the screen orientation of the electronic device.
[0012] In this way, not only can the vibration mode of the motor be changed according to the screen orientation of the electronic device, but also the audio played by the electronic device can change following the rotation of the screen orientation of the electronic device, so as to achieve the effect of adapting the vibration feeling to the user according to the user's hearing, and improve the user experience.
[0013] In a possible implementation manner, in response to the second operation, the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, and the interface displayed on the electronic device rotates following the screen orientation of the electronic device, and the audio channels of the audio played by the electronic device change following the screen orientation of the electronic device.
[0014] In this way, not only can the vibration mode of the motor be changed according to the screen orientation of the electronic device, but also the audio played by the electronic device and the interface of the electronic device can change following the rotation of the screen orientation of the electronic device, so as to achieve the effect of adapting the vibration feeling to the user according to the user's hearing and vision, and improve the user experience.
[0015] In a possible implementation manner, in response to the second operation, the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, the interface displayed on the electronic device does not rotate following the screen orientation of the electronic device, and the at least two motors vibrate in the first vibration mode.
[0016] In this way, the screen orientation of the electronic device changes, but the interface of the electronic device does not rotate. To adapt to the user's visual experience, the vibration mode of the motor does not change, which can improve the user experience.
[0017] In a possible implementation manner, the at least two motors include a first motor and a second motor. The at least two motors vibrate in a first vibration mode, including: the first motor vibrates in a first waveform, and the second motor vibrates in a second waveform; the at least two motors vibrate in a second vibration mode, including: the first motor vibrates in a third waveform, and the second motor vibrates in a fourth waveform. Among them, the difference between the first vibration mode and the second vibration mode can be manifested as: at least one of the third waveform and the fourth waveform is different from the first waveform, and / or at least one of the third waveform and the fourth waveform is different from the second waveform.
[0018] Among them, the first parameter includes a first sub-parameter and a second sub-parameter, and the second parameter includes a third sub-parameter and a fourth sub-parameter. The electronic device can drive the first motor to vibrate in the first waveform with the first sub-parameter, and the electronic device can drive the second motor to vibrate in the second waveform with the second sub-parameter. The electronic device can drive the first motor to vibrate in the third waveform with the third sub-parameter, and the electronic device can drive the second motor to vibrate in the fourth waveform with the fourth sub-parameter.
[0019] In a possible implementation manner, when the scene of the interface of the electronic device is the same scene, the screen orientation is switched, and the second vibration mode is different from the first vibration mode. In the embodiments of the present application, the first waveform and the fourth waveform are the same, and the second waveform and the third waveform are the same, which can bring the same vibration feeling to the user when the electronic device is in the same interface scene.
[0020] In a possible implementation manner, the first waveform is used to represent that the vibration intensity of the first motor changes from strong to weak, and the second waveform is used to represent that the vibration intensity of the second motor changes from weak to strong.
[0021] In this way, when the electronic device is in the same interface scene, it can bring the same vibration feeling of vibrating from the left to the right to the user.
[0022] In a possible implementation manner, the positions of the first motor and the second motor in the electronic device are different. The different installation positions of the motors and the coupling of the vibrations between the motors can enable the user to feel a clearer vibration feeling.
[0023] The following describes the process of the electronic device driving at least two motors to vibrate:
[0024] In a possible implementation, the electronic device may generate a first target configuration file, and the first target configuration file is used to indicate the first vibration mode. The electronic device may generate a first parameter according to the first target configuration file, and the first parameter is used to drive the first motor to vibrate in the first waveform and the second motor to vibrate in the second waveform. Similarly, the electronic device generates a second target configuration file, and the second target configuration file is used to indicate the second vibration mode; the electronic device generates a second parameter according to the second configuration file, and the second parameter is used to drive the first motor to vibrate in the third waveform and the second motor to vibrate in the fourth waveform.
[0025] In a possible implementation, when at least one of the first application scenario and the first screen orientation is different, the first target configuration file is different; and when at least one of the first application scenario and the second screen orientation is different, the second target configuration file is different.
[0026] Optionally, the electronic device may obtain first target configuration information according to the first application scenario, the first screen orientation, and the vibration mode mapping relationship. The vibration mode mapping relationship is used to represent the mapping relationship between the application scenario of the electronic device and the first configuration information, and the first target configuration information is used to represent the first screen orientation; and use the first configuration file containing the first target configuration information as the first target configuration file.
[0027] Optionally, the electronic device may obtain second target configuration information, and the second target configuration information is used to represent the second screen orientation; and use the first configuration file containing the second target configuration information as the second target configuration file. Among them, the electronic device may obtain the second target configuration information according to the first application scenario, the second screen orientation, and the vibration mode mapping relationship; or the electronic device may modify the first target configuration information to the second target configuration information according to the second screen orientation.
[0028] In a possible implementation, the electronic device may include a first layer, a second layer, a third layer, a fourth layer, and a fifth layer. The following takes the first layer as the application layer, the second layer as the KIT layer, the third layer as the application framework layer, the fourth layer as the hardware abstraction layer, and the fifth layer as the kernel layer as an example to illustrate the process of the electronic device driving at least two motors to vibrate:
[0029] The following describes the process of the electronic device generating the first target configuration file in the following two ways:
[0030] The first method: The application layer obtains the first target configuration information according to the first application scenario, the first screen orientation, and the vibration mode mapping relationship; the application layer sends the first target configuration information to the hardware abstraction layer through the KIT layer and the application framework layer; the hardware abstraction layer uses the first configuration file containing the first target configuration information as the first target configuration file.
[0031] In a possible implementation, for different first application scenarios, the identifiers of the target vibration modes are different, and the target vibration mode is the first vibration mode or the second vibration mode; moreover, for different identifiers of the target vibration modes, the initial configuration information is different, and the initial configuration information is the first target configuration information to be determined.
[0032] The second method: The application layer obtains the identifier of the target vibration mode according to the first application scenario and the vibration mode mapping relationship, and the vibration mode mapping relationship is further used to represent the mapping relationship between the application scenario of the electronic device and the identifier of the vibration mode; the application layer sends the identifier of the target vibration mode to the KIT layer; the KIT layer obtains the initial configuration information according to the identifier of the target vibration mode and the vibration mode mapping relationship, and the initial configuration information is: the first configuration information mapped by the identifier of the target vibration mode in the vibration mode mapping relationship; the KIT layer sends the initial configuration information to the application framework layer; the application framework layer obtains the first target configuration information according to the first screen orientation and the initial configuration information; the application framework layer sends the first target configuration information to the hardware abstraction layer; the hardware abstraction layer uses the first configuration file containing the first target configuration information as the first target configuration file.
[0033] The difference between the above two methods lies in: whether the application layer obtains the first target configuration information or the application framework layer obtains the second target configuration information. In the embodiments of the present application, for different applications, it is pre-configured that the application layer obtains the first target configuration information or the application framework layer obtains the second target configuration information.
[0034] In a possible implementation, for different first target configuration files, the first parameters are different; moreover, for different second target configuration files, the second parameters are different.
[0035] In a possible implementation, the hardware abstraction layer sends the first target configuration file to the kernel layer; the kernel layer generates the first parameter according to the first target configuration file; and the hardware abstraction layer sends the second target configuration file to the kernel layer; the kernel layer generates the second parameter according to the first target configuration file.
[0036] In a possible implementation, the first parameter includes a first sub-parameter and a second sub-parameter, and the second parameter includes a third sub-parameter and a fourth sub-parameter; after generating the first parameter, it further includes: the kernel layer drives the first motor to vibrate in the first waveform with the first sub-parameter, and the kernel layer drives the second motor to vibrate in the second waveform with the second sub-parameter; after generating the second parameter, it further includes: the kernel layer drives the first motor to vibrate in the third waveform with the third sub-parameter, and the kernel layer drives the second motor to vibrate in the fourth waveform with the fourth sub-parameter.
[0037] In a second aspect, an embodiment of the present application provides a vibration device, including: a first motor module, a second motor module, a motor interface, a motor library module, and a motor driver.
[0038] In response to a first operation, the electronic device enters a first application scenario, and the electronic device includes at least two motors; in response to the electronic device entering the first application scenario and the screen direction of the electronic device being the first screen direction, the at least two motors vibrate in a first vibration mode; in response to a second operation, the screen direction of the electronic device switches from the first screen direction to a second screen direction, and the at least two motors vibrate in a second vibration mode, and the first vibration mode is different from the second vibration mode.
[0039] In a possible implementation, the interface displayed by the electronic device rotates following the screen direction of the electronic device.
[0040] In a possible implementation, the audio channels of the audio played by the electronic device change following the screen direction of the electronic device.
[0041] In a possible implementation, in response to the second operation, the screen direction of the electronic device switches from the first screen direction to the second screen direction, the interface displayed by the electronic device does not rotate following the screen direction of the electronic device, and the at least two motors vibrate in the first vibration mode.
[0042] In a possible implementation, the at least two motors include a first motor and a second motor. The first motor vibrates in a first waveform, and the second motor vibrates in a second waveform; the first motor vibrates in a third waveform, and the second motor vibrates in a fourth waveform, where at least one of the third waveform and the fourth waveform is different from the first waveform, and / or at least one of the third waveform and the fourth waveform is different from the second waveform.
[0043] In a possible implementation, the first waveform and the fourth waveform are the same, and the second waveform and the third waveform are the same.
[0044] In a possible implementation, the first waveform is used to represent that the vibration intensity of the first motor changes from strong to weak, and the second waveform is used to represent that the vibration intensity of the second motor changes from weak to strong.
[0045] In a possible implementation, the positions of the first motor and the second motor in the electronic device are different.
[0046] In a possible implementation, the motor driver is used to generate a first parameter, and the first parameter is used to drive the first motor to vibrate in the first waveform and the second motor to vibrate in the second waveform; the motor driver is further used to generate a second parameter, and the second parameter is used to drive the first motor to vibrate in the third waveform and the second motor to vibrate in the fourth waveform.
[0047] In a possible implementation, the motor library module is used to generate a first target configuration file, and the first target configuration file is used to indicate the first vibration mode; the motor library module is further used to generate a second target configuration file, and the second target configuration file is used to indicate the second vibration mode.
[0048] In a possible implementation, when at least one of the first application scenario and the first screen orientation is different, the first target configuration file is different; and when at least one of the first application scenario and the second screen orientation is different, the second target configuration file is different.
[0049] In a possible implementation, the first motor module, or the first motor module and the second motor module, is used to obtain first target configuration information according to the first application scenario, the first screen orientation, and the vibration mode mapping relationship, and the vibration mode mapping relationship is used to represent the mapping relationship between the application scenario of the electronic device and the first configuration information, and the first target configuration information is used to represent the first screen orientation; the motor library module is used to use the first configuration file containing the first target configuration information as the first target configuration file.
[0050] In a possible implementation, the first motor module and / or the second motor module obtains second target configuration information, where the second target configuration information is used to characterize the second screen orientation; a motor library module is configured to use a first configuration file including the second target configuration information as the second target configuration file.
[0051] In a possible implementation, the first motor module is configured to obtain the second target configuration information according to the first application scenario, the second screen orientation, and the vibration mode mapping relationship; or, the second motor module is configured to modify the first target configuration information to the second target configuration information according to the second screen orientation.
[0052] In a possible implementation, the first application scenario includes at least one of the following scenarios: a scenario of an interface displayed by the electronic device, a scenario of vibrating following music, a scenario of playing audio, a scenario of an operation of a user on the interface of the electronic device, or an external environment where the electronic device is located.
[0053] In a possible implementation, the electronic device includes a first layer, a second layer, a third layer, and a fourth layer; the first motor module in the first layer is configured to obtain the first target configuration information according to the first application scenario, the first screen orientation, and the vibration mode mapping relationship; the first motor module in the first layer sends the first target configuration information to a motor library module in the fourth layer through a motor interface in the second layer and a second motor module in the third layer; the motor library module in the fourth layer uses a first configuration file including the first target configuration information as the first target configuration file.
[0054] In a possible implementation, when the first application scenario is different, the identifier of the target vibration mode is different, and the target vibration mode is the first vibration mode or the second vibration mode; and when the identifier of the target vibration mode is different, the initial configuration information is different, where the initial configuration information is the first target configuration information to be determined.
[0055] In a possible implementation, the first motor module in the first layer is configured to obtain an identifier of the target vibration mode according to the first application scenario and the vibration mode mapping relationship, where the vibration mode mapping relationship is further used to represent the mapping relationship between the application scenario of the electronic device and the identifier of the vibration mode; the first motor module in the first layer sends the identifier of the target vibration mode to the motor interface in the second layer; the motor interface in the second layer is configured to obtain the initial configuration information according to the identifier of the target vibration mode and the vibration mode mapping relationship, where the initial configuration information is: the first configuration information mapped by the identifier of the target vibration mode in the vibration mode mapping relationship; the motor interface in the second layer sends the initial configuration information to the second motor module in the third layer; the second motor module in the third layer is configured to obtain the first target configuration information according to the first screen direction and the initial configuration information; the second motor module in the third layer sends the first target configuration information to the motor library module in the fourth layer; the motor library module in the fourth layer uses the first configuration file including the first target configuration information as the first target configuration file.
[0056] In a possible implementation, the first target configuration files are different and the first parameters are different; and, the second target configuration files are different and the second parameters are different.
[0057] In a possible implementation, the motor library module in the fourth layer sends the first target configuration file to the motor driver in the fifth layer; the motor driver in the fifth layer generates the first parameter according to the first target configuration file; and, the motor library module in the fourth layer sends the second target configuration file to the motor driver in the fifth layer; the motor driver in the fifth layer generates the second parameter according to the first target configuration file.
[0058] In a possible implementation, the first parameter includes a first sub-parameter and a second sub-parameter, and the second parameter includes a third sub-parameter and a fourth sub-parameter; the motor driver in the fifth layer drives the first motor to vibrate in the first waveform with the first sub-parameter, and the motor driver in the fifth layer drives the second motor to vibrate in the second waveform with the second sub-parameter; and, the motor driver in the fifth layer drives the first motor to vibrate in the third waveform with the third sub-parameter, and the motor driver in the fifth layer drives the second motor to vibrate in the fourth waveform with the fourth sub-parameter.
[0059] In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes: at least two motors.
[0060] In response to a first operation, the electronic device enters a first application scenario. The electronic device includes at least two motors. In response to the electronic device entering the first application scenario and the screen direction of the electronic device being a first screen direction, the at least two motors vibrate in a first vibration mode. In response to a second operation, the screen direction of the electronic device switches from the first screen direction to a second screen direction. The at least two motors vibrate in a second vibration mode, and the first vibration mode is different from the second vibration mode.
[0061] It should be understood that the at least two motors are used to perform the vibration actions in the first aspect or each possible implementation manner of the first aspect, and the electronic device is used to perform the methods other than vibration in the first aspect or each possible implementation manner of the first aspect.
[0062] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes: a processor, a memory, and at least two motors.
[0063] The at least two motors are used to generate vibrations in the first aspect and each possible implementation manner above, so that the electronic device vibrates. The memory is used to store computer-executable program code, and the program code includes instructions. When the processor executes the instructions, the instructions cause the electronic device to perform the methods other than vibration in the first aspect or each possible implementation manner of the first aspect.
[0064] In a fifth aspect, an embodiment of the present application provides a vibration device, which includes units, modules, or circuits for performing the methods provided in the first aspect or each possible implementation manner of the first aspect above. The vibration device can be an electronic device or a module applied to an electronic device. For example, it can be a chip applied to an electronic device.
[0065] In a sixth aspect, an embodiment of the present application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the methods in the first aspect or various possible implementation manners of the first aspect above.
[0066] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored, and when running on a computer, cause the computer to execute the methods in the first aspect or various possible implementation manners of the first aspect above.
[0067] For the possible implementation manners of the second to seventh aspects above, the beneficial effects can refer to the beneficial effects brought by the first aspect and each possible implementation manner of the first aspect, which will not be elaborated here.
[0068] The present application provides a vibration method, apparatus, electronic device, and readable storage medium. The method includes: in response to a first operation, the electronic device enters a first application scenario, and the electronic device includes at least two motors; in response to the electronic device entering the first application scenario and the screen direction of the electronic device being a first screen direction, the at least two motors vibrate in a first vibration mode; in response to a second operation, the screen direction of the electronic device switches from the first screen direction to a second screen direction, and the at least two motors vibrate in a second vibration mode, where the first vibration mode is different from the second vibration mode. In the embodiments of the present application, the vibration mode of the motor can be changed according to the screen direction of the electronic device, thereby achieving the effect of adapting the vibration feeling of the user according to the screen direction and improving the user experience. Description of the Drawings
[0069] Figure 1 It is a schematic structural diagram of an electronic device applicable to the embodiments of the present application;
[0070] Figure 2 It is a schematic software structure block diagram of an electronic device applicable to the embodiments of the present application;
[0071] Figure 3 It is another schematic software structure block diagram of an electronic device applicable to the embodiments of the present application;
[0072] Figure 4 It is a schematic layout diagram of the motors provided by the embodiments of the present application;
[0073] Figure 5 It is a schematic diagram of the screen direction;
[0074] Figure 6 It is a schematic diagram for determining the screen direction;
[0075] Figure 7 It is a schematic flowchart of an embodiment of the vibration method provided by the embodiments of the present application;
[0076] Figure 8 It is a schematic vibration diagram provided by the embodiments of the present application;
[0077] Figure 9 It is another schematic vibration diagram provided by the embodiments of the present application;
[0078] Figure 10 It is another schematic vibration diagram provided by the embodiments of the present application;
[0079] Figure 11 It is another schematic vibration diagram provided by the embodiments of the present application;
[0080] Figure 12 It is another schematic vibration diagram provided by the embodiments of the present application;
[0081] Figure 13 Another vibration schematic diagram provided by an embodiment of the present application;
[0082] Figure 14 Another vibration schematic diagram provided by an embodiment of the present application;
[0083] Figure 15 Another vibration schematic diagram provided by an embodiment of the present application;
[0084] Figure 16 Another vibration schematic diagram provided by an embodiment of the present application;
[0085] Figure 17 A test comparison schematic diagram provided by an embodiment of the present application;
[0086] Figure 18 Another test comparison schematic diagram provided by an embodiment of the present application;
[0087] Figure 19 Another test comparison schematic diagram provided by an embodiment of the present application. Detailed implementation manners
[0088] Figure 1 A schematic structural diagram of an electronic device applicable to an embodiment of the present application. As Figure 1 shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0089] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a display process unit (DPU), and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. Among them, the processor may be the nerve center and command center of the electronic device 100. The processor may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions. A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 100.
[0090] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
[0091] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0092] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 100 through the power management module 141.
[0093] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0094] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0095] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier, etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.
[0096] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
[0097] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), NFC, infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive the signal to be transmitted from the processor 110, perform frequency modulation and amplification on it, and convert it into electromagnetic waves through the antenna 2 for radiation.
[0098] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technologies. The wireless communication technologies may include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The above GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or the Satellite Based Augmentation Systems (SBAS).
[0099] The electronic device 100 can implement the display function through the GPU, the display screen 194, and the application processor, etc. The application processor may include an NPU and a DPU. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute instructions to generate or change the display information. The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc. The DPU is also called the Display Sub-System (DSS). The DPU is used to adjust the color of the display screen 194. The DPU can adjust the color of the display screen through a three-dimensional look-up table (3D LUT). The DPU can also perform processing such as image scaling, noise reduction, contrast enhancement, backlight brightness management, hdr processing, and Gamma adjustment of the display parameters.
[0100] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0101] The electronic device 100 can implement the shooting function through an ISP, one or more cameras 193, a video codec, a GPU, one or more display screens 194, an application processor, etc.
[0102] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, data files such as music, photos, and videos are saved in the external memory card.
[0103] The internal memory 121 can be used to store one or more computer programs, and the one or more computer programs include instructions. The processor 110 can execute various functional applications and data processing by running the above instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system; the program storage area can also store one or more application programs (such as a gallery, contacts, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as photos, contacts, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute various functional applications and data processing by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor 110.
[0104] The internal memory 121 is used to store the vibration mode mapping relationship, the first configuration file, and the mapping relationship between the vibration mode and the parameters of the vibration waveform in the embodiments of the present application. Among them, the vibration mode mapping relationship may include the following first mapping table, second mapping table, and third mapping table. The vibration mode mapping relationship is used to represent the mapping relationship between the application scenarios and configuration information of the electronic device. The configuration information may be information such as a string. The first configuration file is used to indicate the vibration mode, so as to enable the electronic device 100 to obtain the parameters of the vibration waveform according to the first configuration file. The vibration mode is used to represent the vibration manner of the motor in the electronic device 100, and the parameters of the vibration waveform are used to drive the motor to vibrate, and the waveform generated by the motor vibration is the vibration waveform. The parameters of the vibration waveform may include but are not limited to: vibration intensity, vibration start time, vibration duration, and vibration type. The vibration type may be rotor vibration and / or linear vibration.
[0105] In one embodiment, the above-mentioned vibration mode mapping relationship, the first configuration file, and the mapping relationship between the vibration mode and the parameters of the vibration waveform may be pre-stored in the internal memory 121. In one embodiment, the user can customize the settings of the vibration mode mapping relationship, the first configuration file, and the mapping relationship between the vibration mode and the parameters of the vibration waveform. Among them, when the user customizes the settings, the application scenarios, vibration modes, and parameters of the vibration waveform of the electronic device 100 may be pre-stored in the internal memory 121 for the user to select. The electronic device 100 can generate the vibration mode mapping relationship and the mapping relationship between the vibration mode and the parameters of the vibration waveform according to the user's selection, so as to store them in the internal memory 121. It should be understood that in the following embodiments, the parameters of the vibration waveform are represented by the first parameter, the second parameter, or the parameter.
[0106] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, etc. For example, music playback, recording, etc. Among them, the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110. The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by placing the receiver 170B close to the human ear. The microphone 170C, also known as the "microphone", "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to implement sound signal collection, noise reduction, and can also identify the sound source to implement a directional recording function, etc. The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0107] The sensor 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0108] Among them, the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates having conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations with the same touch position but different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
[0109] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of jitter of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and enables the lens to offset the jitter of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation, somatosensory game scenarios, etc.
[0110] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0111] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. In some embodiments, in the shooting scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve rapid focusing.
[0112] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys or touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function control of the electronic device 100.
[0113] The motor 191 can be a rotary motor and / or a linear motor, such as an X-axis linear motor or a Z-axis linear motor. The electronic device may include at least one motor 191. The movement of the motor, such as rotation or linear movement, can generate vibrations, thereby causing the electronic device to vibrate. When the electronic device 100 includes at least two motors, the at least two motors can be of the same type. For example, the motors can all be rotary motors, X-axis linear motors, or Z-axis linear motors. Alternatively, the at least two motors can be of different types. At least some of the motors can be of different types, or at least some of the motors can be of the same type.
[0114] The SIM card interface 195 is used to connect to a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, an embedded SIM card, and the eSIM card can be embedded in the electronic device 100.
[0115] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100. Figure 2 It is a software structure block diagram of an electronic device applicable to the embodiments of this application. The layered architecture divides the software system of the electronic device 100 into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into five layers, namely the application layer (applications), the application framework layer (application framework), Android runtime and system libraries, the hardware abstract layer (hardware abstract layer, HAL), and the kernel layer (kernel).
[0116] The application layer may include a series of application packages. The application layer runs applications by calling the application programming interfaces (APIs) provided by the application framework layer. As Figure 2 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0117] The application framework layer provides APIs and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. As Figure 2 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.
[0118] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data, and make this data accessible to applications. The data may include video, image, audio, dialed and answered calls, browsing history and bookmarks, phone book, etc. The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures. The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, hang up, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device 100 vibrates, the indicator light flashes, etc.
[0119] The Android Runtime includes core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part is the functional functions that the Java language needs to call, and the other part is the core libraries of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection. The system libraries can include multiple functional modules. For example: Surface Manager, Media Libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engines (such as SGL), etc.
[0120] The Surface Manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The Media Libraries support the playback and recording of multiple common audio and video formats, as well as static image files, etc. The Media Libraries can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is the drawing engine for 2D drawing.
[0121] The Hardware Abstraction Layer can include multiple library modules, and the library modules can be, for example, the camera library module, the motor library module, etc. The Android system can load the corresponding library modules for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware. The device hardware can include, for example, the motor, camera, etc. in an electronic device.
[0122] The kernel layer is the layer between the hardware and the software. The kernel layer is used to drive the hardware so that the hardware works. The kernel layer at least includes a display driver, a camera driver, an audio driver, a sensor driver, a motor driver, etc., and the embodiments of the present application do not limit this. Exemplarily, in the embodiments of the present application, the kernel layer uses a motor driver to drive the motor (hardware) in the electronic device 100 to move, so as to generate vibrations.
[0123] In one embodiment, Figure 3 is another software structure block diagram of the electronic device applicable to the embodiments of the present application. Figure 3 will Figure 2 The application framework layer, the Android Runtime, and the system libraries shown are regarded as one layer (in the following embodiments, this layer is taken as an example of the application framework layer for illustration), and the communication interface between the application layer and the application framework layer is described as a separate toolkit KIT layer. The KIT layer can include, for example, a window service interface, a display framework interface, etc.
[0124] In one embodiment, the software architecture of an electronic device may include a first layer, a second layer, a third layer, a fourth layer, and a fifth layer. In the following embodiments, the first layer is taken as the application layer, the second layer is taken as the KIT layer, the third layer is taken as the application framework layer, the fourth layer is taken as the hardware abstraction layer, and the fifth layer is taken as the kernel layer for illustration. It should be understood that in some embodiments, layers that implement the same function may be referred to by other names, or a layer that can implement the functions of multiple layers may be regarded as one layer, or a layer that can implement the functions of multiple layers may be divided into multiple layers.
[0125] Figure 4 This is a schematic diagram of the arrangement of motors provided by the embodiments of the present application. Figure 4 In the following, an example is given in which the electronic device 100 includes two motors. In the embodiments of the present application, the electronic device 100 may also include more or fewer motors, Figure 4 which does not limit the number and arrangement of the motors in the electronic device 100. As Figure 4 shown, there are motor 1 and motor 2 provided in the electronic device 100, and motor 1 and motor 2 can be respectively arranged at both ends of the electronic device 100. For example, motor 1 can be arranged at position m of the electronic device 100, and motor 2 can be arranged at position n of the electronic device 100. It should be understood that motor 1 and motor 2 are arranged inside the electronic device 100, and in the figure, they are represented by dotted lines on the surface of the electronic device 100 to characterize their positions. Figure 4 This is an example of the arrangement of the motors. In the embodiments of the present application, motor 1 and motor 2 can also be arranged diagonally (such as positions o and p), or arranged at the same end of the electronic device 100 (such as positions s and t). In the following embodiments, in combination with Figure 3 the software structure shown in Figure 4 and the arrangement manner of the motors in
[0126] the vibration method of the electronic device provided by the embodiments of the present application is described.
[0127] Screen direction: In the embodiments of the present application, the screen direction may include landscape and portrait. Portrait can include a first direction and a third direction, and landscape can include a second direction and a fourth direction. In the embodiments of the present application, the portrait when the electronic device is facing forward can be taken as the first direction, as Figure 5 shown in a of Figure 5 . Rotating the first direction clockwise by 90° is the second direction, rotating the second direction clockwise by 90° is the third direction, and rotating the third direction clockwise by 90° is the fourth direction. The first direction, the second direction, the third direction, and the fourth direction can be respectively shown as Figure 5 a, b, c, and d in
[0128] It should be understood that if the electronic device is between two screen orientations, in the embodiments of the present application, the included angle between the vertical center line of the electronic device and the vertical center line when the electronic device is in two screen orientations can be obtained, and the screen orientation with the smaller included angle is used as the screen orientation of the electronic device. Exemplarily, as Figure 6 shown, if the electronic device is between a first direction and a second direction. In the embodiments of the present application, the first included angle or / and the second included angle can be obtained, where the first included angle is the included angle between the vertical center line of the electronic device and the vertical center line when the electronic device is in the first direction, such as 55°, and the second included angle is the included angle between the vertical center line of the electronic device and the vertical center line when the electronic device is in the second direction, such as 35°. Then, the second direction with the smaller included angle is used as the screen orientation of the electronic device. It should be understood that the vertical center line of the electronic device can be as Figure 6 shown by the dotted line in
[0129] Main motor: A predefined motor. Exemplarily, in the embodiments of the present application, the motor 2 in Figure 4 can be predefined as the main motor.
[0130] Left motor and right motor: Predefined motors. Exemplarily, in the embodiments of the present application, the motor 2 in Figure 4 can be predefined as the left motor, and the motor 1 as the right motor. It should be understood that in the following embodiments, the first motor can be used as the left motor and the second motor as the right motor for description. Among them, the installation positions of the first motor and the second motor in the electronic device are different, as Figure 4 shown.
[0131] The embodiments of the present application provide a vibration method, which can determine to use a single motor or multiple motors to achieve different types of vibrations according to the application scenario of the electronic device, bringing a more diversified and three-dimensional vibration feeling to the user and improving the user experience.
[0132] The following will describe the vibration method provided by the embodiments of the present application in combination with specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes will not be repeated. Figure 7 It is a schematic flowchart of an embodiment of the vibration method provided by the embodiments of the present application. As Figure 7 shown, the vibration method provided by the embodiments of the present application can include:
[0133] S701, the application layer determines a target vibration mode according to the first application scenario of the electronic device.
[0134] When a user uses an application with vibration feedback on an electronic device, or when the electronic device receives a call or a short message, the electronic device can provide vibration feedback. The application with vibration feedback can be, but is not limited to, an audio / video playback application, an input method application, a game application, or a clock application. The first application scenario of the electronic device can be the application currently running on the electronic device, or the scenario of a call received by the electronic device or the scenario of receiving a short message. To facilitate distinguishing the application scenario where the current electronic device is located from other application scenarios, in the embodiments of the present application, the first application scenario is used as the application scenario where the current electronic device is located. It should be understood that when the first application scenario of the electronic device is different, the target vibration mode of the electronic device is different. Alternatively, in one embodiment, at least some different first application scenarios correspond to different target vibration modes, and some different first application scenarios may also correspond to the same target vibration mode. When the vibration modes are different, at least one of the following vibration parameters of the motor in the electronic device can be different: the number of motors that vibrate, the vibration intensity, the time when vibration starts, the vibration duration, or the type of vibration. The type of vibration can be, but is not limited to, rotor vibration and / or linear vibration.
[0135] In one embodiment, in response to a first operation, the electronic device can enter the first application scenario. The first operation can be, but is not limited to, an operation by the user or an operation of a component inside the electronic device. Among them, the operation by the user can be, but is not limited to: triggering the interface of the electronic device, speaking a voice, or the user carrying the electronic device from one external environment to another external environment. The operation of the component can be, but is not limited to: the processor sending an instruction, or the application layer detecting a change in the screen orientation.
[0136] In one embodiment, S701 can be replaced with: the first motor module in the application layer determines the target vibration mode according to the application scenario of the electronic device. The first motor module can be a module in the application layer used to perform actions related to motor vibration. The following uses the application layer to represent the first motor module in the application layer for explanation.
[0137] In a possible implementation, the first application scenario of the electronic device can be the scenario of the interface displayed by the electronic device. The application layer can determine the target vibration mode according to the scenario of the interface. Optionally, different scenarios of the interface result in different target vibration modes. Exemplarily, when the application is a game application, the scenarios of the interface can be the scenario of starting the game, the scenario of character level-up, or the scenario of passing the level and getting rewards, etc. The scenarios of the interface of the game application can be specifically shown in Table 1. Optionally, the application layer can include a stack for storing information about the interface. The top of the stack includes information about the current interface displayed by the electronic device. Among them, the information about the current interface can include, but is not limited to, the scenario of the current interface, the controls in the current interface, or the coordinate positions of the controls. The controls in the current interface can include a shooting control or a direction control, etc., for controlling the actions of the characters in the game. The coordinate position of the control refers to the coordinate position of the control on the interface of the electronic device. In this way, the application layer can query the top of the stack to obtain the information about the current interface, and then obtain the scenario of the interface displayed by the electronic device.
[0138] In the embodiment of the present application, the application layer can store a first mapping table. The first mapping table is used to represent the mapping relationship among the scenario of the interface, the identifier of the vibration mode, and the first configuration information, as shown in Table 1. Among them, the identifier of the vibration mode can be a digital number, a character, etc. The identifier of the vibration mode is used to distinguish different vibration modes. The embodiment of the present application does not limit the identifier of the vibration mode. In Table 1, an identifier composed of numbers and letters is taken as an example for illustration. The first configuration information is used to enable the KIT layer and the application framework layer to determine the target vibration mode. Optionally, the first configuration information can be information such as a string. In one embodiment, the first mapping table can also include a description of the vibration mode corresponding to the scenario of the interface. The description of the vibration mode is used to indicate the vibration mode to distinguish the vibration modes corresponding to different scenarios of the interface. In one embodiment, the identifier of the vibration mode can also be replaced by the identifier of the scenario of the interface. The identifier of the scenario of the interface is used to distinguish different scenarios of the interface.
[0139] It should be understood that the application layer can also store the first mapping table in a database format or an extensible markup language (XML) format. Table 1 is an example of a format of the first mapping table. The application layer can determine the target vibration mode according to the scenario of the interface and the first mapping table. In one embodiment, the electronic device can represent the target vibration mode by the identifier of the vibration mode (the identifier of the scenario of the interface), the description of the vibration mode, or the first configuration information.
[0140] Table 1
[0141]
[0142] Exemplarily, as shown in Table 1, when the scene of the interface displayed by the electronic device is a character upgrade scene, the application layer can determine that the target vibration mode corresponding to the character upgrade scene is "dual-motor vibration (short and rapid vibration)" according to the character upgrade scene and the first mapping table.
[0143] As shown in Table 1, the description of the vibration mode is "dual-motor vibration". The vibration modes of the two motors can be different. In Table 1, different dual-motor vibration modes are distinguished by "dual-motor vibration 1", "dual-motor vibration 2", etc. The suffix "dual" of the string in the first configuration information indicates dual-motor vibration. The suffix "rtol" indicates vibration from the right motor to the left motor, and "ltor" indicates vibration from the left motor to the right motor. The suffix "left_l" or "Onlyl" indicates that only the left motor vibrates, and the suffix "right_r" or "Onlyr" indicates that only the right motor vibrates. It should be noted that the target vibration mode in the embodiments of the present application can be the vibration of a target type of motor, and the target type of motor can be, for example, an X-axis linear motor, a Z-axis linear motor, or a rotor motor. For example, "X" in the first configuration information "haptic.game_qz.stren_X" can indicate that the target vibration mode is X-axis linear motor vibration, "Z" in the first configuration information "haptic.game_qz.stren_Z" can indicate that the target vibration mode is Z-axis linear motor vibration, and "O" in the first configuration information "haptic.game_qz.stren_O" can indicate that the target vibration mode is rotor motor vibration, which is not shown in Table 1. The following embodiments will be described by taking Table 1 as an example.
[0144] In one embodiment, the first configuration information in Table 1 may not include a suffix. In one embodiment, the first configuration information may not include the suffixes "rtol", "ltor", "left_l", "Onlyl", "right_r", "Onlyr", and then the application layer or the program framework layer adds a suffix according to the screen direction of the electronic device. For details, reference can be made to the relevant descriptions of the following application layer and program framework layer. In one embodiment, the first configuration information may not include the suffix "dual", and the hardware abstraction layer adds a suffix to the first configuration information. For details, reference can be made to the relevant description of the following hardware abstraction layer.
[0145] In a possible implementation, the application scenario of the electronic device can be vibrating following music. Different audio played by the electronic device corresponds to different target vibration modes. For an audio playback application, the application framework layer can obtain the audio file to be played, and the audio file can be a waveform audio (wav) file. The wav file can include the audio channels, and the channels can be the left channel, the right channel, the stereo channel, or the multi-channel. The above application layer can call the API of the KIT layer to obtain the audio channels from the application framework layer, and then determine the target vibration mode according to the audio channels. Exemplarily, if the audio channel is the left channel, the application layer can determine the target vibration mode as the left motor vibrating. If the audio channel is the right channel, the application layer can determine the target vibration mode as the right motor vibrating. If the audio channel is the stereo channel, the application layer can determine the target vibration mode as the left and right motors vibrating. In one implementation, the electronic device can include at least three motors. If the audio channel is the multi-channel, the application layer can determine the target vibration mode as at least three motors vibrating.
[0146] It should be understood that the scenario of vibrating following music shown in Table 1 above can be classified either into "the application scenario of the electronic device is vibrating following music" or into "the application scenario of the electronic device is the interface scenario". However, no matter how it is classified, the purpose of the motor vibrating with the audio channels can be achieved.
[0147] In a possible implementation, the application scenario of the electronic device can be the scenario of playing audio. Optionally, different audio can correspond to different target vibration modes. The application layer can obtain the identifier of the audio played by the electronic device, and then determine the target vibration mode according to the identifier of the audio. Among them, the identifier of the audio can be but not limited to the name of the audio, the number of the audio, etc.
[0148] In a possible implementation, the application scenario of the electronic device can be the screen orientation of the electronic device. Optionally, different screen orientations of the electronic device correspond to different target vibration modes. The application layer can obtain the screen orientation, and then determine the target vibration mode according to the screen orientation. Optionally, the application layer can call the API in the KIT layer for detecting the screen orientation to obtain the screen orientation of the electronic device. The API for detecting the screen orientation can be the window service (windowservice) or the display framework (display FWK) interface. Optionally, the application layer calls the API in the KIT layer for obtaining the data of the sensor to obtain the data from the sensor. The sensor can be a gyroscope and / or an acceleration sensor. The application layer can obtain the screen orientation of the electronic device according to the data from the sensor. Exemplarily, different data range intervals of the data of the sensor correspond to different screen orientations of the electronic device.
[0149] In the embodiments of the present application, a second mapping table may be stored in the application layer. The second mapping table is used to represent the mapping relationship between the screen orientation, the identifier of the vibration mode, and the first configuration information, as shown in Table 2. The application layer may determine the target vibration mode according to the screen orientation and the second mapping table. Exemplarily, when the electronic device is in the vertical screen, the application layer determines the target vibration mode as the main motor vibration according to the vertical screen of the electronic device and the second mapping table. When the electronic device is in the horizontal screen, in order to increase the vibration sensation, the target vibration mode may be dual-motor vibration, such as the simultaneous vibration of Motor 1 and Motor 2. In a possible embodiment, the second mapping table may include a description of the vibration mode corresponding to the identifier of the vibration mode.
[0150] Table 2
[0151]
[0152] In a possible implementation manner, the application scenario of the electronic device may be the user's operation on the interface of the electronic device. The application layer may determine the target vibration mode according to the operation information of the user on the interface of the electronic device. Optionally, different operation information results in different target vibration modes. The operation information may include the user's operation position and / or operation action. The operation position may be the coordinate position where the user operates on the interface, and the operation action may include, but is not limited to, single click, double click, and swipe. It should be understood that when the user operates on the interface of the electronic device, the application layer may receive touch information from the touch panel, which may be referred to as TP information. The TP information may include the operation information of the user on the interface of the electronic device, and thus the application layer may obtain the operation information of the user on the interface of the electronic device.
[0153] Optionally, the application layer may determine the target vibration mode according to the user's operation position. Optionally, different user operation positions result in different target vibration modes. Exemplarily, as Figure 4 shown, if the user's operation position is close to the right motor (Motor 1), the target vibration mode may be determined as the right motor vibration. If the user's operation position is close to the left motor (Motor 2), the target vibration mode may be determined as the left motor vibration. It should be understood that in the embodiments of the present application, the screen of the electronic device may be pre-divided into an area close to the left motor and an area close to the right motor in advance. When the user's operation position falls into the area close to the left motor, it may be determined that the user's operation position is close to the left motor. When the user's operation position falls into the area close to the right motor, it may be determined that the user's operation position is close to the right motor. It should be understood that when the electronic device includes multiple motors, the screen of the electronic device may be pre-divided into multiple areas according to the installation positions of the motors to determine which motor the user's operation position is close to.
[0154] Optionally, the application layer may determine the target vibration mode according to the user's operation actions. Optionally, different user operation actions result in different target vibration modes. Exemplarily, when the user's operation action is a click, the target vibration mode may be the main motor vibration. If the user's operation action is a slide, the target vibration mode may be the dual motor vibration.
[0155] Optionally, the application layer may determine the target vibration mode according to the user's operation position and operation actions. Different user operation actions and / or operation positions result in different target vibration modes. Exemplarily, as Figure 4 shown, based on the user's operation position and operation actions, if the application layer determines that the user slides from bottom to top, it may determine that the target vibration mode is from motor 1 to motor 2. For example, the vibration intensity of motor 2 weakens, and the vibration intensity of motor 1 strengthens, bringing the user a vibration feeling from bottom to top.
[0156] In this method, a third mapping table may be stored in the application layer. The third mapping table is used to represent the mapping relationship between the operation information of the user on the interface of the electronic device, the identifier of the vibration mode, and the first configuration information, as shown in Table 3. The application layer may determine the target vibration mode according to the operation information of the user on the interface of the electronic device and the third mapping table. In one embodiment, the third mapping table may include the description of the vibration mode corresponding to the identifier of the vibration mode.
[0157] Table 3
[0158]
[0159]
[0160] In a possible implementation, the application scenario of the electronic device may be the external environment where the electronic device is located. Optionally, different external environments where the electronic device is located result in different target vibration modes.
[0161] Optionally, the application layer may determine whether the external environment where the electronic device is located is night or day according to the time. If it is night (such as between 24:00 and 6:00), the target vibration mode may be the single motor vibration.
[0162] Optionally, the application layer can determine that the external environment where the electronic device is located is a movie-watching environment, a shopping environment, a bus-riding environment, etc. based on the schedule information, ticket information, and payment information in the electronic device. For a movie-watching environment, if the electronic device receives an incoming call, the target vibration mode can be single-motor vibration. For a movie-watching environment, if the electronic device receives an incoming call, the target vibration mode can be dual-motor vibration. The vibration sensation of single-motor vibration is weaker than that of dual-motor vibration, so as to prompt the user in a vibration manner that fits the external environment where the electronic device is located, improving the user experience.
[0163] Optionally, the application layer can detect the decibel level of the noise in the external environment where the electronic device is located. If the decibel level of the noise is greater than a preset decibel level, the target vibration mode can be dual-motor vibration. If the decibel level of the noise is less than or equal to the preset decibel level, the target vibration mode can be single-motor vibration.
[0164] It should be understood that the "single-motor vibration" and "dual-motor vibration" in the above target vibration modes are for illustrative purposes, and other vibration methods can also be used in the embodiments of the present application.
[0165] In summary, for different applications, the above first mapping table, second mapping table, and / or third mapping table can be preset. The application layer can determine the target vibration mode according to the application scenario of the electronic device. In one embodiment, for audio and video playback applications and game applications, the first mapping table can be pre-stored in the application layer. For input method applications, the second mapping table and / or third mapping table can be pre-stored in the application layer. For clock applications, the third mapping table can be pre-stored in the application layer. Among them, the first mapping table, second mapping table, and third mapping table can be referred to as vibration mode mapping relationships, and the vibration mode mapping relationship is used to represent the mapping relationship between the application scenario of the electronic device, the identifier of the vibration mode, and the first configuration information. In one embodiment, the vibration mode mapping relationship also includes a description of the vibration mode corresponding to the identifier of the vibration mode.
[0166] In one embodiment, the application layer can obtain the number of motors in the electronic device. Among them, the application layer can obtain the number of motors when the application starts. Or, the application layer can obtain the number of motors when the application is started for the first time after installation and save the number of motors, so that the application layer does not need to repeatedly obtain the number of motors when the application is started subsequently. Or, the application layer can obtain the number of motors when determining the target vibration mode. Optionally, in the embodiment of the present application, the KIT layer may include an API for querying the number of motors, and the application layer can call this API to query and obtain the number of motors. Exemplarily, the function corresponding to the API is vibratorEx.getHwParameter(“vibratorNumOnChip”), and the application layer can obtain the number of motors according to this function. Among them, the information in the quotation marks represents the number of motors. For example, “” means that the electronic device supports 1 motor, “sub:1” means that the electronic device supports 2 motors, and “sub2:2” means that the electronic device supports 3 motors. Among them, “” means that the field in the quotation marks is empty. The purpose of using “” is to be compatible with software versions without this function.
[0167] In one embodiment, the application layer can obtain whether the motor in the electronic device supports a linear motor to obtain the vibration ability of the motor. Among them, the application layer can obtain whether the motor supports a linear motor when obtaining the number of motors. Optionally, in the embodiment of the present application, the KIT layer may include an API for querying whether the motor supports a linear motor, and the application layer can call this API to query and obtain whether the motor supports a linear motor. Exemplarily, the function corresponding to the API is “getHwParameter(vibrator Ex.HW_VIBRATOR_GRADE_VALUE)”, and the application layer can call this API to query whether the motor in the electronic device supports a linear motor. Among them, when the VALUE value is NULL, it means that the motor does not support a linear motor, and when the VALUE corresponds to a specific value, it means that the motor supports a linear motor.
[0168] S702, the application layer determines the identifier or the first target configuration information of the target vibration mode according to the target vibration mode and the vibration mode mapping relationship.
[0169] It should be understood that for different target vibration modes, the identifiers of the target vibration modes are different, and the first target configuration information is also different.
[0170] In a possible implementation, after determining the target vibration mode, the application layer may determine the identifier of the target vibration mode according to the "mapping relationship between the vibration mode and the identifier of the vibration mode" in the vibration mode mapping relationship. The identifier of the target vibration mode is the identifier of the vibration mode mapped by the target vibration mode in the vibration mode mapping relationship. Exemplarily, if the target vibration mode is the clearance reward vibration, the identifier of the target vibration mode corresponding to this target vibration mode is "2A".
[0171] In an embodiment, after determining the target vibration mode, the application layer may determine the first target configuration information according to the "mapping relationship between the vibration mode and the first configuration information" in the vibration mode mapping relationship. The first target configuration information may be the first configuration information mapped by the target vibration mode in the vibration mode mapping relationship. The first target configuration information may be a target string. Exemplarily, if the identifier of the target vibration mode is "2A", the first target configuration information is "haptic.game_qmqz.pass_dual".
[0172] In an embodiment, for vibrations with suffixes "rtol", "ltor", "left_l", "Onlyl", "right_r", or "Onlyr", the vibrations have directionality and can also be called three-dimensional vibrations. The application layer may determine the initial configuration information according to the target vibration mode and the vibration mode mapping relationship, and then determine the first target configuration information according to the first screen direction and the initial configuration information of the electronic device. It should be understood that if at least one of the first screen direction and the initial configuration information is different, the first target configuration information is different. The initial configuration information may be referred to as the first target configuration information to be determined. Among them, the first screen direction is the current screen direction of the electronic device. The fact that the vibration has directionality can be understood as: the vibration is transmitted from one part of the electronic device to another part.
[0173] Exemplarily, if the target vibration mode is "clearance reward vibration", the first configuration information mapped by this target vibration mode may be the initial configuration information "haptic.game_qmqz.pass_dual", and the vibration corresponding to the suffix "dual" in this initial configuration information does not have directionality. Therefore, the application layer may use this initial configuration information as the first target configuration information.
[0174] For a scenario of a stereoscopic vibration interface, the vibration has a directionality. Exemplarily, if the scenario of the interface is "turn on game vibration", two strings, "haptic.game_qz.open_ltor" and "haptic.game_qz.open_rtol", can be configured. In this scenario, the application layer can obtain the first screen direction of the electronic device, and then determine the first target configuration information according to the first screen direction and the initial configuration information. Exemplarily, if the first screen direction is the second direction, from the left side to the right side of the electronic device is the predefined left motor to right motor, i.e., "ltor". If the first screen direction is the fourth direction, from the left side to the right side of the electronic device is the predefined right motor to left motor, i.e., "rtol". Among them, if the application layer determines that the first screen direction of the electronic device is the second direction, the first target configuration information can be determined as "haptic.game_qz.open_ltor" according to the initial configuration information.
[0175] In one embodiment, if the first configuration information in Table 1 above does not include the suffix "rtol" or "ltor", such as the initial configuration information mapped by the target vibration mode is "haptic.game_qz.open", the application layer can add a suffix to this initial configuration information according to the first screen direction to obtain the first target configuration information. If the first screen direction is the second direction, the application layer can determine that the suffix is "ltor", and then the first target configuration information can be obtained as "haptic.game_qz.open_ltor".
[0176] It should be understood that the first target configuration information is used to represent the first screen direction. For example, if the first target configuration information is "haptic.game_qz.open_ltor", it can represent that from the left side to the right side of the electronic device is "left motor to right motor", indicating that the first screen direction can be the second direction.
[0177] In one embodiment, when the first application scenario of the electronic device is the scenario of the interface, S702 can be replaced with: The application layer determines the identifier of the scenario of the interface or the first target configuration information according to the scenario of the interface and the vibration mode mapping relationship. In this embodiment, the "identifier of the target vibration mode" in S703 - S708 below can be replaced with the "identifier of the scenario of the interface".
[0178] S703, the application layer sends the identifier of the target vibration mode or the first target configuration information to the KIT layer.
[0179] After obtaining the identifier of the target vibration mode, the application layer may send the identifier of the target vibration mode to the KIT layer. Alternatively, after obtaining the first target configuration information, the application layer may send the first target configuration information to the KIT layer. In a possible implementation manner, embodiments of the present application may pre-define whether the application layer obtains the identifier of the target vibration mode or the first target configuration information. Exemplarily, for the first application, the identifier of the target vibration mode corresponding to the first application may be pre-defined. Then, when the first application runs, the application layer may determine the identifier of the target vibration mode according to the target vibration mode and the vibration mode mapping relationship, and send the identifier of the target vibration mode to the KIT layer.
[0180] In one embodiment, S703 may be replaced with: the first motor module in the application layer sends the identifier of the target vibration mode or the first target configuration information to the motor interface in the KIT layer. In the following embodiments, the motor interface in the KIT layer is represented by the KIT layer for description.
[0181] S704, if the KIT layer receives the first target configuration information from the application layer, it sends the first target configuration information to the application framework layer; if the KIT layer receives the identifier of the target vibration mode from the application layer, it determines the initial configuration information according to the vibration mode mapping relationship, and sends the initial configuration information to the application framework layer.
[0182] In a possible implementation manner, the KIT layer may not store the vibration mode mapping relationship. Wherein, when the KIT layer receives the first target configuration information from the application layer, it may send the first target configuration information to the application framework layer.
[0183] In a possible implementation manner, the KIT layer stores the vibration mode mapping relationship. Wherein, after the KIT layer receives the identifier of the target vibration mode from the application layer, it may determine the initial configuration information mapped by the identifier of the target vibration mode according to the mapping relationship between the identifier of the target vibration mode and the first configuration information in the vibration mode mapping relationship, and send the initial configuration information to the application framework layer. Wherein, the initial configuration information may be: the first configuration information mapped by the identifier of the target vibration mode in the vibration mode mapping relationship. It should be understood that different identifiers of the target vibration mode result in different initial configuration information.
[0184] Exemplarily, if the identifier of the target vibration mode is "2A", the initial configuration information may be "haptic.game_qmqz.pass_dual" corresponding to "2A" in the vibration mode mapping relationship. If the identifier of the target vibration mode is "11A", the initial configuration information may be "haptic.game_qz.open_ltor" and "haptic.game_qz.open_rtol".
[0185] In the embodiment of the present application, the above S704 may be replaced with: If the KIT layer receives the first target configuration information from the application layer, it sends the first target configuration information to the second motor module in the application framework layer; if the KIT layer receives the identifier of the target vibration mode from the application layer, it determines the initial configuration information according to the vibration mode mapping relationship and sends the initial configuration information to the second motor module in the application framework layer. It should be understood that the second motor module may be a module in the application framework layer for performing actions related to motor vibration. In the following embodiments, the application framework layer is used to represent the second motor module in the application framework layer as an example for illustration.
[0186] S705, if the application framework layer receives the first target configuration information from the KIT layer, it sends the first target configuration information to the hardware abstraction layer; if the application framework layer receives the initial configuration information from the KIT layer, it obtains the first target configuration information according to the first screen direction and the initial configuration information of the electronic device, and sends the first target configuration information to the hardware abstraction layer.
[0187] Among them, if the application framework layer receives the first target configuration information from the KIT layer, the application framework layer sends the first target configuration information to the hardware abstraction layer. If the application framework layer receives the initial configuration information from the KIT layer, the application framework layer may obtain the first target configuration information according to the first screen direction and the initial configuration information of the electronic device, and send the first target configuration information to the hardware abstraction layer. If at least one of the first screen direction and the initial configuration information is different, the first target configuration information is different. It should be noted that the process of the application framework layer obtaining the first target configuration information according to the first screen direction and the initial configuration information may refer to the relevant description of the application layer obtaining the first target configuration information in the above S702. In one embodiment, the application framework layer may call the window service or the display framework interface to obtain the first screen direction of the electronic device. In one embodiment, the application framework layer may call the API for obtaining sensor data in the KIT layer to obtain the data from the sensor. The application framework layer may obtain the screen direction of the electronic device according to the data from the sensor.
[0188] In one embodiment, S705 can be replaced with: If the application framework layer receives the first target configuration information from the KIT layer, it sends the first target configuration information to the motor library module in the hardware abstraction layer; if the application framework layer receives the initial configuration information from the KIT layer, it obtains the first target configuration information according to the first screen orientation and the initial configuration information of the electronic device, and sends the first target configuration information to the motor library module in the hardware abstraction layer. In the following embodiments, the hardware abstraction layer is used to represent the motor library module in the hardware abstraction layer for description.
[0189] S706. The hardware abstraction layer obtains a first target configuration file according to the first target configuration information, and the first target configuration file is used to represent the target vibration mode.
[0190] In the embodiments of the present application, the hardware abstraction layer may pre-store multiple first configuration files. The first configuration file is used to represent the vibration mode, enable the kernel layer to determine the vibration mode, and the first configuration file may be an XML file. Different first target configuration information results in different first target configuration files. The first target configuration file is used to represent the target vibration mode, and the first configuration file enables the kernel layer to determine the target vibration mode to generate parameters corresponding to the target vibration mode.
[0191] In a possible implementation manner, after receiving the first target configuration information, the hardware abstraction layer may perform a string search in the first configuration file, and use the first configuration file including the first target configuration information as the first target configuration file. Exemplarily, if the scenario of the interface is "enable game vibration", and the first target configuration information is "haptic.game_qz.open_ltor", the first target configuration file corresponding to the first target configuration information is as follows:
[0192] <HAPTIC_EFFCT ID=〝302〞>
[0193] <name>haptic.game_qz.open_ltor_dualL< / name>
[0194] <value> 0,30 <value>(1)
[0195] and
[0196] <HAPTIC_EFFCT ID="302">
[0197] <name>haptic.game_qz.open_ltor_dualR< / name>
[0198] <value> 0,30 <value>(2)
[0199] Exemplarily, the first line of (1) and (2) in the first target configuration file, "<HAPTIC_EFFCT ID=〝302〞>", represents the identifier of the first configuration file, such as a number. Among them, "30" in "302" of ID is used to represent the vibration mode of the motor vibration, such as the 30th vibration mode. 2 is used to represent vibrating at the vibration intensity of the second gear. It should be understood that in the embodiments of the present application, the mapping relationship between the vibration mode of the motor vibration and the number (as shown in Table 4 below), and the mapping relationship between the gear and the vibration intensity can be pre-configured. In one embodiment, the first target configuration file may include information such as the amplitude, time, and intensity of the motor vibration. It should be understood that, as Figure 4 shown, the vibration modes of the motor vibration are different, and the numbers of the vibration modes are different.
[0200] (1) and (2) the second line, such as " <name>haptic.game_qz.open_ltor_dualL< / name> ” and <name>haptic.game_qz.open_ltor_dualR< / name> , both include the first target configuration information "haptic.game_qz.open_ltor", and the vibration modes "dualL" and "dualR" of the motor vibration. Among them, "dualL" represents the vibration mode of the left motor in the dual motors, and "dualR" represents the vibration mode of the right motor in the dual motors.
[0201] (1) and (2) the third line " <value> 0,30 <value>The "0" in "" can represent the start time of vibration, and "30" represents the 30th vibration mode. The above (1) and (2) indicate that both the left motor and the right motor vibrate in the 30th vibration mode at the 0th second. As above, (1) is the first target configuration file for enabling the left motor to vibrate, and (2) is the first target configuration file for enabling the left motor to vibrate. In one embodiment, when the hardware abstraction layer receives the first target configuration information, it can query the string in the first configuration file and synchronously obtain the first target configuration file (1) corresponding to the left motor and the first target configuration file (2) corresponding to the right motor respectively.
[0202] Table IV
[0203]
[0204]
[0205] S707, the hardware abstraction layer sends the first target configuration file to the kernel layer.
[0206] In one embodiment, S707 can be replaced with: the motor library module in the hardware abstraction layer sends the first target configuration file to the motor driver in the kernel layer. The following uses the kernel layer to represent the motor driver in the kernel layer for explanation.
[0207] S708, the kernel layer obtains the first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0208] If the first target configuration file is different, the target vibration mode is different, and the first parameter is different. The first parameter is used to drive the motor to vibrate in the target vibration mode. When the kernel layer receives the first target configuration file from the hardware abstraction layer, it can parse the first target configuration file to obtain the target vibration mode. Exemplarily, when the kernel layer parses the above first target configuration files (1) and (2), it can obtain that the target vibration mode is the 30th vibration mode. In one possible implementation, a fourth mapping table can be stored in the kernel layer, and the fourth mapping table is used to represent the mapping relationship between the vibration mode and the parameter. Optionally, the fourth mapping table can include the mapping relationship between the identifier of the vibration mode and the parameter. The kernel layer can obtain the parameter corresponding to the target vibration mode, that is, the first parameter, according to the first target configuration file and the fourth mapping table. Exemplarily, the kernel layer can obtain the first parameter corresponding to the 30th vibration mode according to the 30th vibration mode and the fourth mapping table. It should be understood that since the 30th vibration mode is for the left motor and the right motor to vibrate, the kernel layer can synchronously obtain the parameters for enabling the left motor to vibrate and the parameters for the right motor to vibrate.
[0209] In one embodiment, a preset array and a sampling frequency can be stored in the kernel layer. The kernel layer can sample in the preset array according to the sampling frequency to obtain an array corresponding to the target vibration mode, that is, the first parameter. The kernel layer drives the motor to vibrate with the first parameter. It should be understood that other principles for the kernel layer to drive the motor to vibrate can refer to the relevant descriptions of the prior art.
[0210] In the embodiments of the present application, according to different application scenarios of the electronic device, a single motor or multiple motors are used to achieve different types of vibrations, bringing a more diversified and three-dimensional vibration feeling to the user and improving the user experience.
[0211] In one embodiment, since the motor vibration has a directionality, in the embodiments of the present application, when the screen direction changes, according to the first application scenario of the electronic device, the configuration information and configuration file of the motor vibration can be re-obtained, and then the direction of the motor vibration can be changed to adapt to the screen direction of the electronic device.
[0212] In a possible implementation manner, the application layer can detect the screen direction of the electronic device. If the electronic device is in the first application scenario and the application layer detects that the screen direction has changed, the electronic device can execute S701-S708 as described above. The application layer re-determines and issues the first target configuration information, and then the hardware abstraction layer can obtain a first target configuration file adapted to the screen direction according to the first target configuration information, so that the kernel layer can accurately drive the motor to vibrate with the correct first parameter.
[0213] In a possible implementation manner, the application framework layer can detect the screen direction. If the electronic device is in the first application scenario and the application layer detects that the screen direction has changed, the application framework layer can modify the first target configuration information according to the screen direction. Then the hardware abstraction layer can obtain a first target configuration file adapted to the screen direction based on the modified first target configuration information, so that the kernel layer can accurately drive the motor to vibrate with the correct first parameter.
[0214] Exemplarily, when the screen direction is the second direction and the scene of the interface is "footstep vibration, someone coming from the left", the target vibration mode is the left motor vibration, then in the first target configuration file <name>The row can be "haptic.game_qz.left_l_OnlyL", indicating that only motor 2 vibrates, as shown in a of Figure 8 as shown in. When the screen orientation switches from the second direction to the fourth direction, the scene of the interface remains unchanged. However, since the position of the motor changes relative to the scene of the interface, at the fourth direction, the left side of the electronic device is motor 1, and motor 1 is the predefined right motor. Then, in the first target configuration file <name>The row can be changed to "haptic.game_qz.right_r_OnlyR", indicating that only motor 1 vibrates, as shown in Figure 8 b in the figure. In this example, when the screen orientation of the electronic device changes and the scene of the interface is "footstep vibration, someone coming from the left", the user can feel the vibration of the motor on the left side of the electronic device, which conforms to the user's feeling.
[0215] In the embodiments of the present application, the first application scenario of the electronic device can be adapted according to the change of the screen orientation, so that the motor vibration can better conform to the user's feeling. It should be understood that in the illustrations of the embodiments of the present application, multiple wavy lines are used to represent the motor vibration, and the length of the wavy line represents the strength of the motor vibration. Among them, the longer the wavy line, the stronger the motor vibration, and the shorter the wavy line, the weaker the motor vibration. In the direction from the wavy line close to the electronic device to the wavy line far from the electronic device, the change in the length of the wavy line can represent the change in the strength of the motor vibration.
[0216] It should be understood that Figure 8 the vibration mode when the screen orientation shown changes is also applicable to the following interface scenarios: such as a bomb explosion on the left side of the interface, a person's left face being hit on the interface, and a person being injured on the left side.
[0217] In the embodiments of the present application, if the screen orientation changes, the application layer can re-determine and issue the first target configuration information, or the application framework layer can modify the first target configuration information according to the screen orientation, both of which can enable the hardware abstraction layer to obtain the first target configuration file adapted to the screen orientation, so as to achieve that the kernel layer accurately drives the motor vibration with the correct first parameter, adapts to the first application scenario of the electronic device, and improves the user experience.
[0218] Next, the vibration method of the embodiments of the present application will be described in combination with the specific first application scenario of the electronic device. It should be understood that the vibration mode of the electronic device in the first application scenario is for illustrative purposes.
[0219] Scenario 1: The first application scenario of the electronic device is the interface scenario. In the embodiments of the present application, the interface scenario is the "scene of starting a game", the target vibration mode corresponding to the "scene of starting a game" is "vibration transitioning from the left side to the right side", and the example is described with the screen orientation switching from the second direction to the fourth direction.
[0220] The vibration method of the embodiments of the present application may include:
[0221] S901, the application layer determines the target vibration mode according to the scene of starting the game.
[0222] Among them, the target vibration mode can be different for different game scenes of the interface. In one embodiment, at least some different game scenes of the interface correspond to different target vibration modes, or some different game scenes of the interface may correspond to the same target vibration mode.
[0223] S902. The application layer determines the identifier of the target vibration mode or the first target configuration information according to the target vibration mode and the vibration mode mapping relationship, and sends the identifier of the target vibration mode or the first target configuration information to the KIT layer.
[0224] Among them, according to the target vibration mode and the vibration mode mapping relationship, the application layer can determine that the identifier of the target vibration mode is 11A. If the first screen direction is the second direction, the application layer determines the first target configuration information as "haptic.game_qz.open_ltor" according to the first screen direction.
[0225] In one embodiment, S901 and S902 can be replaced with: The application layer determines the identifier of the scene of the interface or the first target configuration information according to the scene of the game when it is started, and sends the identifier of the scene of the interface or the first target configuration information to the KIT layer. In this embodiment, the "identifier of the target vibration mode" in the following S903 - S912 and S907A can be replaced with the "identifier of the scene of the interface".
[0226] S903. If the KIT layer receives the first target configuration information from the application layer, it sends the first target configuration information to the application framework layer; if the KIT layer receives the identifier of the target vibration mode from the application layer, it determines the initial configuration information according to the vibration mode mapping relationship, and sends the initial configuration information to the application framework layer.
[0227] If the KIT layer receives the first target configuration information "haptic.game_qz.open_ltor" from the application layer, it sends the first target configuration information "haptic.game_qz.open_ltor" to the application framework layer. If the KIT layer receives the identifier 11A of the target vibration mode from the application layer, it determines the initial configuration information "haptic.game_qz.open_ltor" and "haptic.game_qz.open_rtol", or "haptic.game_qz.open", according to the vibration mode mapping relationship, and sends the initial configuration information to the application framework layer. The following takes the initial configuration information as "haptic.game_qz.open" as an example for description.
[0228] S904. If the application framework layer receives the first target configuration information from the KIT layer, it sends the first target configuration information to the hardware abstraction layer. If the application framework layer receives the initial configuration information from the KIT layer, it obtains the first target configuration information based on the first screen orientation and the initial configuration information of the electronic device, and sends the first target configuration information to the hardware abstraction layer.
[0229] If the application framework layer receives the first target configuration information "haptic.game_qz.open_ltor" from the KIT layer, it sends the first target configuration information "haptic.game_qz.open_ltor" to the hardware abstraction layer. If the application framework layer receives the initial configuration information "haptic.game_qz.open" from the KIT layer, the application framework layer obtains the first target configuration information "haptic.game_qz.open_ltor" based on the second direction and the initial configuration information "haptic.game_qz.open", and sends the first target configuration information "haptic.game_qz.open_ltor" to the hardware abstraction layer.
[0230] S905. The hardware abstraction layer obtains the first target configuration file based on the first target configuration information, and sends the first target configuration file to the kernel layer.
[0231] Among them, in the first configuration file, the hardware abstraction layer can determine the first target configuration file containing the first target configuration information "haptic.game_qz.open_ltor" according to the first target configuration information. The first target configuration file is used to represent the first vibration mode, and the first configuration file is used to enable the kernel layer to determine the first vibration mode and generate the first parameter corresponding to the first vibration mode. The first target configuration file can be as shown in (3) and (4) below:
[0232] <HAPTIC_EFFCT ID=〝21〞>
[0233] <name>haptic.game_qz.open_ltor_dualL< / name>
[0234] <value> 0,2 <value>(3)
[0235] <HAPTIC_EFFCT ID=〝21〞>
[0236] <name>haptic.game_qz.open_ltor_dualR< / name>
[0237] <value> 0,2 <value>(4)
[0238] (3) and (4) characterize that the target vibration mode is dual-motor vibration, and the vibration transitions from the left side to the right side. The vibration intensity of the motor on the left side of the electronic device changes from strong to weak, and the vibration intensity of the motor on the right side changes from weak to strong, bringing the user a feeling of the vibration transitioning from the left side to the right side. When the first screen direction is the second direction, the vibration transitioning from the left side to the right side represents that "the vibration intensity of motor 2 changes from strong to weak, and the vibration intensity of motor 1 changes from weak to strong". In the embodiments of the present application, when the hardware abstraction layer receives the first configuration information, it can query the string and synchronously obtain the first target configuration file of the left motor (the first motor) and the first target configuration file of the right motor (the second motor).
[0239] S906, the kernel layer generates the first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0240] It should be understood that in order to distinguish from the target vibration mode indicated by the following second target configuration file, the target vibration mode indicated by the first target configuration file is taken as the first vibration mode here, and the target vibration mode indicated by the second target configuration file is taken as the second vibration mode for description.
[0241] The kernel layer obtains the first parameter corresponding to the first vibration mode according to the first vibration mode and the fourth mapping table. Different first configuration files result in different first vibration modes. The kernel layer can drive the motor to vibrate in the first vibration mode with the first parameter. Among them, different first parameters result in different first vibration modes.
[0242] The first parameter is used to drive the first motor to vibrate in the first waveform and the second motor to vibrate in the second waveform. In one embodiment, the kernel layer can obtain the first parameter according to the above first target configuration files (3) and (4). The first parameter can include a first sub-parameter and a second sub-parameter. Among them, the kernel layer drives the first motor to vibrate in the first waveform with the first sub-parameter, and the kernel layer drives the second motor to vibrate in the second waveform with the second sub-parameter. That is to say, the kernel layer can synchronously obtain the first sub-parameter enabling the first motor to vibrate and the second sub-parameter enabling the second motor to vibrate according to the first target parameter.
[0243] Exemplarily, the first waveform can be the waveform of L as shown in a of Figure 9 , and the second waveform can be the waveform of R as shown in a of Figure 9 . The first waveform is used to characterize that the vibration intensity of the first motor changes from strong to weak, and the second waveform is used to characterize that the vibration intensity of the second motor changes from weak to strong. It should be understood, Figure 9 L and R in a and b therein represent the left and right sides of the actual orientation of the electronic device. Among them, the first motor vibrating in the first waveform can be understood as: the first motor vibrates, and the waveform of the vibration is the first waveform. The second motor vibrating in the second waveform can be understood as: the second motor vibrates, and the waveform of the vibration is the second waveform. Among them, Figure 9 a in it represents "the vibration transitions from the left side to the right side", the vibration intensity of the left motor changes from strong to weak, and the vibration intensity of the right motor changes from weak to strong. That is, the vibration intensity of the first motor changes from strong to weak, and the vibration intensity of the second motor changes from weak to strong.
[0244] Exemplarily, Figure 9 The vibration schematic diagram corresponding to the waveform diagram shown in a in it is as Figure 9 shown in c in it. When the screen direction is the second direction and the scene of the interface is the scene of starting a game (boxing game), the vibration intensity of motor 2 changes from strong to weak, and the vibration intensity of motor 1 changes from weak to strong, bringing the user a three-dimensional vibration with the vibration transitioning from the left side to the right side. It should be understood that Figure 9 the vibration mode of the motor shown in c in it is the first vibration mode, and the first vibration mode is that the vibration intensity of motor 2 changes from strong to weak, and the vibration intensity of motor 1 changes from weak to strong.
[0245] S907, if the application layer detects that the screen direction switches from the first screen direction to the second screen direction, then determine the target vibration mode according to the scene of starting the game.
[0246] In one embodiment, in response to the second operation, the screen direction of the electronic device switches from the first screen direction to the second screen direction. Optionally, the second operation can be the operation of the user. The operation of the user is such as the user rotating the electronic device. In the embodiment of the present application, the first screen direction is taken as the second direction and the second screen direction is taken as the fourth direction as an example for illustration.
[0247] S908, the application layer determines that the identifier of the target vibration mode is 11A according to the target vibration mode and the vibration mode mapping relationship, and sends 11A to the KIT layer; or, the application layer determines that the second target configuration information is haptic.game_qz.open_rtol according to the target vibration mode and the vibration mode mapping relationship, and sends the second target configuration information haptic.game_qz.open_rtol to the KIT layer.
[0248] Among them, since the screen direction switches from the second direction to the fourth direction, the predefined left motor and right motor also change with respect to the left and right of the electronic screen. In the fourth direction, "transitioning from the left side to the right side" means that motor 1 vibrates to motor 2. Since motor 2 is the predefined left motor and motor 1 is the predefined right motor, correspondingly, it is the right motor vibrating to the left motor. The application layer can regenerate the second target configuration information as haptic.game_qz.open_rtol and send the second target configuration information haptic.game_qz.open_rtol to the KIT layer.
[0249] haptic.game_qz.open_rtol represents that the target vibration mode is that when in the fourth direction, the vibration of the motor transitions from the left side to the right side, and what the user feels is still the vibration from the left side to the right side. In this way, the vibration of the motor can be adaptively adjusted according to the rotation of the screen so that it can adapt to the user's feeling when the screen rotates.
[0250] S909, if the KIT layer receives the second target configuration information haptic.game_qz.open_rtol from the application layer, it sends the second target configuration information haptic.game_qz.open_rtol to the application framework layer; if the KIT layer receives the identifier 11A of the target vibration mode from the application layer, it determines the initial configuration information haptic.game_qz.open according to the vibration mode mapping relationship and sends the initial configuration information haptic.game_qz.open to the application framework layer.
[0251] S910, if the application framework layer receives the second target configuration information haptic.game_qz.open_rtol from the KIT layer, it sends the second target configuration information haptic.game_qz.open_rtol to the hardware abstraction layer; if the application framework layer receives the initial configuration information haptic.game_qz.open from the KIT layer, it obtains the second target configuration information haptic.game_qz.open_rtol according to the second screen direction and the initial configuration information haptic.game_qz.open, and sends the second target configuration information haptic.game_qz.open_rtol to the hardware abstraction layer.
[0252] S911, the hardware abstraction layer obtains the second target configuration file according to the second target configuration information and sends the second target configuration file to the kernel layer.
[0253] Similar to the above S905, in the first configuration file, the hardware abstraction layer can determine a second target configuration file that contains the first target configuration information "haptic.game_qz.open_rtol" according to the first target configuration information. In one embodiment, when at least one of the first application scenario and the second screen orientation is different, the second target configuration information is different, and the second target configuration file is different. The second target configuration file is used to represent the second vibration mode, and the first configuration file is used to enable the kernel layer to determine the second vibration mode and generate a second parameter corresponding to the second vibration mode. The second target configuration file can be as shown in (5) and (6) below:
[0254] <HAPTIC_EFFCT ID=〝21〞>
[0255] <name>haptic.game_qz.open_rtol_dualL< / name>
[0256] <value> 0,2 <value>(5)
[0257] <HAPTIC_EFFCT ID=〝21〞>
[0258] <name>haptic.game_qz.open_rtol_dualR< / name>
[0259] <value> 0,2 <value>(6)
[0260] In this way, the vibration of the motor can be adaptively adjusted according to the rotation of the screen, so as to adapt to the user's feeling when the screen rotates. Since (5) and (6) are the second target configuration files corresponding to the left motor and the right motor respectively, in the embodiment of the present application, the hardware abstraction layer can synchronously obtain the second target configuration file of the left motor and the second target configuration file of the right motor according to the second target configuration information.
[0261] S912, the kernel layer generates the second parameter corresponding to the target vibration mode according to the second target configuration file, and drives the motor to vibrate with the second parameter.
[0262] The kernel layer obtains the second parameter corresponding to the second vibration mode according to the second vibration mode indicated by the second target configuration file and the fourth mapping table. Different second configuration files result in different second vibration modes. The kernel layer can drive the motor to vibrate in the second vibration mode with the second parameter. Among them, different second parameters result in different second vibration modes. The second vibration mode can be the same as or different from the first vibration mode.
[0263] The following Figure 9 takes the case where the second vibration mode can be different from the first vibration mode as an example for illustration. Among them, the second vibration mode can be different from the first vibration mode can be embodied as: at least one of the third waveform and the fourth waveform is different from the first waveform, and / or at least one of the third waveform and the fourth waveform is different from the second waveform.
[0264] The second parameter is used to drive the first motor to vibrate in the third waveform and the second motor to vibrate in the fourth waveform. In one embodiment, the kernel layer can generate the second parameter according to the above second target configuration files (5) and (6), and the second parameter can include a third sub-parameter and a fourth sub-parameter. Among them, the kernel layer drives the first motor to vibrate in the third waveform with the third sub-parameter, and the kernel layer drives the second motor to vibrate in the fourth waveform with the fourth sub-parameter. That is to say, the kernel layer can synchronously obtain the third sub-parameter enabling the first motor to vibrate and the fourth sub-parameter enabling the second motor to vibrate according to the second target parameter.
[0265] Exemplarily, the third waveform can be the waveform of R shown in b of Figure 9 , and the fourth waveform can be the waveform of L shown in b of Figure 9 . The third waveform is used to characterize that the vibration intensity of the first motor changes from weak to strong, and the fourth waveform is used to characterize that the vibration intensity of the second motor changes from strong to weak. Among them, the first motor vibrating in the third waveform can be understood as: the first motor vibrates, and the waveform of the vibration is the third waveform. The second motor vibrating in the fourth waveform can be understood as: the second motor vibrates, and the waveform of the vibration is the fourth waveform.
[0266] Among them, Figure 9 In [reference], b represents "the vibration transitions from the left side to the right side", the vibration intensity of the right motor changes from strong to weak, and the vibration intensity of the left motor changes from weak to strong. That is, the vibration intensity of the second motor changes from strong to weak, and the vibration intensity of the first motor changes from weak to strong. Exemplarily, Figure 9 The vibration schematic diagram corresponding to the waveform diagram shown by b in [reference] is as Figure 9 shown by d in [reference]. When the screen direction switches from the second direction to the fourth direction and the scene of the interface is a game - starting scene, the vibration intensity of motor 1 changes from strong to weak, and the vibration intensity of motor 2 changes from weak to strong. Similarly, it can bring a three - dimensional vibration feeling of the vibration transitioning from the left side to the right side to the user. It should be understood that Figure 9 the vibration mode of the motors shown by d in [reference] is the second vibration mode, and the second vibration mode is that the vibration intensity of motor 1 changes from strong to weak, and the vibration intensity of motor 2 changes from weak to strong. Figure 9 The second vibration mode of the motors in d in [reference] is different from Figure 9 the first vibration mode of the motors in c in [reference].
[0267] When the scene of the interface of the electronic device is the same scene and the screen direction changes, the second vibration mode is different from the first vibration mode. In order to enable the electronic device to bring the same vibration feeling to the user in the same - interface scene, the first waveform in the embodiments of the present application can be the same as the fourth waveform, and the second waveform can be the same as the third waveform. As shown in Figure 9 a and b in [reference], the first waveform of the first motor is the same as the fourth waveform of the second motor, and the third waveform of the first motor is the same as the second waveform of the second motor. It can bring the same "vibration transitioning from the left side to the right side" vibration feeling to the user in the "game - starting scene".
[0268] In a possible implementation manner, since the application framework layer can also detect the screen direction of the electronic device, the above S907 - S910 can be replaced by S907A. It should be understood that after S907A, the above S911 and S912 can be executed.
[0269] S907A: If the application framework layer detects that the screen direction switches from the first screen direction to the second screen direction, then according to the second screen direction, modify the first target configuration information to the second target configuration information, and send the second target configuration information to the hardware abstraction layer.
[0270] The second screen direction is different, and the second target configuration information is different. Exemplarily, when the first screen direction (the second direction) is as described above, the first target configuration information is haptic.game_qz.open_ltor. However, when the current second screen direction (the fourth direction) is considered, the left and right motors are rotated 180 degrees relative to the left and right of the electronic device. For example, when the second direction is considered, ltor represents the left motor to the right motor. In the fourth direction, the left motor to the right motor becomes rtol. Therefore, the application framework layer can modify the first target configuration information to the second target configuration information "haptic.game_qz.open_rtol" according to the second screen direction.
[0271] Similarly, as Figure 10 shown in a of Figure 10 , when the screen direction of the electronic device is the second direction, the scene of the interface is that a vehicle drives from the left side to the right side, and the target vibration mode corresponding to the scene of this interface is "vibration transitions from the left side to the right side". Then Figure 10 the vibration corresponding to a of Figure 10 is such that the vibration intensity of motor 2 changes from strong to weak, and the vibration intensity of motor 1 changes from weak to strong. The first target configuration information can be "haptic.game_qz.car_ltor". When the screen direction of the electronic device switches to the fourth direction, as shown in b of
[0272] Figure 8 The vibration corresponding to b of
[0273] is such that the vibration intensity of motor 1 changes from strong to weak, and the vibration intensity of motor 2 changes from weak to strong. The second target configuration information can be modified to "haptic.game_qz.car_rtol". Such vibrations can combine the user's vision and touch, bringing a three-dimensional vibration effect to the user and enabling the user to have an immersive experience. Figure 9 In one embodiment, in response to a first operation, the scene of the interface changes from "the scene of starting a game" to "the scene of being attacked". This first operation can be an instruction issued by the processor inside the electronic device to display "the scene of being attacked". When the application layer detects that the scene of the interface changes from Figure 9 When in the "attacked scenario" shown by e, the application layer can determine the target vibration mode as dual-motor vibration according to the "attacked scenario". Specifically, the two motors vibrate simultaneously with the same vibration intensity for the same period of time. Since this target vibration mode has no directionality, the application layer can use the first configuration information corresponding to the identifier of the target vibration mode in the vibration mode mapping relationship as the first target configuration information. In one possible implementation, if the first configuration information in the vibration mode mapping relationship does not include a suffix, the application framework layer can obtain the first target configuration information according to the relevant description above Figure 7 in the relevant description.
[0274] Among them, the application layer determines that the identifier of the target vibration mode is 6A according to the target vibration mode and the vibration mode mapping relationship, or the first target configuration information is haptic.game_qmqz.Shoot2_dual, and sends the identifier 6A of the target vibration mode or the first target configuration information haptic.game_qmqz.Shoot2_dual to the KIT layer. If the KIT layer receives the first target configuration information haptic.game_qmqz.Shoot2_dual from the application layer, it sends the first target configuration information haptic.game_qmqz.Shoot2_dual to the application framework layer. If the KIT layer receives the identifier 6A of the target vibration mode from the application layer, it determines the first target configuration information haptic.game_qmqz.Shoot2_dual according to the vibration mode mapping relationship, and sends the initial configuration information haptic.game_qmqz.Shoot2_dual to the application framework layer. The application framework layer can determine that the initial configuration information is the first target configuration information according to the first screen direction and the initial configuration information haptic.game_qmqz.Shoot2_dual, and send the first target configuration information haptic.game_qmqz.Shoot2_dual to the kernel layer. The kernel layer can use the first configuration file containing the first target configuration information as the first target configuration file.
[0275] The operations performed by the application layer, KIT layer, application framework layer, hardware abstraction layer, and kernel layer in this embodiment can refer to the relevant descriptions of the above embodiments.
[0276] The first target configuration file corresponding to the "attacked scenario" can be as shown in (7) and (8) below:
[0277] <HAPTIC_EFFCT ID=〝12〞>
[0278] <name>haptic.game_qmqz.Shoot2_dualL< / name>
[0279] <value> 0,1 <value>(7)
[0280] <HAPTIC_EFFCT ID=〝12〞>
[0281] <name>haptic.game_qmqz.Shoot2_dualR< / name>
[0282] <value> 0,1 <value>(8)
[0283] It should be understood that in the "scenario under attack", the first target profile is used to indicate the first vibration mode, and the identifier of the first vibration mode is 1. The first vibration mode is that the left motor and the right motor vibrate in the 1st vibration mode at the 0th second. The 1st special effect represents that motor 1 and motor 2 vibrate simultaneously for 3 ms. It can be imagined that in this first vibration mode, the first waveform of the first motor vibration is the same as the second waveform of the second motor vibration.
[0284] Exemplarily, as Figure 9 shown in e of, motor 1 and motor 2 vibrate simultaneously for 3 ms. Among them, if during the vibration of the dual motors, the screen direction of the electronic device switches from the fourth direction to the second direction, because the dual motors vibrate simultaneously in this target vibration mode and the vibration has no directionality, that is, there is no difference between left and right vibrations. The second target configuration information corresponding to the second direction can also be haptic.game_qmqz.Shoot2_dual. Therefore, as Figure 9 shown in f of, the motor vibrates in the second vibration mode. The second vibration mode is that at the 0th second, motor 1 and motor 2 can vibrate simultaneously for 3 ms. The second vibration mode is the same as the first vibration mode. It can be imagined that in this second vibration mode, the third waveform of the first motor vibration is the same as the fourth waveform of the second motor vibration, and the first waveform and the third waveform are the same. It should be understood that Figure 9 in e and f of, the vibration intensities of motor 1 and motor 2 are the same. In the figure, the same length of wavy lines is used to represent that the vibration intensities of motor 1 and motor 2 are the same.
[0285] Scenario 2: The first application scenario of the electronic device is the operation of the interface of the electronic device by the user. In the embodiments of the present application, the clock application is taken as an example for illustration first. Figure 11 a in is the editing interface of the alarm clock, and this editing interface includes a roller selection area 1101 for time and a selection area 1102 for the alarm clock type. Among them, the user can slide up or down in the roller selection area 1101 to select the time. The selection area 1102 for the alarm clock type may include options for "repeating" the alarm clock, options for the alarm clock ringtone, options for the alarm clock ringing duration, and options for the interval between repeated rings of the alarm clock. In the embodiments of the present application, the example of the motor vibrating when the user selects the time of the alarm clock is used for illustration.
[0286] Among them, when the user performs a slide-up operation in the roller selection area 1101 for time, the type of vibration can be dual-motor vibration (transitioning from the lower side to the upper side). When the user performs a slide-down operation in the roller selection area 1101 for time, the type of vibration is dual-motor vibration (transitioning from the upper side to the lower side). The following describes this scenario 2 in combination with the above vibration method. The vibration method may include:
[0287] S1301. The application layer determines a target vibration mode according to the user's operation information.
[0288] The user's operation information may include the user's operation location and / or operation action. Exemplarily, if the user's operation action is a swipe, and the user's operation location is, for example, Figure 11 from position x to position y of a in the figure, it can be determined that the user's operation is a swipe from bottom to top. The application layer determines that the target vibration mode is a dual-motor vibration (transitioning from the lower side to the upper side), that is, from the left motor to the right motor, according to the user's operation information and the vibration mode mapping relationship.
[0289] S1302. The application layer determines that the identifier of the target vibration mode is or the first target configuration information according to the target vibration mode and the vibration mode mapping relationship, and sends the identifier of the target vibration mode or the first target configuration information to the KIT layer.
[0290] Among them, the application layer can determine that the identifier of the target vibration mode is 3C according to the target vibration mode and the vibration mode mapping relationship. It should be understood that the motor at the lower end of the electronic device is the predefined left motor, and the upper motor is the predefined right motor. If the first screen direction is the first direction, then from bottom to top (i.e., from the left motor to the right motor), the first screen direction can be represented by "ltor". Correspondingly, when the screen direction is the third direction, from bottom to top is from the right motor to the left motor, and the screen direction can be represented by "rtol". In the embodiments of the present application, the application layer determines that the first target configuration information is "haptic.clock1_ltor" according to the first screen direction.
[0291] S1303. If the KIT layer receives the first target configuration information "haptic.clock1_ltor" from the application layer, it sends the first target configuration information "haptic.clock1_ltor" to the application framework layer; if the KIT layer receives the identifier 3C of the target vibration mode from the application layer, it determines the initial configuration information "haptic.clock1" according to the vibration mode mapping relationship and sends the initial configuration information "haptic.clock1" to the application framework layer.
[0292] S1304, if the application framework layer receives the first target configuration information haptic.clock1_ltor from the KIT layer, it sends the first target configuration information haptic.clock1_ltor to the hardware abstraction layer; if the application framework layer receives the initial configuration information haptic.clock1 from the KIT layer, it obtains the first target configuration information haptic.clock1_ltor according to the first screen orientation of the electronic device and the initial configuration information haptic.clock1, and sends the first target configuration information haptic.clock1_ltor to the hardware abstraction layer.
[0293] S1305, the hardware abstraction layer obtains the first target configuration file according to the first target configuration information, and sends the first target configuration file to the kernel layer.
[0294] Among them, in the first configuration file, the hardware abstraction layer can determine the first target configuration file to be determined including the first target configuration information according to the first target configuration information. The first target configuration file can be as shown in (9) and (10) below:
[0295] <HAPTIC_EFFCT ID=〝33〞>
[0296] <name>haptic.clock1_ltor_dualL< / name>
[0297] <value> 0,3 <value>(9)
[0298] <HAPTIC_EFFCT ID=〝33〞>
[0299] <name>haptic.clock1_ltor_dualR< / name>
[0300] <value> 0,3 <value>(10)
[0301] If the first screen direction is the first direction, the lower end of the electronic device is the motor 2, that is, the left motor, and the upper end of the electronic device is the motor 1, that is, the right motor. According to the above first target configuration file, it can be determined that the vibration is from the left motor to the right motor of the electronic device, that is, the vibration is realized from the lower side to the upper side.
[0302] S1306. The kernel layer generates the first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0303] Exemplarily, Figure 11 For a in, when the user performs a swiping-up operation in the time roller selection area 1101, the target vibration mode is the first vibration mode, and the first vibration mode is: the vibration of the left motor changes from strong to weak, and the vibration of the right motor changes from weak to strong.
[0304] In one embodiment, if Figure 11 the screen direction of a in changes from the first direction to the third direction, when the user performs a swiping-up operation in the time roller selection area 1101, the second target configuration information may be "haptic.clock1_rtol", and the corresponding second vibration mode is as shown in Figure 11 b in. The second vibration mode is: the vibration of the right motor changes from strong to weak, and the vibration of the left motor changes from weak to strong.
[0305] In the embodiment of the present application, taking the application program as an input method application program as an example, the vibration method will be described. The vibration method may include:
[0306] S1401. The application layer determines the target vibration mode according to the user's operation information.
[0307] The user's operation information may be the user's operation position. Exemplarily, when the user clicks on a control in the keyboard of the input method, the application layer may determine the vibration of the motor close to the user's operation position according to the user's operation position. In the embodiment of the present application, the area close to the motor 2 and the area close to the motor 1 are pre-divided. As shown in Figure 12 the dotted line in a divides the screen into two areas. The area where the motor 2 is located is the area close to the motor 2, and the area where the motor 1 is located is the area close to the motor 1.
[0308] As shown in Figure 12 As shown in a, the first screen direction of the electronic device is the first direction, and the keyboard is located below the interface of the electronic device. When the user searches for information using the input method, the positions where the user clicks on the controls in the keyboard of the input method all fall into the area near the motor 2. That is to say, the operation positions of the user on the keyboard are all close to the motor 2. The application layer can determine the target vibration mode as the vibration of the motor 2 (left motor) based on the operation positions of the user.
[0309] S1402. The application layer determines that the identifier of the target vibration mode is 2C according to the target vibration mode and the vibration mode mapping relationship, or the first target configuration information is haptic.shurufa_ltor, and sends the identifier 2C of the target vibration mode or the first target configuration information haptic.shurufa_ltor to the KIT layer.
[0310] In one embodiment, when the screen direction of the electronic device is the first direction or the third direction, the suffix "ltor" or "rtol" may not be carried in the first target configuration information.
[0311] S1403. If the KIT layer receives the first target configuration information haptic.shurufa_ltor from the application layer, it sends the first target configuration information haptic.shurufa_ltor to the application framework layer; if the KIT layer receives the identifier 2C of the target vibration mode from the application layer, it determines the initial target configuration information haptic.shurufa according to the vibration mode mapping relationship, and sends the initial target configuration information haptic.shurufa to the application framework layer.
[0312] S1404. If the application framework layer receives the first target configuration information from the KIT layer, it sends the first target configuration information haptic.shurufa_ltor to the hardware abstraction layer; if the application framework layer receives the initial configuration information haptic.shurufa from the KIT layer, it obtains the first target configuration information haptic.shurufa_ltor according to the first screen direction and the initial configuration information of the electronic device, and sends the first target configuration information to the hardware abstraction layer.
[0313] S1405. The hardware abstraction layer obtains the first target configuration file according to the first target configuration information, and sends the first target configuration file to the kernel layer.
[0314] The first target configuration information is haptic.shurufa_ltor. In the first configuration file, the hardware abstraction layer can determine the first target configuration file containing the first target configuration information "haptic.shurufa_ltor" according to the first target configuration information as follows:
[0315] <HAPTIC_EFFCT ID=〝45〞>
[0316] <name>haptic.shurufa_ltor_OnlyL< / name>
[0317] <value> 0,4 <value>
[0318] The first target configuration file characterizes that the left motor vibrates in vibration mode No. 4 with vibration intensity level 5 at the 0th second.
[0319] In S1405, the kernel layer generates a first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0320] Exemplarily, as shown in Figure 12 a, when the screen direction is the first direction and the positions where the user clicks on the controls in the keyboard of the input method are all close to motor 2, then when the user clicks on the controls in the keyboard of the input method, the target vibration mode is the first vibration mode, and the first vibration mode is the vibration of motor 2.
[0321] In one embodiment, if Figure 12 the screen direction in a switches from the first direction to the third direction, as shown in Figure 12 b, the positions where the user clicks on the controls in the keyboard of the input method are all close to motor 1, and the user application framework layer can obtain the second target configuration information "haptic.shurufa_rtol". In the second target configuration file, <name>The behavior "haptic.shurufa_rtol_OnlyR" indicates that the first vibration mode is the vibration of motor 1.
[0322] In one embodiment, if the screen direction is switched from the third direction to the second direction, as shown in Figure 12 c in. The application layer can determine the second vibration mode according to the position where the user clicks on the control in the keyboard of the input method. Exemplarily, as shown in Figure 12 c in, when the user clicks on the control to the left of the dotted line, the user's operation position is close to the left motor, so the second vibration mode is the vibration of the left motor (motor 2), and in the second target configuration file <name>Behavior "haptic.shurufa_rtol_OnlyL". As Figure 12 shown in d of Figure 12 , when the user clicks on the control to the right of the dashed line and the user's operation position is close to the right motor, the second vibration mode is the vibration of the right motor (motor 1), and in the second target profile <name>Behavior "haptic.shurufa_rtol_OnlyR". As Figure 12 shown in e of <name>Behavior "haptic.shurufa_rtol_dual".
[0323] Scenario 3: The first application scenario of the electronic device can be vibrating following music.
[0324] In the embodiments of the present application, it is described by taking an example that the electronic device includes two speakers, which are respectively arranged at both ends of the electronic device, as shown in a of Figure 13 When the audio is the left channel, speaker 1 outputs the audio. When the audio is the right channel, speaker 2 outputs the audio. When the audio is stereo, speakers 1 and 2 output the audio. It can be understood that the audio can be multi-channel, and the electronic device can also include at least three speakers. When the audio is multi-channel, at least three speakers can output the audio.
[0325] The following describes Scenario 3 in combination with the above vibration method. The vibration method may include:
[0326] S1701. The application layer determines the target vibration mode according to the channel of the audio.
[0327] The way for the application layer to obtain the channel of the audio can refer to the relevant description of the above embodiments. In the embodiments of the present application, when the audio is the right channel and speaker 1 outputs the audio, the target vibration mode is that motor 1 close to speaker 1 vibrates. When the audio is the left channel and speaker 2 outputs the audio, the target vibration mode is that motor 2 close to speaker 2 vibrates. When the audio is stereo and speakers 1 and 2 output the audio, the target vibration mode is that motors 1 and 2 vibrate simultaneously.
[0328] The following takes the screen direction as the first direction, the audio as the right channel, and speaker 1 outputs the audio as an example for description.
[0329] S1702. The application layer determines the identifier of the target vibration mode according to the target vibration mode and the vibration mode mapping relationship, or the first target configuration information is haptic.music1_ltor, and sends the identifier of the target vibration mode or the first target configuration information haptic.music1._ltor to the KIT layer.
[0330] S1703. If the KIT layer receives the first target configuration information haptic.music1_ltor from the application layer, it sends the first target configuration information haptic.music1_ltor to the application framework layer; if the KIT layer receives the identifier of the target vibration mode from the application layer, it determines the initial configuration information haptic.music1 according to the vibration mode mapping relationship, and sends the initial configuration information haptic.music1 to the application framework layer.
[0331] S1704. If the application framework layer receives the first target configuration information haptic.music1_ltor from the KIT layer, it sends the first target configuration information haptic.music1_ltor to the hardware abstraction layer; if the application framework layer receives the initial configuration information haptic.music1 from the KIT layer, it obtains the first target configuration information haptic.music1_ltor according to the first screen orientation of the electronic device and the initial configuration information, and sends the first target configuration information haptic.music1._ltor to the hardware abstraction layer.
[0332] S1705. The hardware abstraction layer obtains the first target configuration file according to the first target configuration information, and sends the first target configuration file to the kernel layer.
[0333] Among them, in the first configuration file, the hardware abstraction layer can determine the first target configuration file containing the first target configuration information "haptic.music1_ltor" according to the first target configuration information. The first target configuration file can be as follows:
[0334] <HAPTIC_EFFCT ID=〝4003〞>
[0335] <name>haptic.music1_ltor_OnlyR< / name>
[0336] <value> 0,400 <value>
[0337] When the first target configuration file characterizes the audio as the right channel, the right motor vibrates with the special effect No. 400 at the 0th second.
[0338] In S1706, the kernel layer generates the first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0339] Exemplarily, as shown in a of Figure 13 When the audio is the right channel, the speaker 1 outputs the audio "lalala", and the motor 1 vibrates.
[0340] In the embodiments of the present application, when the channel of the audio changes, the application layer can re-obtain the second target configuration information according to S1701-S1706 above. For example, when the channel of the audio changes from the right channel to the left channel, the first target configuration information can change from "haptic.music1_ltor" to "haptic.music2_ltor". Music2 represents the left channel, and music1 represents the right channel. Correspondingly, in the first target configuration file <name>The row can be changed from "haptic.music1_ltor_OnlyR" to "haptic.music2_ltor_OnlyL" in the second target configuration file. As Figure 13 shown in b of , when the audio is in the left channel, speaker 2 outputs the audio "hahaha" and motor 2 vibrates.
[0341] Since the channel of the audio changes rapidly, in order to reduce the delay, in the embodiment of the present application, the application framework layer can modify the first target configuration information haptic.music1_ltor to the second target configuration information haptic.music2_ltor according to the channel of the audio, and further can also implement the hardware abstraction layer to obtain the <name>The behavior "haptic.music2_ltor_OnlyL" implements the vibration as shown in b of Figure 13 . The process of the application framework layer obtaining the audio channels can refer to the relevant description of S701 above.
[0342] In a possible implementation, when the audio channels change from the left channel to the stereo channels, the <name>The row can change from "haptic.music2_ltor_OnlyL" to "haptic.music12_ltor_dual", and "haptic.music12_ltor_dual" is used to represent the simultaneous vibration of dual motors. Music12 represents dual channels. As Figure 13 shown in c of, when the audio is dual-channel, speaker 1 and speaker 2 output the audio "Spring is so beautiful", and motor 1 and motor 2 vibrate.
[0343] In one embodiment, the application layer or the application framework layer can be based on the Figure 13 embodiment shown above. If it is detected that the screen direction changes, the target configuration information can be modified, so as to achieve the purpose that the electronic device can vibrate according to the changes of the screen direction and the audio channels. Among them, when the application layer or the application framework layer detects a change in the screen direction and modifies the target configuration information, it can refer to the above relevant description.
[0344] In one embodiment, when the electronic device plays audio, the interface of the electronic device can display the video corresponding to the audio. Such a scenario is that the electronic device plays a music video (MV), a concert, etc. In such an embodiment, the audio channels and the vibration of the motor can change with the change of the screen direction of the electronic device. The following combines Figure 14 to illustrate this embodiment.
[0345] When the screen direction of the electronic device is the second direction, Figure 14 as shown in a of, it is the scenario where the electronic device plays a concert. On the left side of the interface of the electronic device is a drum, and on the right side is an electronic keyboard. Among them, the audio of the drum is the left channel, and speaker 2 can output the audio of the drum. The audio of the electronic keyboard is the right channel, and speaker 1 can output the audio of the electronic keyboard. In the embodiment of the present application, when the electronic device plays the audio of the drum, speaker 2 outputs the audio of the drum, and motor 2 vibrates, as Figure 14 shown in a of. When the electronic device plays the audio of the electronic keyboard, speaker 1 outputs the audio of the electronic keyboard, and motor 1 vibrates, as Figure 14 shown in b of. When the electronic device plays the audio of the electronic keyboard and the drum, speaker 1 outputs the audio of the electronic keyboard, speaker 2 outputs the audio of the drum, and motor 1 and motor 2 vibrate, as Figure 14 shown in c of. It should be understood that Figure 14 the implementation manners in a, b, and c of can refer to S1701 - S1706 above, and will not be elaborated here.
[0346] When the electronic device switches from the first screen orientation to the second screen orientation, for example, when the electronic device switches from the second orientation to the fourth orientation, the left side of the interface of the electronic device is still the drum, and the right side is still the electronic keyboard. However, the positions of the motor and the speaker in the electronic device change relative to the left and right of the electronic device. In order to enable the user to feel the same vibrations and audio as in Figure 14 a, b, and c, in the embodiments of the present application, when the electronic device outputs the audio of the drum, the audio of the drum can be changed from the left channel to the right channel, and then the audio of the drum is output by the speaker 1, and the motor 1 vibrates, as shown in Figure 14 d in. When the electronic device outputs the audio of the electronic keyboard, the audio of the electronic keyboard is changed from the right channel to the left channel, and then the audio of the drum is output by the speaker 2, and the motor 2 vibrates, as shown in Figure 14 e in. Similarly, when the electronic device plays the audio of the electronic keyboard and the drum, the speaker 1 outputs the audio of the drum, the speaker 2 outputs the audio of the electronic keyboard, and the motor 1 and the motor 2 vibrate, as shown in Figure 14 f in. In this embodiment, with the change of the screen orientation, the user can still feel the same vibration experience and audio experience, improving the user experience.
[0347] In a possible implementation, the first application scenario of the electronic device can be the interface scenario, and the interface scenario is a concert scenario as shown in Figure 14 . In the embodiments of the present application, the target vibration mode corresponding to the interface scenario can be preset. The actions of the application layer, the KIT layer, the application framework layer, the hardware abstraction layer, and the kernel layer can refer to the descriptions in the above embodiments, so as to realize the change of the vibration mode of the motor when the screen orientation of the electronic device changes. It can also refer to the example shown in Figure 13 , which will not be elaborated here.
[0348] In a possible implementation, when the screen orientation changes, the electronic device changes the audio channel. Specifically, when the application layer or the application framework layer detects a change in the screen orientation, it can modify the audio channel, thereby achieving the purpose of changing the audio channel when the screen orientation changes as described above in Figure 14 .
[0349] In the embodiments of the present application, the application layer or the application framework layer can detect a change in the screen orientation, and then modify the target configuration information and the audio channel, so as to enable the electronic device to change the vibration mode according to the change in the screen orientation and change the audio output according to the change in the audio channel, which can improve the user experience.
[0350] Scenario 4: The first application scenario of the electronic device can be the screen orientation of the electronic device. In the embodiments of the present application, the input method application is taken as an example for illustration. Exemplarily, when the user clicks on the control of the keyboard in the input method, the electronic device can perform vibration feedback in combination with the screen orientation.
[0351] The following describes Scenario 4 in combination with the above vibration method. The vibration method may include:
[0352] S1801, when the application layer detects the user's operation action, determine the target vibration mode according to the screen orientation.
[0353] In one embodiment, when the electronic device is in the vertical screen, the target vibration mode may be the main motor vibration. When the electronic device is in the horizontal screen, in order to increase the vibration sensation, dual-motor vibration can be adopted. The following takes the electronic device in the vertical screen as an example for illustration.
[0354] S1802, the application layer determines the identifier 1B of the target vibration mode or the first target configuration information is haptic.shurufa3_ltor according to the target vibration mode and the vibration mode mapping relationship, and sends the identifier 1B of the target vibration mode or the first target configuration information haptic.shurufa3_ltor to the KIT layer.
[0355] S1803, if the KIT layer receives the first target configuration information haptic.shurufa3_ltor from the application layer, it sends the first target configuration information haptic.shurufa3_ltor to the application framework layer; if the KIT layer receives the identifier 1B of the target vibration mode from the application layer, it determines the initial configuration information haptic.shurufa3 according to the vibration mode mapping relationship, and sends the initial configuration information haptic.shurufa3 to the application framework layer.
[0356] S1804, if the application framework layer receives the first target configuration information haptic.shurufa3_ltor from the KIT layer, it sends the first target configuration information haptic.shurufa3_ltor to the hardware abstraction layer; if the application framework layer receives the initial configuration information haptic.shurufa3 from the KIT layer, it obtains the first target configuration information haptic.shurufa3_ltor according to the first screen orientation of the electronic device and the initial configuration information, and sends the first target configuration information haptic.shurufa3_ltor to the hardware abstraction layer.
[0357] S1805, the hardware abstraction layer obtains the first target configuration file according to the first target configuration information, and sends the first target configuration file to the kernel layer.
[0358] Among them, the hardware abstraction layer is in the first configuration file. According to the first target configuration information, the first target configuration file containing the first target configuration information "haptic.shurufa3_ltor" is as follows:
[0359] <HAPTIC_EFFCT ID=〝205〞>
[0360] <name>haptic.shurufa3_ltor_main< / name>
[0361] <value> 0,20 <value>
[0362] The first target configuration file characterizes that when the electronic device is in the portrait screen orientation in the input method application, the main motor (motor 2) vibrates with the 20th special effect at the 0th second.
[0363] S1805, the kernel layer generates the first parameter corresponding to the target vibration mode according to the first target configuration file, and drives the motor to vibrate with the first parameter.
[0364] Exemplarily, as Figure 15 shown in a of, when the screen orientation is the first direction, the user clicks on a control in the keyboard, the target vibration mode is the first vibration mode, and the first vibration mode is the vibration of motor 2.
[0365] In the embodiments of the present application, when the screen orientation switches from the first direction to the second direction, that is, when the screen orientation is the landscape screen orientation, the second vibration mode is the vibration of both motors. As Figure 15 shown in b of, when the user clicks on a control in the keyboard, both motors vibrate, that is, motor 1 and motor 2 vibrate.
[0366] Scenario five: The first application scenario of the electronic device can be a scenario of playing audio.
[0367] In this scenario, different audio can correspond to different target vibration modes, and different audio can be distinguished by the identifier of the audio. The first configuration file is pre-configured with configuration files corresponding to audio with different identifiers. The electronic device can implement the vibration of the motor during audio playback according to the above S701 - S708. It should be understood that the first configuration information sent from the application layer or the application framework layer to the hardware abstraction layer can include the identifier of the audio, so that the hardware abstraction layer can obtain the first target configuration file corresponding to the audio according to the identifier of the audio.
[0368] Exemplarily, the target vibration mode of audio A is "the left motor vibrates at the 1st second, does not vibrate at the 2nd second, vibrates at the 3rd second, and the right motor does not vibrate at the 1st second, vibrates at the 2nd second, vibrates at the 3rd second". Correspondingly, the vibration in haptic_music1_xxx_dualL in the first target configuration file <value>The sequence is (0, 1000, 2000, 1000), vibrating in haptic_music1_xxx_dualR <value>The sequence is (1000, 1000, 2000, 1000). Accordingly, the kernel layer can achieve the vibration effect of "the left motor vibrates in the 1st second, does not vibrate in the 2nd second, vibrates in the 3rd second, the right motor does not vibrate in the 1st second, vibrates in the 2nd second, and vibrates in the 3rd second" according to the first target configuration file. It should be understood that the actions of the application layer, KIT layer, application framework layer, hardware abstraction layer, and kernel layer in the electronic device in this scenario can be referred to the descriptions in the above embodiments.
[0369] Scenario 6: The first application scenario of the electronic device is the external environment where the electronic device is located.
[0370] As Figure 16 shown in a of Figure 16 if the external environment where the electronic device is located is a movie-watching environment and the decibel of the noise is less than or equal to the preset decibel, the target vibration mode can be that motor 1 vibrates. As
[0371] shown in b of
[0372] Table 5
[0373]
[0374] Among them, the application layer can detect the first application scenario of the electronic device so that the motor vibrates in the corresponding vibration mode, and the specific implementation process can be referred to the relevant descriptions in the above embodiments.
[0375] The following briefly describes the test process of the vibration method provided in the embodiments of the present application during production line testing:
[0376] In one embodiment, when one motor is set in the electronic device, calibration testing, function testing, and aging testing can be performed on the motor.
[0377] I. Calibration testing. Calibration testing is used to test whether the motor can start and whether the number of motors can be returned, etc. Refer to Figure 17 As shown in a of [reference], in the embodiment of the present application, the test device can send a calibration start command to the electronic device to be tested (hereinafter referred to as the electronic device) to start the motor. After receiving the calibration start command, the electronic device can feedback a check return value to the test device. Exemplarily, the electronic device can start the F0 sweep frequency to obtain the check return value. Among them, the return value of 1 indicates that the motor starts successfully, and the return value of 0 indicates that the motor starts failed. In one embodiment, the test device can call the calibration EEC3 instruction, specifically call the SetHwParameter(mmi_vibrator_calib_on) function to send a calibration start command to the electronic device. It should be understood that the preset process or code of the F0 sweep frequency can be stored in the non-volatile memory (NVRAM) so that the electronic device can perform calibration tests on the motor.
[0378] Refer to Figure 17 As shown in a of [reference], the test device sends a calibration query command to the electronic device to obtain the number of motors. After receiving the calibration query command, the electronic device can feedback a check return value to the test device. Among them, the return value of 1 indicates that the query is successful, and the return value of 0 indicates that the query fails. A successful query indicates that there is one motor in the electronic device. In one embodiment, the test device can call the calibration EEC3 instruction, specifically call the get.HwParameter(vibratorNUMOnChip) function to send a calibration start command to the electronic device.
[0379] II. Function test. The function test is used to test the vibration function of the motor to determine whether the motor can vibrate according to the preset vibration mode. Refer to Figure 18 As shown in a of [reference], the test device sends a function test start command to the electronic device to test the vibration function of the motor. After receiving the function test start command, the electronic device can drive the motor to vibrate according to the preset vibration mode. In one embodiment, the test device sends the FF84 instruction to the electronic device to instruct the electronic device to start the vibration function test. The native vibration in the figure can be understood as: the electronic device can call the get.SystemService(Content.VIBRATOR_SERVICE) function to drive the motor to vibrate according to the preset vibration mode. The preset vibration mode can be to vibrate for 10s, vibrate for 1s every 2s, and then stop vibrating.
[0380] In a possible implementation, the tester can also manually press the start button corresponding to the motor to drive the motor to vibrate according to the preset vibration mode.
[0381] III. Aging test. The aging test is used to test the aging performance of the motor when it is vibrating all the time, such as obtaining the vibration duration of the motor to determine the available duration of the motor. Refer to Figure 19 As shown in a of , the electronic device can drive the motor to perform native vibration. For example, the electronic device can call the get.SystemService(Content.VIBRATOR_SERVICE) function to drive the motor to vibrate according to a preset vibration mode to obtain the vibration duration of the motor.
[0382] In one embodiment, when there are at least two motors in the electronic device, calibration tests, function tests, and aging tests can be performed on at least two motors. Different from the above tests, since there is more than one motor in the electronic device, each motor can be pre-numbered. During the test, the test device can carry the number of the motor in the test command to perform the test on the motor corresponding to the number. Exemplarily, the motor numbers can be ID 1, ID 2, ID 3... and so on.
[0383] I. Calibration test. Refer to Figure 17 As shown in b of , in the embodiment of the present application, the test device sends a calibration start command to the electronic device to start the motor. Different from a of , the test device can call the calibration EEC3(ID) instruction, specifically call the SetHwParameter(mmi_vibrator_calib_on, ID) function to send a calibration start command to the electronic device. It should be noted that the ID of the motor is included in the function so that the electronic device determines that the motor to be tested is the motor corresponding to this ID. Figure 17 In b of , functions such as "SetHwParameter(mmi_vibrator_calib_on, 1)", "SetHwParameter(mmi_vibrator_calib_on, 2)" are used as examples to illustrate that the test device requests the electronic device to perform calibration tests on the motors with ID 1 and ID 2. Figure 17
[0384] Figure 17 Similarly, refer to Figure 17 As shown in b of , the test device sends a calibration query command to the electronic device to obtain the number of motors. The test device can call the calibration EEC3(ID) instruction, specifically call the get.HwParameter(vibratorNUMOnChip) function to send a calibration start command to the electronic device. Among them, a return value of 3 indicates a successful query, and other return values indicate a query failure. In the embodiment of the present application, a return value of 3 is used to avoid duplication with the ID of the motor. It can be imagined that the return value can also be other custom values.
[0385] II. Function test. Refer to Figure 18 As shown at b in [figure], the test device sends a function test start command to the electronic device, such as the FF84(ID) instruction. The FF84(ID) instruction may include the ID of the motor, so that the electronic device can test the vibration function of the motor corresponding to the ID. After receiving the FF84(ID) instruction, the electronic device can drive the motor to vibrate according to a preset vibration mode. In one embodiment, the electronic device can drive the main motor (such as motor 2) to perform native vibration and drive the secondary motor (motor 1) to perform special effect vibration. The special effect vibration in the figure can be understood as: the electronic device can call the mVibratorEx.set.HwParameter function to drive the motor to vibrate according to a preset vibration mode.
[0386] In a possible implementation, the tester can also manually press the start button corresponding to the motor to drive the main motor and / or the secondary motor to vibrate according to a preset vibration mode.
[0387] III. Aging test. Refer to Figure 19 As shown at b in [figure], the electronic device can drive the main motor to perform native vibration. For example, the electronic device can call the get.SystemService(Content.VIBRATOR_SERVICE) function to drive the main motor to vibrate according to a preset vibration mode to obtain the available vibration duration of the main motor. The electronic device can drive the secondary motor to perform special effect vibration. For example, the electronic device can call the mVibratorEx.set.HwParameter function to drive the secondary motor to vibrate according to a preset vibration mode to obtain the available vibration duration of the secondary motor.
[0388] In one embodiment, the electronic device provided in the embodiment of the present application may include: a processor (such as a CPU), a memory, and at least two motors. The memory may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory. Various instructions can be stored in the memory to complete various processing functions and implement the method steps of the present application. At least two motors are used to perform the vibration actions in the above embodiments. Optionally, the electronic device involved in the present application may further include: a power supply, a communication bus, and a communication port. The above communication port is used to implement connection communication between the electronic device and other peripherals. In the embodiment of the present application, the memory is used to store computer-executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the processor of the electronic device to perform the actions other than the vibration actions in the above method embodiments, and the implementation principle and technical effects are similar and will not be elaborated here.
[0389] It should be noted that the above modules can be one or more integrated circuits configured to implement the above methods. For example: one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. Another example is that when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. Another example is that these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0390] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
[0391] The term "and / or" in the embodiments of the present application merely describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe the specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe the specific order of the target objects. In the embodiments of the present application, "exemplary" or "for example" etc. are used to give examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" refers to two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.
[0392] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.< / value> < / value> < / value> < / value> < / name> < / name> < / name> < / value> < / value> < / name> < / name> < / name> < / name> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / value> < / name> < / name> < / value> < / value> < / value> < / value> < / value> < / value>
Claims
1. A vibration method, characterized in that, Applied to an electronic device, the electronic device includes a screen, a first motor, and a second motor, and the electronic device stores a first target configuration file and a second target configuration file. The method includes: Receiving a first operation of a user; In response to the first operation, the electronic device enters a first application scenario, and the orientation of the screen is a first screen orientation; After the electronic device enters the first application scenario and the orientation of the screen is the first screen orientation, the electronic device controls the first motor and the second motor to vibrate in a first vibration mode based on the first target configuration file; Receiving a second operation of the user; In response to the second operation, the screen orientation of the electronic device switches from the first screen orientation to a second screen orientation; After the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, if the interface displayed by the electronic device rotates following the screen orientation of the electronic device, the electronic device controls the first motor and the second motor to vibrate in a second vibration mode based on the second target configuration file, and the audio channels played by the electronic device change following the screen orientation of the electronic device; After the screen orientation of the electronic device switches from the first screen orientation to the second screen orientation, if the interface displayed by the electronic device does not rotate following the screen orientation of the electronic device, the electronic device continues to control the first motor and the second motor to vibrate in the first vibration mode based on the first target configuration file; Wherein, the first motor and the second motor vibrating in the first vibration mode includes: the first motor vibrating in a first waveform, and the second motor vibrating in a second waveform; the first motor and the second motor vibrating in the second vibration mode includes: the first motor vibrating in a third waveform, and the second motor vibrating in a fourth waveform.
2. The method according to claim 1, wherein The first waveform is the same as the fourth waveform, and the second waveform is the same as the third waveform.
3. The method according to claim 2, wherein When the first motor vibrates in the first waveform, the vibration intensity of the first motor changes from strong to weak, and when the second motor vibrates in the second waveform, the vibration intensity of the second motor changes from weak to strong.
4. The method according to claim 3, characterized in that, When the first motor vibrates in the third waveform, the vibration intensity of the first motor changes from weak to strong, and when the second motor vibrates in the fourth waveform, the vibration intensity of the second motor changes from strong to weak.
5. The method according to any one of claims 1-4, characterized in that, The first motor is the left motor of the electronic device, and the second motor is the right motor of the electronic device.
6. The method according to any one of claims 1-4, characterized in that, The first target configuration file includes first target configuration information, and the first target configuration information includes the first application scenario, the first screen orientation, and the vibration mode mapping relationship.
7. The method according to claim 6, wherein The second target configuration file includes second target configuration information, and the second target configuration information includes the first application scenario, the second screen orientation, and the vibration mode mapping relationship.
8. The method according to any one of claims 1-7, characterized in that, The first application scenario includes: the electronic device displaying an interface or playing audio.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used for storing computer program code, the computer program code including computer instructions, and when the processor executes the computer instructions, the electronic device is caused to execute the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-8.