CN110769096A - Motor vibration method, terminal and storage medium - Google Patents

Motor vibration method, terminal and storage medium Download PDF

Info

Publication number
CN110769096A
CN110769096A CN201911002579.4A CN201911002579A CN110769096A CN 110769096 A CN110769096 A CN 110769096A CN 201911002579 A CN201911002579 A CN 201911002579A CN 110769096 A CN110769096 A CN 110769096A
Authority
CN
China
Prior art keywords
vibration
hardware abstraction
linear motor
service
control request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911002579.4A
Other languages
Chinese (zh)
Inventor
林进全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201911002579.4A priority Critical patent/CN110769096A/en
Publication of CN110769096A publication Critical patent/CN110769096A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions

Abstract

The embodiment of the application discloses a motor vibration method, a terminal and a storage medium, wherein the terminal comprises: the linear motor vibration application program interface and the vibration service are deployed on a framework layer, the linear motor vibration hardware abstraction service is deployed on a hardware abstraction layer, and the vibration driver is deployed on a driving layer, wherein the method comprises the following steps: receiving a control request sent by an application program through a linear motor vibration application program interface; forwarding, by the vibration service, the control request to a linear motor vibration hardware abstraction service; forwarding the control request to a vibration driver through a linear motor vibration hardware abstraction service; and performing vibration control on the linear vibration motor according to the control request through vibration driving.

Description

Motor vibration method, terminal and storage medium
Technical Field
The embodiment of the application relates to the technical field of electronic communication, in particular to a motor vibration method, a terminal and a storage medium.
Background
When people use terminals such as mobile phones and tablet computers, three types of feedback can be obtained, which are respectively: visual feedback, auditory feedback, and tactile feedback. The visual feedback is realized mainly by a display screen, and is also a feedback mode with the largest information quantity, and the corresponding feedback can be displayed on the screen by the operation of a user on the screen. Auditory feedback is primarily dependent on the various sounds emitted by the speakers. Tactile feedback, including the tactile sensation of a key being pressed by the user, and vibrations emitted by the vibration motor.
At present, a terminal is usually configured with a common vibration motor, and the terminal controls the vibration motor to vibrate when receiving a specific operation performed by a user or receiving an application scene such as information, so as to bring a feeling of vibration experience to the user, but the vibration effect generated by the common vibration motor is poor.
Disclosure of Invention
The embodiment of the application provides a motor vibration method, a terminal and a storage medium, and combines services and interfaces such as a linear motor vibration application program interface and a linear motor vibration hardware abstraction service, so that vibration control of a linear vibration motor is realized, and the vibration effect of the terminal is improved.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a motor vibration method, which is applied to a terminal, wherein the terminal comprises: the linear motor vibration application program interface and the vibration service are deployed on a framework layer, the linear motor vibration hardware abstraction service is deployed on a hardware abstraction layer, and the vibration driver is deployed on a driving layer, wherein the method comprises the following steps:
receiving a control request sent by an application program through the linear motor vibration application program interface;
forwarding, by the vibration service, the control request to the linear motor vibration hardware abstraction service;
forwarding, by the linear motor vibration hardware abstraction service, the control request to the vibration drive;
and performing vibration control on the linear vibration motor according to the control request through the vibration driving.
In the above solution, the forwarding, by the vibration service, the control request to the linear motor vibration hardware abstraction service includes:
calling a linear motor hardware abstraction layer interface through the vibration service; the linear motor hardware abstraction layer interface is deployed at the hardware abstraction layer;
forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service.
In the above solution, the invoking of the linear motor hardware abstraction layer interface by the vibration service includes:
determining, by the vibration service, a target method from the plurality of interface methods according to the control request;
invoking, by the vibration service, the target method of the linear motor hardware abstraction layer interface;
correspondingly, the forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service includes:
forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service using the target method.
In the above solution, the forwarding the control request to the vibration driver through the linear motor vibration hardware abstraction service includes:
acquiring a driving node provided by the vibration driving through the linear motor vibration hardware abstraction service;
writing the control request into the driving node through the linear motor vibration hardware abstraction service, so that the vibration driver can obtain the control request from the driving node.
In the above aspect, performing vibration control on the linear vibration motor according to the control request by the vibration driving includes:
in the case that the control request indicates the start of vibration, driving the linear vibration motor to initiate vibration through the vibration driving;
in a case where the control request instructs stopping of vibration, vibration driving of the linear vibration motor is stopped by the vibration driving.
The embodiment of the application provides a terminal, the terminal includes: the system comprises a linear motor vibration application program interface and a vibration service which are deployed on a framework layer, a linear motor vibration hardware abstraction service which is deployed on a hardware abstraction layer, and a vibration driver which is deployed on a driving layer;
the linear motor vibration application program interface is used for receiving a control request sent by an application program;
the vibration service to forward the control request to the linear motor vibration hardware abstraction service;
the linear motor vibration hardware abstraction service to forward the control request to the vibration drive;
and the vibration drive is used for carrying out vibration control on the linear vibration motor according to the control request.
In the above terminal, the terminal further comprises a linear motor hardware abstraction layer interface disposed at the hardware abstraction layer;
the vibration service is specifically used for calling a hardware abstraction layer interface of the linear motor;
the linear motor hardware abstraction layer interface is specifically configured to forward the control request to the linear motor vibration hardware abstraction service.
In the above terminal, the linear motor hardware abstraction layer interface includes a plurality of interface methods of the linear vibration motor,
the vibration service is specifically configured to determine a target method from the plurality of interface methods according to the control request; invoking the target method of the linear motor hardware abstraction layer interface;
the linear motor hardware abstraction layer interface is specifically configured to forward the control request to the linear motor vibration hardware abstraction service using the target method.
In the terminal, the linear motor vibration hardware abstraction service is specifically configured to obtain a driving node provided by the vibration driver; and writing the control request into the driving node so that the vibration driver can obtain the control request from the driving node.
In the terminal, when the control request indicates to start vibration, the vibration driving is specifically configured to drive the linear vibration motor to initiate vibration;
and in the case where the control request instructs stopping of vibration, the vibration driving, specifically, for stopping of vibration for driving the linear vibration motor.
The embodiment of the application provides a terminal, the terminal includes: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is used for executing the motor vibration program stored in the memory so as to realize the motor vibration method.
Embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the above-described motor vibration method.
The embodiment of the application provides a motor vibration method, which is applied to a terminal, wherein the terminal comprises: the linear motor vibration application program interface and the vibration service are deployed on a framework layer, the linear motor vibration hardware abstraction service is deployed on a hardware abstraction layer, and the vibration driver is deployed on a driving layer, wherein the method comprises the following steps: receiving a control request sent by an application program through a linear motor vibration application program interface; forwarding, by the vibration service, the control request to a linear motor vibration hardware abstraction service; forwarding the control request to a vibration driver through a linear motor vibration hardware abstraction service; and performing vibration control on the linear vibration motor according to the control request through vibration driving. According to the technical scheme of the embodiment of the application, services and interfaces such as a linear motor vibration application program interface and a linear motor vibration hardware abstraction service are combined, vibration control of the linear vibration motor is achieved, and the vibration effect of the terminal is improved.
Drawings
Fig. 1 is a schematic diagram of a framework of a terminal according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a motor vibration method according to an embodiment of the present disclosure;
FIG. 3 is a functional diagram of an exemplary linear motor hardware provided in an embodiment of the present application
Fig. 4 is a first schematic structural diagram of a terminal according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant application and are not limiting of the application. It should be noted that, for the convenience of description, only the parts related to the related applications are shown in the drawings.
The embodiment of the application provides a motor vibration method which is applied to a terminal. Fig. 1 is a schematic diagram of a framework of a terminal according to an embodiment of the present application. As shown in fig. 1, the terminal may include an application layer, a framework layer, a hardware abstraction layer, and a driver layer.
It should be noted that, in the embodiment of the present application, as shown in fig. 1, the application layer includes an application program, and a specific application program may be set according to an actual requirement, and the embodiment of the present application is not limited.
It should be noted that the Framework layer (Framework) includes many system services and components, and is exposed to the Application program of the Application layer in the form of an Application Programming Interface (API) to provide support services for the Application program. Among other things, application program interfaces are some predefined functions that are intended to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to understand the details of the internal workings. As shown in fig. 1, in the embodiment of the present application, the framework layer includes an Application Programming Interface (API), a linear motor vibration API, and a vibration service. The vibration service is used for a service providing vibration-related support.
It should be noted that, the Hardware Abstraction Layer (HAL) can provide a Hardware driver module in the form of a closed source, and aims to abstract Hardware, hide Hardware interface details of a specific platform, and provide a consistent Hardware interaction interface. As shown in fig. 1, in an embodiment of the present application, the hardware abstraction layer includes a native vibration hardware abstraction service and a linear motor vibration hardware abstraction service.
It should be noted that, in the embodiment of the present application, as shown in fig. 1, the driving layer includes a vibration driver, which is a program allowing high-level computer software to interact with hardware, that is, a set of programs driving hardware to work.
It should be noted that, in the embodiment of the present application, the native vibration application program interface and the native vibration hardware abstraction service are both originated from the system authority.
It should be noted that, in the prior art, the framework layer includes a native vibration application program interface and a vibration service, and the hardware abstraction layer includes a native vibration hardware abstraction service, so based on these parts, only the vibration control of the ordinary motor can be realized, and the flow shown by the left arrow in fig. 1 is a process of controlling the vibration of the ordinary motor. In the embodiment of the present application, the terminal may be configured with a linear vibration motor, and the linear vibration motor provides more abundant and various vibration sensations and has a stereoscopic sensation, compared with a general vibration motor, and the specific type of the linear vibration motor is not limited in the embodiment of the present application. And services and interfaces for realizing the linear vibration motor are added on each layer of the terminal, so that the vibration function of the linear vibration motor is provided for an application program, and the vibration effect of the terminal is improved.
The motor vibration method provided by the present application is described in detail below based on the above terminal architecture.
Fig. 2 is a schematic flow chart of a motor vibration method according to an embodiment of the present disclosure. As shown in fig. 2, the motor vibration method mainly includes the following steps:
s201, receiving a control request sent by an application program through a linear motor vibration application program interface.
In an embodiment of the application, the terminal may receive a control request sent by an application program through a linear motor vibration application program interface.
It will be appreciated that in embodiments of the present application, the linear motor vibrates the application interface, which is actually the channel between the application and framework layers of the application layer.
It should be noted that, in the embodiment of the present application, the linear motor vibration application program interface may be established in advance in the frame layer. Java is a set of vibration-related application program interfaces provided by a terminal, for example, a vibrate method that may be included in the set is a native vibration application program interface, and thus, a method may be added to the set as a linear motor vibration application program interface.
Illustratively, in embodiments of the present application, the pseudo code of the linear motor vibration application program interface is as follows:
class Vibrator{
publicvoid linearMotorVibrate();
}
it should be noted that, in the embodiment of the present application, the terminal may receive a control request for the linear vibration motor sent by the application program through the linear motor vibration application program interface, and in addition, referring to fig. 1, the terminal may also receive a control request for the ordinary motor sent by the application program through the native vibration application program interface.
It can be understood that, in the embodiment of the present application, a linear motor vibration application program interface is established in the framework layer of the terminal, and the application program can call the linear motor vibration application program interface to implement sending of the control request.
And S202, forwarding the control request to a linear motor vibration hardware abstraction service through a vibration service.
In an embodiment of the application, after receiving the control request through the linear motor vibration application program interface, the terminal may forward the control request to the linear motor vibration hardware abstraction service through the vibration service.
It should be noted that, in the embodiment of the present application, the interaction between the framework layer and the hardware abstraction layer needs to pass through a specific interface, and therefore, the hardware abstraction layer actually also includes a linear motor hardware abstraction layer interface to implement forwarding of the vibration request.
Specifically, in the embodiment of the present application, the terminal forwards the control request to the linear motor vibration hardware abstraction service through the vibration service, including: calling a linear motor hardware abstraction layer interface through vibration service; the linear motor hardware abstraction layer interface is deployed at the hardware abstraction layer; the control request is forwarded to a linear motor vibration hardware abstraction service through a linear motor hardware abstraction layer interface.
It should be noted that, in the embodiment of the present application, before the framework layer of the terminal calls the linear motor hardware abstraction layer interface through the vibration service, the linear motor hardware abstraction layer interface actually needs to be created in advance in the hardware abstraction layer according to a plurality of interface methods of the linear vibration motor.
It should be noted that, in the embodiment of the present application, in an actual situation, multiple interface methods may be added to the hardware abstraction layer interface of the linear motor according to different application scenarios, so as to increase fine-grained control over the linear vibration motor. The embodiments of the present application are not limited to the specific multiple interface methods.
Illustratively, in the embodiments of the present application, the plurality of interface methods of the linear vibration motor include a start vibration method and a stop vibration method, and the pseudo code of the corresponding hardware abstraction layer interface of the linear motor is as follows:
Interface ILinearMotorVibrator{
vibratorOn();
vibratorOff();
}
it should be noted that, in the embodiments of the present application, the method for defining the hardware abstraction layer interface of the linear motor may refer to the system official document, and details are not described herein.
Specifically, in an embodiment of the present application, the linear motor hardware abstraction layer interface includes a plurality of interface methods of the linear vibration motor, and the terminal calls the linear motor hardware abstraction layer interface through the vibration service, including: determining a target method from a plurality of interface methods according to the control request through vibration service, and calling the target method of the linear motor hardware abstraction layer interface; correspondingly, forwarding the control request to the linear motor vibration hardware abstraction service through the linear motor hardware abstraction layer interface includes: the control request is forwarded to the linear motor vibration hardware abstraction service using the target method through the linear motor hardware abstraction layer interface.
It should be noted that, in the embodiment of the present application, the control request indicates a control manner for the linear vibration motor, for example, start vibration and stop vibration, and accordingly, the linear motor hardware abstraction layer interface obtains a plurality of interface methods corresponding to different control manners, for example, start vibration method and stop vibration method, and therefore, the vibration service may implement forwarding of the control request by calling the corresponding interface methods of the linear motor hardware abstraction layer interface. For example, the control request indicates to start vibration, the vibration starting method is the target method, the vibration starting method of the linear motor hardware abstraction layer is called through the vibration service to forward the control request, the control request indicates to stop vibration, and the vibration stopping method of the linear motor hardware abstraction layer is called through the vibration service to forward the control request.
And S203, forwarding the control request to the vibration drive through the linear motor vibration hardware abstraction service.
In the embodiment of the application, after the terminal forwards the control request to the hardware abstraction service for linear motor vibration through the vibration service, the terminal further forwards the control request to the vibration driver through the hardware abstraction service for linear motor vibration.
Specifically, in the embodiment of the present application, the forwarding, by a hardware abstraction layer of the terminal, the control request to the vibration driver through a linear motor vibration hardware abstraction service includes: acquiring a driving node provided by vibration driving through a linear motor vibration hardware abstract service; and writing the control request into the driving node through a linear motor vibration hardware abstraction service so that the vibration driving can obtain the control request from the driving node.
It should be noted that, in the embodiment of the present application, after receiving a control request sent by a framework layer, a linear motor vibration hardware abstraction service needs to forward the control request to a vibration driver of a driver layer, where a forwarding process is implemented by writing a driver node, the driver node is provided with a vibration driver, and the modes of the vibration driver and the write node are provided by a hardware service provider, which is not limited in the embodiment of the present application.
It is understood that in the embodiment of the present application, the linear motor vibration hardware abstraction service is a new service located at the hardware abstraction layer, and the purpose of the new service is to connect the framework layer and the driver layer, and forward the control request from the framework layer to the driver, which plays a role in starting and stopping. Fig. 3 is a functional diagram of an exemplary hardware abstraction service for a linear motor according to an embodiment of the present disclosure. As shown in fig. 3, the linear motor vibration hardware abstraction service receives control requests from the framework layer through the linear motor hardware abstraction layer interface, writing the control requests to the drive nodes for forwarding to the vibration drives of the drive layer.
And S204, performing vibration control on the linear vibration motor through vibration driving according to the control request.
In the embodiment of the application, after the terminal driving layer receives the control request through the vibration driving, the vibration driving can be used for carrying out vibration control on the linear vibration motor according to the control request.
It should be noted that, in the embodiment of the present application, the control manner indicated by the control request may be to start vibration or stop vibration, and therefore, the vibration driving may perform corresponding vibration control on the linear vibration motor according to the control request.
Specifically, in the embodiment of the present application, the vibration control of the linear vibration motor by the terminal through vibration driving according to the control request includes: under the condition that the control request indicates to start vibration, driving a linear vibration motor to initiate vibration through vibration driving; when the control request instructs to stop the vibration, the vibration driving stops the vibration of the linear vibration motor.
The embodiment of the application provides a motor vibration method, which is applied to a terminal, wherein the terminal comprises: the linear motor vibration application program interface and the vibration service are deployed on a framework layer, the linear motor vibration hardware abstraction service is deployed on a hardware abstraction layer, and the vibration driver is deployed on a driving layer, wherein the method comprises the following steps: receiving a control request sent by an application program through a linear motor vibration application program interface; forwarding, by the vibration service, the control request to a linear motor vibration hardware abstraction service; forwarding the control request to a vibration driver through a linear motor vibration hardware abstraction service; and performing vibration control on the linear vibration motor according to the control request through vibration driving. According to the technical scheme of the embodiment of the application, services and interfaces such as a linear motor vibration application program interface and a linear motor vibration hardware abstraction service are combined, vibration control of the linear vibration motor is achieved, and the vibration effect of the terminal is improved.
The embodiment of the application provides a terminal. Fig. 4 is a first schematic structural diagram of a terminal according to an embodiment of the present application. As shown in fig. 4, the terminal includes: a linear motor vibration application program interface 401 and a vibration service 402 deployed at a framework layer, a linear motor vibration hardware abstraction service 403 deployed at a hardware abstraction layer, and a vibration driver 404 deployed at a driver layer;
the linear motor vibration application program interface 401 is configured to receive a control request sent by an application program;
the vibration service 402 to forward the control request to the linear motor vibration hardware abstraction service 403;
the linear motor vibration hardware abstraction service 403, configured to forward the control request to the vibration driver 404;
and the vibration driver 404 is configured to perform vibration control on the linear vibration motor according to the control request.
In the above terminal, the terminal further comprises a linear motor hardware abstraction layer interface 405 disposed at the hardware abstraction layer;
the vibration service 402 is specifically configured to call a linear motor hardware abstraction layer interface 405;
the linear motor hardware abstraction layer interface 405 is specifically configured to forward the control request to the linear motor vibration hardware abstraction service 403.
In the above terminal, the linear motor hardware abstraction layer interface 405 includes a plurality of interface methods of the linear vibration motor,
the vibration service 402 is specifically configured to determine a target method from the plurality of interface methods according to the control request; invoking the target method of the linear motor hardware abstraction layer interface 405;
the linear motor hardware abstraction layer interface 405 is specifically configured to forward the control request to the linear motor vibration hardware abstraction service 403 using the target method.
In the above terminal, the linear motor vibration hardware abstraction service 403 is specifically configured to obtain a driving node provided by the vibration driver 404; the control request is written to the drive node for the vibration driver 404 to obtain the control request from the drive node.
In the above terminal, in a case that the control request indicates to start vibration, the vibration driver 404 is specifically configured to drive the linear vibration motor to initiate vibration;
in the case where the control request indicates stopping of vibration, the vibration drive 404 is specifically configured to stop driving of vibration of the linear vibration motor.
Fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application. As shown in fig. 5, the terminal includes: a processor 501, a memory 502, and a communication bus 503;
the communication bus 503 is used for realizing communication connection between the processor 501 and the memory 502;
the processor 501 is configured to execute the motor vibration program stored in the memory 502 to implement the motor vibration method.
An embodiment of the present application provides a terminal, including: the terminal receives a control request sent by an application program through the linear motor vibration application program interface; forwarding, by the vibration service, the control request to a linear motor vibration hardware abstraction service; forwarding the control request to a vibration driver through a linear motor vibration hardware abstraction service; and performing vibration control on the linear vibration motor according to the control request through vibration driving. The terminal of the embodiment of the application combines services and interfaces such as the linear motor vibration application program interface and the linear motor vibration hardware abstraction service, so that the vibration control of the linear vibration motor is realized, and the vibration effect of the terminal is improved.
Embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the above-described motor vibration method. The computer-readable storage medium may be a volatile memory (volatile memory), such as a Random-access memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard disk (Hard disk Drive, HDD) or a Solid-State Drive (SSD); or may be a respective device, such as a mobile phone, computer, tablet device, personal digital assistant, etc., that includes one or any combination of the above-mentioned memories.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of implementations of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart block or blocks and/or flowchart block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks in the flowchart and/or block diagram block or blocks.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A motor vibration method, applied to a terminal, the terminal comprising: the linear motor vibration application program interface and the vibration service are deployed on a framework layer, the linear motor vibration hardware abstraction service is deployed on a hardware abstraction layer, and the vibration driver is deployed on a driving layer, wherein the method comprises the following steps:
receiving a control request sent by an application program through the linear motor vibration application program interface;
forwarding, by the vibration service, the control request to the linear motor vibration hardware abstraction service;
forwarding, by the linear motor vibration hardware abstraction service, the control request to the vibration drive;
and performing vibration control on the linear vibration motor according to the control request through the vibration driving.
2. The method of claim 1, wherein forwarding, by the vibration service, the control request to the linear motor vibration hardware abstraction service comprises:
calling a linear motor hardware abstraction layer interface through the vibration service; the linear motor hardware abstraction layer interface is deployed at the hardware abstraction layer;
forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service.
3. The method of claim 2, wherein the linear motor hardware abstraction layer interface comprises a plurality of interface methods of the linear vibration motor, and wherein invoking the linear motor hardware abstraction layer interface via the vibration service comprises:
determining a target method from the plurality of interface methods according to the control request through the vibration service, and calling the target method of the linear motor hardware abstraction layer interface;
correspondingly, the forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service includes:
forwarding, by the linear motor hardware abstraction layer interface, the control request to the linear motor vibration hardware abstraction service using the target method.
4. The method of claim 1, wherein forwarding the control request to a vibration driver via the linear motor vibration hardware abstraction service comprises:
acquiring a driving node provided by the vibration driving through the linear motor vibration hardware abstraction service;
writing the control request into the driving node through the linear motor vibration hardware abstraction service, so that the vibration driver can obtain the control request from the driving node.
5. The method according to claim 1, wherein vibration control of a linear vibration motor according to the control request by the vibration drive includes:
in the case that the control request indicates the start of vibration, driving the linear vibration motor to initiate vibration through the vibration driving;
in a case where the control request instructs stopping of vibration, vibration driving of the linear vibration motor is stopped by the vibration driving.
6. A terminal, characterized in that the terminal comprises: the system comprises a linear motor vibration application program interface and a vibration service which are deployed on a framework layer, a linear motor vibration hardware abstraction service which is deployed on a hardware abstraction layer, and a vibration driver which is deployed on a driving layer;
the linear motor vibration application program interface is used for receiving a control request sent by an application program;
the vibration service to forward the control request to the linear motor vibration hardware abstraction service;
the linear motor vibration hardware abstraction service to forward the control request to the vibration drive;
and the vibration drive is used for carrying out vibration control on the linear vibration motor according to the control request.
7. The terminal of claim 6, further comprising a linear motor hardware abstraction layer interface disposed at the hardware abstraction layer;
the vibration service is specifically used for calling a hardware abstraction layer interface of the linear motor;
the linear motor hardware abstraction layer interface is specifically configured to forward the control request to the linear motor vibration hardware abstraction service.
8. The terminal of claim 7, wherein the linear motor hardware abstraction layer interface comprises a plurality of interface methods of the linear vibration motor,
the vibration service is specifically configured to determine a target method from the plurality of interface methods according to the control request, and call the target method of the linear motor hardware abstraction layer interface;
the linear motor hardware abstraction layer interface is specifically configured to forward the control request to the linear motor vibration hardware abstraction service using the target method.
9. The terminal of claim 7,
the linear motor vibration hardware abstraction service is specifically used for acquiring a driving node provided by the vibration driving; and writing the control request into the driving node so that the vibration driver can obtain the control request from the driving node.
10. The terminal of claim 6,
under the condition that the control request indicates starting vibration, the vibration driving is specifically used for driving the linear vibration motor to initiate vibration;
and in the case where the control request instructs stopping of vibration, the vibration driving, specifically, for stopping of vibration for driving the linear vibration motor.
11. A terminal, characterized in that the terminal comprises: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the motor vibration program stored in the memory to implement the motor vibration method according to any one of claims 1 to 5.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a motor vibration method according to any one of claims 1 to 5.
CN201911002579.4A 2019-10-21 2019-10-21 Motor vibration method, terminal and storage medium Pending CN110769096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911002579.4A CN110769096A (en) 2019-10-21 2019-10-21 Motor vibration method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911002579.4A CN110769096A (en) 2019-10-21 2019-10-21 Motor vibration method, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN110769096A true CN110769096A (en) 2020-02-07

Family

ID=69331294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911002579.4A Pending CN110769096A (en) 2019-10-21 2019-10-21 Motor vibration method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110769096A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125131A (en) * 2020-08-31 2022-03-01 华为技术有限公司 Channel configuration method and device for audio drive motor
CN116345984A (en) * 2023-05-29 2023-06-27 荣耀终端有限公司 Control method of linear motor and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662665A (en) * 2012-03-29 2012-09-12 福州瑞芯微电子有限公司 Input subsystem enabling Android to support various sensors
CN103353839A (en) * 2013-06-07 2013-10-16 杭州竞天数码科技有限公司 Universal serial device communication module based on Android system
CN103442172A (en) * 2013-08-15 2013-12-11 Tcl集团股份有限公司 Camera image quality adjusting method, system and mobile terminal based on android platform
CN106843689A (en) * 2017-01-19 2017-06-13 努比亚技术有限公司 Mobile terminal and super printscreen realization method
EP3118733B1 (en) * 2014-03-31 2018-10-17 Huawei Technologies Co. Ltd. Method for recognizing operation mode of user on handheld device, and handheld device
CN109104133A (en) * 2018-06-28 2018-12-28 维沃移动通信有限公司 A kind of method and device controlling motor vibrations
CN110113483A (en) * 2019-04-19 2019-08-09 华为技术有限公司 Use the powerful method of the increasing of electronic equipment and relevant apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662665A (en) * 2012-03-29 2012-09-12 福州瑞芯微电子有限公司 Input subsystem enabling Android to support various sensors
CN103353839A (en) * 2013-06-07 2013-10-16 杭州竞天数码科技有限公司 Universal serial device communication module based on Android system
CN103442172A (en) * 2013-08-15 2013-12-11 Tcl集团股份有限公司 Camera image quality adjusting method, system and mobile terminal based on android platform
EP3118733B1 (en) * 2014-03-31 2018-10-17 Huawei Technologies Co. Ltd. Method for recognizing operation mode of user on handheld device, and handheld device
CN106843689A (en) * 2017-01-19 2017-06-13 努比亚技术有限公司 Mobile terminal and super printscreen realization method
CN109104133A (en) * 2018-06-28 2018-12-28 维沃移动通信有限公司 A kind of method and device controlling motor vibrations
CN110113483A (en) * 2019-04-19 2019-08-09 华为技术有限公司 Use the powerful method of the increasing of electronic equipment and relevant apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何银川: "基于Android系统的手机震动器的研究及其实现", 《现代计算机(专业版)》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125131A (en) * 2020-08-31 2022-03-01 华为技术有限公司 Channel configuration method and device for audio drive motor
CN114125131B (en) * 2020-08-31 2022-12-30 华为技术有限公司 Channel configuration method and device of audio drive motor, electronic equipment and storage medium
EP4195637A4 (en) * 2020-08-31 2024-02-14 Huawei Tech Co Ltd Channel configuration method and device for audio drive motor
CN116345984A (en) * 2023-05-29 2023-06-27 荣耀终端有限公司 Control method of linear motor and electronic equipment
CN116345984B (en) * 2023-05-29 2023-11-07 荣耀终端有限公司 Control method of linear motor and electronic equipment

Similar Documents

Publication Publication Date Title
CN110515573B (en) Screen projection method, device and system and computer equipment
CN110710169B (en) Instant messaging system interacting with dynamically extended applications
KR20110063297A (en) Mobile device and control method thereof
CN104137520A (en) Message pushing method and device
CN110769096A (en) Motor vibration method, terminal and storage medium
KR102095533B1 (en) Electronic device and method for providing notification information selectively
TWI701937B (en) Method, device and system for conversation over network
CN106792442B (en) Data migration method and device
CN112953908A (en) Network isolation configuration method, device and system
CN103944805A (en) Information updating method and system based on Wechat platform
CN114153362A (en) Information processing method and device
CN102045462B (en) Method and apparatus for unified interface for heterogeneous session management
CN111367561B (en) Remote development method and device for software program
CN103458092A (en) Mobile terminal touch player and touch play method
CN112256448A (en) Remote control method, device, electronic equipment, system and storage medium
CN105138872A (en) Method and apparatus for displaying menu page
US20140371890A1 (en) Control and capture of audio data intended for an audio endpoint device of an application executing on a data processing device
CN108469991B (en) Multimedia data processing method and device
CN111090463A (en) Resource identification method and device and computer storage medium
CN114501126B (en) Video playing method, system and storage medium
CN106886721B (en) Method and device for realizing auxiliary function in application
CN112651012B (en) Information processing method and device
CN104765646A (en) Assembly transferring method and device
CN105589616A (en) Method and apparatus for combining multiple application operations on terminal and terminal
CN110968383B (en) Message frame display method and device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200207