A control method and electronic device

By using accelerometers and feedback circuits to recognize users' tapping motions in electronic devices, the problem of inconvenience caused by too many buttons is solved, enabling buttonless control and improving user experience and device operational flexibility.

CN115243125BActive Publication Date: 2026-04-17HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-04-23
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Too many buttons on electronic devices make it inconvenient for users to find and operate them, especially in low light conditions, which makes it difficult to locate the buttons, affecting the user experience and the operational flexibility of the device.

Method used

By installing an acceleration sensor in the electronic device, the user's tapping action can be identified, and vibration data can be collected in combination with a feedback circuit. The acceleration data is processed in real time to identify the user's operating intention and realize functional control.

Benefits of technology

Function control can be achieved without physical buttons, improving operational flexibility and user experience, reducing power consumption, and accurately recognizing user operations even in low light conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115243125B_ABST
    Figure CN115243125B_ABST
Patent Text Reader

Abstract

This application discloses a control method and an electronic device. The electronic device generates vibration when performing at least one function. The electronic device includes an accelerometer and a feedback circuit. The accelerometer outputs acceleration data, and the feedback circuit collects and feeds back vibration-related data. Based on the magnitude change of the acquired acceleration data and interference data, the electronic device obtains the processed change and performs action recognition. Based on the recognition result, the electronic device executes the corresponding function, or controls a second electronic device to execute the corresponding function. This application can shorten the time spent searching for and locating the corresponding button, improving operational flexibility; it also enables the electronic device to accurately identify another function the user wants to use while performing one function, eliminating interference between two or more functions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic devices, and more particularly to a control method and an electronic device. Background Technology

[0002] With the rapid development of electronic devices, integrating more and more functions has become a trend. For example, smart speakers integrate lighting functions, featuring LED strips. Figure 1 As shown, the smart speaker 100 equipped with an LED strip 102 has a touch-sensitive LED strip on / off switch 101. Users can control the LED strip 102's on / off state by touching this switch 101. This reduces the need for or minimizes the number of lights near the smart speaker, saving space and thus gaining market acceptance. However, this also results in a large number of buttons on the electronic device. Some buttons control the device's original functions, while others control newly integrated functions. For example, some buttons on a smart speaker control existing functions like volume control and play / pause, while others control the integrated LED strip's on / off function. Too many buttons can lead to inconvenience and a poor user experience. For instance, locating the correct button increases time consumption, especially for buttons that are not frequently used. For smart speakers with integrated light strips, in low-light or no-light environments, users will find it time-consuming and inefficient to locate the light strip switch button. Similarly, when friends visit and want to control the light strip, they will also need to search for each button individually, which is also time-consuming. This reduces the operational flexibility of the electronic device. Furthermore, too many buttons also detract from the aesthetics. Summary of the Invention

[0003] To address the aforementioned technical problems, embodiments of this application provide a control method and an electronic device. The technical solution provided by this application shortens the time spent searching for and locating the corresponding button, or even eliminates the need to search for and locate the corresponding button, thereby improving the operational flexibility of the electronic device and enhancing the user experience. Furthermore, the technical solution provided by this application enables the electronic device to accurately identify the user's intention to use integrated new functions while performing its original functions, eliminating interference from existing functions in accurately identifying and using new functions.

[0004] In a first aspect, a control method is provided, comprising: a first electronic device acquiring a change in the magnitude of acceleration data and interference data based on a time delay between feedback data from a feedback circuit included therein for acquiring and feeding back vibration-related data and the execution of at least one function, and acceleration data output by an accelerometer included therein; the vibration being generated by the first electronic device while executing at least one function; acquiring a processed change in the magnitude of the acceleration data and the interference data based on the processed change in the magnitude of the acceleration data and the interference data; performing action recognition based on the processed change in the magnitude of the acceleration data; executing a corresponding function based on the recognition result; or, controlling a second electronic device to execute a corresponding function based on the recognition result.

[0005] The feedback circuit can be a circuit used to collect data output when at least one first function is performed. For example, when the first electronic device is a speaker, the feedback circuit may also include a circuit from the speaker's PA connected to the player to the processor via an ADC.

[0006] In this way, the electronic device can recognize the user's tapping motion using an accelerometer, and execute the corresponding function based on the tapping motion. In other words, users can control the electronic device simply by tapping it, reducing operational complexity, increasing the device's operational flexibility, and improving the user experience. Furthermore, it eliminates the need for physical buttons on the electronic device to control related functions, enhancing its aesthetic design. Additionally, the feedback circuit collects data when the electronic device performs functions that generate vibration, and processes this data to eliminate the impact of vibration on the accuracy of tapping motion recognition in these scenarios, while also avoiding misidentification and improving the accuracy of smart speaker control.

[0007] According to the first aspect, based on the time delay between the feedback data from the feedback circuit and the execution of at least one function, as well as the acceleration data, the first electronic device acquires the magnitude change of the acceleration data and interference data in response to the first electronic device receiving an input or in response to the first electronic device executing at least one function. Thus, upon receiving user input or executing at least one of the aforementioned functions, action recognition is triggered, reducing the power consumption of the electronic device.

[0008] According to the first aspect, or any implementation of the first aspect above, the acquisition of the magnitude change of acceleration data and interference data by the first electronic device may include: the first electronic device acquiring the magnitude change of acceleration data and interference data in real time. This allows for real-time motion recognition, enabling timely response to the user's tapping action.

[0009] According to the first aspect, or any implementation of the first aspect above, the first electronic device performs action recognition based on the changes after data processing, which may include: the first electronic device performs action recognition in real time based on the changes after data processing. This allows for timely response to the user's tapping action.

[0010] According to the first aspect, or any implementation of the first aspect above, the first electronic device performs action recognition based on the change in the processed data, which is in response to the change in the processed data satisfying a preset condition. In this way, triggering action recognition upon satisfying the preset condition reduces the power consumption of the electronic device and saves electricity.

[0011] According to the first aspect, or any implementation of the first aspect above, the preset condition is as follows: at time t, the first change in the magnitude of the acceleration of the first electronic device after data processing on the XOY plane of the preset coordinate system is greater than a first preset threshold; or, at time t, the second change in the magnitude of the acceleration of the first electronic device after data processing on the Z axis of the preset coordinate system is greater than a second preset threshold; or, at time t, the first change in the magnitude of the acceleration of the first electronic device after data processing on the XOY plane of the preset coordinate system is greater than a first preset threshold; and, at time t, the second change in the magnitude of the acceleration of the first electronic device after audio cancellation on the Z axis of the preset coordinate system is greater than a second preset threshold; wherein, time t is the time that meets the preset requirements after the start of the self-timing start point.

[0012] According to the first aspect, or any implementation of the first aspect above, the time that satisfies the preset requirement is: t is greater than or equal to t1, where t1 is the time corresponding to when M equals the preset M1; where M is the number of acceleration data points output by the accelerometer from the start of timing; one acceleration data point can be represented as The timing starts at the moment when the first electronic device is powered on.

[0013] According to the first aspect, or any implementation of the first aspect above, when M equals a preset M1, the average value of the acceleration data of the first electronic device is... This is calculated based on M acceleration data points; when M is greater than a preset M1, it represents the average acceleration data of the first electronic device at time (t+1). Based on formula ③ and the average acceleration data of the first electronic device at time t... The calculation yields the result; where formula ③ is:

[0014]

[0015] Where 0 < ω < 1; ω is a pre-set value; and These represent the magnitudes of the accelerations of the first electronic device at time t along the X, Y, and Z axes of the preset coordinate system, respectively. These represent the average magnitudes of the acceleration of the first electronic device in the X, Y, and Z directions of the predefined coordinate system at time t.

[0016] According to the first aspect, or any implementation of the first aspect above, the change in the magnitude of the acceleration data of the first electronic device at time t is decomposed into the change in the magnitude of the acceleration of the first electronic device in the XOY plane of the predefined coordinate system at time t. And the change in the magnitude of the acceleration of the first electronic device on the Z-axis of the predefined coordinate system at time t. And calculated using formula ① and formula ② respectively; where formula ① and formula ② are respectively:

[0017]

[0018]

[0019] According to the first aspect, or any implementation of the first aspect above, the interference data at time t is calculated using formula ⑥; formula ⑥ is:

[0020] e′ (t) =max(e (t-p) e (t-p+1) , ..., e (t-k) ) ⑥

[0021] Where max represents taking the maximum value, e′ (t) This represents the interference data after taking the maximum value; e (t-p) e (t-p+1) , ..., e (t-k) The energy of the output data of the first electronic device when performing at least one function at each time point from time (tp) to time (tk); p is used to reflect the past duration since time (tk);

[0022] Among them, e (t-k) The result is obtained through formula ⑤; formula ⑤ is:

[0023]

[0024] Among them, e (t-k) This represents the energy of the data output by the first electronic device when it performs at least one function during the time period from time (tk-1) to time (tk). Let s1, s2, ..., s be the numbers s1, s2, ..., s2. m The average value; m represents the ratio of the sampling frequency to the return frequency of the output data; s iThis represents the i-th sampled value of the output data during the time interval from time (tk) to time t. By utilizing the energy of the output data from performing at least one of the above functions during a period prior to time t, the influence of the accelerometer at time t is eliminated, further improving the accuracy of motion recognition.

[0025] According to the first aspect, or any implementation of the first aspect above, the change after data processing at time t includes: the change in the magnitude of the acceleration of the first electronic device in the XOY plane after data processing at time t. And, the change in the magnitude of the acceleration of the first electronic device on the Z-axis at time t. The result is obtained through formula ⑦; formula ⑦ is:

[0026]

[0027] Calculated using formula ⑧;

[0028]

[0029] According to the first aspect, or any implementation of the first aspect above, the change after data processing at time t includes: the change in the magnitude of the acceleration of the first electronic device in the XOY plane after data processing at time t. The result is obtained through formula ⑦; formula ⑦ is:

[0030]

[0031] According to the first aspect, or any implementation of the first aspect above, in Greater than the first preset threshold, and If the value exceeds the second preset threshold, the first electronic device performs action recognition based on the change amount after data processing.

[0032] According to the first aspect, or any implementation of the first aspect above, in If the value exceeds the first preset threshold, the first electronic device performs action recognition based on the change amount after data processing.

[0033] According to the first aspect, or any implementation of the first aspect above, action recognition is performed through functions (1) and (2); wherein, functions (1) and (2) are respectively:

[0034]

[0035]

[0036] Among them, T slap >0, T move-xy >0, and T slap and T move-xy All are preset values; yes The cumulative value of all data in the dataset.

[0037] According to the first aspect, or any implementation of the first aspect above, action recognition is performed through functions (1), (2), and (3); wherein functions (1), (2), and (3) are respectively:

[0038]

[0039]

[0040]

[0041] Among them, T slap >0, T move-xy >0, T move-z >0, and T slap T move-xy and T move-z All are preset values; yes The cumulative value of all data in the middle; yes The cumulative value of all data.

[0042] According to the first aspect, or any implementation of the first aspect above, in and and The result of the recognition is that a tap was received; in Then, the recognition result is horizontal displacement.

[0043] According to the first aspect, or any implementation of the first aspect above, in and and and The result of the recognition is that a tap was received; in and Then, the recognition result is horizontal displacement; in Then, the recognition result is vertical movement.

[0044] According to the first aspect, or any implementation of the first aspect above, the first electronic device includes a speaker; the speaker integrates a lighting function; and performs the corresponding function, including: starting the lighting function. For a speaker with integrated lighting function, tapping the speaker can control its lighting to start, making it convenient for users to control the lighting function in low-light conditions such as at night, greatly improving the user experience.

[0045] In a second aspect, a first electronic device is provided, which may include: a processor; a memory; and a computer program, wherein the computer program is stored in the memory and, when executed by the processor, causes the first electronic device to perform a method as described in the first aspect and any implementation thereof.

[0046] The second aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the second aspect and any implementation thereof can be found in the first aspect and any implementation thereof, and will not be repeated here.

[0047] Thirdly, a computer-readable storage medium is provided, the computer-readable storage medium including a computer program that, when run on a first electronic device, causes the first electronic device to perform a method as described in the first aspect and any implementation thereof.

[0048] The third aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the third aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here.

[0049] Fourthly, a computer program product is provided that, when run on a computer, causes the computer to perform a method as described in the first aspect and any implementation thereof.

[0050] The fourth aspect and any implementation thereof correspond to the first aspect and any implementation thereof, respectively. The technical effects of the fourth aspect and any implementation thereof are similar to those of the first aspect and any implementation thereof, and will not be repeated here. Attached Figure Description

[0051] Figure 1 This is an exemplary schematic diagram of a smart speaker with integrated lighting functionality.

[0052] Figure 2This is an exemplary scenario diagram illustrating a control method provided in an embodiment of this application;

[0053] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0054] Figure 4 This is a schematic diagram of the structure of a smart speaker provided in an embodiment of this application;

[0055] Figure 5 A flowchart illustrating a control method provided in an embodiment of this application;

[0056] Figure 6 A schematic diagram of a coordinate system provided for an embodiment of this application;

[0057] Figure 7 A schematic diagram illustrating the principles of data acquisition, data processing, and data recognition in a smart speaker, provided for an embodiment of this application;

[0058] Figure 8 for Figure 7 A schematic diagram illustrating the principle of sampling and variance calculation for audio data playback waveforms in data acquisition and processing.

[0059] Figure 9 for Figure 7 The diagram shown illustrates the principle of tapping motion recognition in the data recognition process.

[0060] Figure 10 This is a schematic diagram of another smart speaker provided in an embodiment of this application;

[0061] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0062] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two). The term “and / or” is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0063] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes both direct and indirect connections, unless otherwise stated.

[0064] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0065] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0066] Integrating more and more functions has become a trend in the development of electronic devices. For example, smart speakers integrate lighting functions through integrated light strips. Users can control the light strip's on / off state by operating corresponding buttons on the smart speaker. However, this results in electronic devices having many buttons, some of which control the original functions of the electronic device, while others control the newly integrated functions. For example, see reference... Figure 1 Continuing with the example of a smart speaker 100 with an integrated LED strip 102, the smart speaker 100 includes: an LED strip on / off switch 101, volume control buttons 103 and 104, a microphone mute button 105, and a play / pause button 106. The LED strip on / off switch 101 controls the on / off state of the integrated LED strip in the smart speaker 100. The volume control buttons 103 and 104, the microphone mute button 105, and the play / pause button 106 control the original functions of the smart speaker 100, namely, controlling the volume of the smart speaker 100, muting the microphone, and playing / pausing music.

[0067] Thus, too many buttons lead to inconvenience and a poor user experience. For example, locating the corresponding button increases time consumption. For smart speakers with integrated light strips, finding the light strip switch button can be time-consuming and inefficient in low-light or no-light environments. This reduces the operational flexibility of electronic devices. Furthermore, too many buttons also detract from the aesthetics.

[0068] This application provides a control method applicable to electronic devices equipped with an acceleration sensor. The electronic device can detect a user's tapping motion using the acceleration sensor, and execute a corresponding function based on the tapping motion. In this way, the user can control the electronic device simply by tapping it, reducing operational complexity, increasing the operational flexibility of the electronic device, and improving the user experience.

[0069] For example, combining Figure 2 Taking a smart speaker 100 with an LED strip 102 as an example, when a user taps the smart speaker 100, the speaker vibrates, causing a change in the acceleration data collected by its accelerometer. Based on this change in acceleration data, the smart speaker 100 can recognize the user's tapping action. After recognizing the tapping action, the smart speaker 100 can execute corresponding functions to achieve flexible control. For example, after recognizing the tapping action, the smart speaker 100 can control the LED strip 102 to turn on / off. Or, based on the recognized tapping action, the smart speaker 100 can control music playback / pause, alarm clock pause / stop, or call answering / hanging up. In other examples, after recognizing a user's tapping motion, the smart speaker 100 can also control the user's smart home devices based on that tapping motion. For example, by further combining... Figure 2 After recognizing the user's tapping motion based on changes in acceleration data collected by the accelerometer, the smart speaker 100 can control the smart screen in the home to turn on / off. Of course, the smart speaker 100 can also control other smart home devices based on the recognized tapping motion, such as turning lights on / off or controlling the robot vacuum cleaner to turn on / off.

[0070] It should be noted that although the above-described electronic device is an example of a smart speaker 100, the control method provided in this embodiment can also be applied to other electronic devices. Specifically, in this embodiment, the electronic device can be a device that vibrates when performing at least one existing function. Such electronic devices typically include motors, speakers, etc. Examples include washing machines, smart speakers, and electronic devices with speakers. In some examples, the electronic device can also be: a Bluetooth speaker, a smart TV, a smart screen, a large screen, a portable computer (such as a mobile phone), a handheld computer, a tablet computer, a laptop computer, a netbook, a personal computer (PC), augmented reality (AR) / virtual reality (VR) devices, an in-vehicle computer, etc. The specific form of the electronic device in this application embodiment is not limited in any way.

[0071] For example, the electronic device 300 in this application embodiment may include Figure 3 The structure is shown. Electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna, a wireless communication module 350, an audio module 360, a speaker 360A, a microphone 360B, a display screen 370, and a sensor module 380, etc. The sensor module 380 may include pressure sensors, barometric pressure sensors, magnetic sensors, distance sensors, proximity sensors, fingerprint sensors, touch sensors, ambient light sensors, accelerometers, etc.

[0072] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0073] Processor 310 may include one or more processing units. For example, processor 310 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, electronic device 300 may also include one or more processors 310. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0074] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or that are used repeatedly. In some embodiments, the processor 310 may include one or more interfaces.

[0075] USB interface 330 is an interface that conforms to the USB standard specification, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. USB interface 330 can be used to connect a charger to charge electronic device 300, and can also be used for data transfer between electronic device 300 and peripheral devices.

[0076] The charging management module 340 receives charging input from a charger, which can be either a wireless charger or a wired charger. While charging the battery 342, the charging management module 340 can also supply power to the electronic device 300 via the power management module 341.

[0077] The power management module 341 connects the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340 to power the processor 310, internal memory 321, display screen 370, and wireless communication module 350, etc. In some other embodiments, the power management module 341 may also be located within the processor 310. In other embodiments, the power management module 341 and the charging management module 340 may be located in the same device.

[0078] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 300 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0079] The wireless communication module 350 can provide solutions for wireless communication applications on the electronic device 300, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 350 can be one or more devices integrating at least one communication processing module. The wireless communication module 350 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to the processor 310. The wireless communication module 350 can also receive signals to be transmitted from the processor 310, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via the antenna.

[0080] The electronic device 300 implements display functions through a GPU, a display screen 370, and an application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The display screen 370 is used to display images, videos, etc. In some embodiments, the electronic device 300 may include one or N display screens 370, where N is a positive integer greater than 1.

[0081] Internal memory 321 may include one or more random access memory (RAM), one or more non-volatile memory (NVM), or a combination of both. RAM may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, generally referred to as DDR5 SDRAM), etc. Non-volatile memory may include disk storage devices and flash memory. RAM can be directly read and written by the processor 310, and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into memory for direct reading and writing by the processor 310.

[0082] The external memory interface 320 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 300. The external non-volatile memory communicates with the processor 310 through the external memory interface 320 to perform data storage functions. For example, music files can be stored in the external non-volatile memory.

[0083] Electronic device 300 can implement audio functions through audio module 360, speaker 360A, microphone 360B, and application processor, such as music playback and recording.

[0084] The audio module 360 ​​is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 360 ​​can also be used for encoding and decoding audio signals. In some embodiments, the audio module 360 ​​may be located in the processor 310, or some functional modules of the audio module 360 ​​may be located in the processor 310.

[0085] Speaker 360A is used to convert audio electrical signals into sound signals. Electronic device 300 can play music through speaker 360A.

[0086] The microphone 360B, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. Users can speak by bringing their mouth close to the microphone 360B to input sound signals.

[0087] Motor 390 can generate vibrations. Motor 390 can be used for applications such as the ringing vibration of an alarm clock, the incoming call vibration of a smartphone, the audio output vibration of a smart speaker, and the rotational vibration during washing in a washing machine.

[0088] The control method provided in this application embodiment can be applied to the aforementioned electronic device 300. The electronic device 300 includes an accelerometer. The accelerometer can periodically collect acceleration data of the electronic device 300 at a certain frequency. For example, it can collect the magnitude of acceleration of the electronic device 300 in various directions (generally the XYZ axes).

[0089] Let's continue using a smart speaker as an example. When a user taps the smart speaker, it vibrates, causing a change in the acceleration data collected by the speaker's accelerometer. Based on this change in acceleration data, the smart speaker can recognize the tapping action and execute the corresponding function accordingly.

[0090] In some examples, combined Figure 4 The smart speaker includes a light strip 406, and a tapping action controls the light strip 406 to turn on / off. The smart speaker also includes an accelerometer 402, which collects acceleration data and reports it to the smart speaker's processor 401. When a user taps the smart speaker, the tapping action causes the speaker to vibrate, which in turn changes the acceleration data collected by the accelerometer 402. Based on the changes in acceleration data collected by the accelerometer 402, the smart speaker's processor 401 can identify the user's tapping action and thus control the light strip 406 to turn on / off accordingly.

[0091] However, when a user plays audio on a smart speaker, the speaker vibrates, causing changes in the acceleration data collected by its accelerometer. If the user taps the smart speaker during audio playback, the resulting acceleration data from the speaker's vibration may be interfered with or masked by the changes in acceleration data caused by the audio playback. This can lead to the speaker failing to accurately recognize the tapping action during audio playback, or misidentifying the speaker's vibration as a tapping action. Therefore, when performing user gesture recognition, it is necessary to remove interfering data from the acceleration data collected by the accelerometer to accurately identify the tapping action and avoid misidentification, thereby improving the accuracy of smart speaker control.

[0092] Continue to combine Figure 4 In an audio playback scenario, the smart speaker processor 401 includes a player that decodes audio data (e.g., decodes MP3 audio data into a PCM stream), amplifies it via a power amplifier (PA) 403, and outputs it through a speaker 404. In this embodiment, the smart speaker may also include an analog-to-digital converter (ADC) 405. One end of the ADC 405 is connected to the output of the PA 403, and the other end is connected to the smart speaker processor 401. In an audio playback scenario, the smart speaker processor 401 can obtain the audio data after analog-to-digital conversion by the ADC 405, i.e., the audio data sampled back to the smart speaker output. The circuit from the PA 403 to the processor 401 via the ADC 405 can be the feedback circuit in this embodiment. In this way, the processor 401 of the smart speaker can remove the interference data caused by the vibration of the smart speaker caused by the playback of audio from the acceleration data collected by the accelerometer 402 based on the audio data collected, thereby accurately identifying the user's tapping action and avoiding misidentification.

[0093] The following combination Figure 4 and Figure 5 The control method provided in this embodiment will be described below. Figure 5 As shown, the method may include:

[0094] S501, the accelerometer 402 of the smart speaker collects the acceleration data of the smart speaker.

[0095] Acceleration data can include the magnitude of the smart speaker's acceleration in various directions within a predefined coordinate system.

[0096] In some examples, such as Figure 6As shown, the predefined coordinate system can be a coordinate system where the origin is located at the center O of the smart speaker or the center O of the accelerometer 402, the XOY plane is parallel to the top cover of the smart speaker, and the Z-axis is perpendicular to the top cover of the smart speaker. For example, the center of the smart speaker or the center of the accelerometer 402 can be the center of mass, the center of space, etc. Alternatively, point O can be any point on the smart speaker or on the accelerometer 402. The accelerometer 402 of the smart speaker can periodically collect (for example, at a frequency of 200Hz, i.e., a collection period of 5ms) the magnitude of the smart speaker's acceleration in the X, Y, and Z directions of this coordinate system at a certain frequency to obtain the smart speaker's acceleration data. For example, combined with... Figure 7 The acceleration data collected by the accelerometer 402 of the smart speaker can be like... Figure 7 As shown in (A) of the diagram.

[0097] [a] x a y a z ] (t) This represents the acceleration data of the smart speaker collected by the accelerometer 402 at time t.

[0098] in, Indicates that at time t, the smart speaker is Figure 6 The magnitude of acceleration along the X-axis in the coordinate system shown. Indicates that at time t, the smart speaker is Figure 6 The magnitude of acceleration along the Y-axis in the coordinate system shown. Indicates that at time t, the smart speaker is Figure 6 The magnitude of the acceleration along the Z-axis in the coordinate system shown.

[0099] The smart speaker's accelerometer 402 can store the collected acceleration data in a buffer.

[0100] S502, the processor 401 of the smart speaker determines the change in acceleration data at time t based on the acceleration data collected by the accelerometer 402 at time t.

[0101] In some examples, the smart speaker can acquire the magnitude of the change in acceleration data at different times in real time.

[0102] The smart speaker's processor 401 can retrieve acceleration data collected by the accelerometer 402 from a cache. For example, combined with... Figure 4The processor 401 includes a processing module. After the smart speaker is powered on, the accelerometer 402 of the smart speaker outputs acceleration data once every predetermined time interval (e.g., 5ms, 10ms, etc.; where ms is millisecond). The processing module of the smart speaker can receive this acceleration data. In one embodiment, the accelerometer 402 can output data to the processing module in an interrupt manner. When the processing module detects an interrupt, it can read the acceleration data collected by the accelerometer 402 from the cache. The processing module can read the acceleration data of the smart speaker collected by the accelerometer 402 at time t, i.e., [a x a y a z ] (t) .

[0103] Generally, when a user taps a smart speaker, the resulting vibration affects the accelerometer's data along the X, Y, and Z axes of a predefined coordinate system. In most cases, the impact of the tapping vibration on the X and Y axes is more pronounced than on the Z-axis. Furthermore, user movement (e.g., picking up, pushing, etc.) also causes vibration. To avoid the impact of movement on tapping recognition, or to prevent the smart speaker from misinterpreting the movement as tapping, the smart speaker needs to detect user movement. This detection can specifically include detecting horizontal movement (movement in the XOY plane) and vertical movement (movement along the Z-axis). Based on these reasons, the change in acceleration data can be processed in two dimensions: the XOY plane and the Z-axis. In this embodiment, the change in acceleration data at time t may include: the change in the magnitude of the acceleration of the smart speaker on the XOY plane of the predefined coordinate system at time t, and the change in the magnitude of the acceleration of the smart speaker on the Z axis of the predefined coordinate system at time t.

[0104] In some examples, the following formulas ① and ② can be used to calculate the change in the magnitude of the smart speaker's acceleration on the XOY plane of the predefined coordinate system at time t, and the change in the magnitude of the smart speaker's acceleration on the Z-axis of the predefined coordinate system at time t, respectively.

[0105]

[0106]

[0107] in, This represents the change in the magnitude of the acceleration of the smart speaker in the XOY plane of the predefined coordinate system at time t. This represents the change in the magnitude of the smart speaker's acceleration along the Z-axis of the predefined coordinate system at time t. These represent the average magnitudes of the smart speaker's acceleration in the X, Y, and Z axes of the predefined coordinate system at time t. For example, the change in the magnitude of the smart speaker's acceleration in the XOY plane of the predefined coordinate system at time t can be found in [reference needed]. Figure 7 (A) in (c).

[0108] In some examples, when the smart speaker is powered on (this moment can be recorded as moment 0), the processor 401 of the smart speaker can continuously collect acceleration data of the smart speaker collected by the accelerometer 402 over a period of time, and the number of collected acceleration data points is recorded as M. In one implementation, the moment when the processor, accelerometer, and related devices that enable communication between the two of the smart speaker are all powered on can be recorded as moment 0.

[0109] The average value of the smart speaker's acceleration data when M is less than or equal to a preset M1 (for example, M1 can be preset to 100). The average value of the M acceleration data is given.

[0110] When M is greater than the preset M1, the processor 401 of the smart speaker can determine the average value of the acceleration data of the smart speaker at time (t+1) according to formula ③.

[0111]

[0112] Where 0 < ω < 1, and the typical value of ω can be 0.99. This represents the average acceleration data of the smart speaker at time (t+1). x a y a z ] (t) The acceleration data of the smart speaker collected by the accelerometer 402 at time t. Accordingly, the average value of the smart speaker's acceleration data at time t can also be determined.

[0113] The unit of "1" in (t+1) is not limited. For example, the unit of "1" in (t+1) can be milliseconds (ms), microseconds (us), or any other reasonable unit such as 10 milliseconds (10ms), 100 milliseconds (100ms), 10 microseconds (10us), or 100 microseconds (100us). Furthermore, the units of k, p, etc., in the following text are the same as the unit of "1".

[0114] In other words, after the smart speaker is powered on, its accelerometer sensor outputs an acceleration data point every T (e.g., 5ms) starting from the moment the smart speaker is powered on. When the number of output acceleration data points M is less than or equal to a preset M1 (e.g., 100), the average of the M acceleration data points is taken as... When M is greater than the preset M1 (for example, 100), it is determined according to formula ③. Accordingly, It can also be determined according to formula ③.

[0115] In other words, when t is less than or equal to M1*T, the average value of the M acceleration data is taken as denoted as . When t is greater than M1*T, it is determined according to formula ③. Accordingly, It can also be determined according to formula ③. In this embodiment, t1 can be the time M1*T.

[0116] Generally, if a user taps the smart speaker, the tap will cause a change in the acceleration data collected by the accelerometer 402. Therefore, the smart speaker, based on the change in acceleration data collected by the accelerometer 402, will... (as described above) and This allows for the identification of whether a user has performed a tapping action. However, as described in the preceding embodiments, in audio playback scenarios, the audio played by the smart speaker also causes the smart speaker to vibrate. This vibration also causes changes in the acceleration data collected by the smart speaker's accelerometer 402, which affects the accuracy of tapping action recognition and may lead to false recognition. To eliminate the impact of audio playback on the accuracy of tapping action recognition and avoid false recognition, interference data caused by the vibration of the smart speaker due to audio playback needs to be removed from the acceleration data collected by the accelerometer 402. In simple terms, data processing (also known as audio cancellation) is required on the acceleration data collected by the accelerometer 402. Therefore, the method provided in this embodiment further includes:

[0117] S503, the processor 401 of the smart speaker determines interference data, which is used to eliminate the influence of audio on the acceleration data collected by the accelerometer 402 at time t.

[0118] In some examples, smart speakers can acquire interference data in real time at various moments.

[0119] The greater the energy (also known as power) of the audio output from the smart speaker, the greater the vibration of the smart speaker, and the greater the impact on the accelerometer 402. Furthermore, the impact of the output audio on the accelerometer 402 has a delay, and this delay is random within a certain range. Therefore, the processor 401 of the smart speaker can determine interference data based on the energy of the output audio at each moment within the time interval from time (tk) to time t, in order to eliminate the influence of the output audio on the acceleration data collected by the accelerometer 402 at time t.

[0120] Where k can be a positive integer greater than or equal to 1. The specific value of k can be preset according to the needs of the actual application scenario, as long as it ensures that the data acquired by the data acquisition and transmission module at time t is affected, and the corresponding audio includes the audio data output by the smart speaker from time (tk) to time t. For example, the value of k can be 1. Of course, the value of k can also be other positive integers.

[0121] In some examples, the processor 401 of the smart speaker can determine the energy of the audio output by the smart speaker at time t based on the data acquired by the data acquisition and transmission module at time t and the audio data output by the smart speaker at the corresponding time.

[0122] Taking the determination of the energy of the audio output at time t as an example, the processor 401 of the smart speaker can acquire the audio data output by the smart speaker at time t, and determine the energy of the audio output by the smart speaker at time t based on the audio data output by the smart speaker at time t.

[0123] For example, combining Figure 4 The processor 401 of the smart speaker may also include a sampling and transmission module. The energy of the audio output by the smart speaker can be determined by this sampling and transmission module.

[0124] In audio playback scenarios, smart speakers can output audio data. For example, the smart speaker's player can decode the audio data, amplify it via PA 403, and then output it through speaker 404. In this embodiment, during the process of the smart speaker outputting audio data, the audio data output from PA 403 can be sampled back by ADC 405 at a certain sampling frequency. The smart speaker's sampling and transmission module can acquire the audio data sampled back by ADC 405 at a certain frequency (also known as the data transmission frequency). For example, the audio data sampled back by the smart speaker's sampling and transmission module can be as follows: Figure 7 As shown in (A) and (b) of the diagram. Because the data received by the acquisition and transmission module has a time delay compared to the audio output data, the data acquired by the acquisition and transmission module from the ADC 405 at time t corresponds to the audio data output at a time earlier than time t. In some examples, the data acquired by the acquisition and transmission module from time t to (t+1) may include the audio data output by the smart speaker from time (t-1) to time t.

[0125] Generally, because the sampling frequency of the ADC 405 for the audio data output waveform is higher than the data transmission frequency of the data acquisition and transmission module, the data acquired by the data acquisition and transmission module at time t (this data is based on the sampled data of the audio data output waveform, obtained after AD conversion) can contain multiple discrete sample values. Combined with... Figure 7 and Figure 8 The data acquired by the data acquisition and transmission module during the time period from (t-1) to t can be represented by the following formula ④.

[0126] S (t) = [s1, s2, ..., s m ] (t) ④

[0127] Among them, S (t) This represents the data acquired by the acquisition and transmission module during the time interval from time (t-1) to time t. m is the number of discrete sample values ​​contained in the acquired audio data. s1, s2, ..., s m These represent the m sample values ​​included in the audio data.

[0128] For example, taking a data transmission frequency of 200Hz for the data acquisition and transmission module and a sampling frequency of 16kHz for the audio data by the ADC 405 as an example, dividing 16kHz by 200Hz yields m = 80. The ADC 405 samples 16K data points of audio data per second, and these 16K data points are divided into 200 data packets, each containing 80 data points. These 200 data packets are then transmitted back to the data acquisition and transmission module within one second. These 200 data packets can be represented as: S (1) To S (200) That is, the aforementioned 1 second is divided into 200 moments, and the duration between each two moments corresponds to 80 data points.

[0129] After that, as Figure 8 As shown, the smart speaker's data acquisition and transmission module can calculate S (t) The variance of S is used to determine the energy of the audio output by the smart speaker during the time interval from time (tk-1) to time (tk). For example, S can be determined using the following formula ⑤. (t) The variance.

[0130]

[0131] Among them, e (t-k) This represents the energy of the audio output by the smart speaker during the time interval from time (tk-1) to time (tk); e (t-k) Therefore, S (t) Energy is expressed in the form of variance; Let s1, s2, ..., s m The mean. In formula ⑤ here, "k" in (tk) is adjustable.

[0132] In other scenarios, k = 1, and formula ⑤ can be:

[0133] Alternatively, the formula can be used: Determine S (t)The variance. Correspondingly, in other scenarios, the formula can also be used: Determine S (t) The variance.

[0134] Similarly, continue to combine Figure 7 (A) and (b) in the middle Figure 8 The smart speaker's data acquisition and transmission module can determine the energy of the smart speaker's output audio at each time point within the time interval from time (t-p+k) to time t. For example, using e... (t-p) e (t-p+1) , ..., e (t-k) This represents the energy of the audio output by the smart speaker at each time point from time (tp) to time (tk). The smart speaker's data acquisition and transmission module can determine the energy of the audio output at each time point. (t-p) e (t -p+1) , ..., e (t-k) Stored in the cache. That is, in the cache, the data that the smart speaker's data acquisition and transmission module should acquire at each time point within the time interval from (t-p+k) to time t is respectively e (t-p) e (t-p+1) , ..., e (t-k) Here, p reflects the past duration; the current outcome is predicted based on the results of the past duration. For example, p = 3. For example, p is mainly used in formula ⑥.

[0135] For example, when k=1, the smart speaker's data acquisition and transmission module can determine the energy e of the audio output by the smart speaker at each time from (tp) to (t-1) based on the data acquired at each time from (t-p+1) to time t. (t-p) e (t-p+1) , ..., e (t-1) The smart speaker's data acquisition and transmission module can transmit data back to the user. (t-p) e (t-p+1) , ..., e (t-1) Stored in the cache. That is, in the cache, the data that the smart speaker's data acquisition and transmission module should acquire at each time point from (t-p+1) to time t is respectively e (t-p) e (t-p+1) , ..., e (t-1) e (t-p) e (t-p+1) , ..., e (t-1) These correspond to the energy of the smart speaker when it outputs audio at each time point from (tp) to (t-1).

[0136] In S503, after the processor 401 (or processing module) of the smart speaker acquires the acceleration data transmitted by the accelerometer 402 at time t, it can read from the cache the data that the smart speaker's data acquisition and transmission module should acquire at each time point within the time period from time (t-p+k) to time t, that is, acquire e. (t-p) e (t-p+1) , ..., e (t-k) And according to e (t-p+k) e (t -p+1) , ..., e (t-k) Identify the interfering data.

[0137] In some examples, the processor 401 of the smart speaker can determine the maximum energy of the output audio at each time step from time (tp) to time (tk) as the aforementioned interference data. That is, the interference data can be determined using the following formula ⑥:

[0138] e′ (t) =max(e (t-p) e (t-p+1) , ..., e (t-k) ) ⑥

[0139] Where max represents taking the maximum value, e′ (t) This represents the interference data after taking the maximum value, as shown below. Figure 7 The highest peak in (d) of (A) is shown. As mentioned earlier, generally speaking, the vibration of the smart speaker caused by the tapping action has a more significant impact on the data collected by the accelerometer on the X and Y axes than on the data collected by the accelerometer on the Z axis; and similarly, the vibration caused by the smart speaker's audio output is generally concentrated in the X and Y axis directions. Therefore, in one implementation, only the interference of the vibration caused by the audio output on the tapping action recognition in the XOY plane can be considered. That is, in one example, the interference data can be determined using the above formula ⑥. Optionally, k = 1.

[0140] Alternatively, other methods can be used to determine the interference data. For example, the average energy of the output audio at each time step (tp) to (tk) can be taken as the interference data. Or, based on the principle of the median, the median energy of the output audio at each time step (tp) to (tk) can be taken as the interference data.

[0141] Understandably, if the smart speaker is not playing audio or the energy of the output audio is very low for a period of time, then the determined interference data e′ will be... (t) It is 0.

[0142] It should be noted that in this embodiment, the acquisition of the magnitude change of acceleration data in S502 and the acquisition of interference data in S503 can be performed in response to an input received by the smart speaker (such as the user's operation on the smart speaker), or in response to the smart speaker performing its own function, such as playing audio. This embodiment does not impose specific limitations here.

[0143] S504, the processor 401 of the smart speaker uses interference data to perform audio cancellation on the change in the magnitude of the smart speaker's acceleration in the XOY plane of the predefined coordinate system at time t, and obtains... It can also obtain the change in the magnitude of the smart speaker's acceleration along the Z-axis of a predefined coordinate system at time t.

[0144] The following formula (⑦) can be used to achieve audio cancellation of the change in the magnitude of the smart speaker's acceleration in the XOY plane at time t.

[0145]

[0146] in, This represents the change in the magnitude of the smart speaker's acceleration in the XOY plane after audio cancellation at time t; Let be the change in the magnitude of the smart speaker's acceleration in the XOY plane of the predefined coordinate system at time t, as determined in S502; and let be the interference data of the smart speaker at time t, as determined in S503. It should be noted that the interference data does not distinguish between the XOY plane and the Z-axis dimensions; therefore, in formula ⑦, e′ (t) This is approximated as the component of the interference data in the XOY plane. Here, we consider that, generally speaking, the vibrations caused by the audio output from a smart speaker are primarily concentrated in the X and Y axis directions.

[0147] related The calculation can be performed by referring to formula ②.

[0148] Optionally, in S504, the smart speaker can further obtain the change in the magnitude of its acceleration along the Z-axis at time t after audio cancellation, i.e. And it can be used for subsequent judgments. Among them, The formula can be used: Sure.

[0149] Optionally, S504 only includes "the processor 401 of the smart speaker uses interference data to perform audio cancellation on the change in the magnitude of the acceleration of the smart speaker in the XOY plane of the predefined coordinate system at time t", without acquiring

[0150] S505, the processor 401 of the smart speaker determines the change in the magnitude of the acceleration of the smart speaker at time t after audio cancellation on the XOY plane of the predefined coordinate system. Whether it is greater than the first preset threshold; determine the change in the magnitude of the smart speaker's acceleration along the Z-axis of the predefined coordinate system at time t. Is it greater than the second preset threshold?

[0151] if Less than the first preset threshold, and If the value is less than the second preset threshold, it indicates that the user has not tapped the smart speaker. The reason for the change in acceleration data at time t may be the audio output by the smart speaker. Then, the smart speaker executes S509, which can determine whether to trigger the tapping action based on the change in acceleration data collected by the acceleration sensor 402 at the next moment.

[0152] It should be noted that S509 is an optional step. The control method provided in this application embodiment may or may not include S509. For example, when S509 is omitted, if... Less than the first preset threshold, and If the value is less than the second preset threshold, the smart speaker may not perform any operation.

[0153] if Greater than the first preset threshold, and Greater than the second preset threshold; or, Greater than the first preset threshold, and If the value is less than the second preset threshold, it indicates that the cause of the change in acceleration data at time t may be the user tapping the smart audio; then execute S506 to further determine whether the user has performed the tapping action.

[0154] if Less than the first preset threshold, and If the value is greater than the second preset threshold, it indicates that the reason for the change in acceleration data at time t may be that the user moved the smart speaker vertically. Execute S510 to further determine whether the user performed vertical movement.

[0155] Both the first and second preset thresholds can be preset based on experience. For example, a typical value for the first preset threshold could be 1*10. 5 micrometers per square second (μm / s) 2 For example, a typical value for the second preset threshold can be 1*10. 5 micrometers per square second (μm / s) 2 ).

[0156] In addition, the above uses the change in the magnitude of the smart speaker's acceleration along the Z-axis of the predefined coordinate system at time t. The judgment is made. In some other embodiments, the change in the magnitude of the acceleration of the smart speaker at time t after audio cancellation on the Z-axis of a predefined coordinate system can also be used. Make a judgment. Among them, The formula can be used: Sure.

[0157] It should be noted that the above S505 refers to... Whether it is greater than the first preset threshold, and The method of determining whether a tapping action is triggered is illustrated using the example of judging whether the value exceeds a second preset threshold. In some other embodiments, only the... The system checks whether the value exceeds a first preset threshold to determine whether a tapping action is triggered. For example, when determining... If the value exceeds the first preset threshold, execute S506 to further determine whether the user has performed a tapping action; upon determining... If the value is less than a first preset threshold, execute step S509. In some other embodiments, only step S509 may be executed. or The system checks whether the value exceeds a second preset threshold to determine whether a tapping action should be triggered. For example, when determining... or If the value exceeds the second preset threshold, execute S506 to further determine whether the user has performed a tapping action; upon determining... or If the value is less than the second preset threshold, execute S509.

[0158] Similarly, S509 is an optional step. The control method provided in this application embodiment may or may not include S509.

[0159] S506. For n consecutive time intervals after time t, the processor 401 of the smart speaker obtains the first change in the magnitude of the acceleration of the smart speaker after audio cancellation on the XOY plane, and the second change in the magnitude of the acceleration of the smart speaker on the Z-axis of the predefined coordinate system for n consecutive time intervals after time t.

[0160] In S505, if the change in the magnitude of the acceleration after audio cancellation by the smart speaker at time t is greater than a preset threshold, it indicates that the user may have tapped the smart speaker. The smart speaker can obtain the change in acceleration data after audio cancellation over a period of time after time t to identify the tapping action.

[0161] In some examples, the smart volume processor 401 can obtain the changes in the magnitude of the smart speaker's acceleration in the XOY plane after audio cancellation at n time points after time t, i.e., obtain n d′ xy ,like:

[0162] It should be noted that, The process of determining and The determination process is similar; for specific implementation details, please refer to the corresponding content in S502 and S503. For example, the waveform of the acceleration data of the smart speaker collected by the accelerometer 402 is as follows: Figure 7 As shown in (A) and (a) in the diagram; in an audio playback scenario, the waveform of the audio data collected by the smart speaker is as follows: Figure 7 As shown in (A) and (b) of the diagram. After the processor 401 of the smart speaker determines that the change in the magnitude of the acceleration of the smart speaker in the XOY plane after audio cancellation at time t is greater than a preset threshold, the processor 401 can acquire the acceleration data of the smart speaker collected by the accelerometer 402 at n times after time t, and determine the change in the magnitude of the acceleration in the XOY plane at each time based on the acquired acceleration data. For example, based on... Figure 7 The waveforms in (A) and (a) represent the changes in the magnitude of acceleration in the XOY plane at various times, as determined by the smart speaker. Figure 7 As shown in (A) and (c) of the above. Additionally, the smart speaker's processor 401 can determine the interference data for n times after time t based on the re-sampled audio data. For example, based on... Figure 7 The waveforms of the audio data shown in (A) and (b) are as follows. The interference data at n times after time t, as determined by the smart speaker, are as follows. Figure 7 As shown in (A) and (d) in the diagram. Then, based on the interference data from n time points after time t, audio cancellation can be performed on the change in the magnitude of acceleration in the XOY plane at the corresponding time points. In this way, the smart speaker can obtain the change in the magnitude of acceleration in the XOY plane after audio cancellation at n time points after time t. For example, the obtained result might be as follows... Figure 7 As shown in (A) and (e) in the diagram, the smart speaker can remove interference from the audio data collected by the accelerometer 402 based on the retrieved audio data.

[0163] A user's tapping of the smart speaker typically causes a change in the magnitude of the speaker's acceleration along the Z-axis of a predefined coordinate system. Therefore, the smart speaker's processor 401 can also obtain the changes in the magnitude of the speaker's acceleration along the Z-axis of the predefined coordinate system for n consecutive time intervals after time t, i.e., obtain n changes in the magnitude of the speaker's acceleration along the Z-axis of the predefined coordinate system. z .like: in, The process of determining and The determination process is similar, and the specific implementation can be found in the detailed description of the corresponding content in S502, which will not be described in detail here.

[0164] Additionally, as described in the preceding embodiments, user movement of the smart speaker will also cause the smart speaker to vibrate. To avoid the impact of movement on the recognition of tapping actions, or to prevent the smart speaker from misidentifying the movement as a tapping action, the smart speaker needs to be able to detect the user's movement operation. The detection of movement operations can specifically include detecting horizontal and vertical movements. The change in the magnitude of the smart speaker's acceleration along the Z-axis can also be used for vertical movement recognition. The change in the magnitude of the smart speaker's acceleration after audio cancellation in the XOY plane can also be used for horizontal movement recognition. For specific details on the recognition of vertical and horizontal movements, please refer to the description in S507.

[0165] S507, the processor 401 of the smart speaker determines whether the user has performed a tapping action on the smart speaker based on the first change and the second change.

[0166] In this embodiment, the waveform recognition function C can be pre-stored in the smart speaker. xy (·) and C z (·)

[0167] The smart speaker's processor 401 obtains the first change in the magnitude of the acceleration of the smart speaker after audio cancellation in the XOY plane of the predefined coordinate system over n consecutive time intervals following time t. And the second change in the magnitude of the smart speaker's acceleration along the Z-axis of the predefined coordinate system over n consecutive time intervals after time t, i.e. The first and second changes are then input into the waveform recognition function C. xy (·) and C z After (·), according to the waveform recognition function C xy (·) and C z The output of (·) can determine whether the user has performed a tapping action on the smart speaker.

[0168] Among them, C xy (·) It can identify the striking motion and horizontal movement based on the input data; C xy The output of (·) can include horizontal lateral movement, tapping action, and no action. z (·) It can identify vertical movement based on input data; C z The output of (·) can include vertical movement and no action.

[0169] For example, the processor 401 in a smart speaker can... Input waveform recognition function C xy (·), about to Input waveform recognition function C xy (·) is used to identify striking motions and horizontal lateral movements. Input waveform recognition function C z (·), about to Input waveform recognition function C z (·) is used to identify vertical movement.

[0170] In some examples, the waveform recognition function C xy (·) can include the following functions (1) and (2).

[0171]

[0172] Among them, T slap >0. T slap The value of T can be selected based on experience. slap This is a preset value. For example, T... slap The value can be 5*10 4 micrometers per square second (μm / s) 2 The function (1) can be used to determine the... Does a spike occur? If the change in acceleration data at a given moment is greater than the changes in acceleration data at the preceding and following moments, and the difference is greater than a threshold T... slap At that moment, a spike is considered to be observed in the change of acceleration data. If a spike appears, it can be assumed that the user has performed a tap.

[0173] For example, combined Figure 9 , and This can be interpreted as the user performing a tap. In one example, combined with... Figure 7 ,Will Figure 7 The waveform data input for (A) and (e) in the waveform recognition function C is shown in the figure. xy After (·), such as Figure 7 As shown in (A) and (f), it can be identified. Two spikes occurred, meaning the user performed two taps.

[0174]

[0175] Among them, T move-xy >0. T move-xy The value of T can be selected based on experience. move-xy This is the default value. yes The cumulative value of all data in the dataset. When Greater than the threshold T move-xy If the horizontal movement occurs at a certain time, it can be considered that the smart speaker has moved horizontally. Conversely, if the horizontal movement does not occur, it can be considered that no horizontal movement has taken place.

[0176] Waveform recognition function C z (·) can include the following function (3).

[0177]

[0178] Among them, T move-z >0. T move-z The value can be selected based on experience. yes The cumulative value of all data. When... Greater than the threshold T move-z If the vertical movement occurs, the smart speaker can be considered to have moved vertically. Conversely, if the vertical movement does not occur, it can be considered not to have moved vertically.

[0179] In other words, function (1) can be used to identify slapping motions, function (2) can be used to identify horizontal movement, and function (3) can be used to identify vertical movement.

[0180] In this embodiment, if the input data only satisfies function (1), then the waveform recognition function C... xy The output of (·) is the slapping action. If the input data only satisfies function (2), then the waveform recognition function C xy The output of (·) is a horizontal shift. For example, to... Figure 7 The waveform data input for (B) and (h) in the waveform recognition function C are shown in the diagram. xy After (·), the waveform recognition function C xy The output of (·) is a horizontal shift. If the input data satisfies both function (1) and function (2), then the waveform recognition function C xy The output of (·) is a horizontal shift, which avoids misinterpreting the user's horizontal shift operation on the smart speaker as a tapping action. If the input data does not satisfy functions (1) and (2), then the waveform recognition function C xy The output of (·) is no action. For example, when... Figure 7 The waveform data input for (B) and (g) in the waveform recognition function C are shown in the diagram. xy After (·), the waveform recognition function C xy The output of (·) is no action.

[0181] If the input data satisfies function (3), then the waveform recognition function C z The output of (·) is vertical movement. If the input data does not satisfy function (3), then the waveform recognition function C z The output of (·) is no action.

[0182] Then, the smart speaker's processor 401 can use the waveform recognition function C xy (·) and C x The output of (·) determines whether the user has performed a tapping action on the smart speaker.

[0183] For example, in the waveform recognition function C xy The output of (·) is the striking action, and the waveform recognition function C is... z When the output of (·) is no action, the processor 401 of the smart speaker can determine that the user has performed a tapping action.

[0184] In waveform recognition function C xy The output of (·) is the striking action, and the waveform recognition function C is... z When the output of (·) is vertical movement, the processor 401 of the smart speaker can determine that the user has picked up the smart speaker and has not performed a patting action. This can avoid misidentifying the user's vertical movement of the smart speaker as a patting action.

[0185] In waveform recognition function C xy The output of (·) is a horizontal shift, and the waveform recognition function C z When the output of (·) is no action, the processor 401 of the smart speaker can determine that the user has moved the smart speaker horizontally without performing a tapping action.

[0186] In waveform recognition function C xy The output of (·) is a horizontal shift, and the waveform recognition function C z The output of (·) is vertical shift, or in the waveform recognition function C xy The output of (·) is no action, and the waveform recognition function C z When the output of (·) is vertical movement, the processor 401 of the smart speaker can determine that the user has picked up the smart speaker and has not performed a tapping action.

[0187] In some other examples, C xy (·) can also be a neural network model, which has the ability to recognize horizontal movement and slapping based on input data. Similarly, C z (·) can also be a neural network model, which has the ability to recognize vertical movement based on input data. In this way, and After inputting the corresponding neural network model, it can output a corresponding result, allowing the smart speaker's processor 401 to determine whether the user has performed a tapping action on the smart speaker based on the output result. The neural network module can be pre-trained and generated based on a large amount of sample data.

[0188] In some embodiments, vertical movement, horizontal movement, and tapping actions can be recognized in a predetermined sequence. The processor 401 of the smart speaker can first... Enter C z (·) Vertical movement recognition. If the output result is vertical movement, the smart speaker processor 401 can determine that the user has not performed a tapping action. The smart speaker can then determine whether to trigger tapping action recognition based on the change in acceleration data collected by the accelerometer 402 at the next moment. If the output result is no action, the smart speaker processor 401 can... Enter C xy (·) First, identify horizontal movement, such as using function (2) to determine whether the user has moved the smart speaker horizontally. If it is determined that the user has not moved the smart speaker horizontally, then... Perform tapping motion recognition, such as... The input function (1) determines whether the user has performed a tapping action. This can save power consumption of the smart speaker.

[0189] Optionally, in one embodiment, after recognizing a first action, the corresponding first function can be executed; if a second action is recognized during the execution of the first function, the second function corresponding to the second action can be executed. During the execution of the second function, if there is a conflict between executing the second function and executing the first function, the second function is executed first; if there is no conflict, the second function is executed first, or the first and second functions are executed simultaneously. Prioritizing the execution of the second function includes, but is not limited to: ceasing the execution of the first function after the second function is executed; and continuing the execution of the first function after the second function is executed. For example, if a user moves a smart speaker horizontally, the smart speaker may recognize this as horizontal movement and issue a voice prompt, "The speaker is moving horizontally." If, during the movement of the smart speaker, the user or another user taps the smart speaker, the smart speaker may recognize this as turning on the light strip, thus turning on the lighting. In this way, as the smart speaker is moved, it can simultaneously issue the aforementioned voice prompts and turn on the light strip to activate the lighting function. This technical solution is suitable for scenarios such as users moving house at night.

[0190] Furthermore, a third action and its corresponding third function can also be set. Similarly, following the above method, this can be extended to include a third action and its corresponding third function.

[0191] For example, combined Figure 4 Specifically, S507 can be executed by the processing module included in the processor 401.

[0192] S508. When the processor 401 of the smart speaker determines that the user has performed a tapping action, the processor 401 of the smart speaker executes the corresponding function, or the smart speaker sends the control event corresponding to the tapping action to other devices for those devices to execute the corresponding function.

[0193] In some embodiments of this application, combined with Figure 4 In the smart speaker's processor 401, if the processing module determines that the user has performed a tapping action, it can send the corresponding control event to the control module, which will then execute the corresponding function, such as controlling the on / off switch of the light strip 406. If the smart speaker's processor 401 determines that the user has not performed a tapping action, it can continue to acquire the acceleration data collected by the accelerometer 402 at the next moment to determine whether to trigger the tapping action recognition based on its changes.

[0194] The above example illustrates how a user controls the smart speaker's light strip by performing a tapping action. In other embodiments, the smart speaker may also perform other functions in response to the tapping action to control other functions of the smart speaker. The functions performed by the smart speaker in response to the tapping action can be pre-configured in the smart speaker, and this embodiment does not impose specific limitations on this.

[0195] Smart speakers can also perform different functions depending on the user's tapping action and the usage scenario. For example, when a user is using the smart speaker's call function, such as answering a phone call, if the smart speaker recognizes the tapping action, it can hang up the call. Or, when a user is playing audio, if the smart speaker recognizes the tapping action, it can pause the music playback and resume playback when the user taps again. Finally, if the smart speaker's alarm clock is ringing, and the smart speaker recognizes the tapping action, it can pause or delay the ringing. Different control functions can be implemented by different control modules. That is, in the processor 401 of the smart speaker, after the processing module determines that the user has performed a tapping action, it can send the corresponding control event to the corresponding control module to execute the corresponding function. For example, the control event can be sent to the light strip control module to control the light strip switch, sent to the playback control module to control the audio pause or playback, sent to the alarm clock module to control the alarm clock pause and delayed ringing, and sent to the call service module to control the answering or hanging up of the call.

[0196] The smart speaker can also perform different functions based on the number of times the user taps the speaker. For example, if it detects that the user taps the smart speaker once, it will control the on / off state of the smart speaker's light strip. If it detects that the user taps the smart speaker twice, it will turn up the volume of the smart speaker.

[0197] Among them, the waveform recognition function C mentioned above xy (·) It also has the function of recognizing the number of taps. For example, when If the data in this array shows a single spike, the number of taps can be identified as 1. If the data in this array shows two spikes, it can be identified that the number of taps is 2, and so on.

[0198] In other embodiments of this application, the smart speaker can control other smart home devices in the user's home based on the recognized tapping action. For example, combined with... Figure 2 After recognizing the user's tapping action based on changes in acceleration data collected by the accelerometer, the smart speaker can control the smart screen in the home to turn on / off.

[0199] In some examples, combined Figure 2 and Figure 4 ,like Figure 10 As shown, the smart speaker establishes a Bluetooth connection with the smart screen, and the tapping action controls the smart screen's on / off state. The smart speaker's accelerometer 402 periodically collects acceleration data and reports it to the processing module of the smart speaker processor 401. During audio playback, the smart speaker processor 401's data acquisition and transmission module acquires corresponding interference data and transmits it to the processing module. The processing module of the smart speaker processor 401 performs audio cancellation and waveform recognition on the changes in acceleration data collected by the accelerometer 402 based on the interference data, accurately identifying the user's tapping action.

[0200] In some examples, reference Figure 10 After the smart speaker's processing module recognizes the user's tapping action, it can send the corresponding control event to the Bluetooth module. The Bluetooth module then uses the Bluetooth connection established between the smart speaker and the smart screen to send the control event to the smart screen to control its opening / closing.

[0201] Alternatively, please refer to other examples. Figure 10 When the smart speaker has not established a connection with other smart home devices, such as the Bluetooth connection mentioned above, after the smart speaker's processing module recognizes the user's tapping action, the smart speaker's processing module can send the corresponding control event to the smart home cloud communication module. The smart home cloud communication module can then send the control event to the corresponding smart home device, such as a light in the home, through the smart home cloud server to control the light's on / off state.

[0202] Of course, smart speakers can also control different smart home devices based on the number of times a user taps the speaker. For example, if the speaker detects that the user taps the speaker once, it can control the lights in the house; if it detects that the user taps the speaker twice, it can control the robot vacuum cleaner. In practice, after the smart speaker detects the tapping action, it can send the control event and the number of taps to the smart home cloud server via the smart home cloud communication module. The smart home cloud server then controls different smart home devices based on the number of taps.

[0203] S510. At n consecutive time points after time t, the processor 401 of the smart speaker obtains the second change in the magnitude of the acceleration of the smart speaker on the Z-axis of the predefined coordinate system.

[0204] S511, the processor 401 of the smart speaker determines whether the user has moved the smart speaker vertically based on the second change amount.

[0205] It should be noted that the specific description of obtaining the second change quantity in S510 is the same as the description of the corresponding content in S506, and the specific description of determining whether the user has moved the smart speaker vertically in S511 is the same as the description of the corresponding content in S507, so it will not be repeated here.

[0206] It should be noted that S510 and S511 are also optional steps. If in S505, only... If the determination is made based on whether the threshold is greater than a first preset threshold to determine whether the tapping action is triggered, then the control method of this application embodiment does not include S510 and S511.

[0207] Using the method provided in this application, the smart speaker can recognize the user's tapping action through an accelerometer. Based on the tapping action, corresponding functions can be executed, such as controlling the on / off switch of the light strip on the smart speaker device, playing / pausing music, pausing and delaying the ringing of the alarm clock, answering and hanging up calls, or controlling other smart home devices. In this way, users can achieve corresponding control by tapping the electronic device, reducing operational complexity, improving the operational flexibility of the electronic device, and enhancing the user experience. Especially for smart speakers with light strips, tapping the smart speaker can control the on / off switch of its light strip, making it convenient for users to control the light strip in low-light conditions such as at night, greatly improving the user experience. Furthermore, there is no need to set physical buttons on the smart speaker for controlling related functions, improving the aesthetics of the speaker device's appearance design.

[0208] In addition, by performing audio cancellation on the acceleration data collected by the accelerometer, the impact of audio playback on the accuracy of tapping action recognition can be eliminated in audio playback scenarios, while avoiding misidentification and improving the accuracy of smart speaker control.

[0209] It should be noted that although the electronic device described in the above embodiments is a smart speaker, those skilled in the art should understand that the electronic device of this application includes devices that generate vibration when performing at least one conventional function. In other words, the electronic device of this application includes, but is not limited to, smart speakers.

[0210] It should be noted that all or part of the various embodiments of this application can be freely and arbitrarily combined. The combined technical solutions are also within the scope of this application.

[0211] It is understood that, in order to achieve the aforementioned functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware-driven or software-driven manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0212] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0213] In one example, please refer to Figure 11 The diagram illustrates a possible structural schematic of the electronic device involved in the above embodiments. The electronic device 1100 includes a processing unit 1110 and a storage unit 1120.

[0214] The processing unit 1110 is used to execute the methods involved in the various embodiments of this application.

[0215] Storage unit 1120 is used to store program code and data of electronic device 1100. For example, the methods involved in the various embodiments of this application can be stored in storage unit 1120 in the form of computer programs.

[0216] Of course, the unit modules in the above-mentioned electronic device 1100 include, but are not limited to, the processing unit 1110 and the storage unit 1120. For example, the electronic device 1100 may also include a power supply unit, etc. The power supply unit is used to supply power to the electronic device 1100.

[0217] The processing unit 1110 may be a processor or controller, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The storage unit 1120 may be a memory.

[0218] This application also provides a computer-readable storage medium storing computer program code. When a processor executes the computer program code, the electronic device performs the method described in the above embodiments.

[0219] This application also provides a computer program product that, when run on a computer, causes the computer to perform the methods described in the above embodiments.

[0220] In this application, the electronic device 1100, computer-readable storage medium, or computer program product provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0221] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above.

[0222] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another electronic device, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; the indirect couplings or communication connections between electronic devices or units may be electrical, mechanical, or other forms.

[0223] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0224] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROMs, magnetic disks, or optical disks.

[0225] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A control method, characterized in that, The method is applied to a first electronic device; the first electronic device generates vibration when performing at least one function; the first electronic device includes an accelerometer and a feedback circuit, the accelerometer being used to output acceleration data, and the feedback circuit being used to acquire and feed back vibration-related data, the feedback circuit being a circuit for acquiring data output when performing at least one function; the method includes: Based on the time delay between the vibration-related data fed back by the feedback circuit and the execution of the at least one function, as well as the acceleration data, the first electronic device acquires the magnitude change of the acceleration data and interference data; Based on the magnitude of the change in the acceleration data and the interference data, the first electronic device obtains the change after data processing. In response to the change amount after data processing satisfying a preset condition, the first electronic device performs action recognition based on the change amount after data processing. The first electronic device performs a corresponding function based on the recognition result; or, the first electronic device controls the second electronic device to perform a corresponding function based on the recognition result; wherein, the function performed by the first electronic device is different in different usage scenarios.

2. The method according to claim 1, characterized in that, Based on the time delay between the vibration-related data fed back by the feedback circuit and the execution of the at least one function, as well as the acceleration data, the first electronic device acquires the magnitude change of the acceleration data and interference data in response to the first electronic device receiving an input or in response to the first electronic device executing the at least one function.

3. The method according to claim 1 or 2, characterized in that, The first electronic device acquires the magnitude change of the acceleration data and interference data; including: the first electronic device acquires the magnitude change of the acceleration data and interference data in real time.

4. The method according to claim 1 or 2, characterized in that, The first electronic device performs action recognition based on the changes after data processing; including: the first electronic device performs action recognition in real time based on the changes after data processing.

5. The method according to claim 1, characterized in that, The preset conditions are: At time t, the first change in the magnitude of the acceleration of the first electronic device after data processing on the XOY plane of the preset coordinate system is greater than the first preset threshold; or, At time t, the second change in the magnitude of the acceleration of the first electronic device after data processing on the Z-axis of the preset coordinate system is greater than the second preset threshold; or, At time t, the first change in the magnitude of the acceleration of the first electronic device after data processing on the XOY plane of the preset coordinate system is greater than the first preset threshold; and at time t, the second change in the magnitude of the acceleration of the first electronic device after audio cancellation on the Z axis of the preset coordinate system is greater than the second preset threshold. Where time t is the time when the preset requirements are met after the start of the self-timer.

6. The method according to claim 5, characterized in that, The moment satisfying the preset requirement is: t is greater than or equal to t1, t1 is a moment corresponding to M being equal to a preset M1; wherein M is a number of acceleration data output by the acceleration sensor since the timing start point; one acceleration data can be represented as [a x , a y , a z ] (t) ; The timing start point is the moment when the first electronic device is powered on.

7. The method according to claim 6, characterized in that, When M equals the preset M1, the average value of the acceleration data of the first electronic device It is calculated based on the M acceleration data; When M is greater than the preset M1, the average value of the acceleration data of the first electronic device at time (t+1) Where 0 < ω < 1; ω is a pre-set value; These represent the magnitudes of the accelerations of the first electronic device at time t in the X, Y, and Z directions of the preset coordinate system. These represent the average magnitudes of the acceleration of the first electronic device in the X, Y, and Z directions of the predefined coordinate system at time t.

8. The method according to claim 7, characterized in that, The change in the magnitude of the acceleration data of the first electronic device at time t can be decomposed into the change in the magnitude of the acceleration of the first electronic device in the XOY plane of the predefined coordinate system at time t. and the change in the magnitude of the acceleration of the first electronic device along the Z-axis of the predefined coordinate system at time t. And calculated using formula ① and formula ② respectively; where formula ① and formula ② are respectively:

9. The method according to claim 7 or 8, characterized in that, The interference data at time t is calculated using formula ⑥; formula ⑥ is: and' (t) =max(e (t-p) ,and (t-p+1) ,...,and (t-k) 2) Where max represents taking the maximum value, e′ (t) This represents the interference data after taking the maximum value; e (t-p) e (t-p+1) , ..., e (t-k) The energy of the output data of the first electronic device when performing the at least one function at each time from time (tp) to time (tk); p is used to reflect the past duration since time (tk); Among them, e (t-k) The result is obtained through formula ⑤; formula ⑤ is: Among them, e (t-k) This represents the energy of the data output by the first electronic device when performing at least one of the functions during the time period from time (tk-1) to time (tk); Let s1, s2, ..., s be the numbers s1, s2, ..., s2. m The average value; m represents the ratio of the sampling frequency to the return frequency of the output data; s i This represents the i-th sampled value of the output data during the time period from time (tk) to time t.

10. The method according to claim 9, characterized in that, The changes at time t after data processing include: the change in the magnitude of the acceleration of the first electronic device in the XOY plane after data processing at time t. And, the change in the magnitude of the acceleration of the first electronic device along the Z-axis at time t. The The result is obtained through formula ⑦; formula ⑦ is: The Calculated using formula ⑧; 11. The method according to claim 9, characterized in that, The changes at time t after data processing include: the change in the magnitude of the acceleration of the first electronic device in the XOY plane after data processing at time t. The The result is obtained through formula ⑦; formula ⑦ is:

12. The method according to claim 10, characterized in that, In the Greater than the first preset threshold, and the If the value exceeds the second preset threshold, the first electronic device performs action recognition based on the change amount after data processing.

13. The method according to claim 11, characterized in that, In the If the value exceeds a first preset threshold, the first electronic device performs action recognition based on the amount of change after data processing.

14. The method according to claim 13, characterized in that, Action recognition is performed using functions (1) and (2); where functions (1) and (2) are respectively: Among them, T slap >0, T move-xy >0, and T slap and T move-xy All are preset values; yes The cumulative value of all data in the dataset.

15. The method according to claim 12, characterized in that, Action recognition is performed using functions (1), (2), and (3); where functions (1), (2), and (3) are respectively: Among them, T slap >0, T move-xy >0, T move-z >0, and T slap T move-xy and T move-z All are preset values; yes The cumulative value of all data in the middle; yes The cumulative value of all data.

16. The method according to claim 14, characterized in that, exist and and The result of the recognition is that a tap was received; exist Then, the recognition result is horizontal displacement.

17. The method according to claim 15, characterized in that, exist and and and The result of the recognition is that a tap was received; exist and Then, the recognition result is a horizontal shift; exist Then, the recognition result is vertical movement.

18. The method according to claim 1 or 2, characterized in that, The first electronic device includes a speaker; the speaker integrates a lighting function; the execution of the corresponding function includes: starting the lighting function.

19. A first electronic device, characterized in that, The first electronic device includes: a processor; a memory; and a computer program, wherein the computer program is stored in the memory and, when executed by the processor, causes the first electronic device to perform the method as described in any one of claims 1-18.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed on the first electronic device, causes the first electronic device to perform the method as described in any one of claims 1-18.

Citation Information

Patent Citations

  • Man-machine interaction method and equipment based on acceleration sensor and motion recognition

    CN103218062A

  • Operation execution method and device

    CN107544686A

  • Knocking sensor algorithm and knock sensor thereof

    CN112129399A