Motor driving method and system, and electronic device

By obtaining the information of the audio and game interface, determining the number of vibrations and driving conditions, the problems of vibration leakage and errors in the existing motor control scheme are solved, improving the stability and effectiveness of vibrations and improving the gaming experience.

CN114870396BActive Publication Date: 2025-02-07SHANGHAI AWINIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210314894.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-02-07
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

The existing motor control schemes are prone to vibration leakage and/or errors, which affect the vibration effect.

Method used

By obtaining the relative frame count of the current audio of the current game and the target identification and trigger factor of the current game interface, the number of vibrations and driving conditions are determined based on these information. If the conditions are met, the motor vibration will be driven according to the vibration waveform of the target identification.

Benefits of technology

It improves the stability and effectiveness of vibration, avoids problems such as vibration leakage, error and uneven vibration, and improves the gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114870396B_ABST
    Figure CN114870396B_ABST
Patent Text Reader

Abstract

The present application discloses a motor driving method and system, and an electronic device. The motor driving method includes: obtaining the current audio of the current game, obtaining the relative frame count of the current audio; obtaining the target identifier and the current trigger factor number of the current game interface; the target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface; determining the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations in the current game; if the relative frame count and the number of vibrations meet the driving conditions, the motor vibration is driven according to the vibration waveform corresponding to the target identifier. It can effectively drive the motor to vibrate, prevent the occurrence of conditions that affect the vibration effect, such as leakage vibration, false vibration and / or uneven vibration, improve the vibration effect, and thus improve the user experience brought by the game product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a motor driving method and system, and an electronic device. Background Art

[0002] As a symbol of technological progress in modern society, mobile phones and other electronic devices have become tools that everyone relies on. With the increasing enhancement of the functions of electronic devices, mobile games have become more abundant and have gradually become a daily leisure and entertainment activity for people. For example, shooting games, archery games and / or other similar action games are popular among game players. In such games, players control guns and other targets through the game interface, compete with other players, and simulate various competition experiences such as military competitions. During the game, players can obtain visual, auditory and tactile feedback, which ensures the experience in the game. The player's tactile sense is mainly provided by motor vibration. The motor usually vibrates at the time when vibration may occur, such as when firing a bullet, to provide players with a more realistic gaming experience.

[0003] In this type of game, traditional motor control solutions often determine parameters such as vibration timing based on the characteristics of audio data. For example, many shooting games usually determine whether it is a gunshot based on audio data, so as to provide corresponding vibration when a gunshot is heard, etc. Although the above motor control solution can control the motor vibration when vibration is required, and to a certain extent respond to the player's tactile needs, it is prone to missed vibrations and / or false vibrations. For example, in shooting games, players' autonomous shooting is prone to missed vibrations, and others shooting at close range or the background sound of the game is prone to false vibrations, which affects the vibration effect. Summary of the invention

[0004] In view of this, the present application provides a motor driving method and system, and an electronic device to solve the problem that the existing motor control scheme is prone to leakage vibration and / or false vibration, which affects the vibration effect.

[0005] A first aspect of the present application provides a motor driving method, comprising:

[0006] S110, obtaining the current audio of the current game, and obtaining the relative frame count of the current audio; the relative frame count is used to represent the time count between the current vibration event and the previous vibration event;

[0007] S120, obtaining a target identifier and a current trigger factor number of the current game interface; the target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface;

[0008] S130, determining the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations in the current game;

[0009] S140: If the relative frame count and the vibration times meet the driving conditions, the motor is driven to vibrate according to the vibration waveform corresponding to the target identifier.

[0010] Optionally, the motor driving method further includes:

[0011] If the number of vibrations is greater than the driving threshold and the relative frame count is greater than the time interval threshold, it is determined that the relative frame count and the number of vibrations meet the driving conditions, otherwise it is determined that the relative frame count and the number of vibrations do not meet the driving conditions; the driving threshold is used to limit whether there is currently an available number of vibrations for the current game; the time interval threshold represents the minimum time interval between two adjacent vibration trigger factors.

[0012] Optionally, after driving the motor to vibrate according to the vibration waveform corresponding to the target identifier, the motor driving method further includes:

[0013] The relative frame count is cleared to zero, and the vibration count is reduced by a first count unit to control the next vibration event of the current game.

[0014] Optionally, the motor driving method further includes:

[0015] If the relative frame count and the vibration times do not meet the driving condition, the relative frame count is increased by a second counting unit, and the process returns to step S110.

[0016] Optionally, determining the number of vibrations according to the current trigger factor number includes:

[0017] The current trigger factor number change amount is obtained according to the current trigger factor number, and the vibration frequency is updated according to the trigger factor number change amount.

[0018] Optionally, obtaining a relative frame count of the current audio includes:

[0019] Splitting the current audio into multiple audio frame units that are continuous in time sequence;

[0020] When one frame of audio unit is processed, the relative frame number count is increased by a second counting unit.

[0021] Optionally, obtaining the current audio of the current game includes:

[0022] After obtaining the read permission of the audio storage area of ​​each type of game, the current audio of the current game is read from the audio storage area; the audio storage area is used to buffer the audio data corresponding to the current game.

[0023] Optionally, before the step of obtaining the target identifier of the current game interface and the current number of trigger factors, the motor driving method further includes:

[0024] The game interface is obtained, the flag information of the control target and the vibration trigger factor number included in the game interface are parsed, and the flag information and the vibration trigger factor number are written into a designated node to read the target identifier and the current trigger factor number from the designated node.

[0025] Optionally, the current game is a shooting game; the control target includes controlling a gun; and the factor triggering vibration includes a bullet fired by the controlled gun.

[0026] Optionally, the current game is a bow and arrow game; the control target includes controlling the bow and arrow; and the factor triggering vibration includes an arrow shot by the controlled bow and arrow.

[0027] A second aspect of the present application provides a motor drive system, comprising:

[0028] A first acquisition module is used to acquire the current audio of the current game and acquire the relative frame count of the current audio; the relative frame count is used to represent the time count between the current vibration event and the previous vibration event;

[0029] The second acquisition module is used to acquire a target identifier and a current trigger factor number of the current game interface; the target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface;

[0030] A determination module, used to determine the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations of the current game;

[0031] The driving module is used to drive the motor to vibrate according to the vibration waveform corresponding to the target identifier if the relative frame count and the vibration times meet the driving conditions.

[0032] A third aspect of the present application provides an electronic device, comprising a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute any of the above-mentioned motor driving methods.

[0033] The motor driving method, system and electronic device provided by the present application obtain a relative frame count representing the time count between the current vibration event and the previous vibration event, and also obtain a target identifier of the current game interface and a current trigger factor number, determine the number of vibrations representing the remaining number of motor vibrations of the current game according to the current trigger factor number, and then judge whether the motor driving conditions are met according to the relative frame count and the number of vibrations, so that the judgment of the motor driving conditions is based on the time interval between the current vibration event and the previous vibration event, which can improve the vibration stability and avoid the occurrence of conditions such as uneven vibration; the judgment of the above-mentioned motor driving conditions is also based on the number of motor vibrations representing the remaining number of motor vibrations of the current game, and can judge whether vibration is needed according to the remaining number of motor vibrations in turn, and can prevent the occurrence of conditions such as missed vibration and / or false vibration on the basis of ensuring the effectiveness of vibration; it can be seen that the present application can effectively drive the motor vibration, prevent the occurrence of conditions such as missed vibration, false vibration and / or uneven vibration that affect the vibration effect, improve the vibration effect, and thus improve the user experience brought by the game product. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 This is a flow chart of a motor driving method in one embodiment of the present application;

[0036] Figure 2 is a schematic diagram of a system framework of an embodiment of the present application;

[0037] Figure 3 is a schematic diagram of the structure of a motor drive system in one embodiment of the present application;

[0038] Figure 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of the working process of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION

[0040] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.

[0041] The first aspect of the present application provides a motor driving method, referring to Figure 1 As shown, the motor driving method includes:

[0042] S110, obtaining the current audio of the current game, and obtaining the relative frame count of the current audio; the relative frame count is used to represent the time count between the current vibration event and the previous vibration event.

[0043] The current audio can be obtained from an audio storage area such as an audio buffer pool of a game that requires a motor to be driven in the electronic device; the game that requires a motor to be driven may include at least one type of game such as a shooting game and / or a bow and arrow game. The audio storage area can be used to buffer the audio data generated by the application layer for the current game.

[0044] The relative frame count can describe the time count between the current vibration event and the last vibration event, so as to characterize the duration of each vibration event by using the corresponding counting rule, and is used to control the shortest time interval between each vibration event, so that the subsequent vibration control process is based on the relative frame count, which can avoid the occurrence of states such as continuous vibration for multiple events, and can improve the uniformity and stability of vibration for each event. The above steps can set the initial value of the relative frame count (such as a smaller value such as 0) at the start time of each vibration event, and then update the relative frame count according to a certain update rule to realize the counting of the duration of each vibration event, so that the relative frame count can characterize the shortest time interval required by some vibration events. The above update rule can include increasing the relative frame count by several counting units every certain time; or increasing the relative frame count by several counting units after processing a frame of data of the current audio, etc.; in this way, the relative frame count can be cleared to 0 after a vibration event ends, and recounted according to the update rule in the next vibration event, and the next vibration is performed when the relative frame count meets the conditions, so as to accurately control the shortest time interval between each vibration event. The duration of the interval in the update rule may be 20 ms (milliseconds) or other time.

[0045] S120, obtaining a target identifier and a current trigger factor number of the current game interface; the target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface.

[0046] The current game may be a game that requires a motor to be driven in an electronic device, and may be a shooting game, an archery game, or other similar action games. The above target identifier and the current trigger factor number match the type of the current game. For example, if the current game is a shooting game, the target identifier may be the gun identifier information such as the type of gun currently being controlled, and the current trigger factor number may be the number of fired bullets corresponding to the current game interface; if the current game is an archery game, the target identifier may be the identifier information such as the type of bow and arrow currently being controlled, and the current trigger factor number may be the number of fired arrows corresponding to the current game interface, and so on.

[0047] After starting the current game, the electronic device can take screenshots of its game interface at a certain frequency to obtain each game interface, identify the control target mark information and vibration trigger factor number of each game interface, and write the identified control target mark information and vibration trigger factor number into the corresponding node and other data recording units, so that when the control target mark information and vibration trigger factor number data need to be obtained, they can be directly read from the above data recording unit to ensure the reading efficiency and the accuracy of the obtained results. The frequency of obtaining the game interface can be matched with the progress of the audio processing. For example, when the interval in the update rule is 20ms, the audio processing is performed approximately every 20ms, that is, the control target mark information and vibration trigger factor will be read every 20ms, and the screenshot can be performed once every 85ms. Here, the audio processing is performed faster than the image screenshot to ensure that the control target information and vibration trigger factor are not missed.

[0048] S130, determining the number of vibrations according to the current number of trigger factors; the number of vibrations is used to record the remaining number of motor vibrations in the current game.

[0049] This embodiment can set the initial value of the vibration number of the current game based on factors such as the range of vibration trigger factors that may occur in the current game, the time interval between each vibration trigger factor, and / or the update rule of the vibration number, so as to update each vibration number according to the current trigger factor number for the initial value, so that the vibration number can accurately record the remaining motor vibration number of the current game at each time point. In one example, the above-mentioned vibration number determination rule matches the change characteristics of the current trigger factor number. For example, if the current trigger factor number increases and / or decreases relative to the previous trigger factor number, the vibration number can be updated accordingly. In another example, the above-mentioned vibration number determination rule is also associated with whether the motor is driven to vibrate. For example, after the motor is driven to perform a vibration, the vibration number can be reduced by several counting units so that the vibration number matches the game process.

[0050] S140: If the relative frame count and the vibration times meet the driving conditions, the motor is driven to vibrate according to the vibration waveform corresponding to the target identifier.

[0051] The above relative frame count can represent the interval time between the current vibration event and the end time of the last vibration event. When the interval time is short, the vibration generated is very likely to affect the vibration stability; the above vibration count represents the remaining motor vibration number of the current game. If it exceeds the range of the remaining motor vibration number of the current game, the vibration generated is likely to be invalid vibration for the current game; therefore, the above steps can judge the relative frame count and vibration number, identify the relative frame count and vibration number that meet the driving conditions, and when the relative frame count and vibration number meet the driving conditions, the motor vibration is driven according to the vibration waveform corresponding to the target identifier to ensure the effectiveness and stability of the motor vibration. The vibration waveform includes waveforms pre-configured for various control targets in various games (such as waveforms configured for various gun types in shooting games and / or waveforms configured for various bow types in bow and arrow games, etc.), which are used to limit the vibration parameters such as vibration frequency and vibration amplitude corresponding to the corresponding control target, so that the vibration parameters are more matched with the control target, which can improve the accuracy and diversity of the corresponding vibration, and further enhance the user experience brought by the motor vibration.

[0052] Furthermore, the above motor driving method may also include: playing the current audio to synchronize the motor driving process, the interface display process and the audio playing process, so as to further ensure the gaming effect.

[0053] Furthermore, the above-mentioned motor driving method also includes: if the relative frame count and the vibration number do not meet the driving conditions, the relative frame count is increased by a second counting unit, and the execution step S110 is returned to obtain the latest relative frame count of the current audio, and the vibration number is updated, and then the motor vibration is continued to be controlled according to the relative frame count and the vibration number to ensure the orderliness and stability of the motor vibration.

[0054] This embodiment identifies whether the motor driving conditions are met based on the relative frame count determined by the current audio and the number of vibrations determined by the current trigger factor number, so that the motor driving conditions are determined based on the time interval between the current vibration event and the previous vibration event, which can improve the vibration stability and avoid the occurrence of conditions such as uneven vibration. The above-mentioned motor driving conditions are also determined based on the remaining number of motor vibrations in the current game, and whether vibration is needed can be determined in turn according to the remaining number of motor vibrations. On the basis of ensuring the effectiveness of vibration, it can also prevent the occurrence of missed vibrations and / or false vibrations. It can be seen that this embodiment can effectively drive the motor vibration during the game, prevent the occurrence of missed vibrations, false vibrations and / or uneven vibrations that affect the vibration effect, improve the vibration effect, and thus improve the user experience brought by the game product.

[0055] In one embodiment, the motor driving method further includes:

[0056] If the number of vibrations is greater than the driving threshold and the relative frame count is greater than the time interval threshold, it is determined that the relative frame count and the number of vibrations meet the driving conditions, otherwise it is determined that the relative frame count and the number of vibrations do not meet the driving conditions; the driving threshold is used to limit whether there is currently an available number of vibrations for the current game; the time interval threshold represents the minimum time interval between two adjacent vibration trigger factors.

[0057] The above-mentioned driving threshold can be set to a smaller value such as 0. The number of vibrations greater than the driving threshold indicates that the vibration event generated subsequently is a valid vibration of the current game, and it can be further determined whether the subsequent vibration needs to be continued. The number of vibrations less than or equal to the driving threshold indicates that the vibration event generated subsequently is very likely to be an invalid vibration relative to the current game. At this time, the motor needs to be controlled not to vibrate to avoid invalid vibrations affecting the vibration effect. The time interval threshold represents the minimum time interval between two adjacent vibration triggering factors, such as the minimum time interval between adjacent arrows in bow and arrow games or the minimum time interval between consecutive adjacent bullets in shooting games, etc. Here, shooting games are taken as an example to further illustrate that the vibration to be generated matches the operation of firing a bullet, and one vibration is generated once a bullet is fired. The relative frame count is greater than the time interval threshold, indicating that the two vibration events associated with the relative frame count correspond to two bullet firing events. When the relative frame count is greater than the time interval threshold, the corresponding vibration is generated, so that the vibration matches each bullet firing operation, which can improve the effectiveness of the vibration; the relative frame count is less than or equal to the time interval threshold, indicating that the shortest time interval between the corresponding vibration events is short, and it is very likely that multiple vibration events will occur continuously, resulting in uneven vibration.

[0058] In this embodiment, when the number of vibrations is greater than the driving threshold and the relative frame count is greater than the time interval threshold, it is determined that the relative frame count and the number of vibrations meet the driving conditions, so that each vibration driven according to the determination result can be more effective and more stable.

[0059] In one embodiment, after driving the motor to vibrate according to the vibration waveform corresponding to the target identifier, the motor driving method further includes:

[0060] The relative frame count is cleared to zero, and the vibration count is reduced by a first count unit to control the next vibration event of the current game.

[0061] The first counting unit can be set to 1 or other counting units. In this embodiment, the driving motor vibration indicates that the corresponding vibration event (such as the current vibration event) has ended, and the relative frame count needs to be cleared to enable the relative frame count to accurately represent the time interval between the new vibration event and the corresponding previous vibration event; after completing a motor vibration, the number of vibrations is subtracted by a first counting unit to match the number of vibrations with the game process, and the number of motor vibrations remaining in the current game can be prepared; in this way, based on the relative frame count and the number of vibrations, each motor vibration can be more accurately controlled to ensure the effectiveness and stability of each motor vibration event.

[0062] In one embodiment, determining the number of vibrations based on the current number of trigger factors includes: obtaining the current change in the number of trigger factors based on the current number of trigger factors, and updating the number of vibrations based on the change in the number of trigger factors, such as updating the number of vibrations to the sum of the number of vibrations and the change in the number of trigger factors, so that the number of vibrations matches the number of vibration trigger factors generated by the current game (such as the number of bullets fired, etc.).

[0063] This embodiment can set data including the last trigger factor number and the current trigger factor number, so as to update the current trigger factor number for the array, calculate the change in the trigger factor number, etc., and simplify the above-mentioned processing procedures. Specifically, if bulletbuff[0] is used to record the last trigger factor number, and bulletbuff[1] is used to record the current trigger factor number, in the process of updating the array, the current trigger factor number bullet is first obtained. If bullet≠bulletbuff[1], bulletbuff[0]=bulletbuff[1], bulletbuff[1]=bullet, so as to update each element in the array. At this time, the change in the trigger factor number is: bulletdiff=bulletbuff[0]-bulletbuff[1]. In an example, trig_num is used to represent the number of vibrations. If bulletdiff>0, trig_num=trig_num+bulletdiff is set to update the number of vibrations trig_num.

[0064] In one embodiment, obtaining the relative frame count of the current audio includes:

[0065] Splitting the current audio into multiple audio frame units that are continuous in time sequence;

[0066] When one frame of audio unit is processed, the relative frame number count is increased by a second counting unit.

[0067] The second counting unit can take a counting unit value such as 1. In this embodiment, the current audio can be framed with N audio data (such as audio sampling points) as a step size, and the audio units with less than N audio sampling points can be padded with 0 to obtain multiple frames of audio units that are continuous in time sequence, so that the audio data to be processed includes multiple frames of audio units, and each frame of audio unit includes N audio sampling points. The value of N can be an integer power of 2 such as 1024. In many cases, the time to process a frame of audio unit is certain (such as 20ms), so this embodiment can also increase the relative frame count by a second counting unit at regular intervals (the time required to process a frame of audio unit) to match the relative frame count with the processing progress of the current audio.

[0068] In one embodiment, obtaining the current audio of the current game includes:

[0069] After obtaining the read permission of the audio storage area of ​​each type of game, the current audio of the current game is read from the audio storage area; the audio storage area is used to buffer the audio data corresponding to the current game.

[0070] After various games are started, the application layer of the electronic device can generate corresponding audio data and buffer the audio data to the audio storage area for use by other modules. This embodiment first obtains the read permission of the audio storage area, and then directly reads the current audio of the current game from the audio storage area, which can ensure the smoothness, timeliness and integrity of the current audio reading process.

[0071] Specifically, after obtaining the read permission of the audio storage area, after reading the current audio of the current game from the audio storage area, volume compensation can also be performed on the current audio to compensate the read volume to the same level of volume.

[0072] Here, the volume of the audio data obtained from the audio storage area is compensated, and the audio data is normalized to the maximum volume or the same level of volume, which can improve the quality of subsequent processing of the audio data.

[0073] In one embodiment, before obtaining the target identifier of the current game interface and the current trigger factor number, the motor driving method further includes:

[0074] The game interface is obtained, the flag information of the control target and the vibration trigger factor number included in the game interface are parsed, and the flag information and the vibration trigger factor number are written into a designated node to read the target identifier and the current trigger factor number from the designated node.

[0075] The above-mentioned designated node can be set in the system kernel and other areas, and the latest flag information and vibration trigger factor number recorded by it are usually the target identifier and current trigger factor number of the current game interface. In this embodiment, the flag information and vibration trigger factor number of the control target included in the game interface are written into the designated node, so as to directly read the target identifier and current trigger factor number from the designated node, which can improve the reading efficiency of the target identifier and current trigger factor number.

[0076] In one embodiment, the games that require the driving of the motor may include at least one type of game such as shooting games and / or bow and arrow games, so as to stably and effectively drive the motor for each type of game, respectively, and enhance the tactile experience brought by each type of game. When the games include shooting games, the current game belongs to the shooting games; the control target includes the control of the gun, and the target identifier may be the current gun type; the factors that trigger the vibration include the bullets fired by the controlled gun, and the current number of trigger factors may be the current number of bullets. When the games include bow and arrow games, the current game belongs to the bow and arrow games; the control target includes the control of the bow and arrow, and the target identifier may be the current bow type; the factors that trigger the vibration include the arrows shot by the controlled bow and arrow, and the current number of trigger factors may be the number of arrows currently shot.

[0077] In one example, a shooting game is used as an example to illustrate the system framework corresponding to the motor driving method. In this example, the application layer (App layer), core class library (Native layer), hardware abstraction layer (Hal layer) and system kernel (Kernel layer, such as Linux kernel) of the shooting game system perform various functions related to audio data. The corresponding system framework diagram can be referred to Figure 2As shown, after starting the game, each layer of the system works separately. The application layer realizes sound effect control. At this time, the above-mentioned audio data is set for each game, wherein volume compensation can be realized through an interface, and the current volume level parameters obtained are passed to the algorithm of the hardware abstraction layer, so that the algorithm of the hardware abstraction layer performs volume compensation, which may specifically include: first, creating sound effects, enabling and releasing sound effects, where the system in which the motor vibrates precisely with shooting games is realized by sound effects; second, setting the game mode, the application layer obtains each game type by parsing the current application game package, and then sets the parameters of each game, for example, some algorithm libraries can support a whole set of games, such as shooting games and racing games, and different games can be configured with different parameters; third, volume compensation, the size of the audio data sent by the system at different volume levels is different, in order to realize the unification of volume data in the system in which the motor vibrates precisely with shooting games, the volume compensation coefficient is set according to the volume level of the current system to perform volume compensation, and unify the size and / or volume of each audio data and other parameters. The core class library is responsible for obtaining the function of sound effect service (audio data). The system loads the sound effect algorithm library of the motor that vibrates accurately with shooting games through AudioFlinger (audio policy executor) and AudioPolicyManager (audio policy manager) to enable the corresponding electronic equipment to obtain audio data. The hardware abstraction layer implements the motor driving algorithm. It can realize two functions. First, obtain the original audio data of the current game (current audio); second, execute the algorithm interface of the sound effect algorithm library of the motor that vibrates accurately with shooting games. This interface obtains the gun type and number of bullets information of the current game interface from the system kernel, determines whether to vibrate according to the changes in the gun type and number of bullets, and sends the vibration information containing the vibration (such as vibration waveform) to the system kernel. The above system kernel can control the relevant driver end to control the motor vibration through the operating chip according to the vibration information sent by the hardware abstraction layer.

[0078] Further, refer to Figure 2 As shown in the figure, the application layer, core class library and system kernel of the system where the shooting game is located perform various functions related to the game interface. Among them, the application layer implements image control, mainly realizing the function of starting or shutting down the image service and obtaining a screenshot of the current game interface. The core class library implements image processing services, mainly realizing the following three functions: first, parsing (TP parser parsing) the touch events received by the system kernel; second, taking screenshots based on the touch events; third, identifying the captured pictures, obtaining the gun type and number of bullets in the picture interface, and writing the gun type and number of bullets to the specified node of the system kernel layer. The system kernel mainly realizes the following two functions: one is to obtain the specified node issued by the system kernel, and the other is to report the touch event (TP event) to the core class library.

[0079] The above motor driving method obtains the relative frame count representing the time count between the current vibration event and the previous vibration event, and also obtains the target identifier of the current game interface and the current trigger factor number, determines the vibration number representing the remaining motor vibration number of the current game according to the current trigger factor number, and then judges whether the motor driving conditions are met based on the relative frame count and the vibration number, so that the judgment of the motor driving conditions is based on the time interval between the current vibration event and the previous vibration event, which can improve the vibration stability and avoid the occurrence of conditions such as uneven vibration and / or invalid vibration; the judgment of the above motor driving conditions is also based on the remaining motor vibration number representing the current game, and can judge whether vibration is needed according to the remaining motor vibration number in turn, and can prevent the occurrence of missed vibration and / or false vibration on the basis of ensuring the effectiveness of vibration; therefore, the above motor driving method can effectively drive the motor vibration during the game, prevent the occurrence of missed vibration, false vibration and / or uneven vibration and other conditions that affect the vibration effect, improve the vibration effect, and thus improve the user experience brought by the game product.

[0080] In a second aspect, the present application provides a motor drive system, such as Figure 3 As shown, the motor drive system includes:

[0081] The first acquisition module 110 is used to acquire the current audio of the current game and acquire the relative frame count of the current audio; the relative frame count is used to represent the time count between the current vibration event and the previous vibration event;

[0082] The second acquisition module 120 is used to acquire a target identifier and a current trigger factor number of the current game interface; the target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface;

[0083] The determination module 130 is used to determine the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations of the current game;

[0084] The driving module 140 is configured to drive the motor to vibrate according to the vibration waveform corresponding to the target identifier if the relative frame count and the vibration times meet the driving conditions.

[0085] For the specific definition of the motor drive system, please refer to the definition of the motor drive method above, which will not be repeated here. Each module in the above motor drive system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0086] In a third aspect, the present application provides an electronic device, referring to Figure 4 As shown, the electronic device includes a processor 610, a storage medium 620 and a motor 630; the storage medium 620 stores program code; the processor 610 is used to call the program code stored in the storage medium 620 to execute the motor driving method described in any of the above embodiments.

[0087] Specifically, refer to Figure 4 As shown, the electronic device also includes a motor driver chip 640. After the electronic device enters the game, when playing the corresponding audio data, the processor 610 can control the motor driver chip 640 to drive the motor 630 to vibrate according to the vibration waveform corresponding to the target identifier.

[0088] Furthermore, the electronic device may also include components such as an audio amplifier and a speaker to play audio data. Figure 5 As shown, firstly, the current audio of the current game, the target identifier of the current game interface and the current trigger factor number are obtained, and then the relative frame count is obtained, the number of vibrations is determined, and a vibration judgment is performed. When the relative frame count and the number of vibrations meet the driving conditions, the motor driving chip is controlled to drive the motor to vibrate according to the vibration waveform corresponding to the target identifier, and the corresponding audio data is played through the audio amplifier and the speaker to provide perception signals for game players from multiple aspects.

[0089] The above-mentioned electronic device can also be called a terminal device, which can effectively drive the motor to vibrate during the game, improve the vibration effect, and thus enhance the user experience provided by the corresponding game product.

[0090] Although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on reading and understanding of this specification and the accompanying drawings. The present application includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components, the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (e.g., it is functionally equivalent), even if it is not structurally equivalent to the disclosed structure that performs the functions in the exemplary implementation of this specification shown herein.

[0091] That is, the above description is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, such as the mutual combination of technical features between the embodiments, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

[0092] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0093] In order to enable any technician in the field to implement and use the application, the application provides the above description. In the above description, various details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the application can also be implemented without using these specific details. In other embodiments, the well-known process will not be elaborated in detail to avoid unnecessary details that make the description of the application obscure. Therefore, the application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the application.

Claims

1. A motor driving method, characterized in that: include: S110, obtaining the current audio of the current game, and obtaining the relative frame count of the current audio; The relative frame count is used to represent the time count between the current vibration event and the previous vibration event; S120, obtaining the target identifier and the current trigger factor number of the current game interface; The target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface; S130, determining the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations in the current game; S140, if the relative frame count and the vibration times meet the driving conditions, driving the motor to vibrate according to the vibration waveform corresponding to the target identifier; The motor driving method also includes: if the number of vibrations is greater than a driving threshold, and the relative frame count is greater than a time interval threshold, then it is determined that the relative frame count and the number of vibrations meet the driving conditions, otherwise it is determined that the relative frame count and the number of vibrations do not meet the driving conditions; the driving threshold is used to limit whether there is an available number of vibrations for the current game; the time interval threshold represents the minimum time interval between two adjacent vibration trigger factors.

2. The motor driving method according to claim 1, characterized in that: After driving the motor to vibrate according to the vibration waveform corresponding to the target identifier, the motor driving method further includes: The relative frame count is cleared to zero, and the vibration count is reduced by a first count unit to control the next vibration event of the current game.

3. The motor driving method according to claim 1, characterized in that: The motor driving method further includes: If the relative frame count and the vibration times do not meet the driving condition, the relative frame count is increased by a second counting unit, and the process returns to step S110.

4. The motor driving method according to claim 1, characterized in that: Determining the vibration times according to the current trigger factor number includes: The current trigger factor number change amount is obtained according to the current trigger factor number, and the vibration frequency is updated according to the trigger factor number change amount.

5. The motor driving method according to claim 1, characterized in that: The obtaining of the relative frame count of the current audio comprises: Splitting the current audio into multiple audio frame units that are continuous in time sequence; When one frame of audio unit is processed, the relative frame number count is increased by a second counting unit.

6. The motor driving method according to claim 1, characterized in that: The obtaining of the current audio of the current game includes: After obtaining the read permission of the audio storage area of ​​each type of game, the current audio of the current game is read from the audio storage area; the audio storage area is used to buffer the audio data corresponding to the current game.

7. The motor driving method according to claim 1, characterized in that: Before the step of obtaining the target identifier of the current game interface and the current number of trigger factors includes, the motor driving method further includes: The game interface is obtained, the flag information of the control target and the vibration trigger factor number included in the game interface are parsed, and the flag information and the vibration trigger factor number are written into a designated node to read the target identifier and the current trigger factor number from the designated node.

8. The motor driving method according to claim 1, characterized in that: The current game is a shooting game; the control target includes controlling a gun; the factor triggering vibration includes a bullet fired by the controlled gun; The game interface is obtained, the flag information of the control target and the vibration trigger factor number included in the game interface are parsed, and the flag information and the vibration trigger factor number are written into a designated node to read the target identifier and the current trigger factor number from the designated node.

9. The motor driving method according to claim 1, characterized in that: The current game is a bow and arrow game; the control target includes controlling the bow and arrow; and the factor triggering vibration includes an arrow shot by the controlled bow and arrow.

10. A motor drive system, characterized in that: include: A first acquisition module, used to acquire current audio of a current game, and acquire a relative frame count of the current audio; The relative frame count is used to represent the time count between the current vibration event and the previous vibration event; The second acquisition module is used to obtain the target identifier and the current trigger factor number of the current game interface; The target identifier represents the sign information of the control target in the current game interface; the current trigger factor number represents the number of factors that trigger vibration included in the current game interface; A determination module, used to determine the number of vibrations according to the current trigger factor number; the number of vibrations is used to record the remaining number of motor vibrations of the current game; A driving module, configured to drive the motor to vibrate according to the vibration waveform corresponding to the target identifier if the relative frame count and the vibration times meet the driving conditions; The motor drive system is also used to determine that the relative frame count and the number of vibrations meet the driving conditions if the number of vibrations is greater than a driving threshold and the relative frame count is greater than a time interval threshold, otherwise determine that the relative frame count and the number of vibrations do not meet the driving conditions; the driving threshold is used to limit whether there is an available number of vibrations in the current game; the time interval threshold represents the minimum time interval between two adjacent vibration trigger factors.

11. An electronic device, characterized in that: It comprises a processor, a storage medium and a motor; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the motor driving method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Motor control method and related products

    CN109126120A

  • Motor vibration method and device, storage medium and electronic device

    CN109821246A