Data acquisition method and device, electronic equipment and storage medium
By using maximum point detection technology in data acquisition, the acceleration data within the preset time period is intercepted, which solves the problem of insufficient accuracy in tapping data acquisition in the existing technology, and improves the quality of data acquisition and training data.
Patent Information
- Application Number
- CN202310681421.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-12-10
AI Technical Summary
The existing knock data acquisition technology has shortcomings in terms of accuracy, making it difficult to effectively train the knock detection algorithm, affecting the performance of equipment control.
By responding to the data acquisition command, the tapping operation position and corresponding acceleration data within the preset time period are obtained, and the specified time data containing the maximum value point is intercepted from it as the target data, so as to realize peak detection based on the maximum value point, Improve the accuracy of data collection.
It improves the accuracy of tap data acquisition and the reliability of training data, and enhances the accuracy of tap detection algorithm.
Smart Images

Figure CN119105688A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data acquisition technology, and more specifically, to a data acquisition method, device, electronic device, and storage medium. Background Art
[0002] With the advancement of technology, terminal input methods are no longer limited to keystrokes, and an increasing number of sensors are being incorporated into the control devices of smart terminals. Tap control is an emerging human-computer interaction method that converts user tapping actions into control signals. It is widely used in products such as Bluetooth headsets, smartwatches, keyboards, and game consoles. The tap detection algorithms that implement tap control require extensive training data to detect tapping operations and implement device control. However, the accuracy of existing tap data collection needs to be improved. Summary of the Invention
[0003] This application proposes a data collection method, device, electronic device and storage medium to improve the above-mentioned problems.
[0004] In a first aspect, an embodiment of the present application provides a data acquisition method, which is applied to an electronic device, and the method includes: in response to a data acquisition instruction, obtaining a tapping position of a specified tapping operation acting on the electronic device within a preset time period; obtaining acceleration data corresponding to the tapping position; obtaining acceleration data of a specified time length from the acceleration data as target data, and the target data includes at least one maximum point.
[0005] In a second aspect, an embodiment of the present application provides a data acquisition device that runs on an electronic device, the device comprising: a tapping position acquisition module for obtaining, in response to a data acquisition instruction, a tapping position of a specified tapping operation acting on the electronic device within a preset time period; an acceleration data acquisition module for obtaining acceleration data corresponding to the tapping position; and a data acquisition module for obtaining acceleration data of a specified duration from the acceleration data as target data, the target data including at least one maximum point.
[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; 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 method of the first aspect above.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, wherein the method of the first aspect described above is executed when the program code is run.
[0008] The present application provides a data collection method, device, electronic device, and storage medium. This method, in response to a data collection instruction, obtains a tapping location of a specified tapping operation on the electronic device within a preset time period; obtains acceleration data corresponding to the tapping location; and extracts acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum point. This method thereby enables the extraction of acceleration data of a specified duration from the tapping data of the preset time period based on peak detection of the maximum point as target data, thereby improving the accuracy of tapping data collection. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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 collection method provided by an embodiment of the present application is shown.
[0011] Figure 2 An example diagram of coordinate axes adapted to the tapping direction of an electronic device provided by an embodiment of the present application is shown.
[0012] Figure 3 A flow chart of a data collection method provided by another embodiment of the present application is shown.
[0013] Figure 4 A principle example diagram of a method for obtaining target data provided by an embodiment of the present application is shown.
[0014] Figure 5 Another principle example diagram of the method for obtaining target data provided by an embodiment of the present application is shown.
[0015] Figure 6 A flow chart of a data collection method provided in another embodiment of the present application is shown.
[0016] Figure 7 A flow chart of a data collection method provided in yet another embodiment of the present application is shown.
[0017] Figure 8 Shown Figure 7 Flowchart of the method for step S410 in FIG.
[0018] Figure 9 An example diagram of a data collection page provided in an embodiment of the present application is shown.
[0019] Figure 10 An example diagram showing the tapping direction of an electronic device in a folded state provided by an embodiment of the present application is shown.
[0020] Figure 11 A structural block diagram of a data acquisition device provided in an embodiment of the present application is shown.
[0021] Figure 12 The figure shows a structural block diagram of an electronic device provided in an embodiment of the present application.
[0022] Figure 13 A storage unit for storing or carrying program codes for implementing the data acquisition method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0024] With the advancement of technology, terminal input methods are no longer limited to keystrokes, and an increasing number of sensors are being incorporated into the control devices of smart terminals. Tap control is an emerging human-computer interaction method that converts user tapping actions into control signals. It is widely used in products such as Bluetooth headsets, smartwatches, keyboards, and game consoles. The tap detection algorithms that implement tap control require extensive training data to detect tapping operations and implement device control. However, the accuracy of existing tap data collection needs to be improved.
[0025] After extensive research, the inventors discovered that, by responding to a data collection instruction, they can obtain the tapping location of a specified tapping operation on the electronic device within a preset time period; then obtain acceleration data corresponding to the tapping location; and then extract acceleration data of a specified duration from the acceleration data as target data, where the target data includes at least one maximum point. This method achieves peak detection based on maximum points, extracting acceleration data of a specified duration from the tapping data of the preset time period as target data, thereby improving the accuracy of tapping data collection.
[0026] Therefore, in order to improve the above problems, the inventor proposed the data collection method, electronic device and computer-readable storage medium provided in this application, which can intercept acceleration data of a specified duration from the tapping data of a preset time period as target data based on peak detection of maximum points, thereby improving the accuracy of tapping data collection.
[0027] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0028] See also Figure 1 , shows a flow chart of a data collection method provided by an embodiment of the present application. This embodiment provides a data collection method that can be applied to an electronic device, and the electronic device can be a mobile phone, a computer, a tablet or a wearable electronic device. The specific type of electronic device may not be limited. In the embodiment of the present application, the screen of the electronic device can be a folding screen or a non-folding screen. For example, if the electronic device is a mobile phone, then the electronic device can be a straight-screen phone (that is, the screen is a non-folding screen), or the electronic device can be a folding-screen mobile phone (that is, the screen is a folding screen). The method includes:
[0029] Step S110: In response to a data collection instruction, obtaining a tapping position of the electronic device caused by a designated tapping operation within a preset time period.
[0030] In this embodiment, the data collection instruction is used to indicate the start of data collection. The specific type of the designated tapping operation may not be limited. For example, the designated tapping operation may be a single-click operation, a double-click operation, or a triple-click operation. In some other embodiments, the designated tapping operation may also refer to touch operations such as slapping. That is, the designated tapping operation is not limited to tapping-type operations, but may also be any other type of touch operation, or may be an operation such as air slapping. This embodiment is described by taking the example of the designated tapping operation referring to the tapping operation.
[0031] The specific value of the preset time period may not be limited, for example, the value of the preset time period may be 3 seconds. The user may tap various sides of the electronic device with a specified tapping operation, so that as an embodiment, the tapping position of the electronic device caused by the specified tapping operation within the preset time period may be obtained in response to the data collection instruction. The tapping position may be various sides of the electronic device, for example, taking the screen of the electronic device as the "front" as an example, the tapping position may be the top, bottom, left, right, front, or back of the electronic device.
[0032] In at least one embodiment, at least one designated tapping operation can be completed within a preset time period. The embodiment of the present application is described by taking the example that one designated tapping operation can be completed within a preset time period.
[0033] Step S120: Acquire acceleration data corresponding to the tapping position.
[0034] To facilitate data collection, coordinate axes adapted to the direction of tapping the electronic device can be divided. As a result, when obtaining acceleration data corresponding to the tapping location, the coordinate axis corresponding to the tapping location can be obtained first, and then the acceleration data corresponding to the coordinate axis can be obtained. The acceleration data corresponding to the coordinate axis can be understood as the acceleration generated on the coordinate axis. Different tapping locations correspond to different acceleration data.
[0035] See also Figure 2 , shows an example diagram of the coordinate axis adapted to the tapping direction of the electronic device provided by the embodiment of the present application. Figure 2 As shown, when the user taps from the back of the phone, the z-axis acceleration is generated, and the direction is positive. When the user taps from the front of the phone, the z-axis acceleration is generated, and the direction is negative. When the user taps from the left side of the phone, the x-axis acceleration is generated, and the direction is positive. When the user taps from the right side of the phone, the x-axis acceleration is generated, and the direction is negative. When the user taps from the top of the phone, the y-axis acceleration is generated, and the direction is negative. When the user taps from the bottom of the phone, the y-axis acceleration is generated, and the direction is positive. It should be noted that Figure 2 The directions of the coordinate axes shown are only examples. In actual implementation, users can adjust the directions of the coordinate axes according to actual needs or habits. For example, Figure 2 The x-axis, y-axis, and z-axis shown are arbitrarily interchanged.
[0036] In this embodiment, when the electronic device is a mobile phone, since the sensor of the mobile phone is usually set in the upper half of the mobile phone, when the user taps the mobile phone from the front, back, left or right of the mobile phone, the tapping position can be the upper half of the mobile phone (that is, for the front, back, left or right of the mobile phone, the tapping position is any position on the upper half of the mobile phone).
[0037] Step S130: Acquire acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum value point.
[0038] In this embodiment, after the acceleration data within the preset time period is obtained, in order to avoid subsequent data processing delays, acceleration data of a specified duration can be obtained from the acceleration data within the preset time period as target data, the specified duration being less than the duration of the preset time period, and the target data being used to train the tap detection algorithm. The acceleration data within the preset time period contains a plurality of peaks of different values, and the tapping position will produce a significant acceleration, that is, the tapping position corresponds to a peak with a significant value (which can be understood as a larger or maximum value). In order to train the tap detection algorithm with more accurate tap acceleration data, the intercepted target data needs to contain a peak with a significant value. Combined with the above discussion, since at least one specified tapping operation can be completed within the preset time period, the target data can include at least one maximum point, wherein a maximum point corresponds to a peak with a significant value.
[0039] In a specific embodiment, taking the case where the tapping operation is designated as a double-click operation and the preset time period is 3 seconds as an example (assuming that it takes 3 seconds for the user to complete a complete double-click operation), when responding to the data acquisition instruction, the user can double-click the phone from the back of the phone (i.e., the tapping position). At this time, two obvious accelerations will appear on the Z axis, and two obvious peaks will appear in the acceleration waveform corresponding to the Z axis. The frame interval between the two peaks can be greater than the specified value (for example, 50 frames). One second of acceleration data containing two obvious peaks can be intercepted from the 3 seconds of acceleration data as target data. The number of frames that can be sampled in one second is greater than the frame interval between the two peaks, so that target data including two maximum points can be obtained.
[0040] In other implementations, if the designated tapping operation is a single-click operation, the target data may include one maximum point; if the designated tapping operation is a double-click operation, the target data may include two maximum points.
[0041] Compared with directly using the acceleration data collected within a preset time period to train the tap detection algorithm, this embodiment can train the tap detection algorithm with more accurate acceleration data by intercepting acceleration data of a specified duration and including at least one maximum point from the acceleration data of the preset time period as target data. On the one hand, it improves the accuracy of data collection, and on the other hand, it improves the reliability of the training data source.
[0042] The data collection method provided in this embodiment obtains, in response to a data collection instruction, a tapping location of a specified tapping operation applied to the electronic device within a preset time period; obtains acceleration data corresponding to the tapping location; and extracts acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum point. This method allows for the extraction of acceleration data of a specified duration from the tapping data within the preset time period based on peak detection of the maximum point, thereby improving the accuracy of tapping data collection.
[0043] See also Figure 3 , shows a flow chart of a data collection method provided by another embodiment of the present application. This embodiment provides a data collection method that can be applied to an electronic device. The method includes:
[0044] Step S210: In response to a data collection instruction, obtaining a tapping position of the electronic device caused by a designated tapping operation within a preset time period.
[0045] The specific implementation of step S210 may refer to the relevant description of step S110 in the aforementioned embodiment, which will not be repeated here.
[0046] Step S220: Acquire acceleration data corresponding to the tapping position.
[0047] The specific implementation of step S220 may refer to the relevant description of step S120 in the aforementioned embodiment, which will not be repeated here.
[0048] Step S230: obtaining a maximum point set from the acceleration data, where the maximum point set includes a plurality of maximum points.
[0049] In this embodiment, the acceleration data within the preset time period includes multiple peaks, each of which corresponds to a maximum point (the definition of a maximum point: if for a certain frame, its value is greater than the previous frame and the next frame, then the point is a maximum point).
[0050] In the process of obtaining acceleration data of a specified duration as target data from acceleration data within a preset time period, each maximum point can be first obtained from the acceleration data within the preset time period to obtain a maximum point set, which includes multiple maximum points.
[0051] Step S240: sorting the multiple maximum value points.
[0052] As an implementation method, multiple maximum points can be sorted in order from large to small (or from small to large, the specific order is not limited) according to the numerical value of the maximum points, so that obvious peaks can be quickly obtained later (that is, the maximum point with the largest value is obtained).
[0053] Step S250: If the designated tapping operation is a double-click or a triple-click, obtain the first peak and the second peak from the sorted multiple maximum points, the maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the frame number interval between the first peak and the second peak is greater than the designated value.
[0054] As an embodiment, if the designated tap operation is a double-tap operation or a triple-tap operation, two peaks with obvious values can be obtained from the sorted multiple maximum value points, namely the first peak and the second peak. The maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the frame interval between the first peak and the second peak is greater than a specified value, which can be 50 frames as described in the above embodiment, or other values.
[0055] The maximum value corresponding to the first peak may be the maximum value among the sorted maximum value points, and the maximum value corresponding to the second peak may be the maximum value among the sorted maximum value points that is second only to the maximum value. It should be noted that the maximum value corresponding to the second peak may also be the maximum value among the sorted maximum value points that is smaller than the maximum value that is second only to the maximum value. For example, assuming that the values of multiple maximum points are sorted in descending order, the value of the first-ranked maximum point can be automatically used as the maximum value corresponding to the first peak, and then the second-ranked maximum point can be compared with the first-ranked maximum point. If the frame interval between the second-ranked maximum point and the first-ranked maximum point is greater than or equal to the specified value, the value of the second-ranked maximum point can be used as the maximum value corresponding to the second peak; and if the frame interval between the second-ranked maximum point and the first-ranked maximum point is less than the specified value, the third-ranked maximum point will continue to be compared with the first-ranked maximum point, and so on, until a maximum point is found whose frame interval with the first-ranked maximum point is greater than or equal to the specified value, and then the value of the maximum point can be used as the maximum value corresponding to the second peak.
[0056] Step S260: Acquire acceleration data including the first peak and the second peak within a specified time period as target data, wherein the target data includes at least one maximum value point.
[0057] In this embodiment, when selecting target data, acceleration data containing the first peak and the second peak within a specified time period may be obtained as target data. In this manner, the target data may include two maximum value points.
[0058] When the first and second peaks are obtained, the frame interval between the first and second peaks can be determined first, and then the corresponding target data acquisition method can be selected based on the determined frame interval. The frame interval between the first and second peaks can be determined by a program (such as a peak detection algorithm), by manual marking, or by a combination of program and manual methods (in this case, if the baseline marked by the program is inaccurate, manual correction can be performed).
[0059] As an implementation method, if the frame interval between the first peak and the second peak is greater than a specified value (for example, the aforementioned 50 frames) and less than the number of sampling frames corresponding to the specified duration (in this embodiment, the number of sampling frames corresponding to the specified duration is 400 frames), then the extreme point where the first peak is located and the extreme point where the second peak is located can be used as the baseline, and the frames can be moved in opposite directions at equal distances (or adaptive distances) (i.e., expanded at equal distances) to make the frame interval between the first peak and the second peak equal to the number of sampling frames corresponding to the specified duration. In this way, the acceleration data within the range of the sampling frame number corresponding to the specified duration can be obtained as the target data. The number of frames of the target data in this method is continuous.
[0060] For example, in a specific application scenario, see Figure 4 , shows a principle example diagram of a method for obtaining target data provided by an embodiment of the present application. Figure 4 As shown, assuming that the user taps the phone from the "back (i.e., back cover)" of the phone, the acceleration data of the Z axis can be generated. If 4 maximum points are detected from the acceleration data within the preset time period, namely A, B, C, and D, A, D, B, and C are obtained by arranging them in descending order according to the numerical values of the corresponding maximum points. After comparison, A is the maximum value corresponding to the first peak, and D is the maximum value corresponding to the second peak. The frame interval between A and D is 50<d<400. A vertical line can be marked as A1 at the peak position where A is located, and a vertical line can be marked as D1 at the peak position where D is located. With A1 and D1 as the baseline, the frames are expanded at equal distances on both sides. A1 moves to the position of A2, and D1 moves to the position of D2, so that the frame interval between A and D becomes d=400 (i.e., the final Figure 4 The frame interval between A2 and D2 shown is 400), so the 400 frames of acceleration data can be acquired as target data.
[0061] As another implementation method, if the frame interval between the first peak and the second peak is greater than the number of sampling frames corresponding to the specified duration (400 frames), then the extreme point where the first peak is located can be used as the baseline, and a first number of frames can be moved equidistantly in the opposite direction to obtain the first acceleration data. At the same time, the extreme point where the second peak is located can be used as the baseline, and a second number of frames can be moved equidistantly in the opposite direction to obtain the second acceleration data. The first acceleration data and the second acceleration data are then used together as the target data. The first number and the second number are equal. The number of frames of the target data in this method is discontinuous.
[0062] For example, in a specific application scenario, see Figure 5 , shows another principle example diagram of the method of obtaining target data provided by the embodiment of the present application. Figure 5 As shown, in Figure 4 Based on the example shown, if the frame interval d between A and D is greater than 400, a vertical line can be marked as A at the peak position of A and a vertical line can be marked as D at the peak position of D. A is used as the reference line and the two sides are moved 100 frames at equal distances. At the same time, D is used as the reference line and the two sides are moved 100 frames at equal distances. That is, Figure 5 The range A1A2 shown includes 200 frames of acceleration data, which is the first acceleration data; Figure 5 The D1D2 interval shown also includes 200 frames of acceleration data, which is the second acceleration data. In this way, the first acceleration data in the A1A2 interval and the second acceleration data in the D1D2 interval can be used as target data.
[0063] As another implementation, if the frame interval between the first and second peaks is less than a specified value (e.g., 50 frames as described above), the second peak will be acquired again until the frame interval between the acquired second peak and the first peak is greater than the specified value. If no second peak is acquired that satisfies the requirement that the frame interval between the first and second peaks is greater than the specified value, the data acquired this time may be discarded.
[0064] The data collection method provided in this embodiment obtains the tapping position of the electronic device caused by a specified tapping operation within a preset time period in response to a data collection instruction; obtains acceleration data corresponding to the tapping position; obtains a maximum point set from the acceleration data, wherein the maximum point set includes multiple maximum points; sorts the multiple maximum points; if the specified tapping operation is a double tap or a triple tap, obtains a first peak and a second peak from the sorted multiple maximum points, wherein the maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the frame interval between the first peak and the second peak is greater than a specified value; and obtains the acceleration data containing the first peak and the second peak within a specified time period as target data, wherein the target data includes at least one maximum point. Thus, through the above method, it is possible to intercept acceleration data of a specified time period from the tapping data of a preset time period based on peak detection of the maximum point as target data, thereby improving the accuracy of tapping data collection.
[0065] See also Figure 6 , shows a flow chart of a data collection method provided by another embodiment of the present application. This embodiment provides a data collection method that can be applied to an electronic device. The method includes:
[0066] Step S310: In response to a data collection instruction, obtaining a tapping position of the electronic device caused by a designated tapping operation within a preset time period.
[0067] The specific implementation of step S310 may refer to the relevant description of step S110 in the aforementioned embodiment, which will not be repeated here.
[0068] Step S320: Acquire acceleration data corresponding to the tapping position.
[0069] The specific implementation of step S320 may refer to the relevant description of step S120 in the aforementioned embodiment, which will not be repeated here.
[0070] Step S330: obtaining a maximum point set from the acceleration data, where the maximum point set includes a plurality of maximum points.
[0071] The specific implementation of step S330 may refer to the relevant description of step S230 in the aforementioned embodiment, which will not be repeated here.
[0072] Step S340: sorting the multiple maximum value points.
[0073] The specific implementation of step S340 may refer to the relevant description of step S240 in the aforementioned embodiment, which will not be repeated here.
[0074] In this embodiment, the type of the designated tapping operation can be obtained so that after the multiple maximum points are sorted, the corresponding target data acquisition method can be determined according to the type of the designated tapping operation. Among them, the type of the designated tapping operation can be determined according to the numerical value of the maximum point. If there is only one maximum point with a larger value, then the designated tapping operation can be determined to be a single-click operation. If there are two or more maximum points with larger values, then the designated tapping operation can be determined to be a double-click operation or a triple-click operation. Among them, if the difference between the numerical value of a maximum value and other maximum values is greater than a preset value, then the maximum value can be considered to be a maximum value with a larger value. The number of maximum points with larger values can also be determined by a program combined with manual methods. For example, Figure 4 A and D shown are both maximum points with large values.
[0075] Step S351: If the designated tapping operation is a double-click or a triple-click, obtain the first peak and the second peak from the sorted multiple maximum points, the maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the frame number interval between the first peak and the second peak is greater than the designated value.
[0076] The specific implementation of step S351 may refer to the relevant description of step S250 in the aforementioned embodiment, which will not be repeated here.
[0077] Step S352: Acquire acceleration data containing the first peak and the second peak within a specified time period as target data, wherein the target data includes at least one maximum value point.
[0078] The specific implementation of step S352 may refer to the relevant description of step S260 in the aforementioned embodiment, which will not be repeated here.
[0079] Step S361: If the designated tapping operation is a single click, a first peak is obtained from the sorted plurality of maximum value points.
[0080] In this embodiment, if the tapping operation is designated as a single-click operation, a peak can be obtained from the sorted multiple maximum value points as the first peak. The first peak can be the maximum value point with the most prominent (large, obvious) value.
[0081] Step S362: Using the extreme point where the first wave peak is located as a reference line, the frames are moved in opposite directions at equal distances, so that the frame interval between the two frame boundaries after the movement is equal to the sampling frames corresponding to the specified time length.
[0082] As an implementation method, the extreme point where the first wave peak is located can be used as the baseline, and the frames can be moved in the opposite direction at equal distances (the movement principle is the same as Figure 4 as well as Figure 5 The example shown is similar and will not be described again here), so that the frame interval between the two frame boundaries after the movement is equal to the number of sampling frames corresponding to the specified time length (such as 400 frames described in the above embodiment).
[0083] Step S363: Acquire acceleration data within a sampling frame interval corresponding to the specified duration as target data.
[0084] In this embodiment, the acceleration data within the sampling frame number interval corresponding to the specified time length can be directly used as the target data. The target data in this manner includes a maximum value point.
[0085] The data acquisition method provided in this embodiment obtains the tapping position of the electronic device caused by a specified tapping operation within a preset time period in response to a data acquisition instruction; obtains acceleration data corresponding to the tapping position; obtains a maximum point set from the acceleration data, wherein the maximum point set includes multiple maximum points; sorts the multiple maximum points; if the specified tapping operation is a double tap or a triple tap, obtains a first peak and a second peak from the sorted multiple maximum points, wherein the maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the first peak The frame interval with the second peak is greater than a specified value; the acceleration data containing the first peak and the second peak within the specified time length is obtained as target data, and the target data includes at least one maximum point; if the specified tapping operation is a single click, the first peak is obtained from the sorted multiple maximum points; with the extreme point where the first peak is located as the baseline, the frames are moved equidistantly in opposite directions so that the frame interval between the two frame boundaries after the movement is equal to the sampling frames corresponding to the specified time length; the acceleration data within the sampling frame interval corresponding to the specified time length is obtained as target data. Thus, through the above method, it is possible to intercept the acceleration data of the specified time length from the tapping data of the preset time period based on the peak detection of the maximum point as target data, thereby improving the accuracy of tapping data collection.
[0086] At the same time, by determining the corresponding target data acquisition method according to the type of specified tapping operation, the flexibility and diversity of data collection are improved.
[0087] See also Figure 7 , shows a flow chart of a data collection method provided by another embodiment of the present application. This embodiment provides a data collection method that can be applied to an electronic device, and the method includes:
[0088] Step S410: When the data acquisition application is in an open state, if a touch operation acting on a detection function button of the data acquisition application is detected, a data acquisition instruction is triggered to be generated.
[0089] The electronic device in the embodiments of the present application is configured with a data acquisition application for controlling the completion of data acquisition operations. The data acquisition application may be configured with a detection function button for controlling the triggering and initiation of data acquisition operations. In one embodiment, when the data acquisition application is in an open state, if a touch operation is detected on the detection function button of the data acquisition application, a data acquisition instruction may be triggered.
[0090] When the data acquisition application is running in the foreground, it can be determined that the data acquisition application is in the open state. Therefore, it can be determined whether the data acquisition application is in the open state by detecting whether the data acquisition application is running in the foreground.
[0091] In order to facilitate accurate control of the data collection process, the data collection application can be configured with a data collection page for displaying the above-mentioned detection function buttons and the collected data. The screen of an electronic device can be large or small. For example, if the electronic device is a mobile phone, the screen of the electronic device is large enough to directly display the data collection page. However, if it is a foldable screen mobile phone, when the mobile phone is in the folded state, the screen of the foldable screen mobile phone is fixed and too small to display the data collection application directly on the screen of the foldable screen mobile phone. Therefore, it is necessary to determine the corresponding data collection instruction triggering method according to the screen type of the electronic device.
[0092] See also Figure 8 As one approach, step S410 may specifically include:
[0093] Step S411: When the data acquisition application is in an open state, if a touch operation acting on a detection function button of the data acquisition application is detected, the screen type of the electronic device is obtained.
[0094] As an implementation method, when it is determined that the data acquisition application is in an open state, if a touch operation acting on the detection function button of the data acquisition application is detected, the screen type of the electronic device can be obtained so that data collection work can be carried out in a targeted manner according to the screen type of the electronic device.
[0095] Step S412: If the screen type is the first type, trigger the generation of a data collection instruction.
[0096] The first type is the screen type of a bar phone. As an implementation, if the screen type of the electronic device is the first type, a data collection instruction can be directly triggered to start data collection conveniently.
[0097] Step S413: If the screen type is the second type, a data collection instruction is generated when a designated prompt sound is sounded.
[0098] In this embodiment, the second type is the screen type of a foldable screen (mainly referring to the external screen of a foldable screen electronic device). As an embodiment, if the screen type of the electronic device is obtained to be the second type, it is possible to continue to detect whether a specified prompt tone is sounded. The specified prompt tone can be a short ringtone, and the specific content and prompt method of the specified prompt tone are not limited. When the specified prompt tone is sounded, a data collection instruction can be triggered.
[0099] In a specific application scenario, see Figure 9 , shows an example diagram of the data collection page provided by the embodiment of the present application. Figure 9 As shown, the data acquisition interface includes a "Start Detection" button. If the electronic device is a straight-screen device, when the "Start Detection" button is triggered, the data acquisition instruction can be triggered. The collected acceleration data can be displayed in the form of a waveform in the blank area in the lower half of the data acquisition page (that is, the Figure 4 or Figure 5 The acceleration waveform shown is displayed in Figure 9 The user can use the interface to assist the program in selecting acceleration data that meets the corresponding conditions as target data, and the user can write the selected target data into the memory of the electronic device by touching the "Write Data" button.
[0100] like Figure 9 As shown, you can also choose to specify the action type of the tapping operation, where two represents a double-click operation, three represents a triple-click operation, one represents a single-click operation, and a negative sample represents an operation such as "throwing the phone on the table". Before touching the start detection function button, the user can first select the action type of the specified tapping operation, and then click the start detection button to trigger the generation of data collection instructions. It should be noted that for the action type of "negative sample", if the specified tapping operation selected is "negative sample", then you can click the "Collect Negative Sample" button, which will automatically trigger the collection of acceleration data of the negative sample, and the collection will automatically stop after the set collection time is reached, and the start frame and end frame of the collected data can be displayed. For the other three types of click operations, after selecting the corresponding action type, you need to touch the "Start Detection" function button again to trigger the generation of data collection instructions.
[0101] In this embodiment, when the screen type of the electronic device is the second type, the tapping direction of the electronic device is the left and right sides in the folded state (such as Figure 10 As shown by the arrow in , it shows the direction of tapping on the electronic device when the electronic device is a folding screen). As an embodiment, when the screen type of the electronic device is the second type, when the screen is in a non-folding state, the data collection page of the data collection application can be displayed, and the user can click the "Start Detection" button on the page, and then immediately close the screen, and the screen becomes a folding state. At this time, if a specified prompt sound is heard, a data collection instruction can be generated, thereby triggering the start of data collection. Optionally, when the specified prompt sound is sounded for the second time, another round of collection work is triggered, and so on.
[0102] It should be noted that the specific content of step S410 can be combined with the content described in any of the foregoing embodiments, and is not limited to the combination described in this embodiment.
[0103] Step S420: In response to the data collection instruction, obtaining a tapping position of the electronic device caused by a designated tapping operation within a preset time period.
[0104] The specific implementation of step S420 may refer to the relevant description of step S110 in the aforementioned embodiment, which will not be repeated here.
[0105] Step S430: Acquire acceleration data corresponding to the tapping position.
[0106] The specific implementation of step S430 may refer to the relevant description of step S120 in the aforementioned embodiment, which will not be repeated here.
[0107] Step S440: Acquire acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum value point.
[0108] The specific implementation of step S440 may refer to the relevant description of step S130 in the aforementioned embodiment, which will not be repeated here.
[0109] In this embodiment, if the electronic device's screen type is type 2, there is a time interval between the user touching the detection function button and the start of data collection when the prompt sound sounds. During this time interval, no data is collected, but sensor data is recorded (acceleration data is recorded by the sensor) and needs to be discarded. Therefore, before obtaining acceleration data of a specified duration from the acceleration data within the preset time period as target data, the acceleration data from the time the data collection application touches the detection function button to the time the specified prompt sound sounds can be discarded, thereby improving the accuracy and effectiveness of data collection.
[0110] The data collection method provided in this embodiment triggers the generation of a data collection instruction when a touch operation is detected on a detection function button of the data collection application when the data collection application is in an open state; in response to the data collection instruction, obtains a tapping position of the electronic device caused by a specified tapping operation within a preset time period; obtains acceleration data corresponding to the tapping position; and obtains acceleration data of a specified duration as target data from the acceleration data, wherein the target data includes at least one maximum point. Thus, the above method enables the interception of acceleration data of a specified duration as target data from the tapping data of the preset time period based on peak detection of the maximum point, thereby improving the accuracy of tapping data collection and obtaining accurate data.
[0111] At the same time, by determining the screen type and then determining the corresponding data collection method based on the screen type, the flexibility of data collection can be improved. Collecting data based on ringtones can achieve data collection without looking at the screen, making data collection more interesting.
[0112] See also Figure 11 , is a structural block diagram of a data acquisition device provided in an embodiment of the present application. This embodiment provides a data acquisition device 500 that can be run on an electronic device. The device 500 includes a tapping position acquisition module 510, an acceleration data acquisition module 520, and a data acquisition module 530:
[0113] The tapping position acquisition module 510 is configured to acquire, in response to a data collection instruction, a tapping position of the electronic device caused by a designated tapping operation within a preset time period.
[0114] In this embodiment, the electronic device is configured with a data acquisition application. The apparatus 500 further includes an instruction generation module configured to trigger generation of a data acquisition instruction upon detecting a touch operation on a detection function button of the data acquisition application while the data acquisition application is in an active state, before acquiring a designated tapping operation applied to a tapping position of the electronic device within a preset time period in response to the data acquisition instruction.
[0115] In at least one embodiment, when the data acquisition application is in the turned-on state, if a touch operation acting on a detection function button of the data acquisition application is detected, triggering the generation of a data acquisition instruction may include: when the data acquisition application is in the turned-on state, if a touch operation acting on a detection function button of the data acquisition application is detected, obtaining the screen type of the electronic device; if the screen type is the first type, triggering the generation of a data acquisition instruction; if the screen type is the second type, triggering the generation of a data acquisition instruction when a specified prompt sound sounds.
[0116] The acceleration data acquisition module 520 is configured to acquire acceleration data corresponding to the tapping position.
[0117] As an implementation manner, the acceleration data acquisition module 520 may be specifically configured to acquire a coordinate axis corresponding to the tapping position; and acquire acceleration data corresponding to the coordinate axis.
[0118] The data acquisition module 530 is configured to acquire acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum value point.
[0119] As an embodiment, the data acquisition module 530 can be specifically used to obtain a maximum point set from the acceleration data, wherein the maximum point set includes multiple maximum points; sort the multiple maximum points; if the specified tapping operation is a double tap or a triple tap, obtain the first peak and the second peak from the sorted multiple maximum points, the maximum value corresponding to the first peak is greater than the maximum value corresponding to the second peak, and the frame number interval between the first peak and the second peak is greater than a specified value; obtain the acceleration data containing the first peak and the second peak within the specified time length as target data.
[0120] In at least one embodiment, the acceleration data including the first peak and the second peak within the specified time length is obtained as the target data, including: taking the extreme point where the first peak and the extreme point where the second peak are located as the baseline, moving the frames at equal distances in opposite directions, so that the frame interval between the first peak and the second peak is equal to the sampling frame number corresponding to the specified time length; and obtaining the acceleration data within the sampling frame number interval corresponding to the specified time length as the target data.
[0121] As another embodiment, the data acquisition module 530 can be specifically used to obtain the first peak from the sorted multiple maximum points if the designated tapping operation is a single click; using the extreme point where the first peak is located as the baseline, moving the frames at equal distances in opposite directions so that the frame interval between the two frame boundaries after the movement is equal to the sampling frames corresponding to the specified time length; and obtaining the acceleration data within the sampling frame interval corresponding to the specified time length as the target data.
[0122] In this embodiment, the device 500 may further include a data processing module for discarding the acceleration data from the touch operation of the detection function button of the data acquisition application to the time period when the prompt sound sounds before obtaining the acceleration data of a specified duration from the acceleration data as target data if the screen type is the second type.
[0123] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0124] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0125] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0126] See also Figure 12 Based on the above-mentioned data collection method and apparatus, an embodiment of the present application further provides an electronic device 100 capable of executing the aforementioned data collection method. The electronic device 100 includes a memory 102 and one or more (only one is shown in the figure) processors 104 coupled to each other. The memory 102 and the processors 104 are connected by a communication line. The memory 102 stores a program capable of executing the contents of the above-mentioned embodiments, and the processor 104 can execute the program stored in the memory 102.
[0127] The processor 104 may include one or more processing cores. The processor 104 utilizes various interfaces and circuits to connect various components within the electronic device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 102, as well as accesses data stored in the memory 102, to perform various functions and process data within the electronic device 100. Optionally, the processor 104 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 104 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 104 and may be implemented separately via a communication chip.
[0128] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 102 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 aforementioned various embodiments, etc. The data storage area may also store data created by the electronic device 100 during use (such as a phone book, audio and video data, chat history data, etc.).
[0129] Please refer to Figure 13 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 600 stores program code, which can be called by a processor to execute the method described in the above method embodiment.
[0130] The computer-readable storage medium 600 can 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. Alternatively, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 600 has storage space for program code 610 for executing any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program code 610 can be compressed, for example, in a suitable form.
[0131] In summary, the embodiments of the present application provide a data acquisition method, device, electronic device, and storage medium. The method is applied to an electronic device. The method obtains the tapping position of a specified tapping operation on the electronic device within a preset time period in response to a data acquisition instruction; obtains acceleration data corresponding to the tapping position; and obtains acceleration data of a specified duration from the acceleration data as target data, wherein the target data includes at least one maximum point. Thus, the above-mentioned method can achieve the ability to intercept acceleration data of a specified duration from the tapping data of a preset time period as target data based on peak detection of the maximum point, thereby improving the accuracy of tapping data acquisition.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data collection method, characterized in that: Applied to electronic equipment, the method comprises: In response to the data collection instruction, obtaining a tapping position of the electronic device caused by a designated tapping operation within a preset time period; Acquiring acceleration data corresponding to the tapping position; Acceleration data of a specified duration is acquired from the acceleration data as target data, wherein the target data includes at least one maximum value point.
2. The method according to claim 1, characterized in that The step of acquiring acceleration data of a specified duration from the acceleration data as target data includes: Acquire a maximum value point set from the acceleration data, wherein the maximum value point set includes a plurality of maximum value points; Sorting the multiple maximum value points; If the designated tapping operation is a double tap or a triple tap, a first wave peak and a second wave peak are obtained from the sorted plurality of maximum value points, the maximum value corresponding to the first wave peak is greater than the maximum value corresponding to the second wave peak, and the frame number interval between the first wave peak and the second wave peak is greater than a designated value; The acceleration data including the first wave peak and the second wave peak within the specified time length is acquired as the target data.
3. The method according to claim 2, characterized in that The step of acquiring the acceleration data including the first wave peak and the second wave peak within the specified time period as target data includes: Taking the extreme point where the first wave peak is located and the extreme point where the second wave peak is located as the reference line, the frames are moved in opposite directions by equal distances, so that the frame interval between the first wave peak and the second wave peak is equal to the sampling frame number corresponding to the specified time length; The acceleration data within the sampling frame number interval corresponding to the specified time length is acquired as the target data.
4. The method according to claim 2, characterized in that: The method further comprises: If the designated tapping operation is a single click, obtaining a first wave peak from the sorted plurality of maximum value points; Taking the extreme point where the first wave peak is located as the reference line, the frames are moved in the opposite direction at equal distances, so that the frame interval between the two frame boundaries after the movement is equal to the sampling frames corresponding to the specified time length; The acceleration data within the sampling frame number interval corresponding to the specified time length is acquired as the target data.
5. The method according to claim 1, characterized in that The acquiring acceleration data corresponding to the tapping position includes: Acquire the coordinate axis corresponding to the tapping position; Acquire acceleration data corresponding to the coordinate axis.
6. The method according to any one of claims 1 to 5, characterized in that: The electronic device is configured with a data collection application program, and before the designated tapping operation within a preset time period is acquired in response to the data collection instruction and acts on the tapping position of the electronic device, the method further includes: When the data acquisition application is in an open state, if a touch operation acting on a detection function button of the data acquisition application is detected, a data acquisition instruction is triggered to be generated.
7. The method according to claim 6, characterized in that When the data acquisition application is in the open state, if a touch operation acting on a detection function button of the data acquisition application is detected, triggering the generation of a data acquisition instruction includes: When the data acquisition application is in an open state, if a touch operation acting on a detection function button of the data acquisition application is detected, obtaining the screen type of the electronic device; If the screen type is the first type, triggering the generation of a data collection instruction; If the screen type is the second type, a data collection instruction is generated when a designated prompt sound is sounded.
8. The method according to claim 7, characterized in that If the screen type is the second type, before acquiring acceleration data of a specified duration from the acceleration data as target data, the method further includes: The acceleration data from the touch operation on the detection function button of the data acquisition application program to the time period when the designated prompt sound sounds are sounded is discarded.
9. A data acquisition device, characterized in that: Running on an electronic device, the device comprises: A tapping position acquisition module, configured to acquire, in response to a data collection instruction, a tapping position of the electronic device caused by a designated tapping operation within a preset time period; An acceleration data acquisition module, used to acquire acceleration data corresponding to the tapping position; The data acquisition module is used to obtain acceleration data of a specified time length from the acceleration data as target data, and the target data includes at least one maximum value point.
10. An electronic device, characterized in that: comprising one or more processors and memory; 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 method according to any one of claims 1 to 8.
11. 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 8 is executed.
