CN111158470B - Method, apparatus, computer device and storage medium for controlling output vibration signal - Google Patents

Method, apparatus, computer device and storage medium for controlling output vibration signal Download PDF

Info

Publication number
CN111158470B
CN111158470B CN201911302000.6A CN201911302000A CN111158470B CN 111158470 B CN111158470 B CN 111158470B CN 201911302000 A CN201911302000 A CN 201911302000A CN 111158470 B CN111158470 B CN 111158470B
Authority
CN
China
Prior art keywords
vibration
time
target
media
service
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.)
Active
Application number
CN201911302000.6A
Other languages
Chinese (zh)
Other versions
CN111158470A (en
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.)
AAC Technologies Pte Ltd
Original Assignee
AAC Technologies Pte 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 AAC Technologies Pte Ltd filed Critical AAC Technologies Pte Ltd
Priority to CN201911302000.6A priority Critical patent/CN111158470B/en
Publication of CN111158470A publication Critical patent/CN111158470A/en
Application granted granted Critical
Publication of CN111158470B publication Critical patent/CN111158470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/016Input arrangements with force or tactile feedback as computer generated output to the user
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/10Indexing; Addressing; Timing or synchronising; Measuring tape travel

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)

Abstract

The invention provides a method, a device, computer equipment and a storage medium for controlling output vibration signals. The method for controlling output vibration signals in the invention comprises the following steps: the media service acquires a vibration information table; the media service with the timer sends a playing instruction to the media drive service, and the timer starts to count; the media service obtains the current playing time of the target media file through a timer, and determines a target vibration signal identifier according to the current playing time and a vibration information table; the media service sends the target vibration signal identification to the motor drive service. Because the playing of the media file and the driving of the motor are controlled by the same timer, the running program is simple, and the problem that the playing of the media file and the motor is not synchronous or vibration leakage occurs due to time errors caused by setting different timers can be avoided, so that the synchronous playing of the media file and the motor vibration can be effectively realized.

Description

Method, apparatus, computer device and storage medium for controlling output vibration signal
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a method, an apparatus, a computer device, and a storage medium for controlling output of a vibration signal.
Background
With the increasing progress of technology, consumer electronic products are diversified, consumers are no longer satisfied with only visual and audible interaction with the electronic products, and the haptic interaction fills the consumer demand. When the media is used for transmitting information in most interactive scenes, novel and profound experience effects can be brought to users by adding the haptic feedback with high matching degree with the media files.
In current electronic devices, the media file and motor vibration output are processed by different service programs, which can cause the phenomenon that the media file and motor vibration are not synchronously played. Two different service programs are synchronously processed, and because additional timers are needed to count, the time recorded between the timers has a certain time difference due to the fact that the reading time is different in sequence, and the condition that the time point difference is not in a threshold value range and vibration is missed can be caused. In addition, setting the additional timer requires multiple queries of the media timer and the time of the additional timer, respectively, and the running process is relatively complex.
Disclosure of Invention
The invention aims to provide a method, a device, computer equipment and a storage medium for controlling output vibration signals, wherein the method, the device, the computer equipment and the storage medium can realize synchronous playing of media files and motor vibration.
The embodiment of the invention provides a method for controlling output vibration signals, which comprises the following steps:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays the target media file, and the timer starts to count;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
An apparatus for controlling an output vibration signal, comprising:
the media service module is used for acquiring a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service module comprises a timing module, and is further used for sending a playing instruction to the media drive service so that the media drive service plays the target media file, and the timing module starts timing;
The media service module is further configured to obtain, through the timing module, a current playing time of the target media file, and determine a target vibration signal identifier according to the current playing time and the vibration information table;
the media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays the target media file, and the timer starts to count;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
The media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
A computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays the target media file, and the timer starts to count;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
The embodiment of the invention has the following beneficial effects:
The method, the device, the computer equipment and the storage device for controlling and outputting the vibration signal acquire the vibration information table through the media service, acquire the current playing time of the target media file according to the timer in the media service, determine the target vibration signal identification according to the current playing time of the target file and the vibration information table, and drive the motor according to the target vibration signal identification by the motor driving service. Because the playing of the media file and the driving of the motor are controlled by the same timer, the synchronous playing of the media file and the motor vibration can be realized according to the time of the timer read each time, the running program is simple, and the time error caused by setting two different timers can not occur, thereby the problem that the playing of the media file and the motor is asynchronous or the vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
FIG. 1 is a diagram of an application environment for a method of controlling an output vibration signal in one embodiment;
FIG. 2 is a flow chart of a method of controlling an output vibration signal in one embodiment;
FIG. 3 is a flow diagram of determining a target vibration signal identification according to the current playing time and the vibration information table in one embodiment;
FIG. 4 is a block diagram of a computer device in one embodiment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 is a diagram of an environment in which a method of controlling an output vibration signal is used in one embodiment. As shown in fig. 1, the method of controlling an output vibration signal is applied to a system for controlling an output vibration signal. The system for controlling and outputting the vibration signal comprises a terminal 1, wherein the terminal 1 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer and the like. The terminal comprises a media service module 11, a media drive service module 12, a motor drive service module 13, a media playing end 14 and a motor playing end 15. The media service module 11 is used for controlling the synchronous play of the media file and the motor vibration. The media driving service module 12 obtains the media playing instruction sent by the media service module 11, and drives the media file to be played at the media playing terminal 14 according to the media playing instruction. The motor driving service module 13 obtains the target vibration signal identifier sent by the media service module 11, and drives the motor playing terminal 15 to vibrate according to the target vibration signal identifier.
In one embodiment, as shown in FIG. 2, a method of controlling an output vibration signal is provided. The method can be applied to a terminal, a server and other devices for controlling and outputting vibration signals. The present embodiment is exemplified as an apparatus applied to control output vibration signals. The media service module in the device for controlling and outputting the vibration signal determines the target vibration signal identification based on the same timer through the current playing time of the target media file and the vibration information table, and sends the target vibration signal identification to the motor driving service, so that the motor driving service drives the motor according to the target vibration signal identification, and synchronous playing of the target media file and motor vibration is realized. The method for controlling the output vibration signal specifically comprises the following steps:
step 102: the media service obtains a vibration information table that records a plurality of vibration point information, each of which includes a vibration start time and a vibration signal identification.
Wherein, the media service refers to a control module capable of realizing synchronous playing of media files and motor vibration, wherein, the media files comprise but are not limited to audio files and video files.
The vibration information table refers to a vibration information configuration table including a plurality of vibration point information stored in advance in the media service. The vibration point information corresponds to the vibration information of each vibration of the motor one by one, and the vibration point information comprises a vibration starting time and a vibration signal mark.
The vibration signal identifier is used for uniquely identifying one vibration signal. The vibration signal identification can be the storage position information of the vibration signal, can be a number corresponding to the storage position information of the vibration signal one by one, and can be determined according to other unique characteristics of the vibration signal.
Step 104: the media service includes a timer that sends a play instruction to the media drive service for the media drive service to play the target media file, the timer starting to count.
The media drive service is used for receiving a playing instruction sent by the media service and driving the corresponding media file to play according to the playing instruction.
The target media file refers to a media file that an operator needs to play synchronously with motor vibration.
The timer is means for recording the playing time of the media.
The media service sends playing instructions to the media drive service, and a timer starts to count, and the time recorded in the timer is the playing time of the target media file.
Step 106: and the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table.
The current playing time of the target media file refers to the time of the target media file under the current playing progress, and can be obtained according to the time data recorded by the timer.
Wherein the target vibration signal identification is determined according to the current playing time and the vibration starting time of a plurality of vibration points in the vibration information table. If the current playing time is the same as or similar to the vibration starting time of one vibration point in the vibration information table, the target vibration signal is identified as the vibration identification of the vibration point, and if the current playing time is different from or not similar to the vibration starting time of any vibration point in the vibration information table, the target vibration signal is identified as empty, namely the target vibration signal does not contain any content. If the target vibration signal identifier is empty, the motor driving service does not drive the motor to vibrate after acquiring the target vibration signal identifier, and waits for the media service to acquire the current playing time of the target media file again.
Step 108: the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
The motor driving service refers to a module for driving the motor to vibrate. The motor driving service receives a target vibration signal identifier sent by the media service, acquires a target vibration signal according to the target vibration signal identifier, and drives the motor to vibrate according to the target vibration signal.
The method for controlling the output vibration signal obtains the vibration information table through the media service, obtains the current playing time of the target media file according to the timer in the media service, determines the target vibration signal identification according to the current playing time of the target file and the vibration information table, and drives the motor according to the target vibration signal identification by the motor driving service. Because the playing of the media file and the driving of the motor are controlled by the same timer, the synchronous playing of the media file and the motor vibration can be realized according to the time of the timer read each time, the running program is simple, and the time error caused by setting two different timers can not occur, thereby the problem that the playing of the media file and the motor is asynchronous or the vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the obtaining, in step 106, the current playing time of the target media file by the timer includes:
step 106A: and acquiring a time reading instruction sent by the media drive service.
The time reading instruction is used for reading the timing time of the timer.
And the media drive service communicates with the media service according to preset conditions, and in the communication process, the media drive service sends a time reading instruction to the media service so as to acquire the current playing time of the target media file. The preset condition may be a preset time period, and illustratively, the media driving service 1s communicates with the media service once, and the media service 1s receives a time reading instruction sent by the media driving service once.
Step 106B: and acquiring the timing time of the timer according to the time reading instruction.
And the media service reads the current recording time of the timer according to the received time reading instruction, so that the timing time of the timer can be obtained.
Step 106C: and taking the timing time as the current playing time of the target media file.
And the media service reads the timing time of the timer according to the time reading instruction sent by the media drive service. Since the timer records the playing time of the target media file, the read timing time can be used as the playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media driving service in step 106A includes: and acquiring a time reading instruction sent by the media drive service at intervals of preset time.
The media drive service sends a time reading instruction every preset time, and correspondingly, the media service obtains the timing time of the timer according to the obtained time reading instruction every preset time, so that the current playing time of the target media file can be obtained according to the period as the preset time.
In one embodiment, the determining, in step 106, the target vibration signal identifier according to the current playing time and the vibration information table includes:
step 106a: and comparing the current playing time with vibration starting time of a plurality of pieces of vibration point information in the vibration information table to obtain target vibration point information.
The target vibration point information is determined according to the current playing time and the vibration starting time of a plurality of vibration point information in the vibration information table, if the current playing time is the same as or similar to the vibration starting time of one vibration point information in the vibration information table, the vibration point information is the target vibration point information, and if the vibration starting time of any vibration point information in the vibration information table is not the same as or similar to the current playing time, the target vibration point information is an empty point which does not contain vibration information.
In one embodiment, step 106a includes:
step 106a1: a time error range is acquired.
Where a time error range refers to a range in which playback of the target media file and playback of the motor vibration can be considered synchronized playback.
The considerations for determining the time error range are mainly the following: and acquiring the frequency of the current playing time and the time loss caused by information transmission among the media service, the media drive service and the motor drive service according to the distribution rule of the vibration starting time of the vibration point information in the vibration information table. If the vibration starting time distribution of the plurality of vibration point information in the vibration information table is dense, and the frequency of acquiring the current playing time is fast, the time error range should be set smaller, so that vibration signal identifiers for acquiring the same vibration point information for multiple times are prevented from being used as target vibration identifiers; if the vibration starting time distribution of the plurality of vibration point information in the vibration information table is dispersed, and the frequency of acquiring the current playing time is slow, the time error range should be set larger, and the phenomenon of vibration leakage is avoided. If the time loss caused by the information transmission between the media service and the media drive service and the motor drive service is large, the time loss should be considered when determining the time error range, which is beneficial to improving the synchronicity of the target media file and the motor vibration playing.
Step 106a2: and obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range.
The confidence interval corresponding to the current playing time means that the time falling into the confidence interval can be considered to be the same as or similar to the current playing time. For example, the current playing time is T, the time error range is ±t, and the confidence interval corresponding to the current playing time is (T-T, t+t).
Step 106a3: and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the plurality of vibration point information in the vibration information table.
If the vibration starting time of a certain vibration point information in the vibration information table falls into the confidence interval corresponding to the current playing time, the vibration point information is target vibration point information; if the vibration starting time of any vibration point information in the vibration information table does not fall into the confidence interval corresponding to the current playing time, the target vibration point information is a null point which does not contain vibration information.
Step 106b: and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
If the target vibration point information is a certain vibration point information, the vibration signal identifier contained in the vibration point information is used as a target vibration signal identifier; if the target vibration point information is a null point which does not contain vibration information, the target vibration signal is marked as null.
In one embodiment, as shown in fig. 3, the determining, in step 106, the target vibration signal identifier according to the current playing time and the vibration information table includes:
the arrangement according to the time sequence means that a plurality of vibration point information in the vibration information table is arranged according to the sequence of the vibration starting time in the vibration point information. For example, the vibration information table includes three vibration point information, which are a (t 1, signalID 1), B (t 2, signalID 2), and C (t 3, signalID 3), where SignalID refers to a vibration signal identifier, t1< t2< t3, and the plurality of vibration point information in the vibration information table are obtained by arranging a (t 1, signalID 1), B (t 2, signalID 2), and C (t 3, signalID 3) in time sequence.
Step 1061: and comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table.
The vibration starting time of the first vibration point information in the vibration information table is earliest, and if the current playing time is smaller than the starting vibration time of the vibration point, the current playing time is necessarily smaller than the vibration starting time of other vibration point information in the vibration information table. Each time the current playing time is compared with the vibration starting time of the first vibration point information in the vibration information table, namely each time the current playing time is compared with the vibration starting time of the vibration point information of which the first vibration signal identification is not acquired by the motor driving service, until the vibration signal identifications of all the vibration point information in the vibration information table are acquired by the motor driving service.
Step 1062: and if the comparison result shows that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier.
Wherein the preset value is the same as the determining factor of the time error range.
And if the absolute value of the difference Deltat between the current playing time T1 and the vibration starting time T2 of the first vibration point is smaller than a preset value, the error value of T1 and T2 is smaller than the preset value, and T1 and T2 can be regarded as the same time, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier, and the motor driving service drives the motor to vibrate and synchronously play the target media file according to the target vibration signal identifier.
Step 1063: and deleting the first vibration point information in the vibration information table.
When the vibration signal identifier of the first vibration point information in the vibration information table is used as the target vibration signal identifier, the motor driving service drives the motor to vibrate according to the target vibration signal identifier, then the first vibration point information is deleted from the vibration information table, and the vibration information table is updated. In the updated vibration information table, the second vibration point information originally arranged in the vibration information table before updating is arranged at the first position, and when the media service acquires the current playing time of the target media file again, the media service determines the target vibration signal identification according to the current playing time of the target media file and the first vibration point information in the vibration information table after updating. Therefore, each media service can be ensured to accurately determine the target vibration signal identification according to the current playing time of the target media file and the first vibration point information in the current vibration information table, the comparison of the current playing time and the vibration starting time of a plurality of vibration point information in the vibration information table is avoided, the running speed is improved, meanwhile, the time error caused by the internal reasons of the system is reduced, and the synchronous playing consistency of the media file and the motor vibration is improved.
In one embodiment, the method further comprises:
step 1064: and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is larger than or equal to a preset value, entering a waiting time reading state to acquire the timing time of the timer when a time reading instruction sent by the media drive service is received.
The absolute value of the difference Δt between the current playing time T1 and the vibration starting time T2 of the first vibration point is greater than or equal to a preset value, and if the error value of T1 and T2 is greater than or equal to the preset value, it is impossible to consider T1 and T2 as the same time, and at this time, the target vibration point information is a null point that does not include a vibration signal identifier, the target vibration signal identifier is null, and the motor driving service does not drive the motor to vibrate. At this time, waiting for the next round to acquire the current playing time of the target media file, that is, waiting for the media service to receive the time reading instruction sent by the media driving service again, and acquiring the timing time of the timer, so as to acquire the current playing time of the target media file.
In one embodiment, there is provided an apparatus for controlling an output vibration signal, the apparatus comprising:
The media service module is used for acquiring a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service module comprises a timing module, and is further used for sending a playing instruction to the media drive service so that the media drive service plays the target media file, and the timing module starts timing;
the media service module is further configured to obtain, through the timing module, a current playing time of the target media file, and determine a target vibration signal identifier according to the current playing time and the vibration information table;
the media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
According to the device for controlling and outputting the vibration signal, the vibration information table is acquired through the media service, the current playing time of the target media file is acquired according to the timer in the media service, the target vibration signal identification is determined according to the current playing time of the target file and the vibration information table, and the motor driving service drives the motor according to the target vibration signal identification. Because the playing of the media file and the driving of the motor are controlled by the same timer, the synchronous playing of the media file and the motor vibration can be realized according to the time of the timer read each time, the running program is simple, and the time error caused by setting two different timers can not occur, thereby the problem that the playing of the media file and the motor is asynchronous or the vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the media service module is configured to obtain, by using the timing module, a current playing time of the target media file, including: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the media service module is configured to obtain a time reading instruction sent by the media driving service, and includes: and acquiring a time reading instruction sent by the media drive service at intervals of preset time.
In one embodiment, the media service module is further configured to determine a target vibration signal identifier according to the current playing time and the vibration information table, including: comparing the current playing time with vibration starting time of a plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In one embodiment, the media service module is configured to compare the current playing time with vibration start times of a plurality of vibration point information in the vibration information table to obtain target vibration point information, and includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the plurality of vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table is arranged in time sequence; the media service module is configured to determine a target vibration signal identifier according to the current playing time and the vibration information table, and includes: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result shows that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In one embodiment, the media service module is configured to determine a target vibration signal identifier according to the current playing time and the vibration information table, and further includes: and if the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is larger than or equal to a preset value, entering a waiting time reading state to acquire the timing time of the timer when a time reading instruction sent by the media drive service is received.
FIG. 4 illustrates an internal block diagram of a computer device in one embodiment. The computer device may be a terminal, a server, or a device for controlling output of a vibration signal. As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program which, when executed by a processor, causes the processor to implement a method of controlling the output of a vibration signal. The internal memory may also have stored therein a computer program which, when executed by the processor, causes the processor to perform a method of controlling the output of the vibration signal. Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is presented comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
the media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays the target media file, and the timer starts to count;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
According to the computer equipment, the vibration information table is obtained through the media service, the current playing time of the target media file is obtained according to the timer in the media service, the target vibration signal identification is determined according to the current playing time of the target file and the vibration information table, and the motor driving service drives the motor according to the target vibration signal identification. Because the playing of the media file and the driving of the motor are controlled by the same timer, the synchronous playing of the media file and the motor vibration can be realized according to the time of the timer read each time, the running program is simple, and the time error caused by setting two different timers can not occur, thereby the problem that the playing of the media file and the motor is asynchronous or the vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the obtaining, by the timer, the current playing time of the target media file includes: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media driving service includes: and acquiring a time reading instruction sent by the media drive service at intervals of preset time.
In one embodiment, the determining the target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with vibration starting time of a plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In one embodiment, the comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain the target vibration point information includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the plurality of vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table is arranged in time sequence; the determining the target vibration signal identifier according to the current playing time and the vibration information table comprises the following steps: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result shows that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In one embodiment, if the comparison result is that the absolute value of the difference between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, entering a waiting time reading state, so as to obtain the timing time of the timer when the time reading instruction sent by the media drive service is received.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
The media service acquires a vibration information table, wherein the vibration information table records a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays the target media file, and the timer starts to count;
the media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table;
the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
The computer readable storage device is used for acquiring the vibration information table through the media service, acquiring the current playing time of the target media file according to the timer in the media service, determining the target vibration signal identification according to the current playing time of the target file and the vibration information table, and driving the motor by the motor driving service according to the target vibration signal identification. Because the playing of the media file and the driving of the motor are controlled by the same timer, the synchronous playing of the media file and the motor vibration can be realized according to the time of the timer read each time, the running program is simple, and the time error caused by setting two different timers can not occur, thereby the problem that the playing of the media file and the motor is asynchronous or the vibration leakage occurs due to the time error can be avoided, and the synchronous playing of the media file and the motor vibration can be effectively realized.
In one embodiment, the obtaining, by the timer, the current playing time of the target media file includes: acquiring a time reading instruction sent by the media drive service; acquiring the timing time of a timer according to the time reading instruction; and taking the timing time as the current playing time of the target media file.
In one embodiment, the obtaining the time reading instruction sent by the media driving service includes: and acquiring a time reading instruction sent by the media drive service at intervals of preset time.
In one embodiment, the determining the target vibration signal identifier according to the current playing time and the vibration information table includes: comparing the current playing time with vibration starting time of a plurality of vibration point information in the vibration information table to obtain target vibration point information; and taking the vibration signal identification of the target vibration point information as a target vibration signal identification.
In one embodiment, the comparing the current playing time with the vibration starting time of the plurality of vibration point information in the vibration information table to obtain the target vibration point information includes: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; and obtaining target vibration point information according to the confidence interval corresponding to the current playing time and the vibration starting time of the plurality of vibration point information in the vibration information table.
In one embodiment, the plurality of vibration point information in the vibration information table is arranged in time sequence; the determining the target vibration signal identifier according to the current playing time and the vibration information table comprises the following steps: comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table; if the comparison result shows that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier; and deleting the first vibration point information in the vibration information table.
In one embodiment, if the comparison result is that the absolute value of the difference between the current playing time and the vibration starting time of the first vibration point information is greater than or equal to a preset value, entering a waiting time reading state, so as to obtain the timing time of the timer when the time reading instruction sent by the media drive service is received.
It should be noted that the above method for controlling output of a vibration signal, apparatus for controlling output of a vibration signal, computer device and computer readable storage medium belong to a general inventive concept, and the content in the embodiments of the method for controlling output of a vibration signal, apparatus for controlling output of a vibration signal, computer device and computer readable storage medium may be mutually applicable.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (8)

1. A method of controlling an output vibration signal, comprising:
the method comprises the steps that a media service obtains a vibration information table, wherein the vibration information table is a vibration information configuration table which is stored in the media service in advance and comprises a plurality of vibration point information, and each vibration point information comprises a vibration starting time and a vibration signal identifier;
the media service comprises a timer, and the media service sends a playing instruction to the media drive service so that the media drive service plays a target media file, the timer starts timing, and the target media file is a media file which needs to be played synchronously with motor vibration;
The media service obtains the current playing time of the target media file through the timer, and determines a target vibration signal identifier according to the current playing time and the vibration information table; the determining the target vibration signal identifier according to the current playing time and the vibration information table comprises the following steps: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; obtaining target vibration point information according to the confidence interval corresponding to the current playing time and vibration starting time of a plurality of vibration point information in the vibration information table; taking the vibration signal identification of the target vibration point information as a target vibration signal identification;
the media service sends the target vibration signal identification to a motor drive service so that the motor drive service drives a motor according to the target vibration signal identification.
2. The method of claim 1, wherein the obtaining, by the timer, the current playing time of the target media file comprises:
acquiring a time reading instruction sent by the media drive service;
Acquiring the timing time of a timer according to the time reading instruction;
and taking the timing time as the current playing time of the target media file.
3. The method of claim 2, wherein the obtaining the time reading instruction sent by the media drive service comprises:
and acquiring a time reading instruction sent by the media drive service at intervals of preset time.
4. The method of claim 1, wherein the plurality of vibration point information in the vibration information table is arranged in chronological order; the determining the target vibration signal identifier according to the current playing time and the vibration information table comprises the following steps:
comparing the current playing time with the vibration starting time of the first vibration point information in the vibration information table;
if the comparison result shows that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is smaller than a preset value, the vibration signal identifier of the first vibration point information is used as the target vibration signal identifier;
and deleting the first vibration point information in the vibration information table.
5. The method according to claim 4, wherein the method further comprises:
If the comparison result is that the absolute value of the difference value between the current playing time and the vibration starting time of the first vibration point information is larger than or equal to a preset value, entering a waiting time reading state, and obtaining the timing time of the timer when the time reading instruction sent by the media drive service is received.
6. An apparatus for controlling an output vibration signal, comprising:
a media service module, configured to obtain a vibration information table, where the vibration information table is a vibration information configuration table that is stored in advance in the media service and includes a plurality of vibration point information, and each vibration point information includes a vibration start time and a vibration signal identifier;
the media service module comprises a timing module and is further used for sending a playing instruction to the media drive service so that the media drive service plays a target media file, the timing module starts timing, and the target media file is a media file which needs to be played synchronously with motor vibration;
the media service module is further configured to obtain, through the timing module, a current playing time of the target media file, and determine a target vibration signal identifier according to the current playing time and the vibration information table; the determining the target vibration signal identifier according to the current playing time and the vibration information table comprises the following steps: acquiring a time error range; obtaining a confidence interval corresponding to the current playing time according to the current playing time of the target media file and the time error range; obtaining target vibration point information according to the confidence interval corresponding to the current playing time and vibration starting time of a plurality of vibration point information in the vibration information table; taking the vibration signal identification of the target vibration point information as a target vibration signal identification;
The media service module is further configured to send the target vibration signal identifier to a motor driving service, so that the motor driving service drives a motor according to the target vibration signal identifier.
7. A computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of the method of controlling an output vibration signal as claimed in any one of claims 1 to 5.
8. A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method of controlling an output vibration signal as claimed in any one of claims 1 to 5.
CN201911302000.6A 2019-12-17 2019-12-17 Method, apparatus, computer device and storage medium for controlling output vibration signal Active CN111158470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911302000.6A CN111158470B (en) 2019-12-17 2019-12-17 Method, apparatus, computer device and storage medium for controlling output vibration signal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911302000.6A CN111158470B (en) 2019-12-17 2019-12-17 Method, apparatus, computer device and storage medium for controlling output vibration signal

Publications (2)

Publication Number Publication Date
CN111158470A CN111158470A (en) 2020-05-15
CN111158470B true CN111158470B (en) 2024-02-23

Family

ID=70557564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911302000.6A Active CN111158470B (en) 2019-12-17 2019-12-17 Method, apparatus, computer device and storage medium for controlling output vibration signal

Country Status (1)

Country Link
CN (1) CN111158470B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115703007B (en) * 2021-08-12 2024-04-12 荣耀终端有限公司 Vibration output method and related device
CN114339353B (en) * 2021-12-31 2023-09-29 晶晨半导体科技(北京)有限公司 Audio/video synchronization method and device, electronic equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017101523A1 (en) * 2015-12-15 2017-06-22 乐视控股(北京)有限公司 Method and apparatus for controlling wearable device
CN107613356A (en) * 2017-08-30 2018-01-19 瑞声科技(新加坡)有限公司 Media and vibrations synchronous broadcast method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108235099B (en) * 2018-01-12 2021-06-15 瑞声科技(新加坡)有限公司 Media and vibration synchronous playing method and device thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017101523A1 (en) * 2015-12-15 2017-06-22 乐视控股(北京)有限公司 Method and apparatus for controlling wearable device
CN107613356A (en) * 2017-08-30 2018-01-19 瑞声科技(新加坡)有限公司 Media and vibrations synchronous broadcast method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111158470A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN110674146B (en) Data synchronization method, synchronization end, end to be synchronized, equipment and storage medium
CN108933948B (en) Video playing progress synchronization method and device
CN111158470B (en) Method, apparatus, computer device and storage medium for controlling output vibration signal
CN104104971A (en) Video file processing method and system
JP2020533862A (en) Video information processing methods, computer devices and storage media
CN110113655B (en) Video playing method and device and user terminal
WO2018233539A1 (en) Video processing method, computer storage medium, and device
CN105208318A (en) Video conference content processing method and device
CN103634647A (en) Method and device for synchronizing playing records of mobile terminal and smart television
CN110830823A (en) Play progress correction method and device, electronic equipment and readable storage medium
CN110677714A (en) Video data downloading method and device, electronic equipment and storage medium
CN108449607B (en) File compliance checking method and system
CN112138376A (en) Cloud game archiving method and device and electronic equipment
CN110290396B (en) Video processing method, device, system, equipment and storage medium
CN112584200A (en) Screen projection method and system, electronic equipment and storage medium
CN111405215A (en) Video storage method and device, cloud server and storage medium
CN106303754A (en) A kind of audio data play method and device
EP3664423A1 (en) Incoming call voice calling method and terminal
CN109587517B (en) Multimedia file playing method and device, server and storage medium
CN110471896B (en) Data processing method, system and server
CN105812865A (en) Information processing method and electronic device
US11004472B2 (en) Method and device of playing video, and computing device
CN112533007B (en) Network live broadcast method, system, terminal device and storage medium
WO2021119993A1 (en) Method and apparatus for controlling output of vibration signal, computer device, and storage medium
CN111405373B (en) Method and device for acquiring video stream

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
GR01 Patent grant
GR01 Patent grant