Methods, devices, terminal equipment and storage media for monitoring knocking events
Patent Information
- Application Number
- CN202111680377.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2041-12-31
AI Technical Summary
[0005]本发明的主要目的是提供一种敲击事件的监测方法、装置、终端设备及存储介质,旨在解决现有技术中敲击事件的监测结果的获得效率较低的技术问题
[0018]现有技术中,需要对重力传感器的三轴数据进行复杂的计算处理,才能得到设备的状态,使得设备的状态确定效率较低,进而导致敲击事件的监测结果的获得效率较低。而在本发明中,终端设备根据重力传感器发送的第一敲击事件监测信息,获得第一敲击状态,并在第一敲击状态为敲击物远离终端设备时,确定第一敲击事件监测信息的第一时间信息,并根据第一时间信息和起始时间信息,获得敲击事件监测结果,终端设备不需要进行复杂的计算处理,大大节省了终端设备的运算时间,从而提高了终端设备的敲击事件的监测结果的获得效率。
Smart Images

Figure CN114428552B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of equipment monitoring technology, and in particular to a method, apparatus, terminal device, and storage medium for monitoring impact events. Background Technology
[0002] With the increasing popularity of consumer electronic devices and the growing demand for more mainstream and intelligent products, consumers are also placing higher demands on the intelligent detection and multi-functional integration of electronic devices. Therefore, if a smart product can be designed with the automatic detection capabilities of a g-sensor (gravity sensor), it will greatly improve the user experience, increase product diversification, and enhance the product's competitiveness.
[0003] In related technologies, the device is equipped with a g-sensor, which monitors the device's three-axis data (X-axis, Y-axis, and Z-axis), determines the device's status based on the three-axis data, and then determines whether the device has experienced a knocking event based on the device's status.
[0004] However, existing methods for monitoring impact events require complex calculations on triaxial data to determine the equipment's status, resulting in low efficiency in determining the equipment's status and consequently, low efficiency in obtaining monitoring results for impact events. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, terminal device, and storage medium for monitoring tapping events, aiming to solve the technical problem of low efficiency in obtaining monitoring results of tapping events in the prior art.
[0006] To achieve the above objectives, the present invention proposes a method for monitoring tapping events, comprising:
[0007] If the first tapping event monitoring information sent by the gravity sensor is detected, the first tapping state corresponding to the first tapping event monitoring information is determined.
[0008] If the first tapping state is that the tapping object is far away from the terminal device, then the first time information of the first tapping event monitoring information is determined;
[0009] The start time information is obtained based on the second tapping event monitoring information corresponding to the most recent received tapping state where the tapping object is close to the terminal device. The second tapping event monitoring information is sent before the first tapping event monitoring information.
[0010] Based on the first-time information and the start-time information, the results of the knocking event monitoring are obtained.
[0011] Furthermore, to achieve the above objectives, the present invention also provides a device for monitoring tapping events, comprising:
[0012] The monitoring module is used to determine the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
[0013] The determination module is used to determine the first time information of the first tapping event monitoring information if the first tapping state is that the tapping object is far away from the terminal device;
[0014] The acquisition module is used to acquire start time information. The start time information is obtained based on the second tapping event monitoring information corresponding to the most recently received tapping state that the tapping object is close to the terminal device. The second tapping event monitoring information is sent before the first tapping event monitoring information.
[0015] The acquisition module is used to obtain the tapping event monitoring results based on the first time information and the start time information.
[0016] In addition, to achieve the above objectives, the present invention also proposes a terminal device, which includes a gravity sensor, a memory, a processor, and a tapping event monitoring program stored in the memory and running on the processor. When the processor executes the tapping event monitoring program, it implements the steps of the tapping event monitoring method described above.
[0017] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a tapping event monitoring program, which, when executed by a processor, implements the steps of the tapping event monitoring method described above.
[0018] In existing technologies, complex calculations are required to process the triaxial data from gravity sensors to determine the device's state, resulting in low efficiency in determining the device's state and consequently, low efficiency in obtaining the monitoring results of impact events. In this invention, the terminal device obtains a first impact state based on the first impact event monitoring information sent by the gravity sensor. When the first impact state occurs when the impacting object moves away from the terminal device, the device determines the first time information of the first impact event monitoring information. Based on the first time information and the start time information, the device obtains the impact event monitoring result. This eliminates the need for complex calculations by the terminal device, significantly saving its processing time and thus improving the efficiency of obtaining the impact event monitoring results. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiments of the present invention;
[0021] Figure 2 This is a flowchart illustrating the first embodiment of the method for monitoring tapping events according to the present invention;
[0022] Figure 3 This is a structural block diagram of the first embodiment of the impact event monitoring device of the present invention.
[0023] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0025] Reference Figure 1 , Figure 1 This is a schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiments of the present invention.
[0026] Typically, a terminal device includes at least one processor 301, a memory 302, and a tap event monitoring program stored in the memory and executable on the processor, the tap event monitoring program being configured to implement the steps of the tap event monitoring method described above.
[0027] Processor 301 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 301 may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). Processor 301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. Processor 301 may also include an AI (Artificial Intelligence) processor, which handles the operation of the tapping event monitoring method, enabling the tapping event monitoring method model to learn autonomously, improving efficiency and accuracy.
[0028] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 302 are used to store at least one instruction, which is executed by the processor 301 to implement the tapping event monitoring method provided in the method embodiments of this application.
[0029] In some embodiments, the terminal may also optionally include a communication interface 303 and at least one peripheral device. The processor 301, memory 302, and communication interface 303 can be connected via a bus or signal line. Each peripheral device can be connected to the communication interface 303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 304, a display screen 305, and a power supply 306.
[0030] The communication interface 303 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0031] The radio frequency (RF) circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 304 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 304 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 304 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0032] Display screen 305 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 305 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 301 for processing. In this case, display screen 305 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, display screen 305 can be a single screen, the front panel of an electronic device; in other embodiments, display screen 305 can be at least two screens, respectively disposed on different surfaces of the electronic device or in a folded design; in still other embodiments, display screen 305 can be a flexible display screen, disposed on a curved or folded surface of the electronic device. Furthermore, display screen 305 can also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 305 can be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0033] Power supply 306 is used to supply power to various components in an electronic device. Power supply 306 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 306 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0034] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0035] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a tapping event monitoring program. When executed by a processor, the tapping event monitoring program implements the steps of the tapping event monitoring method described above. Therefore, further details will not be repeated here. Additionally, the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed to execute on a single terminal device, or on multiple terminal devices located in one location, or on multiple terminal devices distributed across multiple locations and interconnected via a communication network.
[0036] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The computer-readable storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0037] Based on the above hardware structure, an embodiment of the tapping event monitoring method of the present invention is proposed.
[0038] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the tapping event monitoring method of the present invention. The method includes the following steps:
[0039] Step S11: If the terminal device detects the first tapping event monitoring information sent by the gravity sensor, then determine the first tapping state corresponding to the first tapping event monitoring information.
[0040] It should be noted that the terminal device is equipped with a tapping event monitoring program. When the terminal device executes the tapping event monitoring program, it implements the steps of the tapping event monitoring method of the present invention. Typically, the tapping event monitoring program is always running, that is, it constantly monitors whether it receives tapping event monitoring information sent by the gravity sensor.
[0041] Typically, terminal devices need to have a gravity sensor (G-sensor, or g-sensor). These devices are primarily designed for embedded systems; therefore, the main controller (SoC) needs to run mainstream embedded operating systems such as Linux, VxWorks, and eCos. The operating system also needs to generate interrupts and transmit them to the user layer for processing in real time. Since Linux is currently the most prevalent and representative operating system in mainstream embedded devices, the following descriptions will focus on Linux as the device's operating system.
[0042] G-sensor device kernel driver implementation: Three key aspects require special attention during driver design: 1. The kernel driver code must include interrupt functionality, enabling real-time transmission of interrupts to the user layer. Different interrupt triggering methods (high-level or low-level triggering) for different gravity sensors necessitate corresponding driver trigger routines. 2. The G-sensor device must be registered as an input device during driver registration. This allows the use of the input subsystem to transmit low-level data to the user layer, reducing latency in data transmission from the lower layer to the upper layer. The input subsystem also offers more robust functionality, reducing the likelihood of program errors. 3. The underlying layer must provide reserved interfaces for user-level programs to manipulate the G-sensor device's registers. This, combined with the user-level detection algorithm implementation, enhances the accuracy of the detection algorithm.
[0043] The tapping event monitoring information sent by the gravity sensor (including first tapping event monitoring information, second tapping event monitoring information, and third tapping event monitoring information, etc.) includes an event identifier (usually an identifier code or identifier ID) and a tapping state (including first tapping state and second tapping state, etc.). Typically, the tapping state is represented by a specific identifier value: an identifier value of 1 indicates that the tapping object is close to the terminal device, and an identifier value of 0 indicates that the tapping object is far away from the terminal device. The tapping object can be any type of object (e.g., a finger, knuckle, or pen). The tapping action between the object and the terminal device necessarily involves the object either moving close to or far away from the terminal device.
[0044] In practical applications, when an object is brought close to the terminal device, the first specific parameter (specific gravitational acceleration) of the gravity sensor is counted, and when the object is moved away from the terminal device, the second specific parameter (specific gravitational acceleration) of the gravity sensor is counted. The correspondence between the first and second specific parameters and the identification value is established respectively, so as to directly obtain the identification value. Usually, this correspondence can be built into the gravity sensor, and the gravity sensor can directly determine the identification value as 0 or 1 based on its own actual parameters.
[0045] Step S12: If the first tapping state is that the tapping object is far away from the terminal device, the terminal device determines the first time information of the first tapping event monitoring information.
[0046] Based on the above description, the identification type is either the object being struck is far from the terminal device or the object being struck is close to the terminal device. The first time information of the first striking event monitoring information refers to the current time information of the execution up to step S12.
[0047] Step S13: The terminal device obtains the start time information. The start time information is obtained based on the second tapping event monitoring information corresponding to the most recently received tapping state where the tapping object is close to the terminal device. The second tapping event monitoring information is sent before the first tapping event monitoring information.
[0048] Typically, at the very beginning of the impact event monitoring information from the gravity sensor, this initial moment is set as the start time information. Then, when impact event monitoring information indicating that the impacting object is close to the terminal device is received, the start time information is updated using the determined moment of the impact state (impacting object close to the terminal device) from the impact event monitoring information.
[0049] In this invention, monitoring is performed in real time. At the start of monitoring, multiple tapping events may be detected where the tapping object is moving away from the terminal device. The tapping event monitoring information where the tapping object is closest to the terminal device is then determined as the second tapping event monitoring information. The start time information is updated using the determination time of the tapping state corresponding to the second tapping event monitoring information.
[0050] It is understandable that the knocking event monitoring information sent by the gravity sensor is based on the initial moment. Usually, the knocking object is close to the terminal device - the knocking object is far away from the terminal device, the knocking object is close to the terminal device - the knocking object is far away from the terminal device, and so on. When the knocking object is far away from the terminal device, then the knocking state of the previous knocking event monitoring information must have been that the knocking object was close to the terminal device.
[0051] Among them, the first tapping event monitoring information, where the tapping state is that the tapping object is moving away from the terminal device, could be any pair in the aforementioned multiple paired processes. In this case, the event where the tapping state is that the tapping object is moving closer to the terminal device is the second tapping event monitoring information. That is, before executing steps S11-S12, an event where the tapping state is that the tapping object is moving closer to the terminal device must have already occurred, and the start time information is determined based on this event where the tapping state is that the tapping object is moving closer to the terminal device.
[0052] Step S14: The terminal device obtains the tapping event monitoring results based on the first time information and the start time information.
[0053] Specifically, the terminal device obtains the tapping event monitoring results based on the first time information and the start time information, including:
[0054] The terminal device calculates the first time difference between the first time information and the start time information;
[0055] If the first time difference is within the first time interval, the terminal device obtains the tap event monitoring result of a single tap event occurring on the terminal device; or,
[0056] If the first time difference is within the second time interval, the terminal device obtains the tapping event monitoring result of the terminal device experiencing two tapping events.
[0057] In this embodiment of the invention, the first time interval is [0ms, 110ms] and the second time interval is [110ms, 200ms]. This is only a preferred choice of the first and second time intervals and does not constitute a limitation of the invention.
[0058] Furthermore, after the terminal device obtains the tapping event monitoring results based on the first time information and the start time information, the method also includes:
[0059] If the terminal device detects the third tapping event monitoring information sent by the gravity sensor, it determines the second tapping state corresponding to the third tapping event monitoring information.
[0060] If the second tapping state is that the tapping object is close to the terminal device, the terminal device determines the second time information of the third tapping event monitoring information;
[0061] The terminal device updates the start time information using the second time information and returns to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected, until the gravity sensor stops sending knocking event monitoring information, and obtains multiple knocking event monitoring results.
[0062] The terminal device obtains the final tapping event monitoring result based on the current time information, the start time information, and the monitoring results of multiple tapping events.
[0063] Based on the above description, the method of this invention performs continuous monitoring in real time. After obtaining the tapping event monitoring result, it means that the process of a pair of tapping objects approaching the terminal device and then moving away from the terminal device is completed, and the next round of monitoring is required. The third tapping event monitoring information is received, which typically indicates that the tapping object is approaching the terminal device. Then, the method of this invention is repeated to obtain multiple tapping event monitoring results corresponding to multiple cycles, and the current time information is obtained. Then, based on the current time information, the start time information, and the multiple tapping event monitoring results, the final tapping event monitoring result is obtained.
[0064] Specifically, the terminal device obtains the final tapping event monitoring results based on the current time information, the start time information, and the monitoring results of multiple tapping events, including:
[0065] The terminal device calculates the second time difference between the current time information and the start time information;
[0066] If the second time difference is within the third time interval, the terminal device will count the tapping type and the number of taps corresponding to the tapping type of multiple tapping event monitoring results.
[0067] The terminal device obtains the final tapping event monitoring results based on the tapping type and its corresponding number of taps.
[0068] The terminal device obtains the final tapping event monitoring results based on the tapping type and its corresponding number of taps, including:
[0069] If the tap type includes a double-tap event on the terminal device, and the number of taps in the double-tap event is not zero, then the terminal device obtains the final tap event monitoring result for the double-tap event; or,
[0070] If the tap type only includes a single tap event occurring on the terminal device, and the number of taps in a single tap event on the terminal device is not zero, then the terminal device obtains the final tap event monitoring result for the single tap event occurring on the terminal device.
[0071] The third time interval is [400ms, 650ms]. This third time interval is also a preferred choice and does not constitute a limitation of the present invention. If the second time difference is within the third time interval, it indicates that the multiple tapping event monitoring results are valid, that is, the user did indeed send a tapping operation to the terminal device. If the second time difference is not within the third time interval, it indicates that the multiple tapping event monitoring results are invalid, that is, the user did not send a tapping operation to the terminal device, but rather a similar tapping operation caused by accidental touch or other vibrations.
[0072] Therefore, only when the second time difference falls within the third time interval are the tapping types and the corresponding number of taps for each tapping event monitored. Tapping types include single tapping events and double tapping events, and the number of taps includes the number of taps for each single and double tapping event.
[0073] Regardless of whether the tap type includes single taps from the terminal device, as long as the tap type includes double taps from the terminal device, and the number of taps in a double tap event is not zero, the final tap event monitoring result for a double tap event is obtained. If the tap type does not include double taps from the terminal device, then only single taps from the terminal device are included. As long as the number of taps in a single tap event is not zero, the final tap event monitoring result for a single tap event is obtained.
[0074] In this embodiment, a third time interval is used to determine whether a tap is a valid tap, thereby filtering out invalid tap events and improving the accuracy of the final tap event monitoring results.
[0075] Furthermore, after the terminal device calculates the second time difference between the current time information and the start time information, the method also includes:
[0076] If the second time difference is not within the third time interval, the terminal device obtains the new current time information;
[0077] The terminal device obtains the third time difference based on the new current time information and the start time information;
[0078] If the third time difference is within the fourth time interval, the terminal device will clear the tap type and its corresponding number of taps, and return to the step of determining the first tap state corresponding to the first tap event monitoring information if the first tap event monitoring information sent by the gravity sensor is detected; or, if the third time difference is not within the fourth time interval and the third time difference is greater than the preset time threshold, the terminal device will update the start time information using the new current time information, and return to the step of determining the first tap state corresponding to the first tap event monitoring information if the first tap event monitoring information sent by the gravity sensor is detected.
[0079] The preset time threshold is usually the maximum value of the fourth time interval. In this invention, the fourth time interval is [1s, 5s], so the preset time threshold is 5s. When the third time is within the fourth time interval, the single-shot and double-shot counts need to be reset to 0. When the third time is greater than 5s (the maximum value of the group in the fourth time interval), in order to prevent the method of this invention from entering an unknown error, the start time information needs to be re-acquired: the current time (i.e., the new current event described above) value is used as the start time information.
[0080] In this embodiment, regardless of the third time difference, the corresponding operation must be performed before returning to step S11 to continue monitoring the impact event information of the gravity sensor in the terminal device.
[0081] When designing the kernel of a terminal device, when the kernel detects a g-sensor interrupt, it needs to promptly notify the input subsystem, which then uploads the event message to the user layer. To ensure real-time performance, efficient and accurate communication is required. In this low-level driver development, it is recommended to use a work queue to handle interrupt responses, although other efficient kernel message transmission methods can also be selected.
[0082] In existing technologies, complex calculations are required to process the triaxial data from gravity sensors to determine the device's state, resulting in low efficiency in determining the device's state and consequently, low efficiency in obtaining the monitoring results of impact events. In this invention, the terminal device obtains a first impact state based on the first impact event monitoring information sent by the gravity sensor. When the first impact state occurs when the impacting object moves away from the terminal device, the device determines the first time information of the first impact event monitoring information. Based on the first time information and the start time information, the device obtains the impact event monitoring result. This eliminates the need for complex calculations by the terminal device, significantly saving its processing time and thus improving the efficiency of obtaining the impact event monitoring results.
[0083] The method of this invention has lower resource consumption, faster timeliness, higher accuracy, and lower false detection rate. Therefore, when used in embedded intelligent devices with high system resource requirements and strong customer experience, it can greatly reduce the overall power consumption and heat of the system, and enhance product competitiveness and diversification.
[0084] Reference Figure 3 , Figure 3 This is a structural block diagram of the first embodiment of the tapping event monitoring device of the present invention. Based on the same inventive concept as the foregoing embodiments, the device includes:
[0085] The monitoring module 10 is used to determine the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
[0086] The determination module 20 is used to determine the first time information of the first tapping event monitoring information if the first tapping state is that the tapping object is far away from the terminal device;
[0087] The acquisition module 30 is used to acquire start time information. The start time information is obtained based on the second tapping event monitoring information corresponding to the most recently received tapping state that the tapping object is close to the terminal device. The second tapping event monitoring information is sent before the first tapping event monitoring information.
[0088] The acquisition module 40 is used to obtain the tapping event monitoring results based on the first time information and the start time information.
[0089] Furthermore, module 40 is specifically used to calculate the first time difference between the first time information and the start time information; if the first time difference is within the first time interval, then the tapping event monitoring result of a single tapping event occurring on the terminal device is obtained; or, if the first time difference is within the second time interval, then the tapping event monitoring result of a double tapping event occurring on the terminal device is obtained.
[0090] Furthermore, the device also includes:
[0091] The loop module is used to determine the second knocking state corresponding to the third knocking event monitoring information if the gravity sensor detects a third knocking event monitoring information; if the second knocking state is that the knocking object is close to the terminal device, determine the second time information of the third knocking event monitoring information; update the start time information using the second time information, and return to execute the step of determining the first knocking state corresponding to the first knocking event monitoring information if the gravity sensor detects a first knocking event monitoring information, until the gravity sensor stops sending knocking event monitoring information, and obtain multiple knocking event monitoring results; and obtain the final knocking event monitoring result based on the current time information, the start time information, and the multiple knocking event monitoring results.
[0092] Furthermore, the loop module is also used to calculate the second time difference between the current time information and the start time information; if the second time difference is within the third time interval, the knocking type and the number of knocks corresponding to the multiple knocking event monitoring results are counted; based on the knocking type and its corresponding number of knocks, the final knocking event monitoring result is obtained.
[0093] Furthermore, the loop module is also used to obtain the final tap event monitoring result of the terminal device experiencing a double tap event if the tap type includes a double tap event of the terminal device and the number of taps in the double tap event of the terminal device is not zero; or, if the tap type only includes a single tap event of the terminal device and the number of taps in the single tap event of the terminal device is not zero, then obtain the final tap event monitoring result of the terminal device experiencing a single tap event.
[0094] Furthermore, the device also includes:
[0095] The clearing module is used to obtain new current time information if the second time difference is not within the third time interval; obtain the third time difference based on the new current time information and the start time information; if the third time difference is within the fourth time interval, clear the knocking type and its corresponding knocking count, and return to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
[0096] Furthermore, the device also includes:
[0097] The update module is used to update the start time information with the new current time information if the third time difference is not within the fourth time interval and the third time difference is greater than the preset time threshold, and then return to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
[0098] It should be noted that since the steps performed by the device in this embodiment are the same as those in the aforementioned method embodiments, the specific implementation methods and the technical effects that can be achieved can be referred to the aforementioned embodiments, and will not be repeated here.
[0099] The above are merely optional embodiments of the present invention and do not limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present invention specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A method for monitoring tapping events, characterized in that, include: If the first tapping event monitoring information sent by the gravity sensor is detected, then the first tapping state corresponding to the first tapping event monitoring information is determined. If the first tapping state is that the tapping object is far away from the terminal device, then the first time information of the first tapping event monitoring information is determined; The start time information is obtained based on the most recent received tapping state, which is the second tapping event monitoring information corresponding to the tapping object approaching the terminal device. The second tapping event monitoring information was sent before the first tapping event monitoring information. Based on the first time information and the start time information, the tapping event monitoring results are obtained; The step of obtaining the tapping event monitoring result based on the first time information and the start time information includes: Calculate the first time difference between the first time information and the start time information; If the first time difference is within the first time interval, then the tapping event monitoring result of a single tapping event occurring on the terminal device is obtained; If the first time difference is within the second time interval, then the tapping event monitoring result of the terminal device having a double tapping event is obtained, and the starting endpoint value of the second time interval is the ending endpoint value of the first time interval.
2. The method as described in claim 1, characterized in that, After obtaining the tapping event monitoring result based on the first time information and the start time information, the method further includes: If the third tapping event monitoring information sent by the gravity sensor is detected, then the second tapping state corresponding to the third tapping event monitoring information is determined. If the second tapping state is that the tapping object is close to the terminal device, then the second time information of the third tapping event monitoring information is determined; The second time information is used to update the start time information, and the process returns to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected, until the gravity sensor no longer sends knocking event monitoring information, and multiple knocking event monitoring results are obtained. Based on the current time information, the start time information, and the multiple tapping event monitoring results, the final tapping event monitoring result is obtained, where the current time information is the time information at the moment when the multiple tapping event monitoring results are obtained.
3. The method as described in claim 2, characterized in that, The step of obtaining the final tapping event monitoring result based on the current time information, the start time information, and multiple tapping event monitoring results includes: Calculate the second time difference between the current time information and the starting time information; If the second time difference is within the third time interval, then the knocking type and the number of knocks corresponding to the multiple knocking event monitoring results are counted. Based on the tapping type and its corresponding number of taps, the final tapping event monitoring result is obtained.
4. The method as described in claim 3, characterized in that, The step of obtaining the final tapping event monitoring result based on the tapping type and its corresponding number of taps includes: If the tapping type includes a double-tap event on the terminal device, and the number of taps in the double-tap event on the terminal device is not zero, then the final tapping event monitoring result for the double-tap event on the terminal device is obtained; or, If the tapping type only includes a single tapping event occurring on the terminal device, and the number of taps in a single tapping event on the terminal device is not zero, then the final tapping event monitoring result for the single tapping event occurring on the terminal device is obtained.
5. The method as described in claim 3, characterized in that, After calculating the second time difference between the current time information and the start time information, the method further includes: If the second time difference is not within the third time interval, then new current time information is obtained; Based on the new current time information and the start time information, a third time difference is obtained; If the third time difference is within the fourth time interval, then the knocking type and its corresponding number of knocks are cleared, and the process returns to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
6. The method as described in claim 5, characterized in that, After obtaining the third time difference based on the new current time information and the start time information, the method further includes: If the third time difference is not within the fourth time interval and the third time difference is greater than a preset time threshold, then the starting time information is updated using the new current time information, and the process returns to the step of determining the first knocking state corresponding to the first knocking event monitoring information if the first knocking event monitoring information sent by the gravity sensor is detected.
7. A device for monitoring knocking events, characterized in that, include: The monitoring module is used to determine the first tapping state corresponding to the first tapping event monitoring information if the first tapping event monitoring information sent by the gravity sensor is detected. The determination module is used to determine the first time information of the first tapping event monitoring information if the first tapping state is that the tapping object is far away from the terminal device; The acquisition module is used to acquire start time information, which is obtained based on the second tapping event monitoring information corresponding to the most recently received tapping state that the tapping object is close to the terminal device. The second tapping event monitoring information is sent before the first tapping event monitoring information. The acquisition module is used to obtain the tapping event monitoring results based on the first time information and the start time information; The obtaining module is further configured to calculate a first time difference between the first time information and the start time information; if the first time difference is within a first time interval, then a tapping event monitoring result of a single tapping event occurring on the terminal device is obtained; if the first time difference is within a second time interval, then a tapping event monitoring result of a double tapping event occurring on the terminal device is obtained, wherein the start endpoint value of the second time interval is the end endpoint value of the first time interval.
8. A terminal device, characterized in that, The terminal device includes a gravity sensor, a memory, a processor, and a tapping event monitoring program stored in the memory and running on the processor. When the processor executes the tapping event monitoring program, it implements the steps of the tapping event monitoring method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a tapping event monitoring program, which, when executed by a processor, implements the steps of the tapping event monitoring method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Lifting gesture recognition method and system, electronic equipment and storage medium
CN111580664A