Channel data processing, pressing method determination method and system, electronic equipment

By using pressure-sensitive sensors to detect the measurement data and baseline relationship of the detection channel, the key pressing method is identified, which solves the problems of high noise and low reliability of traditional keys and achieves a high-reliability and low-noise key pressing experience.

CN117289805BActive Publication Date: 2026-11-17SHANGHAI AWINIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210694422.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2026-11-17
Estimated Expiration
2042-06-16

AI Technical Summary

Technical Problem

Traditional buttons, such as mechanical and capacitive buttons, are noisy and unreliable, which affects the user experience.

Method used

The first state flag is determined by measuring data from the pressure sensor detection channel and baseline relationship. The pressing method, including pressing, releasing, and long press, is identified based on the state flag. The AFE module is used for data sampling to simplify the circuit structure.

Benefits of technology

It improves the reliability and flexibility of the pressing method, reduces testing costs, enhances the user experience, and has the advantages of being waterproof and low-noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117289805B_ABST
    Figure CN117289805B_ABST
Patent Text Reader

Abstract

This application discloses a channel data processing method, a method and system for determining button pressing mode, and an electronic device. The channel data processing method includes: determining a first state flag based on the relationship between measurement data obtained from the detection channel of a pressure sensor and a baseline; and determining a first pressing mode corresponding to the detection channel based on the first state flag. This application exhibits advantages such as low noise generation when the corresponding button is pressed by the pressing body, strong waterproofing, and a good user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of signal processing technology, specifically to a channel data processing method and system for determining button pressing mode, and an electronic device. Background Technology

[0002] Buttons, as one of the most commonly used tools in human-computer interaction, have penetrated almost every corner of people's production and daily life. With societal progress, people are paying increasing attention to user experience. Traditional solutions often employ mechanical buttons and capacitive touch buttons. While these types of buttons can receive user input, mechanical buttons suffer from high noise levels, and capacitive touch buttons are easily affected by environmental factors and have low reliability. Clearly, traditional buttons can negatively impact user experience. Summary of the Invention

[0003] In view of this, this application provides a channel data processing method and system for determining the pressing mode of a button, and an electronic device, to solve the technical problem that traditional buttons can easily affect the user experience.

[0004] The first aspect of this application provides a channel data processing method, including:

[0005] The first state flag is determined based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline;

[0006] The first pressing method corresponding to the detection channel is determined based on the first status flag.

[0007] Optionally, the first status flag includes a first press flag and a first release flag; determining the first press method corresponding to the detection channel based on the first status flag includes: performing a first press count when the first press flag is valid, performing a first release count when the first release flag is valid; and determining the first press method based on the first press flag, the first release flag, the first press count, and / or the first release count.

[0008] Optionally, determining the first pressing method based on the first pressing indicator, the first release indicator, the first pressing count, and / or the first release count includes: when the first pressing indicator changes to the first release indicator, if the first release count is greater than a preset combo threshold, then the first pressing method is determined to be a single click; if the first release count is less than or equal to the combo threshold, then the first pressing method is determined to be a combo.

[0009] Optionally, the first status flag further includes a long press flag; the step of determining the first pressing method corresponding to the detection channel based on the first status flag further includes: when the first pressing flag is valid, performing a long press count; when the long press flag is invalid and the first pressing flag is valid, if the first pressing count is greater than or equal to the long press count, then the first pressing method is determined to be a long press.

[0010] Optionally, the first status flag further includes a hard press flag; the measurement data includes current data; determining the first press mode based on the first press flag, the first release flag, the first press count and / or the first release count includes: when the first press mode is a single click, if the difference between the current data and the corresponding baseline value is greater than a preset first hard press threshold, then the hard press flag is determined to be valid, and a hard press count is performed; the hard press mode is identified based on the hard press count.

[0011] Optionally, before determining the first pressing method corresponding to the detection channel based on the first status flag, the channel data processing method further includes: if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, determining that the first pressing flag is invalid and the first release flag is valid; if the difference between the current data and the corresponding baseline value is greater than or equal to the first release threshold, determining that the first pressing flag is valid and the first release flag is invalid.

[0012] Optionally, if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first press flag is determined to be invalid. After the first release flag is valid, the channel data processing method further includes: clearing the long press count and the first release count to zero; and / or, if the long press count is greater than a preset long press update count, then setting the long press count as the long press update count.

[0013] Optionally, the step of performing a first press count when the first press flag is valid and performing a first release count when the first release flag is valid includes: when the first release flag is valid, if the first release count is greater than or equal to a preset second release threshold, then the first release count is set to the second release threshold; if the first release count is less than the second release threshold, then the first release count is incremented by one unit when a measurement data is received; when the first press flag is valid and the long press flag is invalid, if the first press count is greater than or equal to the long press count, then the first press count is set to the long press count; if the first press count is less than the long press count, then the first press count is incremented by one unit when a measurement data is received.

[0014] Optionally, determining the first pressing method corresponding to the detection channel based on the first state flag further includes: if the first pressing method is a long press, or the first hand-off count is greater than or equal to the second hand-off threshold, then the first pressing count and the first hand-off count are cleared to zero, and the first pressing flag, the first hand-off flag, the long press flag, the hard press flag, and the forced update flag are set to invalid, and the first pressing method is determined to be a hand-off state.

[0015] Optionally, before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, the channel data processing method further includes: S130, determining a base point based on the measurement data; S140, determining an upper baseline limit and a lower baseline limit based on the base point and a preset baseline limit parameter, wherein the baseline limit parameter is used to describe the height of the baseline; S150, determining the baseline value corresponding to each of the measurement data based on the measurement data, the upper baseline limit, and the lower baseline limit.

[0016] Optionally, determining the baseline value corresponding to each measurement data point based on the measurement data, the upper baseline limit, and the lower baseline limit includes: when the nth data point is greater than the upper baseline limit, determining the nth baseline value corresponding to the nth data point based on the upper baseline limit; when the nth data point is less than the lower baseline limit, determining the nth baseline value based on the lower baseline limit; and when the nth data point is less than or equal to the upper baseline limit and greater than or equal to the lower baseline limit, determining the nth baseline value based on the nth data point.

[0017] Optionally, determining the baseline value corresponding to each of the measurement data based on the measurement data, the upper baseline limit, and the lower baseline limit further includes: setting the forced update flag to valid when the number of times the baseline value is equal to the upper baseline limit or the lower baseline limit exceeds a preset number; updating the base point and setting the forced update flag to invalid when the forced update flag is valid and the measurement data is in a smooth state.

[0018] Optionally, the method for setting the forced update flag further includes: when the long press count is greater than a first long press threshold, the first release flag is invalid, the measurement data is in a non-smooth state, and the first press flag is invalid, setting the forced update flag to be valid.

[0019] Optionally, after determining the baseline value corresponding to each measurement data based on the measurement data, the upper baseline limit, and the lower baseline limit, the channel data processing method further includes: S131, setting a first period and a second period for updating the base point, wherein the first period includes m second periods, and the first first period and the first second period have the same start time; S132, identifying the start time of the first first period; S133, determining whether the measurement data is in a smooth state, and if the measurement data is in a smooth state, returning to step S130 and continuing to execute step S133; S134, if the measurement data is in a non-smooth state, identifying whether the measurement data is smooth in the next second period; S135, if the measurement data is in a smooth state, returning to step S130 and continuing to execute step S133.

[0020] Optionally, before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, the channel data processing method further includes: filtering the initial data to obtain filtered data; storing the filtered data sequentially into a preset first array, and when storing a new piece of filtered data after the elements of the first array are full, discarding the first piece of filtered data, moving the filtered data stored in each element to the previous element, and storing the new filtered data in the last element; and determining the first array formed at time n as the measurement data at time n.

[0021] Optionally, the step of filtering the initial data to obtain filtered data includes: determining the nth initial data at time n as the last element of a second array, the second array including a first element, a middle element, and a last element; obtaining the range of multiple consecutive initial data including the nth initial data; if the first element, the middle element, the last element, and the range conform to a preset relationship, then assigning the average of the first element and the last element to the first element, assigning the last element to the middle element, and determining the filtered data at time n based on the updated first element, the preset relationship being used to characterize the smoothness between the first element, the middle element, and the last element.

[0022] Optionally, the preset relationship includes: the difference between the middle element and one-third of the range is greater than the first element and the last element; or, the sum between the middle element and one-third of the range is less than the first element and the last element.

[0023] Optionally, the channel data processing method further includes: calculating the slope, mean, and peak-to-peak value of the measurement data based on the first array; and identifying whether the measurement data is smooth based on the slope, the mean, and the peak-to-peak value.

[0024] Optionally, identifying whether the measurement data is smooth based on the slope, the mean, and the peak-to-peak value includes: when the mean is less than the upper limit of the baseline, if the absolute value of the peak-to-peak value is less than a first smoothing threshold or the slope is less than a second smoothing threshold, determining that the measurement data is smooth.

[0025] This application also provides a method for determining the pressing mode of a button, including:

[0026] The channel data processing method described in any of the above embodiments is used to determine the first pressing mode of at least one channel corresponding to the button;

[0027] Determine the second state flag corresponding to the button based on at least one of the first pressing methods;

[0028] The second pressing method corresponding to the button is determined based on the second status flag.

[0029] Optionally, determining the second state flag corresponding to the button based on at least one first pressing method includes: performing logical operations on multiple first pressing methods to obtain an initial state of the button; and determining the second state flag based on the duration condition of the initial state of the button.

[0030] Optionally, the initial state of the button includes a pressed state and a released state; determining the second state flag corresponding to the button based on at least one first pressing method includes: if the pressed state occurs consecutively m1 times, the second state flag is determined as a second pressed flag; if the released state occurs consecutively m2 times, the second state flag is determined as a second released flag.

[0031] Optionally, the second pressing method includes pressing and releasing the hand; determining the second pressing method corresponding to the button according to the second state flag includes: when the second state flag changes from the second releasing flag to the second pressing flag for the first time, and the second pressing method is releasing the hand, setting the second pressing method to pressing and performing a second pressing count.

[0032] Optionally, determining the second pressing mode corresponding to the button based on the second state flag further includes: setting the second pressing mode to long press when the second pressing count is greater than or equal to the first counting threshold.

[0033] Optionally, determining the second pressing method corresponding to the button based on the second state flag further includes: performing a second release count when the second pressing method is not a long press and the second state flag changes from the second pressing flag to the second release flag; if the second release count is less than a second counting threshold when the second state flag changes from the second release flag to the second pressing flag, determining the second pressing method as a continuous click and incrementing the preset click count by one; if the second state flag does not change from the second release flag to the second pressing flag when the second release count is greater than or equal to the second counting threshold, determining the number of clicks based on the current click count.

[0034] Optionally, the condition for resetting the click count includes: setting the click count to zero when the second status flag changes from the second press flag to the second release flag.

[0035] This application also provides a channel data processing system, including:

[0036] The first determining module is used to determine a first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline;

[0037] The second determining module is used to determine the first pressing method corresponding to the detection channel based on the first status flag.

[0038] This application also provides a button press mode determination system, including:

[0039] The third determining module is used to determine the first pressing mode of at least one channel corresponding to the button using the channel data processing system described in any of the above embodiments.

[0040] The fourth determining module is used to determine the second state flag corresponding to the button based on at least one of the first pressing methods;

[0041] The fifth determining module is used to determine the second pressing method corresponding to the button based on the second state flag.

[0042] This application also provides an electronic device, including a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute any of the above-described channel data processing methods or any of the above-described button pressing method determination methods.

[0043] Optionally, the above-mentioned electronic device further includes a pressure sensor connected to the processor for acquiring the pressing characteristics of the sensing area to generate initial data.

[0044] Optionally, the above-mentioned electronic device further includes an AFE module, which is connected between the processor and the pressure sensor and is used to sample the sensing data of the pressure sensor to obtain the initial data.

[0045] Optionally, the processor is also configured to detect a calibration timing and execute a calibration algorithm at that timing.

[0046] The channel data processing, button pressing method and system, and electronic equipment provided in this application use pressure sensors to detect the pressing method of the user's finger or other pressing body. When the pressing body presses the corresponding button, the noise generated is small, and it has advantages such as strong waterproof performance and good user experience. It only requires an external AFE module to the processor to complete the required data sampling, without the need for other external SOC chips. It has a relatively simple circuit structure and can reduce the cost of pressing method detection.

[0047] The aforementioned channel data processing method determines a first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline. Based on the first state flag, the first pressing mode corresponding to the detection channel is quickly and accurately determined, thereby simultaneously improving the reliability and flexibility of the pressing mode detection process. The first state flag may include multiple state flags such as a first pressing flag and a first release flag. When each state flag is valid, a corresponding count is performed, enabling more accurate and stable identification of the first pressing mode based on each state flag and each count.

[0048] The above-mentioned method for determining the button's pressing mode uses the aforementioned channel data processing method to determine the first pressing mode of at least one channel corresponding to the button, thereby determining the second pressing mode of the button. This method is highly reliable and suitable for application scenarios where multiple detection channels correspond to one button. It can realize the mapping function of multiple sensor channels to a single button. The button response mode can be selected according to the user's usage. Specifically, the first pressing mode of each detection channel can be obtained first, and then the relevant fusion channel data can be obtained. Then, the second pressing mode of the button can be identified through a debounce method when the button is pressed and released, which can further improve the accuracy and stability of the pressing detection process. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a schematic flowchart of a channel data processing method according to an embodiment of this application;

[0051] Figure 2 This is a schematic diagram of an electronic device structure according to an embodiment of this application;

[0052] Figure 3 This is a schematic flowchart of a channel data processing method according to an embodiment of this application;

[0053] Figure 4 This is a partial flowchart of a channel data processing method according to an embodiment of this application;

[0054] Figure 5 This is a schematic flowchart of a method for determining the pressing mode of a button according to an embodiment of this application;

[0055] Figure 6 This is a schematic diagram of the channel data processing system structure according to an embodiment of this application;

[0056] Figure 7 This is a schematic diagram of a button pressing method determination system according to an embodiment of this application;

[0057] Figure 8 This is a schematic diagram of an electronic device structure according to an embodiment of this application;

[0058] Figure 9 This is a schematic diagram of an electronic device structure according to an embodiment of this application;

[0059] Figure 10 This is a schematic diagram of an electronic device structure according to an embodiment of this application. Detailed Implementation

[0060] The inventors researched traditional buttons and found that mechanical buttons are noisy and poorly waterproof, while capacitive touch buttons are prone to accidental triggering and susceptible to environmental influences. Touch buttons based on pressure sensors offer advantages such as strong waterproofing and a good user experience, but also suffer from small voltage fluctuations and temperature drift. Pressure-sensitive touch buttons work by attaching a sensor to the underside of the pressing medium (such as a plastic shell, metal shell, or PCB board). When the user presses the upper surface of the medium, the sensor generates a physical deformation, triggering a pressure signal and responding to the press event. This allows users to not only achieve the pressing function through finger pressure but also receive better feedback and a more immersive experience than traditional pressing methods. While pressure-sensitive touch buttons can improve the user experience of pressing operations to some extent, specific methods for detecting pressing events are relatively lacking.

[0061] To address the aforementioned issues, this application determines a first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline. Based on the first state flag, the pressing method corresponding to the detection channel is quickly and accurately determined. The aforementioned pressing method detection process has high reliability and flexibility.

[0062] The technical solutions in the embodiments of this application 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 this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.

[0063] The first aspect of this application provides a channel data processing method, with reference to... Figure 1 As shown, the above channel data processing method includes S110 and S120.

[0064] S110, determine the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline.

[0065] The aforementioned detection channels include channels that use pressure sensors to monitor the pressing state of a corresponding area and / or pressing status. Optionally, the pressure sensor includes a resistive sensor. In specific electronic devices, refer to... Figure 2 As shown, the pressure sensor is connected to the main control chip via an AFE (Analog Front-End) module to upload sensed data (such as initial data) to the main control chip. The AFE module samples the raw sensing data from the pressure sensor and converts the sampled data to obtain initial data, which the main control chip can directly read. The AFE module includes components such as an analog front-end module based on an ADC (Analog-to-Digital Converter), a DAC (Digital-to-Analog Converter), and a PGA (Programmable Gain Amplifier). The ADC performs analog-to-digital conversion, the DAC performs digital-to-analog conversion, and the PGA samples the raw sensing data from the pressure sensor. Optionally, the connection relationships of the components in the AFE module can be determined according to the corresponding functions of the AFE module. For example, the sampling terminal, PGA, ADC, and output terminal of the AFE module can be connected sequentially. This allows the PGA to sample the raw sensing data from the pressure sensor, and the ADC to convert the sampled data into initial data, which is then output to the main control chip.

[0066] Optionally, the measurement data includes at least one type of data, such as the current data acquired by the main control chip at the current moment. The baseline includes the baseline value corresponding to each data point in the measurement data, i.e., the baseline value corresponding to each moment. The first state flag may include flags indicating at least one state that the detection channel may face, such as a first press flag, a first release flag, and / or a long press flag, etc. The relationship between the measurement data and the baseline can characterize at least some of the first state flags. For example, a relatively small difference between the measurement data and the corresponding baseline value can characterize a valid release flag, while a relatively large difference can characterize a valid press flag, etc. In this way, the corresponding first state flag can be accurately determined based on the relationship between the measurement data and the baseline.

[0067] S120, determine the first pressing method corresponding to the detection channel based on the first status flag.

[0068] The first pressing method includes at least one pressing method that the corresponding detection channel needs to identify, such as the two basic pressing methods of pressing and releasing, or other pressing methods such as single click, double click, long press, and / or heavy press. Releasing the hand includes pressing methods where the hand or other pressing subject (or touch subject) does not exert pressure on the sensing area corresponding to the detection channel, such as when the user's finger leaves the corresponding sensing area. Optionally, the method for determining the first pressing method can be set based on the functional characteristics of the electronic device where the corresponding detection channel is located and / or the type of pressing method that needs to be identified. If the detection channel only needs to identify pressing and releasing pressing methods, the corresponding pressing method can be directly determined based on the validity of each flag in the first status flag, thereby improving the efficiency of pressing method determination. If the detection channel needs to identify other pressing methods such as long press, single click, and / or double click in addition to the two basic pressing methods of pressing and releasing, the corresponding pressing method can be determined based on the validity of each flag in the first status flag and the counting characteristics corresponding to each flag in the valid state, thereby improving the accuracy of the determined pressing method.

[0069] The aforementioned channel data processing method uses a pressure sensor to detect the pressing method of the user's finger or other pressing body. The noise generated when the pressing body presses the corresponding button is small, and the detected pressing method has higher reliability. The first state flag is determined based on the relationship between the measurement data obtained by the detection channel of the pressure sensor and the baseline. The first pressing method corresponding to the detection channel is quickly and accurately determined based on the first state flag, and the reliability and flexibility of the pressing method detection process are improved simultaneously.

[0070] In one embodiment, the first status flag includes a first press flag and a first release flag. Corresponding to the above... Figure 1Step S120, which involves determining the first pressing method corresponding to the detection channel based on the first status flag, includes: performing a first pressing count when the first pressing flag is valid, performing a first releasing count when the first releasing flag is valid; and determining the first pressing method based on the first pressing flag, the first releasing flag, the first pressing count, and / or the first releasing count.

[0071] The initial values ​​and counting units of the first press count and the first release count can be set according to factors such as counting accuracy and / or subsequent processing characteristics. For example, the initial values ​​can be set to 0, and each counting unit can be 1, etc., to simplify the subsequent counting process and related data processing. In this embodiment, the first press count is performed when the first press flag is valid, and the first release count is performed when the first release flag is valid. This allows the first press count to represent the corresponding press time, and the first release count to represent the corresponding release time. In this way, the pressing method corresponding to the detection channel can be determined more accurately based on the first press flag, the first release flag, the first press count, and / or the first release count.

[0072] Optionally, the method for determining the first pressing mode based on the first pressing flag, the first release flag, the first pressing count, and / or the first release count can be set according to factors such as the functional characteristics of the electronic device where the detection channel is located and / or the type of pressing mode to be identified. For example, when the first pressing flag is valid, a first pressing count exceeding 2 indicates that the current pressing mode is pressing; when the first release flag is valid, a first release count exceeding 2 indicates that the current pressing mode is releasing, and so on. Optionally, the electronic device or the corresponding main control chip can use one specified value to represent validity and another specified value to represent invalidity, such as using 1 to represent validity and 0 to represent invalidity, etc., to identify the validity of each flag in the first status flag based on relatively simple specified values, thereby improving identification efficiency.

[0073] In one example, determining the first pressing method based on the first press flag, the first release flag, the first press count, and / or the first release count includes: when the first press flag changes to the first release flag, if the first release count is greater than a preset combo threshold, the first pressing method is determined to be a single click; if the first release count is less than or equal to the combo threshold, the first pressing method is determined to be a combo. The combo threshold can be set based on factors such as the frequency of data collection by the main control chip, the initial value of the first release count, and / or the functional characteristics of the electronic device, for example, it can be set to a value of 4 or 5. Optionally, in this example, the first release count can be reset to zero after or before each first release count. In this way, if the first release count is greater than the combo threshold, it means that after the pressing body presses the corresponding sensing area, there is no further pressing of the sensing area, and the current first pressing method can be determined to be a single click; if the first release count is less than or equal to the combo threshold, it means that the pressing body presses the corresponding sensing area immediately, and the current first pressing method is a combo. As you can see, this example can accurately identify both single and double click presses.

[0074] In one example, the first status flag also includes a long-press flag. (Corresponding to...) Figure 1 In step S120, determining the first pressing method corresponding to the detection channel based on the first state flag further includes: when the first pressing flag is valid, performing a long press count; when the long press flag is invalid and the first pressing flag is valid, if the first pressing count is greater than or equal to the long press count, then the first pressing method is determined to be a long press. Optionally, the long press flag can be set to valid when the first pressing flag is valid and the first pressing count is greater than or equal to a certain threshold (such as a second long press threshold), which represents a long press state, and set to invalid when the long press state disappears. In this example, when the long press flag is invalid and the first pressing flag is valid, if the first pressing count is greater than or equal to the long press count, it indicates that the pressing method has lasted for a certain period of time, and the corresponding pressing method is a long press. It can be seen that this example can accurately identify the long press pressing method.

[0075] In one example, the first status flag further includes a hard press flag; the measurement data includes current data; wherein the current data includes data acquired at the current moment. Determining the first press method based on the first press flag, the first release flag, the first press count, and / or the first release count includes: when the first press method is a single click, if the difference between the current data and the corresponding baseline value is greater than a preset first hard press threshold, then the hard press flag is determined to be valid, and a hard press count is performed; otherwise, the hard press flag is determined to be invalid, and the hard press count is cleared (i.e., the hard press count is set to zero); the hard press method is identified based on the hard press count. Specifically, identifying the hard press method based on the hard press count includes: if the hard press count is greater than or equal to a second hard press threshold, the first press method is determined to be a hard press. Optionally, the first hard press threshold can be set based on factors such as the characteristics of the measurement data and / or the method of determining the corresponding baseline, and can typically be set to a value that represents a larger pressing force of the corresponding pressing body. The second hard press threshold can be set based on factors such as the frequency of data acquisition by the main control chip and / or the functional characteristics of the electronic device, for example, it can be set to a value of 4 or 5. In this example, when the first press method is a single click, and the difference between the current data and the corresponding baseline value is greater than the preset first heavy press threshold, the heavy press flag is determined to be valid, and a heavy press count is performed to identify the heavy press method based on the heavy press count, thus enabling accurate identification of the heavy press method.

[0076] In one example, Figure 1 In the corresponding step S120, before determining the first pressing method corresponding to the detection channel based on the first status flag, the channel data processing method further includes: if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, determining that the first pressing flag is invalid and the first release flag is valid; if the difference between the current data and the corresponding baseline value is greater than or equal to the first release threshold, determining that the first pressing flag is valid and the first release flag is invalid; so as to accurately determine the first pressing flag and the first release flag. Optionally, this example can use relatively simple level signals such as 0 or 1 to represent validity and / or invalidity, for example, using 1 to represent validity, using 0 to represent invalidity, etc., to simply and accurately represent the validity of each flag such as the first pressing flag and / or the first release flag.

[0077] Optionally, if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first press flag is determined to be invalid. After the first release flag is valid, the channel data processing method further includes: resetting the long press count and the first release count to zero. The aforementioned long press count is used when pressed, and is reset to zero after release, making the subsequent long press counting process more accurate. Here, the first release count is reset to zero so that the first release count can be restarted after the first release flag is valid, so that the first release count can accurately represent the duration of the current release state.

[0078] Optionally, if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first press flag is determined to be invalid. After the first release flag is valid, the channel data processing method further includes: if the long press count is greater than a preset long press update count, the long press count is set as the long press update count so that the corresponding baseline can be updated when the long press times out.

[0079] In one example, the step of performing a first press count when the first press flag is valid and performing a first release count when the first release flag is valid includes: when the first release flag is valid, if the first release count is greater than or equal to a preset second release threshold (count_double), then the first release count is set to the second release threshold to limit the maximum value of the first release count, making the first release count more standardized and simplifying the process of performing corresponding detection based on the first release count; if the first release count is less than the second release threshold, then when a measurement data is received, the first release count is increased by one count unit to perform ordered counting of the first release count.

[0080] When the first press flag is valid and the long press flag is invalid, if the first press count is greater than or equal to the long press count, the first press count is set to the long press count to make the first press count more standardized and simplify the process of performing corresponding detection based on the first press count; if the first press count is less than the long press count, when a measurement data is received, the first press count is increased by one counting unit to perform orderly counting of the first press count.

[0081] In one example, corresponding to the above Figure 1Step S120, determining the first pressing method corresponding to the detection channel based on the first state flag, further includes: if the first pressing method is a long press, or the first hand-off count is greater than or equal to the second hand-off threshold, then the first pressing count and the first hand-off count are cleared to zero, and the first pressing flag, the first hand-off flag, the long press flag, the hard press flag, and the forced update flag are set to invalid, and the first pressing method is determined to be a hand-off state. In this example, when the corresponding detection channel is in a long-press state or a long-term hand-off state, etc., for a relatively long period of time, the first pressing count and the first hand-off count are cleared to zero, and the first pressing flag, the first hand-off flag, the long press flag, the hard press flag, and the forced update flag are set to invalid, and the first pressing method is determined to be a hand-off state. This ensures that when the detection channel is in one state for a long time, various states are cleared, and each flag and count are re-determined based on the current state of the detection channel. This allows each flag and count to match the current state of the detection channel, which helps to eliminate interference caused by long-press states or long-term hand-off states to the real-time detection process.

[0082] In one embodiment, corresponding to the above Figure 1 In step S110, before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, refer to Figure 3 As shown, the channel data processing method further includes:

[0083] S130, Determine the base point based on the measurement data;

[0084] S140, determine the upper limit and lower limit of the baseline based on the base point and the preset baseline limit parameters, wherein the baseline limit parameters are used to describe the height of the baseline;

[0085] S150, determine the baseline value corresponding to each of the measurement data based on the measurement data, the upper limit of the baseline, and the lower limit of the baseline.

[0086] The baseline upper limit includes the maximum value of the baseline, the baseline lower limit includes the minimum value of the baseline, the baseline constraint parameter may include the difference between the baseline upper limit and the baseline lower limit, and the base point may include the average value between the baseline upper limit and the baseline lower limit. Step S150 determines the baseline value to be between the baseline upper limit and the baseline lower limit, and the difference between the baseline value and the measured data is less than or equal to a set baseline threshold value, so as to accurately and stably determine the baseline value based on the measured data. Optionally, the baseline threshold may include a relatively small value such as 1 or 2 to ensure that the baseline value is consistent with the corresponding measured data.

[0087] In one example, determining the baseline value corresponding to each measurement data point based on the measurement data, the baseline upper limit, and the baseline lower limit includes: when the nth data point is greater than the baseline upper limit, determining the nth baseline value corresponding to the nth data point based on the baseline upper limit, such as setting the nth baseline value as the baseline upper limit to ensure that the nth baseline value is not greater than the baseline upper limit; when the nth data point is less than the baseline lower limit, determining the nth baseline value based on the baseline lower limit, such as setting the nth baseline value as the baseline lower limit to ensure that the nth baseline value is not less than the baseline lower limit; when the nth data point is less than or equal to the baseline upper limit and greater than or equal to the baseline lower limit, determining the nth baseline value based on the nth data point, such as setting the nth baseline value as the nth data point to ensure that the nth baseline value is consistent with the nth data point. Optionally, the nth data point may include one corresponding to the current time, such as the nth data point including the current data, etc. This example can accurately determine the baseline value corresponding to each time point, enabling the baseline to accurately and stably track the measurement data. It can effectively cope with slow data temperature drift changes, and the maximum value of the baseline value is the upper limit of the baseline, while the minimum value is the lower limit of the baseline, ensuring the stability of the corresponding baseline.

[0088] In one example, determining the baseline value corresponding to each of the measurement data based on the measurement data, the baseline upper limit, and the baseline lower limit further includes: when the number of times the baseline value equals the baseline upper limit or the baseline lower limit exceeds a preset number consecutively, setting a forced update flag to be valid, so that the base point can be re-determined when it is possible to accurately determine the base point based on the measurement data; when the forced update flag is valid and the measurement data is in a smooth state, updating the base point (e.g., determining the base point based on the corresponding measurement data, etc.) to ensure the accuracy of the updated base point, and setting the forced update flag to be invalid to prevent subsequent repeated updates of the base point, thus ensuring the validity of each base point update event. Optionally, the preset number may include 4 or 5 times. When the number of times the baseline value equals the baseline upper limit or the baseline lower limit exceeds the preset number consecutively, it indicates that the current base point (or the corresponding baseline upper limit or lower limit) does not match the measurement data and needs to be updated so that the updated base point matches the measurement data, thereby ensuring that the baseline upper limit, baseline lower limit, and baseline value all match the measurement data, thus ensuring the accuracy of the determined baseline value.

[0089] Optionally, the method for setting the forced update flag further includes: when the long press count is greater than a first long press threshold, the first release flag is invalid, the measurement data is in a non-smooth state, and the first press flag is invalid, setting the forced update flag to be valid, so as to re-determine the base point when the base point can be accurately determined based on the measurement data.

[0090] In one example, after determining the baseline value corresponding to each of the measurement data based on the measurement data, the upper baseline limit, and the lower baseline limit, referencing Figure 4 As shown, the channel data processing method further includes steps S131 to S135.

[0091] S131, set a first period and a second period for updating the base point. The first period includes m second periods. The first first period and the first second period have the same start time. For example, the first period includes 2 second periods. The start time of each first period is the start time of the second period, etc.

[0092] S132, identify the start time of the first cycle.

[0093] S133, determine whether the measurement data is smooth. If the measurement data is smooth, return to step S130 and continue to step S133.

[0094] S134, if the measurement data is not smooth, then in the next second cycle, it is identified whether the measurement data is smooth.

[0095] S135, if the measurement data is in a smooth state, return to step S130 and continue to step S133; if the measurement data is in a non-smooth state, continue to step S134, so as to detect whether the conditions for updating the base point are met in the second cycle when the base point is not updated, and update the base point when the conditions for updating the base point are met, so as to ensure the accuracy of the baseline update process. When updating the base point, the base point is updated in the first cycle to improve the base point update efficiency.

[0096] In one embodiment, corresponding to the above Figure 1In step S110, before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, the channel data processing method further includes: filtering the initial data to obtain filtered data; storing the filtered data sequentially into a preset first array, and when storing a new piece of filtered data after the elements of the first array are full, discarding the first stored filtered data, moving the filtered data stored in each element to the previous element, and storing the new filtered data in the last element; determining the first array formed at time n as the measurement data at time n, so that the first array includes the filtered data obtained at time n and multiple times before time n, ensuring the continuity and integrity of the filtered data included in the first array. Optionally, the number of elements in the first array can be 5 to 8, such as 5, 6, or 8, etc. Optionally, the initial data includes the original press data obtained by the detection channel for the corresponding sensing area at set intervals; the original press data may include data such as the voltage difference corresponding to the pressure sensor. The set interval may include a duration such as 10ms.

[0097] In one example, the first array has 5 elements, including buff[0], buff[1], buff[2], buff[3], and buff[4]. buff[4] stores the latest filtered data. The filtered data at each time step are sequentially placed into buff[0], buff[2], ..., buff[4]. After each element has its corresponding filtered data, when the filtered data at time n is obtained, the filtered data stored in buff[0] is discarded, and the filtered data stored in each element is moved into the previous element, that is, buff[i] is written into buff[i-1]. The value of i includes 4, 3, 2, and 1, etc. Then the filtered data at time n is stored into buff[4] so that the first array containing the filtered data at time n can accurately and completely represent the measurement data at time n.

[0098] In one example, the filtering process on the initial data to obtain filtered data includes:

[0099] The initial data at time n is determined as the last element of the second array, which includes the first element, the middle element, and the last element.

[0100] Obtain the range of multiple consecutive initial data including the nth initial data, wherein the range includes the difference between the maximum and minimum values ​​among the multiple consecutive initial data, and the multiple consecutive initial data includes multiple initial data such as 200 or 250 with the nth initial data as the last data.

[0101] If the first element, the middle element, the last element, and the range conform to a preset relationship, then the average value of the first element and the last element is assigned to the first element, and the last element is assigned to the middle element. The filtered data at time n is determined based on the updated first element. The preset relationship is used to characterize the smoothness between the first element, the middle element, and the last element. If the first element, the middle element, the last element, and the range conform to the preset relationship, it indicates that the first element, the middle element, and the last element are in a smooth state. In this way, each element in the second array is updated, and the initial data can be smoothed and filtered.

[0102] This example effectively filters out noisy data from the initial data, ensuring the accuracy of the resulting filtered data.

[0103] Optionally, the preset relationship includes: the difference between the middle element and one-third of the range is greater than the first element and the last element, respectively; or, the sum between the middle element and one-third of the range is less than the first element and the last element. Specifically, the second array can be buff_raw, the first element is buff_raw[0], the middle element is buff_raw[1], the last element is buff_raw[2], and the range is noise_pt. The filtering process corresponding to the initial data can include: when buff_raw[1] minus noise_pt / 3 is still greater than buff_raw[0] and buff_raw[2], or buff_raw[1] plus noise_pt / 3 is still less than buff_raw[0] and buff_raw[2]. When buff_raw[1] = (buff_raw[0] + buff_raw[2]) / 2, the first two raw data are assigned to buff_raw[0] and buff_raw[1] respectively. Then, the newly collected data is put into buff_raw[2]. After updating the above elements, the value of buff_raw[1] is assigned to buff_raw[0], the value of buff_raw[2] is assigned to buff_raw[1], and biff_raw[0] is passed to the main function of the algorithm as the filtered data. And so on. The range noise_pt can be the peak-to-peak value of 200 samples of data (200 consecutive initial data with the nth initial data as the last data). The peak-to-peak value includes the difference between the maximum and minimum values ​​in the 200 consecutive initial data.

[0104] In one example, the channel data processing method further includes: calculating the slope, mean, and peak-to-peak value of the measurement data based on the first array; and identifying whether the measurement data is smooth based on the slope, mean, and peak-to-peak value. This example can calculate the slope, mean, and peak-to-peak value based on the filtered data stored in each element of the first array to ensure the accuracy of the obtained slope, mean, and peak-to-peak value, thereby improving the accuracy of the subsequently identified smoothness state. Optionally, the peak-to-peak value is the difference between the maximum and minimum values ​​of the filtered data stored in each element of the first array.

[0105] Optionally, this example can also set relevant weights to amplify the slope, so that the threshold range set in the subsequent smooth state recognition process can be wider, thereby improving the recognition accuracy of the smooth state. Taking the first array including the five elements buff[0], buff[1], buff[2], buff[3], and buff[4] as an example, the slope K is calculated. The formula for calculating the slope K can include: K = 2*(buff[4]-buff[2])+(buff3]-buff[1])+(buff2]-buff[0]). The formula for calculating the slope K includes the sum of three differences. The slope based on two consecutive discrete points can be estimated by the difference between the two points. Amplifying the difference between buff[4] and buff[2] allows the threshold range set in the subsequent smooth state recognition process to be wider, thereby improving the recognition accuracy.

[0106] Optionally, identifying whether the measurement data is smooth based on the slope, the mean, and the peak-to-peak value includes: when the mean is less than the upper limit of the baseline, if the absolute value of the peak-to-peak value is less than a first smoothing threshold or the slope is less than a second smoothing threshold, then the measurement data is determined to be smooth, i.e., the measurement data is in a smooth state. The aforementioned first and / or second smoothing thresholds can be set based on factors such as the specific characteristics of the measurement data. This allows for quick and accurate identification of whether the measurement data is smooth.

[0107] The above channel data processing method uses pressure sensors to detect the pressing pattern of the user's finger or other pressing object. This method generates less noise when the pressing object presses the corresponding button, resulting in higher reliability of the detected pressing pattern. A first state flag is determined based on the relationship between the measurement data obtained from the pressure sensor's detection channel and the baseline. This first state flag quickly and accurately determines the first pressing pattern corresponding to the detection channel, simultaneously improving both reliability and flexibility in the pressing pattern detection process. The first state flag can include multiple state flags such as a first pressing flag and a first release flag. Each valid state flag is counted accordingly, enabling more accurate and stable identification of the first pressing pattern based on each state flag and each count.

[0108] This application provides a method for determining the pressing mode of a button in a second aspect, referring to... Figure 5 As shown, the method for determining the pressing mode of the button includes steps S210 to S230.

[0109] S210, the first pressing mode of at least one channel corresponding to the button is determined by the channel data processing method described in any of the above embodiments.

[0110] S220, determine the second state flag corresponding to the button based on at least one of the first pressing methods.

[0111] Step S220 described above can perform logical operations and other fusion processing on the first pressing mode of the channel based on features such as the number of channels corresponding to the button and / or the size of the sensing area, to obtain a second state flag representing the current pressed state of the button. Optionally, if the button corresponds to only one detection channel, the second state flag and the second pressing mode of the button can be directly determined based on the first pressing mode of the detection channel to improve determination efficiency. If the button corresponds to multiple detection channels, logical operations and / or continuous condition judgment operations can be performed on the first pressing modes of each detection channel to determine the second state flag, thereby improving the accuracy of the determined second state flag.

[0112] S230, determine the second pressing method corresponding to the button according to the second status flag.

[0113] The above step S230 can determine the second pressing method based on factors such as the change characteristics of the second state flag and / or the duration of each state flag, so as to match the environmental characteristics corresponding to the button and improve the accuracy of the determined second pressing method.

[0114] In one embodiment, determining the second state flag corresponding to the button based on at least one first pressing method includes: performing logical operations on multiple first pressing methods to obtain an initial state of the button; and determining the second state flag based on the duration condition of the initial state of the button.

[0115] Optionally, the first pressing method may include basic pressing methods such as pressing and / or releasing. Optionally, the logical operation rules corresponding to the first pressing method can be determined based on characteristics such as the size of the sensing area (or pressing area). For example, when the area of ​​the sensing area is greater than a set area, a logical OR operation is used, and the first pressing method of each channel is logically ORed to obtain the initial state of the button corresponding to the button; when the area of ​​the sensing area is less than or equal to the set area, a logical AND operation is used, and the first pressing method of each channel is logically ANDed to obtain the initial state of the button corresponding to the button.

[0116] Optionally, the initial state of the button includes a pressed state and a released state; determining the second state flag corresponding to the button based on at least one first pressing method includes: if the pressed state occurs consecutively m1 times, the second state flag is determined as a second pressed flag; if the released state occurs consecutively m2 times, the second state flag is determined as a second released flag. Optionally, m1 and m2 can be set according to the detection efficiency and detection accuracy of the second pressing method, for example, m1 and m2 can both be set to 2 or 3. Here, determining the second state flag as a second pressed flag when the pressed state occurs consecutively m1 times, and determining the second released flag as a second released flag when the released state occurs consecutively m2 times, can avoid interference from related noise during the determination of the second state flag and improve the accuracy of the determined second state flag. Optionally, fusion_flag can be used to represent the initial state of the button, with fusion_flag being 1 representing the pressed state and fusion_flag being 0 representing the released state. key_flag can be used to represent the second state flag, with key_flag being 1 representing the second pressed flag and key_flag being 0 representing the second released flag. If fusion_flag is 1 for m1 consecutive times, key_flag is set to 1. If fusion_flag is 0 for m2 consecutive times, key_flag is set to 0.

[0117] In one example, the second pressing method includes pressing and releasing the hand. Determining the second pressing method corresponding to the button based on the second status flag includes: when the second status flag first changes from the second release flag to the second pressing flag, and the second pressing method is releasing the hand, setting the second pressing method to pressing and performing a second pressing count. In this example, "first time" includes the first time of each pressing event, so that each pressing event can be detected independently, improving the reliability of the detection process. Specifically, this example can use `key_status` to represent the second pressing method, where `key_status` of 1 represents pressing and `key_status` of 0 represents releasing the hand. `key_count_high` is used to represent the second pressing count. When the second status flag `key_flag` first changes from 0 to 1, and the second pressing method `key_status` is 0, `key_status` is set to 1 to initially set the second pressing method to pressing. At this time, the second pressing count `key_count_high` can start counting from 0 to detect the pressing duration in the current pressing event.

[0118] In one example, determining the second pressing mode corresponding to the button based on the second status flag further includes: setting the second pressing mode to a long press when the second pressing count is greater than or equal to a first counting threshold. This example can use CNT_CLICK_LONG to represent the first counting threshold and key_status = 0xff to represent a long press. The first counting threshold CNT_CLICK_LONG can be set based on factors such as the functional characteristics of the corresponding button. key_status[key_num] represents the click count, and key_event[key_num] represents the number of clicks in each pressing event, to accurately count each operation and / or event during the detection process. Specifically, when the second pressing count is greater than or equal to the first counting threshold CNT_CLICK_LONG, the second pressing mode key_status becomes 0xff, and the status pressing value stored in the click count key_status[key_num] is assigned to the click count key_event[key_num].

[0119] In one example, determining the second pressing method corresponding to the button based on the second status flag further includes: when the second pressing method is not a long press (i.e., key_status is not 0xff) and the second status flag key_flag changes from the second pressing flag to the second release flag, performing a second release count; until the second status flag key_flag changes from the second release flag to the second pressing flag again, if the second release count is less than the second counting threshold, the second pressing method key_status is determined to be a combo, and the preset click count key_status[key_num] is incremented by one, so as to accurately update the click count key_status[key_num] based on accurate detection of combos; if the second release count is greater than or equal to the second counting threshold, and the second status flag key_flag does not change from the second release flag to the second pressing flag, the click count key_event[key_num] is determined based on the current click count key_status[key_num], so as to accurately determine the number of clicks in the corresponding pressing event. Optionally, the second counting threshold, also known as the double-press response count, can be represented by CNT_CLICK_DOUBLE to identify the second press method of long press. The second counting threshold CNT_CLICK_DOUBLE can be set according to factors such as the functional characteristics of the corresponding button. Here, key_count_low can be used to represent the second off-hand count. The initial value of the second off-hand count key_count_low is 0 for each press event. When the second press method key_status is not 0xff (not a long press state) and the second press method key_flag changes from 1 to 0, the second off-hand count key_count_low starts counting from 0. Until the second press method key_flag changes from 0 to 1 again, it is determined whether the second off-hand count key_count_low is less than the second counting threshold CNT_CLICK_DOUBLE. If the second off-hand count key_count_low is less than the second counting threshold CNT_CLICK_DOUBLE, then the second press method key_status is determined to be a double press, and the click count key_status[key_num] is incremented by 1.If the second off-hand count key_count_low accumulates to the second counting threshold CNT_CLICK_DOUBLE and no click has occurred, then the click count key_status[key_num] is assigned to the click count key_event[key_num], and then the click count key_status[key_num] is set to 0. Subsequent clicks (i.e., the second status flag key_flag is reset to 1) are considered the start of a new press event, and the click count key_status[key_num] is re-counted, such as being reassigned to 1, so that the click count key_status[key_num] is counted independently in each press event, ultimately accurately representing the number of clicks in each press event.

[0120] Optionally, the condition for resetting the click count includes: when the second status flag key_flag changes from the second press flag to the second release flag, the click count key_status[key_num] is set to zero. Specifically, when the second status flag key_flag changes from 1 to 0, key_status[key_num] is assigned to 0, and key_count_low can be assigned to the second counting threshold CNT_CLICK_DOUBLE. At this time, there is no longer a continuous press response interval, and subsequent clicks are considered to be the start of a new click, that is, subsequent clicks belong to the next press event. In this way, subsequent clicks and other operations will not be considered as continuous presses or other related press methods of the current press event, which can ensure the independence of each press event.

[0121] Optionally, when the second off-hand count key_count_low is greater than the second counting threshold CNT_CLICK_DOUBLE, the second counting threshold CNT_CLICK_DOUBLE can be assigned to the second off-hand count key_count_low to limit the maximum value of the second off-hand count key_count_low and simplify the computational workload of the subsequent detection process.

[0122] Optionally, in the above method for determining a pressing mode of a key, key_flag being 1 may be used to represent pressing, and key_flag being 0 may be used to represent releasing (finger off); key_event is used to represent the final status report (for example, 1 represents single click, 2 represents double click, n (2<n<254) represents n consecutive clicks, 255 represents long press, etc.), so as to improve the orderliness of the corresponding data transmission process of the processor or main control chip. Optionally, after the processor or main control chip acquires required data such as the pressing mode of the key, initialization processing (such as zero clearing, etc.) may be performed on each status and / or count to carry out subsequent detection, so that each subsequent detection work is independent of the current detection process, and the accuracy of each detection process is improved.

[0123] In the above method for determining a pressing mode of a key, the channel data processing method described in any one of the above embodiments is adopted to determine the first pressing mode of at least one channel corresponding to the key, so as to determine the second pressing mode corresponding to the key, which has higher reliability; the method for determining a pressing mode of a key is applicable to application scenarios where multiple detection channels correspond to one key, can realize the mapping function of multiple sensor channels corresponding to a single key, and select a key response mode according to the user's usage situation. Specifically, the first pressing mode of each detection channel may be acquired first, then the relevant fused channel data is acquired, and then the second pressing mode of the key is identified through a debounce manner when the key is pressed and released, which can further improve the accuracy and stability of the pressing detection process.

[0124] In a third aspect, the present application provides a channel data processing system, with reference to Figure 6 as shown, comprising:

[0125] a first determining module 310, configured to determine a first status flag according to the relationship between the measurement data obtained by the detection channel of the pressure sensor and the baseline;

[0126] a second determining module 320, configured to determine the first pressing mode corresponding to the detection channel according to the first status flag.

[0127] For specific limitations on the channel data processing system, reference may be made to the above limitations on the channel data processing method, which will not be repeated herein. Each of the above modules in the channel data processing system may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in or independent of the operation module of the computer device in the form of hardware, or may be stored in the memory of the computer device in the form of software, so that the operation module of the computer device can call and execute the operations corresponding to each of the above modules.

[0128] In a fourth aspect, the present application provides a system for determining a pressing mode of a key, with reference to Figure 7 as shown, comprising:

[0129] The third determining module 410 is used to determine the first pressing mode of at least one channel corresponding to the button using the channel data processing system described in any of the above embodiments.

[0130] The fourth determining module 420 is used to determine the second state flag corresponding to the button based on at least one of the first pressing methods;

[0131] The fifth determining module 430 is used to determine the second pressing method corresponding to the button based on the second state flag.

[0132] For specific limitations regarding the key press mode determination system, please refer to the limitations of the key press mode determination method described above, which will not be repeated here. Each module in the aforementioned key press mode determination system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the computing module in the computer device, or stored in software in the computer device's memory, so that the computer device's computing module can call and execute the corresponding operations of each module.

[0133] This application provides an electronic device in a fifth aspect, which may include smart devices such as mobile phones and / or headphones that need to detect press events. (Reference) Figure 8 As shown, the electronic device includes a processor 620 and a storage medium 630; the storage medium 630 stores program code; the processor 620 is used to call the program code stored in the storage medium 630 to execute the channel data processing method provided in any of the above embodiments or the key press mode determination method provided in any of the above embodiments. Optionally, the processor 620 may include a smart processing chip such as a main control chip for detecting corresponding press events.

[0134] In one embodiment, reference Figure 9 As shown, the aforementioned electronic device also includes a pressure sensor 640, which is connected to the processor 620 and used to acquire the pressing characteristics of the sensing area to generate initial data, which is then uploaded to the processor 620. Optionally, the pressure sensor 640 may include multiple resistors connected in series to more stably acquire the pressing characteristics of the sensing area. This embodiment uses a resistive pressure sensor to acquire the pressing characteristics of the sensing area, which has high reliability and generates less noise when the corresponding button is pressed, thus improving the pressing experience provided by the corresponding electronic device.

[0135] In one example, reference Figure 10As shown, the aforementioned electronic device also includes an AFE module 650, which is connected between the processor 620 and the pressure sensor 640. The AFE module 650 samples the sensing data from the pressure sensor 640 to obtain the initial data, making the initial data more standardized. The AFE module can sample the raw sensing data from the pressure sensor and perform corresponding conversions on the sampled data to obtain the initial data, enabling the main control chip to directly read the initial data. The AFE module includes components such as an analog front-end module based on an ADC (analog-to-digital converter), a DAC (digital-to-analog converter), and a PGA (programmable gain amplifier); where the ADC can be used for analog-to-digital conversion, the DAC for digital-to-analog conversion, and the PGA for sampling the raw sensing data from the pressure sensor. Optionally, the connection relationships of the various components in the AFE module can be determined according to the corresponding functions of the AFE module. For example, the sampling terminal, PGA, ADC, and output terminal of the AFE module can be connected sequentially. In this way, the PGA can sample the raw sensing data of the pressure sensor through the sampling terminal, and the ADC can convert the sampled data into initial data and output it to the main control chip through the output terminal. This allows for stable sampling of sensing data, converting the sampled sensing data into a digital signal, and obtaining the initial data represented by the sampled digital signal. Optionally, the AFE module 650 includes a stable chip such as the AW8680X chip or the AW8686X chip.

[0136] Optionally, the processor 620 is further configured to detect a calibration timing and execute a calibration algorithm at that timing. The calibration timing refers to the point when calibration of the processor 620 and the AFE module 650 is required, such as when the second status flag key_flag is 0 and the collected relevant data exceeds the chip calibration limit. In this case, the processor 620 executes a calibration algorithm to calibrate the relevant functional modules of the processor 620 and the AFE module 650, enabling them to accurately and stably perform the testing operation. Optionally, the calibration algorithm includes algorithms such as an initialization algorithm capable of calibrating the relevant functional modules of the processor 620 and the AFE module 650. In one example, the processor 620 executing the calibration algorithm at the calibration timing may include: the processor 620 executing a fast initialization algorithm at the calibration timing, and then controlling the AFE module 650 to normally sample the sensing data from the pressure sensor 640. In one example, the processor 620 may execute a calibration algorithm during calibration by first recording various types of data before calibration, then executing a fast initialization algorithm, and then controlling the AFE module 650 to normally sample the sensing data of the pressure sensor 640. Based on the newly acquired initial data and various types of data before calibration, the pressing method is detected, thereby maintaining the continuity of the sampled data and avoiding the need to re-accumulate data.

[0137] The above electronic devices use a pressure sensor 640 to detect the pressing method of the user's finger or other pressing body. When the pressing body presses the corresponding button, the noise generated is small, and it has advantages such as strong waterproof performance and good user experience. It only requires the processor 620 to connect an external AFE module 650 to complete the required data sampling. It does not require any other SOC (System-on-a-Chip) chip, has a relatively simple circuit structure, and can reduce the cost of pressing method detection.

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

[0139] That is, the above description is only an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made using the content of this application’s specification and drawings, such as the combination of technical features between different embodiments, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of this application.

[0140] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0141] The above description is provided to enable any person skilled in the art to implement and use this application. Various details are set forth in the above description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other embodiments, well-known processes will not be described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.

Claims

1. A method of processing data in a channel, characterized by, include: The first state flag is determined based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline; The first pressing method corresponding to the detection channel is determined based on the first status flag; The first status flag includes a first press flag and a first release flag; Before determining the first pressing method corresponding to the detection channel based on the first status flag, the channel data processing method further includes: if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first pressing flag is determined to be invalid and the first release flag is determined to be valid; if the difference between the current data and the corresponding baseline value is greater than or equal to the first release threshold, the first pressing flag is determined to be valid and the first release flag is determined to be invalid. The step of determining the first pressing method corresponding to the detection channel based on the first status flag includes: performing a first pressing count when the first pressing flag is valid, performing a first releasing count when the first releasing flag is valid; and determining the first pressing method based on the first pressing flag, the first releasing flag, the first pressing count, and / or the first releasing count.

2. The channel data processing method according to claim 1, characterized in that, Determining the first pressing method based on the first pressing indicator, the first release indicator, the first pressing count, and / or the first release count includes: When the first press indicator changes to the first release indicator, if the first release count is greater than a preset combo threshold, the first press method is determined to be a single click; if the first release count is less than or equal to the combo threshold, the first press method is determined to be a combo.

3. The channel data processing method according to claim 1, characterized in that, The first status flag also includes a long press flag; The step of determining the first pressing method corresponding to the detection channel based on the first status flag further includes: While the first press indicator is active, a long press count is performed. When the long press flag is invalid and the first press flag is valid, if the first press count is greater than or equal to the long press count, then the first press method is determined to be a long press.

4. The channel data processing method according to claim 1, characterized in that, The first status flag also includes a hard press flag; the measurement data includes current data; Determining the first pressing method based on the first pressing indicator, the first release indicator, the first pressing count, and / or the first release count includes: When the first pressing method is a single click, if the difference between the current data and the corresponding baseline value is greater than the preset first heavy press threshold, the heavy press flag is determined to be valid and heavy press counting is performed. The method of repeated presses is identified based on the repeated press count.

5. The channel data processing method according to claim 1, characterized in that, If the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first press flag is determined to be invalid. After the first release flag is valid, the channel data processing method further includes: Reset the long press count and the first off-hand count to zero; If the long press count is greater than the preset long press update count, then the long press count is set as the long press update count.

6. The channel data processing method according to claim 1, characterized in that, The step of performing a first press count when the first press indicator is valid, and performing a first release count when the first release indicator is valid, includes: When the first hand-off flag is valid, if the first hand-off count is greater than or equal to a preset second hand-off threshold, the first hand-off count is set to the second hand-off threshold; if the first hand-off count is less than the second hand-off threshold, the first hand-off count is incremented by one unit when a measurement data is received. When the first press flag is valid and the long press flag is invalid, if the first press count is greater than or equal to the long press count, the first press count is set to the long press count; if the first press count is less than the long press count, the first press count is incremented by one unit when a measurement data is received.

7. The channel data processing method according to claim 1, characterized in that, The step of determining the first pressing method corresponding to the detection channel based on the first status flag further includes: If the first press method is a long press, or the first hand-off count is greater than or equal to the second hand-off threshold, then the first press count and the first hand-off count are cleared to zero, and the first press flag, the first hand-off flag, the long press flag, the hard press flag, and the forced update flag are set to invalid, and the first press method is determined to be a hand-off state.

8. The channel data processing method according to claim 1, characterized in that, Before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, the channel data processing method further includes: S130, Determine the base point based on the measurement data; S140, determine the upper limit and lower limit of the baseline based on the base point and the preset baseline limit parameters, wherein the baseline limit parameters are used to describe the height of the baseline; S150, determine the baseline value corresponding to each of the measurement data based on the measurement data, the upper limit of the baseline, and the lower limit of the baseline.

9. The channel data processing method according to claim 8, characterized in that, Determining the baseline value corresponding to each measurement data point based on the measurement data, the upper baseline limit, and the lower baseline limit includes: When the nth data point is greater than the upper limit of the baseline, the nth baseline value corresponding to the nth data point is determined according to the upper limit of the baseline. When the nth data point is less than the lower limit of the baseline, the nth baseline value is determined according to the lower limit of the baseline. When the nth data point is less than or equal to the upper limit of the baseline and greater than or equal to the lower limit of the baseline, the nth baseline value is determined according to the nth data point.

10. The channel data processing method according to claim 8, characterized in that, The step of determining the baseline value corresponding to each measurement data point based on the measurement data, the upper baseline limit, and the lower baseline limit further includes: If the number of times the baseline value is equal to the upper limit of the baseline or the lower limit of the baseline exceeds a preset number consecutively, the forced update flag will be set to valid; When the forced update flag is valid and the measurement data is in a smooth state, update the base point and invalidate the forced update flag.

11. The channel data processing method according to claim 10, characterized in that, The method for setting the forced update flag also includes: When the long press count is greater than the first long press threshold, the first release flag is invalid, the measurement data is in a non-smooth state, and the first press flag is invalid, the forced update flag is set to valid.

12. The channel data processing method according to claim 8, characterized in that, After determining the baseline value corresponding to each measurement data point based on the measurement data, the upper baseline limit, and the lower baseline limit, the channel data processing method further includes: S131, set a first period and a second period for updating the base point, the first period includes m second periods, and the first first period and the first second period have the same start time; S132, identify the start time of the first cycle; S133, determine whether the measurement data is in a smooth state. If the measurement data is in a smooth state, return to step S130 and continue to step S133. S134, if the measurement data is not smooth, then in the next second cycle, identify whether the measurement data is smooth; S135, if the measurement data is in a smooth state, return to step S130 and continue to step S133.

13. The channel data processing method according to claim 1, characterized in that, Before determining the first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline, the channel data processing method further includes: The initial data is filtered to obtain filtered data; The filtered data is stored sequentially into a preset first array. When a new filtered data is stored after the first array is full, the first filtered data is discarded, the filtered data stored in each element is moved to the previous element, and the new filtered data is stored in the last element. The first array formed at time n is determined as the measurement data at time n.

14. The channel data processing method according to claim 13, characterized in that, The filtering process for the initial data to obtain filtered data includes: The initial data at time n is determined as the last element of the second array, which includes the first element, the middle element, and the last element. Obtain the range of multiple consecutive initial data including the nth initial data; If the first element, the middle element, the last element, and the range conform to a preset relationship, then the average value of the first element and the last element is assigned to the first element, and the last element is assigned to the middle element. The filtered data at time n is determined based on the updated first element. The preset relationship is used to characterize the smoothness between the first element, the middle element, and the last element.

15. The channel data processing method according to claim 14, characterized in that, The preset relationships include: The difference between the intermediate element and one-third of the range is greater than the first element and the last element; or, the sum between the intermediate element and one-third of the range is less than the first element and the last element.

16. The channel data processing method according to claim 13, characterized in that, The channel data processing method further includes: Calculate the slope, mean, and peak-to-peak value of the measured data based on the first array; The smoothness of the measurement data is identified based on the slope, the mean, and the peak-to-peak value.

17. The channel data processing method according to claim 16, characterized in that, The step of identifying whether the measurement data is smooth based on the slope, the mean, and the peak-to-peak value includes: When the mean is less than the upper limit of the baseline, if the absolute value of the peak value is less than the first smoothing threshold or the slope is less than the second smoothing threshold, the measurement data is determined to be smooth.

18. A method for determining the pressing mode of a button, characterized in that, include: The channel data processing method according to any one of claims 1 to 17 is used to determine the first pressing mode of at least one channel corresponding to the button; Determine the second state flag corresponding to the button based on at least one of the first pressing methods; The second pressing method corresponding to the button is determined based on the second status flag.

19. The method for determining the pressing mode of a button according to claim 18, characterized in that, The step of determining the second state flag corresponding to the button based on at least one of the first pressing methods includes: Perform logical operations on multiple first press methods to obtain the initial state of the button; The second state flag is determined based on the duration condition of the initial state of the button.

20. The method for determining the pressing mode of a button according to claim 19, characterized in that, The initial states of the button include the pressed state and the released state; The step of determining the second state flag corresponding to the button based on at least one of the first pressing methods includes: if the pressing state occurs continuously for m1 times, the second state flag is determined as a second pressing flag; if the release state occurs continuously for m2 times, the second state flag is determined as a second release flag.

21. The method for determining the pressing mode of a button according to claim 20, characterized in that, The second pressing method includes pressing and releasing; determining the second pressing method corresponding to the button based on the second status flag includes: When the second status flag changes from the second off-hand flag to the second press flag for the first time, and the second press method is off-hand, the second press method is set to press, and the second press count is performed.

22. The method for determining the pressing mode of a button according to claim 21, characterized in that, The step of determining the second pressing method corresponding to the button based on the second status flag further includes: When the second press count is greater than or equal to the first count threshold, the second press mode is set to long press.

23. The method for determining the pressing mode of a button according to claim 21, characterized in that, The step of determining the second pressing method corresponding to the button based on the second status flag further includes: When the second pressing method is not a long press, and the second status flag changes from the second pressing flag to the second release flag, the second release count is performed; When the second status flag changes from the second off-hand flag to the second press flag, if the second off-hand count is less than the second count threshold, the second press method is determined to be a continuous click, and the preset click count is incremented by one; If the second state flag does not change from the second hand-off flag to the second press flag when the second hand-off count is greater than or equal to the second count threshold, the number of clicks is determined based on the current click count.

24. The method for determining the pressing mode of a button according to claim 23, characterized in that, The condition for resetting the click count includes: when the second status flag changes from the second press flag to the second release flag, the click count is set to zero.

25. A channel data processing system, characterized in that, include: The first determining module is used to determine a first state flag based on the relationship between the measurement data obtained from the detection channel of the pressure sensor and the baseline; The second determining module is used to determine the first pressing method corresponding to the detection channel based on the first status flag. The first status flag includes a first press flag and a first release flag; Before determining the first pressing method corresponding to the detection channel based on the first status flag, the channel data processing method further includes: if the difference between the current data and the corresponding baseline value is less than a preset first release threshold, the first pressing flag is determined to be invalid and the first release flag is determined to be valid; if the difference between the current data and the corresponding baseline value is greater than or equal to the first release threshold, the first pressing flag is determined to be valid and the first release flag is determined to be invalid. The step of determining the first pressing method corresponding to the detection channel based on the first status flag includes: performing a first pressing count when the first pressing flag is valid, performing a first releasing count when the first releasing flag is valid; and determining the first pressing method based on the first pressing flag, the first releasing flag, the first pressing count, and / or the first releasing count.

26. A system for determining the pressing method of a button, characterized in that, include: The third determining module is used to determine the first pressing mode of at least one channel corresponding to the button using the channel data processing system of claim 25. The fourth determining module is used to determine the second state flag corresponding to the button based on at least one of the first pressing methods; The fifth determining module is used to determine the second pressing method corresponding to the button based on the second state flag.

27. An electronic device, characterized in that, It includes a processor and a storage medium; the storage medium stores program code; the processor is used to call the program code stored in the storage medium to execute the channel data processing method as described in any one of claims 1 to 17 or the key pressing method as described in any one of claims 18 to 24.

28. The electronic device according to claim 27, characterized in that, It also includes a pressure sensor connected to the processor, which is used to acquire the pressure characteristics of the sensing area to generate initial data.

29. The electronic device according to claim 28, characterized in that, It also includes an AFE module, which is connected between the processor and the pressure sensor to sample the sensing data of the pressure sensor to obtain the initial data.

30. The electronic device according to claim 29, characterized in that, The processor is also used to detect the calibration timing and execute the calibration algorithm at the calibration timing.

Citation Information

Patent Citations

  • Pressure-sensitive key automatic identification system, electronic product and pressure event detection method

    CN112732124A