Data processing method and device, electronic equipment and storage medium

By obtaining linear acceleration information in the preset time window in the electronic device and performing peak detection processing, inputting it into the recognition model, the problem of misidentification of tapping operations is solved, and the recognition accuracy and user experience are improved.

CN119128408APending Publication Date: 2024-12-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310700658.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art recognizes the knock operation due to the acquisition error of input data, which leads to the misidentification of the knock operation, especially in the noisy environment or when the user is walking with the device in his hand, which can easily cause misjudgment, affecting the user experience.

Method used

By obtaining linear acceleration information in the preset time window, the data is peak detection processed, and then the target data is obtained and inputted into the pre-trained recognition model to identify the type of knocking operation.

Benefits of technology

It improves the recognition accuracy of tapping operations, reduces the false recognition rate, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128408A_ABST
    Figure CN119128408A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring to-be-processed data in a preset time window, wherein the to-be-processed data is linear acceleration information corresponding to a tapping operation acting on the electronic equipment; performing wave crest detection processing on the to-be-processed data to obtain target data; and inputting the target data into a pre-trained identification model, and obtaining a knocking type of a knocking operation corresponding to the target data output by the identification model. According to the method, after the to-be-processed data is obtained, the to-be-processed data is subjected to wave crest detection processing to obtain the more standard target data, so that the target data is input into the recognition model, and the recognition accuracy of the model on the knocking operation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and specifically relates to a data processing method, device, electronic device and storage medium. Background Art

[0002] When the tapping operation is recognized through the model, the tapping operation may be misrecognized due to the collection error of the input data. Summary of the invention

[0003] In view of the above problems, the present application proposes a data processing method, device, electronic device and storage medium to improve the above problems.

[0004] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising: obtaining data to be processed within a preset time window, the data to be processed being linear acceleration information corresponding to a tapping operation acting on an electronic device; performing peak detection processing on the data to be processed to obtain target data; inputting the target data into a pre-trained recognition model, and obtaining the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0005] In the second aspect, an embodiment of the present application provides a data processing device, which includes: a data acquisition unit, used to acquire data to be processed within a preset time window, wherein the data to be processed is linear acceleration information corresponding to a tapping operation acting on an electronic device; a processing unit, used to perform peak detection processing on the data to be processed to obtain target data; and a recognition unit, used to input the target data into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is run.

[0008] The embodiments of the present application provide a data processing method, device, electronic device and storage medium. First, the data to be processed within a preset time window is obtained, and the data to be processed is the linear acceleration information corresponding to the tapping operation acting on the electronic device. Then, the data to be processed is subjected to peak detection processing to obtain target data, and the target data is input into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, after obtaining the data to be processed, the data to be processed is first subjected to peak detection processing to obtain more standard target data, and then the target data is input into the recognition model, which can improve the accuracy of the model in recognizing the tapping operation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0010] Figure 1 A flow chart of a data processing method proposed in one embodiment of the present application is shown;

[0011] Figure 2 An exemplary schematic diagram of three axes in an electronic device in an embodiment of the present application is shown;

[0012] Figure 3 A schematic diagram showing 200 frames of linear acceleration information collected within 1 second in an embodiment of the present application is shown;

[0013] Figure 4 A flow chart of a data processing method proposed in another embodiment of the present application is shown;

[0014] Figure 5 A schematic diagram showing the sliding of a preset time window in another embodiment of the present application is shown;

[0015] Figure 6 A schematic diagram showing another embodiment of the present application in which the first linear acceleration and the second linear acceleration are at the middle position of the preset time window;

[0016] Figure 7 A flowchart of a data processing method proposed in another embodiment of the present application is shown;

[0017] Figure 8 A structural block diagram of a data processing device proposed in an embodiment of the present application is shown;

[0018] Fig. 9A structural block diagram of an electronic device for executing a data processing method according to an embodiment of the present application is shown;

[0019] Fig.10 A storage unit in an embodiment of the present application is shown for storing or carrying program codes for implementing a data processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0021] At present, more and more smart electronic devices (such as mobile phones) are becoming more and more functional, and the ways to turn on or off a function in electronic devices are becoming more and more diverse. For example, touch or voice control. At present, some electronic devices support triggering turning on or off a function by tapping. For example, if you tap the back of an electronic device twice in a row, the electronic device can trigger the screenshot function. Or, if you tap the screen of an electronic device twice in a row, the electronic device can trigger the screenshot function.

[0022] In this way, by tapping an electronic device, a function can be triggered to be turned on or off, which can greatly facilitate users to control electronic devices and realize the diversification of triggering methods for the same function. The current method of turning on or off a function by tapping an electronic device is based on sound recognition or pressure sensors. Some electronic devices can recognize the sound of tapping an electronic device, so that the tapping operation is recognized by the sound generated by tapping the electronic device when tapping the electronic device, and then the corresponding function is triggered. Some electronic devices can also detect that the pressure meets the preset conditions through a pressure sensor when tapping the electronic device, recognize the corresponding tapping operation and trigger the corresponding function. In order to improve the accuracy of electronic devices in identifying tapping operations, other devices can also be combined to determine whether there is a tapping operation from more dimensional information, such as sampling data collected by a gyroscope sensor. However, the method based on sound recognition will affect the judgment of the electronic device on the tapping operation when the ambient sound is noisy. There are also a large number of misjudgment scenarios for the recognition of tapping operations based on pressure sensors. For example, when a user is walking with an electronic device in his hand, the contact of the finger on the electronic device caused by walking will also be recognized as a tapping operation, resulting in the wrong triggering of the opening or closing of a function.

[0023] The inventor discovered during research on related data processing methods that the current research direction is to improve the accuracy of electronic devices in recognizing tapping operations, so as to improve the correctness of triggering a certain function through tapping operations and enhance user experience.

[0024] Therefore, the inventors proposed the data processing method, device, electronic device and storage medium in the present application. First, the data to be processed within a preset time window is obtained, and the data to be processed is the linear acceleration information corresponding to the tapping operation acting on the electronic device, and then the data to be processed is subjected to peak detection processing to obtain target data, and the target data is input into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, after obtaining the data to be processed, the data to be processed is first subjected to peak detection processing to obtain more standard target data, and then the target data is input into the recognition model, which can improve the accuracy of the model in recognizing the tapping operation.

[0025] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0026] See also Figure 1 , a data processing method provided in an embodiment of the present application is applied to an electronic device, the method comprising:

[0027] Step S110: Acquire the data to be processed within a preset time window, where the data to be processed is linear acceleration information corresponding to the tapping operation acting on the electronic device.

[0028] In an embodiment of the present application, the preset time window is a preset time length for obtaining the data to be processed. Exemplarily, the preset time window can be set to 1s, that is, the data to be processed within 1s is obtained. The data to be processed can be the linear acceleration information corresponding to the tapping operation acting on the electronic device obtained by the sensor set in the electronic device. Among them, the sensor set in the electronic device can be a linear accelerometer or an acceleration sensor. In the case where the sensor is an acceleration sensor, the acceleration information collected by the acceleration sensor can be filtered and the filtered data is used as the data to be processed. Among them, filtering the acceleration information collected by the acceleration sensor refers to filtering the gravity acceleration in the acceleration information.

[0029] As a method, the data to be processed within the preset time window can be the data to be processed obtained from all the data collected by the electronic device. Among them, all the data collected by the electronic device refers to the data collected from the start of the data collection to the end of the data collection process of the electronic device, that is, when the electronic device turns on the data collection function, it will obtain the linear acceleration information of the electronic device according to a certain sampling frequency. For example, the sampling frequency can be 200hz, that is, one frame of linear acceleration information is obtained every 50ms. The sampling frequency of the electronic device to obtain linear acceleration information can be adjusted according to actual conditions. For example, the stronger the processing capability of the electronic device, the greater the sampling frequency can be. It should not constitute a limitation on the implementation of this application.

[0030] Optionally, the electronic device may also acquire the linear acceleration of the electronic device at a certain sampling frame rate. Exemplarily, the sampling frame rate may be 200 frames / s, that is, 200 frames of linear acceleration information are collected per second.

[0031] In the embodiment of the present application, the timing when the electronic device obtains linear acceleration information may include but is not limited to the following timings: after the electronic device is turned on, the linear acceleration information can be continuously obtained; after the electronic device is turned on, when it is detected that the switch controls corresponding to the tapping types (including double-click operations or triple-click operations, etc.) in the setting item for tapping the specified position are all turned on, the linear acceleration information can be continuously obtained. Among them, the setting item for tapping the specified position can be understood as an interface for setting the collection of linear acceleration information corresponding to the tapping operation at the specified position.

[0032] Further, in the embodiment of the present application, the linear acceleration information may include the linear acceleration of the electronic device in three axes, that is, the linear acceleration information may include the linear acceleration signal of the electronic device in the X-axis, the linear acceleration signal of the Y-axis, and the linear acceleration signal of the Z-axis. Among them, the X-axis, the Y-axis, and the Z-axis may be collectively referred to as three axes.

[0033] For example, an exemplary schematic diagram of three axes in an electronic device can be as follows: Figure 2 As shown, the three axes are the aforementioned X-axis, Y-axis and Z-axis. Figure 2 As can be seen in FIG. 1 , the X axis may be an axis parallel to the first side (wide side) of the electronic device, and the Y axis may be an axis parallel to the second side (long side) of the electronic device. The Z axis may be an axis pointing vertically from the back of the electronic device to the screen. The three axes intersect at point O, which may be the geometric center of the electronic device.

[0034] The tapping operation on the electronic device in the embodiment of the present application may refer to a tapping operation on the back of the electronic device, or may refer to a tapping operation on the screen of the electronic device, or may refer to a tapping operation on the side (left side (e.g., Figure 2 The side corresponding to the second side in), the right side (such as, Figure 2 The second side in the middle), the upper side (such as Figure 2 ) and the lower edge (e.g., Figure 2 The tapping operation of the edge corresponding to the first edge in the figure is not specifically limited here.

[0035] When the tapping operation applied to the electronic device is a tapping operation applied to different positions, the values ​​of the three-axis linear acceleration included in the acquired data to be processed may be different. Specifically, when the tapping operation applied to the electronic device is a tapping operation applied to the back or screen of the electronic device, the value of the Z-axis linear acceleration in the three-axis linear acceleration included in the data to be processed will change more obviously; when the tapping operation applied to the electronic device is a tapping operation applied to the left or right side of the electronic device, the value of the X-axis linear acceleration in the three-axis linear acceleration included in the data to be processed will change more obviously; when the tapping operation applied to the electronic device is a tapping operation applied to the top or bottom of the electronic device, the value of the Y-axis linear acceleration in the three-axis linear acceleration included in the data to be processed will change more obviously.

[0036] In the embodiment of the present application, if the data to be processed is 200 frames of linear acceleration information collected within 1 second, the data to be processed can be represented as a 3*200 value, where 200 refers to the 200 frames of linear acceleration information collected in 1 second, and 3 refers to the fact that each frame of linear acceleration information contains 3 dimensions, namely the value of linear acceleration in the X-axis direction, the value of linear acceleration in the Y-axis direction, and the value of linear acceleration in the Z-axis direction. For example, the schematic diagram of 200 frames of linear acceleration information collected within 1 second can be as follows: Figure 3 As shown, Figure 3 The horizontal axis represents the frame, and the vertical axis represents the value of linear acceleration.

[0037] As a method, a buffer can be set in the electronic device, and when the electronic device collects linear acceleration information, the collected linear acceleration information can be cached in the buffer. When it is necessary to obtain the data to be processed within a preset time window, the data to be processed can be obtained from the buffer.

[0038] As another method, the collected linear acceleration information can also be stored in a preset storage area or a cloud server, and when the data to be processed needs to be obtained, the corresponding data to be processed can be obtained from the preset storage area or the cloud server. When the collected linear acceleration information is stored in the preset storage area or the cloud server, the linear acceleration can be stored according to the position where the tapping operation acts on the electronic device.

[0039] Step S120: performing peak detection processing on the data to be processed to obtain target data.

[0040] In the embodiment of the present application, peak detection processing of the data to be processed refers to finding the peak of the suspected tapping operation (single-click operation, double-click operation or multi-click operation) in the data to be processed, and then placing the peak in the middle of the data. Wherein, in the case of different tapping types of the tapping operation, the number of peaks to be determined is different. Specifically, when the tapping operation is a single-click operation, peak detection processing of the data to be processed refers to finding a peak of the suspected single-click operation in the data to be processed, and then placing the peak in the middle of the data; when the tapping operation is a double-click operation, peak detection processing of the data to be processed refers to finding two peaks of the suspected double-click operation in the data to be processed, and then placing the two peaks in the middle of the data; when the tapping operation is a multi-click operation, peak detection processing of the data to be processed refers to finding multiple peaks of the suspected multi-click operation in the data to be processed, and then placing the multiple peaks in the middle of the data.

[0041] When the data to be processed is obtained in the above manner, the peak of the suspected tapping operation in the data to be processed can be found, and the determined peak of the suspected tapping operation can be placed in the middle of the data to be processed.

[0042] Step S130: input the target data into a pre-trained recognition model, and obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0043] In an embodiment of the present application, the tapping type may include operations of tapping the left side of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the left side of an electronic device; it may also include operations of tapping the right side of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the right side of an electronic device; it may also include operations of tapping the top of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the top of an electronic device; it may also include operations of tapping the bottom of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the bottom of an electronic device; it may also include operations of tapping the back of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the back of an electronic device; and it may also include operations of tapping the screen of an electronic device multiple times, such as single-clicking, double-clicking, or tripling on the screen of an electronic device, etc., and no specific limitations are made here. For any tapping operation of multiple tapping of an electronic device (hereinafter referred to as tapping operation), the linear acceleration of the electronic device in various directions (generally three axes) will change. The linear acceleration information obtained by the electronic device when tapping the electronic device has a certain regularity. By analyzing the linear acceleration information, the operation of tapping the electronic device once can be identified. If the operation of tapping the electronic device Q times is identified in the linear acceleration information collected within a preset time, it can be regarded as the operation of multiple tapping of the electronic device. For example, when Q is 2, it is a double-click operation, and when Q is 3, it is a triple-click operation.

[0044] As a way, different tapping types can be used to trigger different functions. For example, a single tap on the back of an electronic device can be used to trigger function A, a double tap on the back of an electronic device can be used to trigger function B, and multiple taps on the back of an electronic device can be used to trigger function C, etc.

[0045] In the embodiment of the present application, the function corresponding to each tapping type can be set through the user setting interface. During the setting, each tapping type can correspond to one function or multiple functions, which is not specifically limited here.

[0046] In an embodiment of the present application, after peak detection is performed on the data to be processed within a preset time window and target data is obtained, the target data can be input into a pre-trained recognition model, and the recognition model outputs the knock type corresponding to the data to be processed, so that the corresponding function can be triggered based on the knock type. At this time, the preset time window can be understood as a knock type judgment cycle. Among them, the pre-trained recognition model can be a neural network model, which is used to identify the knock type of the input target data.

[0047] The present application provides a data processing method, which first obtains the data to be processed within a preset time window, wherein the data to be processed is the linear acceleration information corresponding to the tapping operation acting on the electronic device, and then performs peak detection processing on the data to be processed to obtain target data, and inputs the target data into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, after obtaining the data to be processed, the data to be processed is first subjected to peak detection processing to obtain more standard target data, and then the target data is input into the recognition model, which can improve the accuracy of the model in recognizing the tapping operation.

[0048] See also Figure 4 , a data processing method provided in an embodiment of the present application is applied to an electronic device, the method comprising:

[0049] Step S210: Acquire the data to be processed within a preset time window, where the data to be processed is linear acceleration information corresponding to the tapping operation acting on the electronic device.

[0050] In the embodiment of the present application, when obtaining the data to be processed in the preset time window, the data to be processed in the preset time window can be obtained once every preset time interval in the form of a sliding window. Figure 5 As shown, Figure 5 The black frame in the figure represents the preset time window. Figure 5 It can be seen that the preset time window will move back a little bit at every preset time interval.

[0051] Step S220: If it is determined that the data to be processed meets the preset condition, a peak detection operation is performed on the data to be processed to obtain target data.

[0052] In an embodiment of the present application, the preset condition is a pre-set condition for filtering the data to be processed. When the data to be processed meets the preset condition, the next operation can be performed on the data to be processed, that is, a peak detection operation is performed on the data to be processed; when the data to be processed does not meet the preset condition, no processing is performed on the data to be processed. By filtering the data to be processed under the preset condition, the electronic device does not need to run the model in real time, thereby reducing the power consumption of the electronic device. Among them, the electronic device does not need to run the model in real time means that when the data to be processed does not meet the preset condition, the data to be processed does not need to be processed as target data and sent to the recognition model, that is, the model does not need to be run; only when the data to be processed meets the preset condition, the data to be processed will be processed as target data and sent to the recognition model, that is, the model needs to be run.

[0053] As one method, the data to be processed includes multiple frames of data; if it is determined that the data to be processed meets a preset condition, a peak detection operation is performed on the data to be processed to obtain target data, including: obtaining a first linear acceleration corresponding to the data to be processed from the multiple frames of data, wherein the first linear acceleration is the maximum linear acceleration in the direction perpendicular to the action position of the tapping operation in the multiple frames of data; based on the first linear acceleration, if it is determined that the data to be processed meets the preset condition, a peak detection operation is performed on the data to be processed to obtain the target data.

[0054] Among them, multi-frame data refers to multi-frame linear acceleration information collected within a preset time window. The action position may include one of the back, screen, left side, right side, top and bottom of the electronic device. The action position of the tapping operation is different, and the direction of the action position perpendicular to the tapping operation is different. Specifically, if the action position of the tapping operation is the back or screen of the electronic device, the direction of the action position perpendicular to the tapping operation refers to the Z-axis direction; if the action position of the tapping operation is the top or bottom of the electronic device, the direction of the action position perpendicular to the tapping operation refers to the Y-axis direction; if the action position of the tapping operation is the left or right side of the electronic device, the direction of the action position perpendicular to the tapping operation refers to the X-axis direction.

[0055] Furthermore, if the tapping operation is performed on the back or screen of the electronic device, then the first linear acceleration is the maximum linear acceleration in the Z-axis direction in the multiple frames of data; if the tapping operation is performed on the top or bottom of the electronic device, then the first linear acceleration is the maximum linear acceleration in the Y-axis direction in the multiple frames of data; if the tapping operation is performed on the left or right side of the electronic device, then the first linear acceleration is the maximum linear acceleration in the X-axis direction in the multiple frames of data.

[0056] That is, when the tapping operation is applied to the back or screen of the electronic device, the magnitude of the Z-axis linear acceleration in each frame of data in multiple frames of data can be compared, so that the maximum Z-axis linear acceleration can be determined as the first linear acceleration; when the tapping operation is applied to the top or bottom of the electronic device, the magnitude of the Y-axis linear acceleration in each frame of data in multiple frames of data can be compared, so that the maximum Y-axis linear acceleration can be determined as the first linear acceleration; when the tapping operation is applied to the left or right side of the electronic device, the magnitude of the X-axis linear acceleration in each frame of data in multiple frames of data can be compared, so that the maximum X-axis linear acceleration can be determined as the first linear acceleration.

[0057] Wherein, based on the first linear acceleration, if it is determined that the data to be processed meets the preset condition, a peak detection operation is performed on the data to be processed to obtain target data, including: if the first linear acceleration is greater than a first threshold and less than a second threshold, it is determined that the data to be processed meets the preset condition, wherein the first threshold is less than the second threshold; a peak detection operation is performed on the data to be processed to obtain target data.

[0058] In the embodiment of the present application, the preset condition can be set as the first linear acceleration being greater than the first threshold and less than the second preset. The first threshold and the second threshold are pre-set linear acceleration values ​​that indicate that the operation on the electronic device may be a tapping operation. For example, the first threshold can be set to 5m / s 2 , the second threshold can be set to 20m / s 2 , no specific limitation is given here.

[0059] After obtaining the first linear acceleration, the first linear acceleration is compared with the first threshold value and the second threshold value which are set in advance. If the first linear acceleration is greater than the first threshold value and less than the second threshold value, it can be determined that the data to be processed meets the preset condition; if the first linear acceleration is less than or equal to the first threshold value, it can be determined that the data to be processed does not meet the preset condition. Similarly, if the first linear acceleration is greater than or equal to the second threshold value, it can also be determined that the data to be processed does not meet the preset condition. Among them, the first threshold value and the second threshold value can be set according to actual needs and are not specifically limited here.

[0060] For example, if the first threshold is set to 5 m / s 2 , the second threshold is set to 20m / s 2 After obtaining the first linear acceleration, the first linear acceleration is compared with the first threshold and the second threshold respectively. If the first linear acceleration is greater than 5m / s 2 And less than 20m / s 2 , it can be determined that the data to be processed meets the preset condition. Otherwise, if the first linear acceleration is less than or equal to 5m / s 2 , or the first linear acceleration is greater than or equal to 20m / s 2 , it can be determined that the data to be processed meets the preset conditions. Exemplarily, Figure 3 The first linear acceleration of the data to be processed is 11 m / s 2 , 11m / s 2 More than 5m / s 2 And less than 20m / s 2 , we can determine Figure 2 The data to be processed shown meets the preset conditions.

[0061] The smaller the first threshold is, the more sensitive the algorithm is. It can recognize a light tap on an electronic device. The larger the first threshold is, the slower the algorithm is. It needs a heavier tap to be recognized. The second threshold is set based on the principle that when a person taps an electronic device with his finger, the linear acceleration generated is generally 5m / s 2 -20m / s 2 Between, more than 20m / s 2 In the case of a sudden strong external force or impact on the electronic device, it is likely that the electronic device was suddenly hit by a strong external force or impact, and it is unlikely to be a human knock. Therefore, this situation can be filtered out, which can also reduce the power consumption of the electronic device and reduce misidentification.

[0062] Furthermore, the peak detection operation is performed on the data to be processed to obtain target data, including: obtaining a second linear acceleration corresponding to the data to be processed, the second linear acceleration being a linear acceleration in a plurality of frames of data included in the data to be processed, the acquisition time interval between the second linear acceleration and the first linear acceleration being greater than the first time interval and less than the second time interval, the second linear acceleration being less than the first linear acceleration; adjusting the position of the preset time window based on the acquisition times corresponding to the first linear acceleration and the second linear acceleration, so that the first linear acceleration and the second linear acceleration are in the middle position of the adjusted preset time window; and taking the data to be processed within the adjusted preset time window as target data.

[0063] The number of the second linear accelerations may be one or more. When the number of the second linear accelerations is one, it can be determined whether the tapping operation is a double-click operation; when the number of the second linear accelerations is more than one, it can be determined whether the tapping operation is a multi-tap operation. Similarly, the second linear acceleration is also a linear acceleration in a direction perpendicular to the action position of the tapping operation.

[0064] The first time interval is a preset time interval used to characterize that a tapping operation has occurred; the second time interval is a preset time interval used to characterize that the first linear acceleration and the second linear acceleration belong to the same tapping operation. For example, the first time interval can be set to 0.2s, and the second time interval can be set to 1s.

[0065] After determining the first linear acceleration, the acquisition time of the first linear acceleration can be determined, and then based on the acquisition time of the first linear acceleration, the second linear acceleration is determined from a plurality of linear acceleration information whose time interval with the acquisition time of the first linear acceleration is greater than the first interval time and less than the second interval time. Wherein, in the case where the tapping operation to be identified is a double-click operation, the number of second linear accelerations determined from the aforementioned plurality of linear acceleration information is 1, that is, the second linear acceleration is the maximum linear acceleration in the aforementioned plurality of linear acceleration information; in the case where the tapping operation to be identified is a multi-tap operation, the number of second linear accelerations determined from the aforementioned plurality of linear acceleration information is at least 2, that is, the second linear acceleration is at least 2 linear accelerations in the aforementioned plurality of linear acceleration information that are arranged in the front designated position (arranged in order of linear acceleration from large to small). Wherein, when the second linear acceleration is at least 2 linear accelerations in the aforementioned plurality of linear acceleration information that are arranged in the front designated position, the time interval between the plurality of second linear accelerations also satisfies the requirement of being greater than the first time interval and less than the second time interval.

[0066] After determining the first linear acceleration and the second linear acceleration from the data to be processed in the aforementioned manner, the positions of the first linear acceleration and the second linear acceleration in the preset time window can be determined. If it is determined that the first linear acceleration and the second linear acceleration are in the middle position of the preset time window, the preset time window may not be adjusted; if the first linear acceleration and the second linear acceleration are not in the middle position of the preset time window, the preset time window needs to be adjusted.

[0067] The first linear acceleration and the second linear acceleration are in the middle of the preset time window, which means that the time interval between the acquisition time of the first linear acceleration and the start time or end time of the preset time window is the same as the time interval between the acquisition time of the second linear acceleration and the end time or start time of the preset time window. Of course, this is the case when there is only one second linear acceleration. For example, Figure 6 As shown, in Figure 6 The black frame indicates the preset time window. Figure 6 The peak point of the left border of the black frame (the start time of the preset time window) can be understood as the determined first linear acceleration. Figure 6 The peak point of the right border of the black frame shown (the end time of the preset time window) can be understood as the determined second linear acceleration. At this time, the distance between the first linear acceleration and the left border is the same as the distance between the second linear acceleration and the right border, that is, the first linear acceleration and the second linear acceleration are in the middle position of the preset time window.

[0068] In the case where there are multiple determined second linear accelerations, the first linear acceleration and the second linear acceleration are in the middle of the preset time window, which may mean that the time interval between the acquisition time of one second linear acceleration and the start time or end time of the preset time window is the same as the time interval between the acquisition time of the other second linear acceleration and the end time or start time of the preset time window. Of course, this is the case where the determined first linear acceleration is between multiple determined second linear accelerations.

[0069] In the case where there are multiple determined second linear accelerations, the first linear acceleration and the second linear acceleration are in the middle of the preset time window, which may also refer to the time interval between the acquisition time of the first linear acceleration and the start time or end time of the preset time window, which is the same as the time interval between the acquisition time of the second linear acceleration and the end time or start time of the preset time window. In this case, the first linear acceleration is not between the multiple determined second linear accelerations, and further, the aforementioned second linear acceleration may refer to the second linear acceleration that is closest to the start time or end time of the preset time window among the multiple determined second linear accelerations.

[0070] Furthermore, the adjusting the position of the preset time window based on the acquisition time corresponding to each of the first linear acceleration and the second linear acceleration includes: if it is determined based on the acquisition time corresponding to each of the first linear acceleration and the second linear acceleration that the first linear acceleration and the second linear acceleration are not in the middle position of the preset time window, obtaining the to-be-processed data of the previous time window and the to-be-processed data of the subsequent time window of the preset time window; adjusting the position of the preset time window based on the to-be-processed data of the previous time window and the to-be-processed data of the subsequent time window.

[0071] When it is determined through the above method that the first linear acceleration and the second linear acceleration are not in the middle of the preset time window, the preset time window can be translated (forward or backward) so that the first linear acceleration and the second linear acceleration can be in the middle of the preset time window. At this time, when it is necessary to translate the preset time window, it is necessary to pay attention to the pending data of the previous time window and the pending data of the next time window; if it is necessary to translate the preset time window forward, it is necessary to obtain part of the pending data from the pending data of the previous time window; if it is necessary to translate the preset time window backward, it is necessary to obtain part of the pending data from the pending data of the next time window. Exemplarily, it can be based on Figure 5 The last schematic diagram and Figure 6 From the schematic diagram shown, Figure 5The preset time window in the last schematic diagram is translated forward by about 50 frames of data, that is, 50 frames of linear acceleration information are obtained from the data to be processed within the previous preset time window.

[0072] Step S230: input the target data into a pre-trained recognition model, and obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0073] The present application provides a data processing method, firstly obtaining the data to be processed within a preset time window, wherein the data to be processed is the linear acceleration information corresponding to the tapping operation acting on the electronic device, and if it is determined that the data to be processed meets the preset conditions, performing a peak detection operation on the data to be processed to obtain target data, and then inputting the target data into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, when it is determined that the data to be processed meets the preset conditions, a peak detection operation is further performed on the data to be processed, so that more standard target data can be obtained, thereby inputting the target data into the recognition model for tapping type recognition, which can improve the recognition accuracy.

[0074] See also Figure 7 , a data processing method provided in an embodiment of the present application is applied to an electronic device, the method comprising:

[0075] Step S310: acquiring the data to be processed within a preset time window at every preset time interval.

[0076] In an embodiment of the present application, the preset time interval is a preset time interval for obtaining the data to be processed, that is, the data to be processed is obtained in a sliding window manner. Exemplarily, the preset time interval can be 0.1s. That is, after obtaining the data to be processed at the current moment, wait for the preset time interval and obtain the data to be processed again. Among them, obtaining the data to be processed within a preset time window at every preset time interval can be understood as different data to be processed within the preset time window obtained at different moments. Exemplarily, if the data to be processed within the preset time window currently obtained is the data to be processed within 0s~1s, after waiting for 0.1s, the data to be processed within the preset time window obtained is the data to be processed within 0.1s~1.1s, and then wait for 0.1s, and the data to be processed within the preset time window obtained is the data to be processed within 0.2s~1.2s, and so on.

[0077] Step S320: performing peak detection processing on the data to be processed to obtain target data.

[0078] Step S330: input the target data into a pre-trained recognition model, and obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0079] The present application provides a data processing method, which first obtains the data to be processed within a preset time window at a preset time interval, then performs peak detection processing on the data to be processed to obtain target data, and then inputs the target data into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, after obtaining the data to be processed, the data to be processed is first subjected to peak detection processing to obtain more standard target data, and then the target data is input into the recognition model, which can improve the accuracy of the model in identifying the tapping operation.

[0080] See also Figure 8 , an embodiment of the present application provides a data processing device 400, the device 400 comprising:

[0081] The data acquisition unit 410 is used to acquire the data to be processed within a preset time window, where the data to be processed is linear acceleration information corresponding to the tapping operation acting on the electronic device.

[0082] As a method, the data acquisition unit 410 is specifically configured to acquire the to-be-processed data within a preset time window once every preset time interval.

[0083] The processing unit 420 is used to perform peak detection processing on the data to be processed to obtain target data.

[0084] As a method, the processing unit 420 is specifically configured to perform a peak detection operation on the data to be processed to obtain target data if it is determined that the data to be processed meets a preset condition.

[0085] Furthermore, the processing unit 420 is specifically used to obtain a first linear acceleration corresponding to the data to be processed from the multiple frames of data, wherein the first linear acceleration is the maximum linear acceleration in the direction perpendicular to the action position of the tapping operation in the multiple frames of data; based on the first linear acceleration, if it is determined that the data to be processed meets the preset conditions, a peak detection operation is performed on the data to be processed to obtain target data.

[0086] Furthermore, the processing unit 420 is specifically used to determine that the data to be processed meets the preset condition if the first linear acceleration is greater than a first threshold and less than a second threshold, wherein the first threshold is less than the second threshold; and perform a peak detection operation on the data to be processed to obtain target data.

[0087] Furthermore, the processing unit 420 is specifically used to obtain a second linear acceleration corresponding to the data to be processed, where the second linear acceleration is a linear acceleration in a plurality of frames of data included in the data to be processed, wherein the acquisition time interval between the second linear acceleration and the first linear acceleration is greater than the first time interval and less than the second time interval, and the second linear acceleration is less than the first linear acceleration; based on the acquisition time corresponding to each of the first linear acceleration and the second linear acceleration, the position of the preset time window is adjusted so that the first linear acceleration and the second linear acceleration are in the middle position of the adjusted preset time window; and the data to be processed within the adjusted preset time window is used as the target data.

[0088] Furthermore, the processing unit 420 is specifically used to obtain the to-be-processed data of the previous time window and the to-be-processed data of the subsequent time window of the preset time window if it is determined that the first linear acceleration and the second linear acceleration are not in the middle position of the preset time window based on the acquisition time corresponding to each of the first linear acceleration and the second linear acceleration; and adjust the position of the preset time window based on the to-be-processed data of the previous time window and the to-be-processed data of the subsequent time window.

[0089] The recognition unit 430 is used to input the target data into a pre-trained recognition model, and obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

[0090] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0091] The following will be combined Fig. 9 An electronic device provided by the present application is described.

[0092] See also Fig. 9 Based on the above data processing method and device, the embodiment of the present application also provides another electronic device 800 that can execute the above data processing method. The electronic device 800 includes one or more (only one is shown in the figure) processors 802, a memory 804 and a network module 806 that are coupled to each other. Among them, the memory 804 stores a program that can execute the content of the above embodiments, and the processor 802 can execute the program stored in the memory 804.

[0093] Among them, the processor 802 may include one or more processing cores. The processor 802 uses various interfaces and lines to connect various parts of the entire electronic device 800, and executes various functions and processes data of the electronic device 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 804, and calling data stored in the memory 804. Optionally, the processor 802 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 802 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 802, but may be implemented separately through a communication chip.

[0094] The memory 804 may include a random access memory (RAM) or a read-only memory (ROM). The memory 804 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 804 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 800 during use.

[0095] The network module 806 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as communicating with electronic devices. The network module 806 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. The network module 806 may communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices via wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. For example, the network module 806 may exchange information with a base station.

[0096] Please refer to Fig.10 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 900 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0097] The computer-readable storage medium 900 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 900 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 900 has storage space for program code 910 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 910 can be compressed, for example, in an appropriate form.

[0098] The present application provides a data processing method, device, electronic device and storage medium, which first obtains the data to be processed within a preset time window, wherein the data to be processed is the linear acceleration information corresponding to the tapping operation acting on the electronic device, and then performs peak detection processing on the data to be processed to obtain target data, and inputs the target data into a pre-trained recognition model to obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model. Through the above method, after obtaining the data to be processed, the data to be processed is first subjected to peak detection processing to obtain more standard target data, and then the target data is input into the recognition model, which can improve the accuracy of the model in recognizing the tapping operation.

[0099] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A data processing method, characterized in that: The method comprises: Acquire data to be processed within a preset time window, where the data to be processed is linear acceleration information corresponding to a tapping operation acting on the electronic device; Performing peak detection processing on the data to be processed to obtain target data; The target data is input into a pre-trained recognition model, and the tapping type of the tapping operation corresponding to the target data output by the recognition model is obtained.

2. The method according to claim 1, characterized in that: The step of performing peak detection processing on the data to be processed to obtain target data includes: If it is determined that the data to be processed meets the preset condition, a peak detection operation is performed on the data to be processed to obtain target data.

3. The method according to claim 2, characterized in that The data to be processed includes multiple frames of data; if it is determined that the data to be processed meets a preset condition, a peak detection operation is performed on the data to be processed to obtain target data, including: Acquire a first linear acceleration corresponding to the data to be processed from the multiple frames of data, wherein the first linear acceleration is a maximum linear acceleration in a direction perpendicular to the action position of the tapping operation in the multiple frames of data; Based on the first linear acceleration, if it is determined that the data to be processed meets the preset condition, a peak detection operation is performed on the data to be processed to obtain target data.

4. The method according to claim 3, characterized in that The step of performing a peak detection operation on the data to be processed to obtain target data based on the first linear acceleration, if it is determined that the data to be processed meets the preset condition, includes: If the first linear acceleration is greater than a first threshold and less than a second threshold, determining that the to-be-processed condition satisfies the preset condition, wherein the first threshold is less than the second threshold; A peak detection operation is performed on the data to be processed to obtain target data.

5. The method according to claim 3 or 4, characterized in that: The step of performing a peak detection operation on the data to be processed to obtain target data includes: Acquire a second linear acceleration corresponding to the data to be processed, where the second linear acceleration is a linear acceleration whose acquisition time interval with the first linear acceleration is greater than the first time interval and less than the second time interval in multiple frames of data included in the data to be processed, and the second linear acceleration is less than the first linear acceleration; Based on the acquisition times corresponding to the first linear acceleration and the second linear acceleration, respectively, adjusting the position of the preset time window so that the first linear acceleration and the second linear acceleration are located in the middle position of the adjusted preset time window; The data to be processed within the adjusted preset time window is used as the target data.

6. The method according to claim 5, characterized in that The adjusting the position of the preset time window based on the acquisition time corresponding to each of the first linear acceleration and the second linear acceleration includes: If it is determined that the first linear acceleration and the second linear acceleration are not in the middle of the preset time window based on the acquisition times corresponding to the first linear acceleration and the second linear acceleration, the to-be-processed data of the previous time window and the to-be-processed data of the next time window of the preset time window are acquired; Based on the data to be processed in the previous time window and the data to be processed in the next time window, the position of the preset time window is adjusted.

7. The method according to claim 1, characterized in that The step of obtaining the data to be processed within a preset time window includes: At every preset time interval, the data to be processed within the preset time window is obtained.

8. A data processing device, characterized in that: The device comprises: A data acquisition unit, used to acquire data to be processed within a preset time window, wherein the data to be processed is linear acceleration information corresponding to a tapping operation acting on the electronic device; A processing unit, used for performing peak detection processing on the data to be processed to obtain target data; The recognition unit is used to input the target data into a pre-trained recognition model, and obtain the tapping type of the tapping operation corresponding to the target data output by the recognition model.

9. An electronic device, characterized in that: The method comprises one or more processors; one or more programs are stored in the memory and configured to execute the method according to any one of claims 1 to 7 by the one or more processors.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 7 is executed.