Device state detection method, swimming state detection method, and electronic device

By combining the capacitance information of the touch panel of the electronic device with the sensor, the problem of insufficient accuracy of wearable devices in swimming status detection is solved, achieving more efficient swimming status recognition and improving user experience.

WO2025200778A1PCT designated stage Publication Date: 2025-10-02HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/075697
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-26
Filing Date
2025-02-05
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

Existing wearable devices lack accuracy and reliability in detecting swimming status, especially in measuring swimming indicators, making it difficult to effectively evaluate users' swimming style, pace, and stroke count.

Method used

By utilizing the capacitance information of the touch panel of the electronic device, detecting the capacitance value, the relationship between the capacitance value and time, and the positional relationship between the capacitance value and the detection site, combined with sensors such as a barometer and electrocardiogram electrodes, it is determined whether the device is in a submerged state, and the user's swimming status is identified through the capacitance information.

Benefits of technology

The accuracy and reliability of swimming status detection are improved, the power consumption of the device is reduced, and the reliability of swimming status data detection and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025075697_02102025_PF_FP_ABST
    Figure CN2025075697_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a device state detection method, a swimming state detection method, and an electronic device. An electronic device can acquire capacitance information of a touch panel, and determines, on the basis of the capacitance information, whether a plurality of events are detected so as to determine whether the device is in a target state (for example, whether the device is submerged in water). In a swimming scenario, on the basis of the capacitance information or on the basis of state information of the device, the electronic device can also determine information such as the swimming duration, swimming stroke, stroke count, and number of laps of a user. By using the method provided by the present application, the state of the device is determined more accurately and reliably, the user swimming state information determined in the swimming scenario can better reflect the actual swimming situation of the user, data is more real, and the user experience is better.
Need to check novelty before this filing date? Find Prior Art

Description

Device state detection method, swimming state detection method, and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 26, 2024, with application number 202410356297.9 and invention name “Method for detecting device status, method for detecting swimming status and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal device software, and in particular, to a method for detecting device status, a method for detecting swimming status, and an electronic device. Background Art

[0003] With the development of electronic information technology, wearable devices such as smart watches, smart bracelets, and smart glasses have become increasingly popular. Swimming, as a full-body aerobic exercise, is beneficial to cardiovascular health and is widely loved by users.

[0004] Swimming style, pace, and stroke count are effective indicators for evaluating a user's swimming status. How to improve the accuracy and reliability of wearable devices in measuring these swimming indicators is an issue worth considering. Summary of the Invention

[0005] This application provides a method for detecting device status and swimming status. An electronic device can use capacitance information detected by its touch panel to determine whether it is in a target state (e.g., submerged). In swimming scenarios, this capacitance information or device status information can also be used to determine certain swimming states during the user's swimming process. Using capacitance information from the touch panel to detect device status and user swimming status provides more accurate and reliable detection results.

[0006] In a first aspect, a method for detecting a device state is provided, which is applied to an electronic device, the electronic device including a touch panel, the touch panel including M sites, the method comprising: obtaining capacitance information of the touch panel, the capacitance information comprising one or more of the following: capacitance values ​​of the M sites, a relationship between the capacitance values ​​of the M sites and time, or a relationship between the capacitance values ​​of the M sites and positions of the M sites; upon detecting a first event and a second event, determining that the electronic device is in a target state, the target state comprising the electronic device being at least partially immersed in a conductive liquid;

[0007] Among them, the first event includes: the capacitance values ​​of at least N sites among the M sites are greater than or equal to the first threshold, N≤M, N and M are both positive integers; the second event includes one or more of the following: the duration of the first event is greater than or equal to the first time length, the capacitance value changes of at least P sites among the N sites within the second time length are greater than or equal to the second threshold, or, the N sites are continuously distributed, P≤N, and P is a positive integer.

[0008] In a possible implementation, the electronic device may detect the first event and the second event simultaneously. In this case, the first event and the second event may also be understood as one event, or in other words, the first event may include the second event.

[0009] In a possible implementation, the target state may include the electronic device being submerged in water.

[0010] In some scenarios, the continuous distribution of N sites can also be understood as the N sites not being dispersed with each other.

[0011] In this technical solution, the capacitance information of the electronic device's touch panel is used to detect whether multiple events have occurred. If multiple events are confirmed to have occurred, the device is determined to be in the target state. Compared to solutions that only consider the change in the capacitance value of the touch panel, this technical solution further combines information such as the relationship between the capacitance value on the touch panel and time, the positional relationship between the capacitance value and the detection point, and the fluctuation of the capacitance value. This information can more accurately and effectively reflect the contact state between the touch panel and the conductive object, and thus more accurately and reliably reflect whether the device is in the target state.

[0012] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: detecting a third event when the electronic device is in a target state; and determining that the electronic device is not in the target state when the third event is detected; wherein the third event includes at least one of the following: the capacitance values ​​of at least Q sites among the M sites are less than or equal to a third threshold, Q≤M, and Q is a positive integer; or, the capacitance value changes of at least R sites among the N sites within the second time length are greater than or equal to a fourth threshold, R≤N, and R is a positive integer.

[0013] In some scenarios, the fact that the capacitance values ​​of at least Q sites among the M sites are less than or equal to the third threshold can also be understood as a decrease in the capacitance values ​​of at least some of the multiple sites on the touch panel.

[0014] Based on the above understanding, since the electronic device being in the target state and the electronic device not being in the target state cannot be true at the same time, in order to avoid misunderstanding, in some examples, the value of Q can satisfy: Q>MN, that is, Q+N>M.

[0015] In some scenarios, the capacitance value changes of at least R of the N sites within the second time period are greater than or equal to the fourth threshold, which can also be understood as the capacitance values ​​of at least some of the multiple sites on the touch panel decrease within the preset time period.

[0016] In a possible implementation, the electronic device not being in the target state may include the electronic device being in a water-out state.

[0017] In this technical solution, on the basis of determining that the device is in the target state, it is further determined whether the device is no longer in the target state based on the decrease in the capacitance information of the touch panel. Compared with the method of using detection data from sensors such as a barometer to determine whether the device is no longer in the target state, this solution uses the changes in the capacitance information over a period of time to make judgments, so the determination result is more accurate and reliable.

[0018] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the automatic power-off function of the touch panel is turned on, in response to detecting a first event, powering off the touch panel after a third time period, and the third time period is greater than or equal to the first time period.

[0019] In this technical solution, the electronic device can perform delayed power-off for the touch panel after detecting a first event when the automatic power-off function of the touch panel is turned on. In this way, the electronic device can use the capacitance information of the touch panel to determine whether the device is in the target state, and the touch panel after power-off is also beneficial to reducing the energy consumption of the electronic device.

[0020] In combination with the first aspect, in certain implementations of the first aspect, the electronic device further includes a barometer and / or electrocardiogram electrodes, and the method further includes: when the touch panel is powered off, in response to the barometer and / or electrocardiogram electrodes indicating that the electronic device is in the target state, powering on the touch panel.

[0021] In this technical solution, the electronic device enters the target state after the touch panel is powered off. In order to call the capacitance information of the touch panel, the electronic device can use the detection data of other sensors to determine whether the device is in the target state. When it is determined that the device is in the target state, the touch panel is powered on to obtain the capacitance information. This improves the reliability of the electronic device in detecting the device state while also helping to reduce the power consumption of the device.

[0022] In combination with the first aspect, in certain implementations of the first aspect, the electronic device further includes a sensor, the sensor including one or more of the following: an accelerometer, a gyroscope, a magnetometer, an electrocardiogram electrode, or a barometer, and the method further includes: in response to abnormal capacitance values ​​at M sites, determining whether the electronic device is in a target state in combination with information from the sensor.

[0023] In some scenarios, the above-mentioned capacitance abnormality can also be understood as the electronic device detecting a reference event, which may include one or more of the following: the user pressing the display screen of the electronic device for a long time, the ambient temperature rising, or the user powering on the touch panel in the target state, etc.

[0024] For some special events, there may be a discrepancy between the device status determined based on the capacitance information of the touch panel and the actual device status. In other words, when these events occur, using capacitance information to determine the device status may lead to misjudgment. In this case, combining other sensors in the electronic device can help improve the accuracy of device status detection.

[0025] In a second aspect, a method for detecting a swimming state is provided, which is applied to an electronic device, the electronic device including a touch panel, the method including: obtaining capacitance information of the touch panel; determining one or more of the following based on the capacitance information: swimming posture, whether the user is in a swimming state, stroke information or number of laps information; wherein the capacitance information includes one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel.

[0026] In a possible implementation, the stroke information may include one or more of the following: whether the current stroke is valid, the number of all strokes in the current stroke, or the number of valid strokes in the current stroke, etc.

[0027] In a possible implementation, the trip number information may include: whether the current trip is valid and / or the number of completed trips, etc.

[0028] In this technical solution, the capacitance information of the touch panel of the electronic device is used to detect the user's swimming status. Compared with the solution using sensors such as gyroscopes and magnetometers for detection, since the capacitance information can more accurately reflect the status of the device, the implementation of this solution is conducive to improving the reliability and accuracy of the results of the device detecting the user's swimming status.

[0029] In combination with the second aspect, in certain implementations of the second aspect, one or more of the following is determined based on the capacitance information: swimming style, whether the user is in a swimming state, stroke information or lap number information, including: determining the frequency of the electronic device's entry into the water and / or the duration of the entry into the water based on the capacitance information; when the frequency of the entry into the water within the preset time period is greater than or equal to the first number, and / or when the duration of the entry into the water within the preset time period is greater than or equal to the first duration, determining that the strokes recorded by the electronic device within the preset time period are valid strokes.

[0030] In this technical solution, whether the user's current stroke count is valid is determined by the device's water entry frequency and / or water entry duration. Both the water entry frequency and water entry duration can directly or indirectly reflect the device's water entry status, or in other words, can reflect the length of time the user is in the water during swimming, which can improve the accuracy of the device's determination of valid stroke counts to a certain extent.

[0031] In combination with the second aspect, in certain implementations of the second aspect, the frequency of the electronic device being immersed in water and / or the duration of being immersed in water are determined based on the capacitance information, including: determining the valid sites based on the capacitance information, the ratio of the capacitance value of the valid sites to the maximum capacitance value of the sites on the touch panel being greater than or equal to a preset value; determining the frequency of the water immersion and / or the duration of being immersed in water based on the number of valid sites.

[0032] In this technical solution, the electronic device can determine the frequency and / or duration of the device's immersion in water based on the capacitance values ​​of multiple points in the touch panel, and specifically provides a solution for determining the duration of the device's immersion in water using capacitance information.

[0033] In combination with the second aspect, in certain implementations of the second aspect, one or more of the following is determined based on the capacitance information: swimming style, whether the user is in a swimming state, stroke information or lap number information, including: when the total water entry time of all strokes in the current lap is greater than or equal to the second time length, and / or when the number of valid strokes in the current lap is greater than or equal to the second number, determining that the current lap is a valid lap.

[0034] In this technical solution, the electronic device can determine whether the user's swimming trip is a valid trip based on the number of valid strokes during the user's swimming process, which is conducive to detecting the user's swimming status using capacitance information.

[0035] In combination with the second aspect, in certain implementations of the second aspect, one or more of the following is determined based on the capacitance information: swimming style, whether the user is swimming, stroke information or number of laps information, including: determining the single water entry duration of the electronic device based on the capacitance information; when the single water entry duration is greater than or equal to the third duration, determining that the user's swimming style is breaststroke.

[0036] In some scenarios, the duration of a single water immersion can also be understood as the length of time between the start and end of the water immersion of the electronic device worn by the user.

[0037] In combination with the second aspect, in some implementations of the second aspect, the electronic device also includes an accelerometer and a gyroscope, and determines one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or number of laps information, including: determining the user's swimming style by combining accelerometer information, gyroscope information and capacitance information.

[0038] In a possible implementation, a swimming stroke recognition model may be trained using accelerometer information, gyroscope information, and capacitance information. Based on the swimming stroke recognition model, the electronic device may recognize the user's swimming stroke.

[0039] In this technical solution, the electronic device can combine the capacitance information of the touch panel to judge the user's swimming style. By introducing new monitoring data during the swimming process, it is helpful to improve the accuracy of the electronic device in judging the swimming style.

[0040] In combination with the second aspect, in certain implementations of the second aspect, the electronic device also includes a barometer, which determines one or more of the following based on the capacitance information: swimming style, whether the user is in a swimming state, stroke information or number of laps information, including: determining whether the user is in a swimming state by combining the barometer information and the capacitance information.

[0041] In combination with the second aspect, in certain implementations of the second aspect, the barometer information and the capacitance information are combined to determine whether the user is in a swimming state, including: when the barometer indicates that the electronic device is in a water state, and the capacitance information indicates that the number of valid swimming strokes in M ​​valid strokes is greater than or equal to N, determining that the user is in a swimming state, N≤M, N and M are positive integers; or, when the barometer indicates that the electronic device is not in a water state, and the capacitance information indicates that the water entry time of the electronic device is greater than or equal to the fourth time length and the number of strokes containing valid swimming strokes in the most recent P strokes is greater than or equal to Q, determining that the user is in a swimming state, Q≤P, Q and P are positive integers.

[0042] In combination with the second aspect, in certain implementations of the second aspect, the barometer information and the capacitance information are combined to determine whether the user is in a swimming state, including: when the barometer indicates that the electronic device is in a water state, and the capacitance information indicates that the number of valid swimming strokes in M ​​valid strokes is less than N, determining that the user is in a water and non-swimming state, N≤M, N and M are positive integers.

[0043] In combination with the second aspect, in certain implementations of the second aspect, the barometer information and capacitance information are combined to determine whether the user is in a swimming state, including: when the barometer indicates that the electronic device is in a non-water state, and the touch panel indicates that the electronic device's water entry time is less than a fourth time period and / or the number of strokes containing valid swimming strokes in the most recent P strokes is less than Q, determining that the user is in a non-water state, Q≤P, Q and P are positive integers.

[0044] In the above scheme, the electronic device can combine the barometer and capacitance information to jointly determine whether the user is in a swimming state. Compared with the scheme based only on the barometer for judgment, it is helpful to reduce the situation where the judgment cannot be made due to failure of the barometer, and is helpful to improve the reliability and accuracy of determining whether the user is in a swimming state or a resting state.

[0045] In a third aspect, a method for detecting a swimming state is provided, which is applied to an electronic device, the electronic device including a touch panel. The method includes: in response to an operation of starting swimming, displaying a prompt message, the prompt message being used to prompt the touch panel to enable detection of the swimming state; in response to a confirmation operation, obtaining capacitance information of the touch panel; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel.

[0046] In this technical solution, the electronic device can prompt the user to use the touch panel to detect the swimming status, and turn on the swimming status detection function of the touch panel according to the user's choice, which is conducive to obtaining more data to reflect the user's swimming status, thereby improving the reliability and accuracy of the user's swimming status data detection results and enhancing the user's experience.

[0047] In combination with the third aspect, in certain implementations of the third aspect, the electronic device further includes a barometer, and the method further includes: in response to the detection data of the barometer indicating that the electronic device is in an out-of-water state, and the capacitance information indicating that the user is in a swimming state, displaying a prompt message, wherein the prompt message is used to indicate that the barometer is in an invalid state.

[0048] In a possible implementation, in response to a confirmation operation by the user, the electronic device may use a touch panel to detect the user's swimming status.

[0049] In this technical solution, the electronic device can combine capacitance information to reflect the working status of the device's barometer, which is conducive to timely adaptive adjustment of the functions of the electronic device to obtain more accurate and effective data and information, thereby improving the user experience.

[0050] In combination with the third aspect, in certain implementations of the third aspect, the electronic device further includes a barometer, and the method further includes: in response to the detection data of the barometer indicating that the electronic device is in a water-out state, and the capacitance information indicates that the user is in a resting state, powering off the touch panel of the electronic device.

[0051] In this technical solution, the electronic device can determine that the user is not swimming based on the capacitance information and promptly disable the touch panel's function of detecting the user's swimming status, which is beneficial to reducing the energy consumption of the electronic device.

[0052] In combination with the third aspect, in certain implementations of the third aspect, the method further includes: in response to the capacitance information indicating that the water entry time of the user's current swimming trip is greater than or equal to a preset time and / or the effective stroke count of the user's current swimming trip is greater than or equal to a preset number, updating the number of swimming trips currently completed by the user.

[0053] In this technical solution, the electronic device can pre-update the user's swimming lap data based on the capacitance information of the touch panel, which is beneficial to improving the user experience.

[0054] In a fourth aspect, a method for detecting a swimming status is provided, which is applied to an electronic device, the electronic device including a touch panel, the method including: obtaining device status information, the device status information being determined based on capacitance information of the touch panel; determining the user's swimming status information based on the device status information; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel, the device status information includes one or more of the following: the duration of time the device is in the water state, the duration of time the device is in the water state, the frequency of the device being in the water state, or the frequency of the device being in the water state, and the swimming status information includes one or more of the following: swimming style, whether the user is in the swimming state, stroke information, or number of laps information.

[0055] In combination with the fourth aspect, in certain implementations of the fourth aspect, the method further includes: obtaining capacitance information in response to an operation of starting swimming; and determining whether the device is in a water-immersed state based on the capacitance information.

[0056] In one possible implementation, the electronic device may determine whether the device is in the water state or the water state according to the method in the first aspect and any possible implementation thereof. On this basis, the electronic device may determine the user's swimming state in combination with the method in the second aspect and any possible implementation thereof.

[0057] In this technical solution, the electronic device can determine the user's swimming status based on the user's own device status, and establish an association between the device status and the user's activity status based on the capacitance information of the electronic device, which is conducive to enriching the functions of the electronic device and improving the user experience.

[0058] For detailed description of the following technical solutions and explanation of the beneficial effects, please refer to the relevant contents of the technical solutions in the first to fourth aspects. For the sake of brevity, they will not be repeated below.

[0059] In a fifth aspect, a device for detecting a device state is provided, the device including a touch panel including M sites, the device further including an acquisition module and a processing module, the acquisition module being configured to: acquire capacitance information of the touch panel, the capacitance information including one or more of the following: capacitance values ​​of the M sites, a relationship between the capacitance values ​​of the M sites and time, or a relationship between the capacitance values ​​of the M sites and positions of the M sites; the processing module being configured to: upon detecting a first event and a second event, determine that the device is in a target state, the target state including that the device is at least partially immersed in a conductive liquid;

[0060] Among them, the first event includes: the capacitance values ​​of at least N sites among the M sites are greater than or equal to the first threshold, N≤M, N and M are both positive integers; the second event includes one or more of the following: the duration of the first event is greater than or equal to the first time length, the capacitance value changes of at least P sites among the N sites within the second time length are greater than or equal to the second threshold, or, the N sites are continuously distributed, P≤N, and P is a positive integer.

[0061] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is further used to: detect a third event when the device is in the target state; and determine that the device is not in the target state when the third event is detected; wherein the third event includes at least one of the following: the capacitance values ​​of at least Q sites among the M sites are less than or equal to a third threshold, Q≤M, Q is a positive integer; or, the capacitance value changes of at least R sites among the N sites within the second time length are greater than or equal to a fourth threshold, R≤N, R is a positive integer.

[0062] In combination with the fifth aspect, in certain implementations of the fifth aspect, the device also includes a barometer and / or electrocardiogram electrodes, and the processing module is further used to: when the touch panel is powered off, power on the touch panel in response to the barometer and / or electrocardiogram electrodes indicating that the device is in the target state.

[0063] In combination with the fifth aspect, in certain implementations of the fifth aspect, the device further includes a sensor, which includes one or more of the following: an accelerometer, a gyroscope, a magnetometer, an electrocardiogram electrode, or a barometer. The processing module is also used to: in response to abnormal capacitance values ​​at M sites, determine whether the device is in the target state in combination with the information from the sensor.

[0064] In a sixth aspect, a device for detecting a swimming state is provided, which includes a touch panel, and further includes an acquisition module and a processing module. The acquisition module is used to: obtain capacitance information of the touch panel; the processing module is used to: determine one or more of the following based on the capacitance information: swimming posture, whether the user is in a swimming state, stroke information or number of laps information; wherein the capacitance information includes one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel.

[0065] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: determine the frequency of the device's entry into the water and / or the duration of the entry into the water based on the capacitance information; when the frequency of the entry into the water within the preset duration is greater than or equal to the first number, and / or when the duration of the entry into the water within the preset duration is greater than or equal to the first duration, determine that the strokes recorded by the device within the preset time length are valid strokes.

[0066] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: determine the effective site based on the capacitance information, and the ratio of the capacitance value of the effective site to the maximum capacitance value of the site of the touch panel is greater than or equal to a preset value; determine the frequency of the water entry state and / or the duration of the water entry based on the number of effective sites.

[0067] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: determine that the current trip is a valid trip when the total water entry time of all strokes in the current trip is greater than or equal to the second time length, and / or when the number of valid strokes in the current trip is greater than or equal to the second number.

[0068] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: determine the single water entry duration of the device based on the capacitance information; and when the single water entry duration is greater than or equal to the third duration, determine that the user's swimming style is breaststroke.

[0069] In combination with the sixth aspect, in some implementations of the sixth aspect, the device further includes an accelerometer and a gyroscope, and the processing module is specifically used to: determine the user's swimming posture by combining information from the accelerometer, information from the gyroscope, and capacitance information.

[0070] In combination with the sixth aspect, in certain implementations of the sixth aspect, the device further includes a barometer, and the processing module is specifically used to: determine whether the user is in a swimming state by combining the information of the barometer and the capacitance information.

[0071] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: when the barometer indicates that the device is in the water state, and the capacitance information indicates that the number of valid swimming strokes in the M valid strokes is greater than or equal to N, determine that the user is in the swimming state, N≤M, N and M are positive integers; or, when the barometer indicates that the device is in the non-water state, and the capacitance information indicates that the water entry time of the device is greater than or equal to the fourth time length and the number of strokes containing valid swimming strokes in the most recent P strokes is greater than or equal to Q, determine that the user is in the swimming state, Q≤P, Q and P are positive integers.

[0072] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: when the barometer indicates that the device is in the water state, and the capacitance information indicates that the number of valid swimming strokes in the M valid strokes is less than N, determine that the user is in the water and not swimming, N≤M, N and M are positive integers.

[0073] In combination with the sixth aspect, in certain implementations of the sixth aspect, the processing module is specifically used to: when the barometer indicates that the device is in a non-water state, and the touch panel indicates that the device's water entry time is less than a fourth time period and / or the number of strokes containing valid swimming strokes in the most recent P strokes is less than Q, determine that the user is in a non-water state, Q≤P, and Q and P are positive integers.

[0074] In the seventh aspect, a device for detecting a swimming status is provided, which includes a touch panel and a processing module, wherein the processing module is used to: display a prompt message in response to an operation of starting swimming, wherein the prompt message is used to prompt to enable the touch panel to detect the swimming status; and obtain capacitance information of the touch panel in response to a confirmation operation; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel.

[0075] In combination with the seventh aspect, in certain implementations of the seventh aspect, the device also includes a barometer, and the processing module is further used to: in response to the detection data of the barometer indicating that the device is in an out-of-water state, and the capacitance information indicating that the user is in a swimming state, display a prompt message, and the prompt message is used to indicate that the barometer is in an invalid state.

[0076] In combination with the seventh aspect, in certain implementations of the seventh aspect, the device further includes a barometer, and the processing module is further used to: in response to the detection data of the barometer indicating that the device is in a water-discharging state, and the capacitance information indicating that the user is in a resting state, cut off power to the touch panel of the device.

[0077] In combination with the seventh aspect, in certain implementations of the seventh aspect, the processing module is further used to: update the number of swimming laps currently completed by the user in response to capacitance information indicating that the water entry time of the user's current swimming lap is greater than or equal to a preset time and / or the effective strokes of the user's current swimming lap are greater than or equal to a preset number.

[0078] In an eighth aspect, a device for detecting a swimming status is provided, the device including a touch panel, and the device also including a processing module, the processing module being used to: obtain device status information, the device status information being determined based on the capacitance information of the touch panel; determine the user's swimming status information based on the device status information; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel, the device status information includes one or more of the following: the duration that the device is in the water state, the duration that the device is in the water state, the frequency that the device is in the water state, or the frequency that the device is in the water state, and the swimming status information includes one or more of the following: swimming style, whether the user is in the swimming state, stroke information, or number of laps information.

[0079] In combination with the eighth aspect, in certain implementations of the eighth aspect, the processing module is further used to: obtain capacitance information in response to an operation of starting swimming; and determine whether the device is in a water-immersed state based on the capacitance information.

[0080] In a ninth aspect, an electronic device is provided, the electronic device including a touch panel, the touch panel including M sites, the electronic device further including a processor and a memory, the memory being configured to store program instructions, the processor being configured to: obtain capacitance information of the touch panel, the capacitance information including one or more of the following: capacitance values ​​of the M sites, a relationship between the capacitance values ​​of the M sites and time, or a relationship between the capacitance values ​​of the M sites and positions of the M sites; and upon detecting a first event and a second event, determine that the electronic device is in a target state, the target state including that the electronic device is at least partially immersed in a conductive liquid;

[0081] Among them, the first event includes: the capacitance values ​​of at least N sites among the M sites are greater than or equal to the first threshold, N≤M, N and M are both positive integers; the second event includes one or more of the following: the duration of the first event is greater than or equal to the first time length, the capacitance value changes of at least P sites among the N sites within the second time length are greater than or equal to the second threshold, or, the N sites are continuously distributed, P≤N, and P is a positive integer.

[0082] In combination with the ninth aspect, in certain implementations of the ninth aspect, the processor is further used to: detect a third event when the electronic device is in a target state; and determine that the electronic device is not in the target state when the third event is detected; wherein the third event includes at least one of the following: the capacitance values ​​of at least Q sites among the M sites are less than or equal to a third threshold, Q≤M, and Q is a positive integer; or, the capacitance value changes of at least R sites among the N sites within the second time length are greater than or equal to a fourth threshold, R≤N, and R is a positive integer.

[0083] In combination with the ninth aspect, in certain implementations of the ninth aspect, the electronic device further includes a barometer and / or electrocardiogram electrodes, and the processor is further used to: when the touch panel is powered off, power on the touch panel in response to the barometer and / or electrocardiogram electrodes indicating that the electronic device is in the target state.

[0084] In combination with the ninth aspect, in certain implementations of the ninth aspect, the electronic device further includes a sensor, the sensor including one or more of the following: an accelerometer, a gyroscope, a magnetometer, an electrocardiogram electrode, or a barometer, and the processor is further used to: in response to abnormal capacitance values ​​at M sites, determine whether the electronic device is in a target state in combination with information from the sensor.

[0085] In a tenth aspect, an electronic device is provided, which includes a touch panel, and further includes a processor and a memory, the memory is used to store program instructions, and the processor is used to: obtain capacitance information of the touch panel; determine one or more of the following based on the capacitance information: swimming style, whether the user is in a swimming state, stroke information or number of laps information; wherein the capacitance information includes one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel.

[0086] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: determine the frequency and / or duration of the electronic device's immersion in water based on capacitance information; when the frequency of the immersion in water within a preset time period is greater than or equal to the first number, and / or when the immersion in water duration within the preset time period is greater than or equal to the first duration, determine that the strokes recorded by the electronic device within the preset time period are valid strokes.

[0087] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: determine the effective site based on the capacitance information, the ratio of the capacitance value of the effective site to the maximum capacitance value of the site of the touch panel is greater than or equal to a preset value; determine the frequency of the water entry state and / or the duration of the water entry based on the number of effective sites.

[0088] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: determine that the current trip is a valid trip when the total water entry time of all strokes in the current trip is greater than or equal to the second time, and / or when the number of valid strokes in the current trip is greater than or equal to the second number.

[0089] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: determine a single water entry duration of the electronic device based on capacitance information; and when the single water entry duration is greater than or equal to a third duration, determine that the user's swimming style is breaststroke.

[0090] In combination with the tenth aspect, in certain implementations of the tenth aspect, the electronic device further includes an accelerometer and a gyroscope, and the processor is specifically used to: determine the user's swimming posture by combining information from the accelerometer, information from the gyroscope, and capacitance information.

[0091] In combination with the tenth aspect, in certain implementations of the tenth aspect, the electronic device further includes a barometer, and the processor is specifically used to: determine whether the user is in a swimming state by combining information from the barometer and capacitance information.

[0092] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: when the barometer indicates that the electronic device is in a water state and the capacitance information indicates that the number of valid swimming strokes in M ​​valid strokes is greater than or equal to N, determine that the user is in a swimming state, N≤M, N and M are positive integers; or, when the barometer indicates that the electronic device is not in a water state and the capacitance information indicates that the water entry time of the electronic device is greater than or equal to a fourth time length and the number of strokes containing valid swimming strokes in the most recent P strokes is greater than or equal to Q, determine that the user is in a swimming state, Q≤P, Q and P are positive integers.

[0093] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: when the barometer indicates that the electronic device is in a water state and the capacitance information indicates that the number of valid swimming strokes in M ​​valid strokes is less than N, determine that the user is in a water and not swimming state, N≤M, N and M are positive integers.

[0094] In combination with the tenth aspect, in certain implementations of the tenth aspect, the processor is specifically used to: determine that the user is in a non-water state when the barometer indicates that the electronic device is in a non-water state, and the touch panel indicates that the electronic device's water entry time is less than a fourth time period and / or the number of strokes containing valid swimming strokes in the most recent P strokes is less than Q, where Q≤P, and Q and P are positive integers.

[0095] In the eleventh aspect, an electronic device is provided, which includes a touch panel, a processor and a memory, the memory is used to store program instructions, and the processor is used to: in response to an operation of starting swimming, display a prompt message, the prompt message is used to prompt to enable the touch panel to detect the swimming status; in response to a confirmation operation, obtain capacitance information of the touch panel; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel.

[0096] In combination with the eleventh aspect, in certain implementations of the eleventh aspect, the electronic device also includes a barometer, and the processor is further used to: in response to the detection data of the barometer indicating that the electronic device is in an out-of-water state, and the capacitance information indicating that the user is in a swimming state, display a prompt message, and the prompt message is used to indicate that the barometer is in an invalid state.

[0097] In combination with the eleventh aspect, in certain implementations of the eleventh aspect, the electronic device also includes a barometer, and the processor is further used to: in response to the detection data of the barometer indicating that the electronic device is in a water-out state, and the capacitance information indicates that the user is in a resting state, cut off power to the touch panel of the electronic device.

[0098] In combination with the eleventh aspect, in certain implementations of the eleventh aspect, the processor is further used to: update the number of swimming laps currently completed by the user in response to capacitance information indicating that the water entry time of the user's current swimming lap is greater than or equal to a preset time and / or the effective strokes of the user's current swimming lap are greater than or equal to a preset number.

[0099] In a twelfth aspect, an electronic device is provided, which includes a touch panel, and the electronic device also includes a processor and a memory, the memory is used to store program instructions, and the processor is used to: obtain device status information, the device status information is determined based on the capacitance information of the touch panel; determine the user's swimming status information based on the device status information; wherein the capacitance information includes one or more of the following: the capacitance value on the touch panel, the relationship between the capacitance value of the touch panel and time, or the capacitance value distribution on the touch panel, the device status information includes one or more of the following: the length of time the device is in the water state, the length of time the device is in the water state, the frequency of the device being in the water state, or the frequency of the device being in the water state, the swimming status information includes one or more of the following: swimming style, whether the user is in the swimming state, stroke information, or number of laps information.

[0100] In combination with the twelfth aspect, in certain implementations of the twelfth aspect, the processor is further used to: obtain capacitance information in response to an operation of starting swimming; and determine that the device is in a water-immersed state based on the capacitance information.

[0101] In the thirteenth aspect, a computer program product is provided, which includes computer program code. When the computer program code runs on a computer, the method in the first aspect and any possible implementation thereof is executed, or the method in the second aspect and any possible implementation thereof is executed, or the method in the third aspect and any possible implementation thereof is executed, or the method in the fourth aspect and any possible implementation thereof is executed.

[0102] In the fourteenth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the method in the first aspect and any possible implementation thereof is executed, or the method in the second aspect and any possible implementation thereof is executed, or the method in the third aspect and any possible implementation thereof is executed, or the method in the fourth aspect and any possible implementation thereof is executed.

[0103] In the fifteenth aspect, a chip is provided, comprising a processor for reading instructions stored in a memory, wherein when the processor executes the instructions, the chip implements the method in the first aspect and any possible implementation thereof, or the chip implements the method in the second aspect and any possible implementation thereof, or the method in the third aspect and any possible implementation thereof is executed, or the method in the fourth aspect and any possible implementation thereof is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] FIG1 is a schematic diagram of a hardware architecture of an electronic device provided in an embodiment of the present application.

[0105] FIG2 is a schematic structural diagram of a display screen of an electronic device provided in an embodiment of the present application.

[0106] FIG3 is a three-dimensional view of a touch panel provided in an embodiment of the present application.

[0107] FIG4 is a stacked view of a touch panel provided in an embodiment of the present application.

[0108] FIG5 is a schematic diagram of a method for detecting device status provided in an embodiment of the present application.

[0109] FIG6 is a schematic diagram of another method for detecting whether a device is in a target state provided by an embodiment of the present application.

[0110] FIG. 7 is a schematic diagram of a curve showing changes in capacitance values ​​at capacitance detection sites of a touch panel provided by an embodiment of the present application.

[0111] FIG8 is a schematic diagram of another method for detecting whether a device is in a target state provided by an embodiment of the present application.

[0112] FIG. 9 is a schematic diagram of a curve showing changes in capacitance values ​​at capacitance detection sites of another touch panel provided in an embodiment of the present application.

[0113] FIG10 is a schematic diagram of another method for detecting whether a device is in a target state provided by an embodiment of the present application.

[0114] FIG11 is a schematic diagram of a method for a device to enter a target state according to an embodiment of the present application.

[0115] FIG. 12 is a schematic diagram illustrating the capacitance distribution of the touch panel of the device in FIG. 11 under different modes.

[0116] FIG13 is a schematic diagram of a method for determining how a device enters a target state provided by an embodiment of the present application.

[0117] FIG14 is a schematic diagram of a method for detecting that a device is not in a target state provided by an embodiment of the present application.

[0118] FIG15 is a schematic diagram of a scenario for detecting whether a device is in a target state, provided in an embodiment of the present application.

[0119] FIG16 is a schematic diagram of a method for detecting device status in the scenario shown in FIG15 .

[0120] FIG17 is a schematic diagram of another scenario for detecting whether a device is in a target state provided in an embodiment of the present application.

[0121] FIG18 is a schematic diagram of a method for detecting device status in the scenario shown in FIG17 .

[0122] FIG19 is a schematic diagram of another method for detecting device status provided in an embodiment of the present application.

[0123] Figure 20 is a schematic diagram of a method for detecting swimming status provided in an embodiment of the present application.

[0124] FIG21 is a schematic diagram of a method for determining stroke information during swimming provided in an embodiment of the present application.

[0125] FIG22 is a schematic diagram of a statistical result of the number of effective capacitance value detection sites within a certain period of time provided in an embodiment of the present application.

[0126] Figure 23 is a schematic diagram of a method for determining the number of laps during swimming provided by an embodiment of the present application.

[0127] Figure 24 is a schematic diagram of another method for determining the number of laps during swimming provided by an embodiment of the present application.

[0128] Figure 25 is a schematic diagram of a method for determining a swimming stroke provided in an embodiment of the present application.

[0129] Figure 26 is a schematic diagram of a method for determining whether a user is in a swimming state provided in an embodiment of the present application.

[0130] Figure 27 is a schematic diagram of another method for determining whether a user is in a swimming state provided in an embodiment of the present application.

[0131] Figure 28 is a schematic diagram of another method for detecting swimming status provided in an embodiment of the present application.

[0132] Figures 29 to 35 are schematic diagrams of the graphical user interface of the electronic device provided in embodiments of the present application.

[0133] Figure 36 is a schematic diagram of a device status detection apparatus provided in an embodiment of the present application.

[0134] Figure 37 is a schematic diagram of a swimming status detection device provided in an embodiment of the present application.

[0135] Figure 38 is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0136] The technical solution in this application will be described below with reference to the accompanying drawings.

[0137] The following describes embodiments of the present application in detail, and examples of the embodiments of the present application are shown in the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present application and are not to be construed as limiting the present application.

[0138] The terms "first," "second," "third," "fourth," and the like, if any, in this application are used to distinguish between similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the application described herein can be implemented in orders other than those illustrated or described herein.

[0139] Unless otherwise defined, the technical terms or scientific data used in this application shall have the ordinary meanings understood by persons having ordinary skills in the technical field to which this application belongs. In the description of this application, it should be understood that the directions or positional relationships indicated by the terms "center", "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing this application and simplifying the description, and are not intended to indicate or require that the device or element referred to must have a specific direction, be constructed and operate in a specific direction, and therefore should not be understood as limiting this application.

[0140] In order to make the technical problems solved by this application, the technical solutions adopted and the technical effects achieved clearer, the technical solutions of the embodiments of this application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0141] FIG1 is a schematic functional block diagram of a wearable device 100 provided in an embodiment of the present application. Exemplarily, the wearable device 100 may be a smart watch or a smart bracelet, etc. Referring to FIG1 , exemplarily, the wearable device 100 may include a processor 110, an input device 120, a sensor module 130, a memory 160, and a power supply module 170. It will be understood that the components shown in FIG1 do not constitute a specific limitation on the wearable device 100, and the wearable device 100 may also include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.

[0142] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may be the nerve center and command center of the wearable device 100. The controller may generate an operation control signal based on the instruction opcode and timing signal to control the fetching and execution of instructions. In other embodiments, the processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that have just been used or are recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory, avoiding repeated access, reducing the waiting time of the processor 110, and thus improving the efficiency of the wearable device 100.

[0143] The input device 120 is used to provide user input and can be a mechanical device. The user touches the input device 120, causing the input device 120 to rotate, translate or tilt to realize user input, so as to realize functions or operations such as starting the wearable device 100 (for example, turning on or off), determining or adjusting signals (for example, adjusting the volume), etc.

[0144] The sensor module 130 may include one or more sensors, for example, a PPG sensor 130A, a pressure sensor 130B, a fingerprint sensor 130C, a capacitive sensor 130D, an acceleration sensor 130E, an ambient light sensor 130F, a proximity light sensor 130G, a touch sensor 130H, etc. It should be understood that FIG1 only lists several examples of sensors. In actual applications, the wearable device 100 may also include more or fewer sensors, or use other sensors with the same or similar functions to replace the above-mentioned sensors, etc., and the embodiments of the present application are not limited thereto.

[0145] In some embodiments, the sensor module 130 can detect user input from the input device 120 and respond to the user input to implement functions or operations such as starting, determining, and adjusting signals.

[0146] The PPG sensor 130A can be used to detect heart rate, that is, the number of heartbeats per unit time. In some embodiments, the PPG sensor 130A may include a light transmitting unit and a light receiving unit. The light transmitting unit can irradiate a light beam into the human body (such as a blood vessel), and the light beam is reflected / refracted in the human body, and the reflected / refracted light is received by the light receiving unit to obtain a light signal. Since the transmittance of the blood changes during the fluctuation process, the transmitted / refracted light changes, and the light signal detected by the PPG sensor 130A also changes. The PPG sensor 130A can convert the light signal into an electrical signal and determine the heart rate corresponding to the electrical signal. In an embodiment of the present application, the PPG sensor 130A can be set in the input device 120 or in the housing 180, and the PPG detection function can be achieved through the light signal detected by the PPG sensor 130A.

[0147] The pressure sensor 130B can be used to detect the pressure value between the human body and the wearable device 100. The pressure sensor 130B is used to sense the pressure signal and can convert the pressure signal into an electrical signal. There are many types of pressure sensors 130B, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc., which are not limited in the embodiment of the present application. In the embodiment of the present application, multiple pressure sensors 130B can be provided on the input device 120, and the rotation of the input device 120 can be identified by the signal difference between adjacent pressure sensors 130B among the multiple pressure sensors 130B.

[0148] The capacitance sensor 130D can be used to detect the capacitance between two electrodes to achieve specific functions.

[0149] In some embodiments, the capacitance sensor 130D can be used to detect the capacitance between the human body and the wearable device 100. The capacitance can reflect whether the contact between the human body and the wearable device is good, and can be applied to electrocardiography (ECG) detection, in which the human body can be used as an electrode. When the capacitance sensor 130D is set on the electrode on the wearable device, the capacitance sensor 130D can detect the capacitance between the human body and the electrode. When the capacitance detected by the capacitance sensor 130D is too large or too small, it means that the contact between the human body and the electrode is poor; when the capacitance detected by the capacitance sensor 130D is moderate, it means that the contact between the human body and the electrode is good. Since whether the contact between the human body and the electrode is good will affect the electrode detection electrical signal, and thus affect the generation of ECG, the wearable device 100 can refer to the capacitance detected by the capacitance sensor 130D when generating ECG.

[0150] In some examples, the wearable device 100 may also be provided with electrocardiogram (ECG) electrodes, which can be used to detect the user's electrocardiogram, heart rate, and other functions.

[0151] The acceleration sensor 130E, which may also be called an accelerometer, is used to detect changes in acceleration of the device in multiple directions in three-dimensional space.

[0152] The magnetic sensor 130J, also known as a magnetometer, is used to detect the strength and direction of the geomagnetic field in the environment surrounding the device, and can realize functions such as electronic compass and positioning.

[0153] In some examples, the wearable device 100 may further include sensors such as a gyroscope and a barometer. The gyroscope may be used to determine the rotation and tilt angle of the device in three-dimensional space, and the barometer may be used to measure the pressure of the device's surrounding environment (e.g., the atmosphere or water).

[0154] The memory 160 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the wearable device 100 by running the instructions stored in the memory. The memory 160 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc., which is not limited in the embodiments of the present application.

[0155] The power supply module 170 can provide power to various components in the wearable device 100, such as the processor 110 and the sensor module 130. In some embodiments, the power supply module 170 can be a battery or other portable power element. In other embodiments, the wearable device 100 can also be connected to a charging device (e.g., via a wireless or wired connection), and the power supply module 170 can receive power input from the charging device and store it in the battery.

[0156] In some embodiments, with continued reference to FIG1 , the wearable device 100 further includes a display screen 140 . The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, a quantum dot light-emitting diode (QLED), or the like.

[0157] In some embodiments, a touch sensor may be provided in the display screen 140 to form a touch screen, which is not limited in the present embodiment. It is understood that in some embodiments, the wearable device 100 may include a display screen 140 or may not include a display screen 140. For example, when the wearable device 100 is a wristband, it may include a display screen or not. When the wearable device 100 is a watch, it may include a display screen.

[0158] In addition, the wearable device 100 may have wireless communication capabilities. In some embodiments, referring again to FIG. 1 , the wearable device 100 may further include a wireless communication module 191, a mobile communication module 192, one or more antennas 1, and one or more antennas 2. The wearable device 100 may implement wireless communication capabilities through antennas 1, 2, the wireless communication module 191, and the mobile communication module 192.

[0159] The touchscreen (or touch panel) of a wearable device responds to the action of a conductor on the touchscreen. When the touchscreen surface comes into contact with water, the capacitance at that location changes accordingly. Based on this principle, the touchscreen of a wearable device can be used to determine whether the device has been submerged in water. Events such as user taps, water contact with the touchscreen surface, and temperature changes can also cause changes in the capacitance of the touchscreen surface. These events may interfere with accurately identifying the wearable device's usage status and determining the user's activity status.

[0160] In the swimming scenario, in order to more accurately use the touch panel of the wearable device to determine the usage status of the wearable device and identify the user's swimming status, this application provides a method for device status detection, which is introduced as follows.

[0161] Before formally introducing the embodiments of the present application, the following terms and nouns that may be used in the following examples are first explained and illustrated.

[0162] A micro control unit (MCU), also known as a single-chip microcomputer, is an integrated circuit used to control device operations and feature systems.

[0163] FIG2 exemplarily provides a schematic structural diagram of a display screen 140, which may include a circuit board 141, a display panel 142 and a touch panel 10, and these three display screen components may be stacked in sequence. The touch panel 10 may be located on the outside of the display screen 140, for responding to the user's touch operation and realizing the touch function of the display screen 140. The display panel 142 may be arranged between the circuit board 141 and the touch panel 10, and the display panel 142 may be composed of a plurality of display units arranged in an array, for realizing the display function of the display screen 140. The circuit board 141 may be provided with a signal processing circuit, which may be used to process signals from the display panel 142 and the touch panel 10, and the signal processing circuit may also send the signals from the display panel 142 and the touch panel 10 and the processing results of these signals to the processor 110 of the wearable device 100 for subsequent processing.

[0164] In some examples, display panel 142 may include a display module 143 and a display module connecting plate 144. Display module 143 may be composed of a multi-layer structure, which is not limited in this application. One end of display module connecting plate 144 may be electrically connected to display module 143, and the other end may be electrically connected to circuit board 141, for transmitting data information and / or control signals between circuit board 141 and display module 143.

[0165] In some examples, the touch panel 10 can be composed of a touch module 11 and a touch module connecting plate 16, one end of the touch module connecting plate 16 can be electrically connected to the touch module 11, and the other end can be electrically connected to the circuit board 141, for transmitting data information and / or control signals, etc. between the circuit board 141 and the touch module 11.

[0166] In some examples, the touch panel 10 may further include a processing unit 17, which may be electrically connected to the touch module 11 and the touch module connecting plate 16. For example, the processing unit 17 may be an MCU. The processing unit 17 may be used to control power on and / or off of different areas of the touch module 11. The processing unit 17 may also be used to respond to an operation applied to the touch module 11 and determine the location of the operation applied to the touch module 11. For example, the processing unit 17 may be mounted on the touch module connecting plate 16.

[0167] Figures 3 and 4 provide schematic diagrams of the structure of a touch module 11. In some examples, the touch module 11 may be composed of a first electrode layer 12, an insulating layer 13, and a second electrode layer 14 stacked in sequence. The first electrode layer 12, the insulating layer 13, and the second electrode layer 14 may all be transparent to allow light generated by the display panel 142 located below the touch panel 10 to pass through the touch panel 10.

[0168] In some examples, the first electrode layer 12 may be composed of a plurality of first electrode sheets 12A arranged in an array, and the second electrode layer 14 may be composed of a plurality of second electrode sheets 14A arranged in an array. For example, the plurality of first electrode sheets 12A may be interconnected in a first direction to form first electrode strips, and the plurality of first electrode strips may be arranged along a second direction to form the first electrode layer 12. Similarly, the plurality of second electrode sheets 14A may be interconnected in a third direction to form second electrode strips, and the plurality of second electrode strips may be arranged along a fourth direction to form the second electrode layer 14.

[0169] For example, as shown in FIG4 , first electrode sheets 12A can be interconnected along the y-axis to form first electrode strips, and multiple first electrode strips can be arranged along the z-axis to form a first electrode layer 12. Second electrode sheets 14A can be interconnected along the x-axis to form second electrode strips, and multiple second electrode strips can be arranged along the y-axis to form a second electrode layer 14. In some scenarios, the first electrode layer 12 of the above structure can also be referred to as a horizontal electrode layer 12, and the second electrode layer 14 can also be referred to as a vertical electrode layer 14.

[0170] The plurality of first electrode sheets 12A arranged in an array in the first electrode layer 12 and the plurality of second electrode sheets 14A arranged in an array in the second electrode layer 14 can be arranged in an interlaced manner so that electrode sheets can be provided in different areas within the plane where the touch module 11 is located, thereby responding to user touch operations at different positions.

[0171] In one possible implementation, a high-frequency current may be applied to the first electrode sheet 12A and / or the second electrode sheet 14A in the first electrode layer 12 and the second electrode layer 14. When a conductor (such as the user's skin) contacts the touch panel 10, the conductor may form a coupling capacitor with the electrode sheet at the contact position thereof. The high-frequency current may be conducted through the coupling capacitor, i.e., a high-frequency current loop is formed. The current in the loop may be captured and used to determine the position where the conductor contacts the touch panel 10.

[0172] During a touch event, the coupling capacitances generated by different electrode sheets in the touch panel 10 vary depending on the distance from the touch location. In other words, the capacitance of the coupling capacitance on the touch panel 10 can vary depending on the touch panel 10. The capacitance of the coupling capacitance generated by the same electrode sheet can also vary before, during, and after a touch event. In other words, the capacitance of the coupling capacitance generated by the same electrode sheet in the touch panel 10 can also vary over time. In addition, the capacitance of the coupling capacitance generated by the same electrode sheet can also vary for different conductors and different touch events.

[0173] By collecting, analyzing, and processing one or more of the above information, the type of contact event acting on the touch panel 10 and / or the duration of the contact event can be determined to a certain extent, and the device status of the wearable device 100 can also be determined to a certain extent.

[0174] For ease of explanation, the information generated by the touch panel 10 in response to a touch event is referred to as capacitance information below. The capacitance information may include one or more of the following information: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel. Here, the capacitance value of the touch panel can be understood as the capacitance value of the coupling capacitance generated by different capacitance value detection sites of the touch panel. Similarly, the relationship between the capacitance value of the touch panel and time can be understood as the relationship between the capacitance value of the coupling capacitance generated by different capacitance value detection sites of the touch panel and time. The capacitance value distribution of the touch panel can be understood as the relationship between the capacitance value of the coupling capacitance generated by different capacitance value detection sites of the touch panel and the position of the different detection sites.

[0175] For ease of explanation, the capacitance detection site is referred to as the detection site or site in the following examples, and no distinction is made between these three expressions.

[0176] It should be noted that the above-mentioned contact event can include direct contact between the conductor and the touch panel 10, or it can include the conductor and the touch panel 10 approaching each other to a certain distance (not in direct contact). In other words, any event that can cause the capacitance value of the touch panel 10 to change can be understood as the above-mentioned contact event.

[0177] It should be noted that similar expressions such as "preset duration", "preset threshold", "preset capacitance value" may be used in the following examples. In these expressions, the same name may correspond to the same value or different values. Whether these same expressions correspond to the same value should be determined in combination with the actual technical solution or context, and expressions with the same name should not be regarded as having the same value.

[0178] FIG5 is a schematic diagram of a method for detecting device status according to an embodiment of the present application. The electronic device can detect whether a specific event occurs based on the capacitance information of the touch panel, and determine that the device is in a target state when the event occurs.

[0179] S110: The electronic device obtains capacitance information of the touch panel.

[0180] Here, the electronic device can be a portable device such as a mobile phone or a tablet computer, or it can be a wearable device such as a watch or a bracelet as mentioned above, and this application does not impose any restrictions on this.

[0181] A touch panel can be a component of a display screen of an electronic device and can be used to enable the electronic device to respond to user touch operations. In some scenarios, a touch panel can also be called a touch screen. In some examples, the touch panel can be a surface capacitive touch panel or a projected capacitive touch panel, for example, a self-capacitive touch panel or a mutual-capacitive touch panel.

[0182] The touch panel and the data processing module of the electronic device (such as a central processing unit) may be provided with an electrical connection line, and the data processing module of the electronic device may use the electrical connection line to obtain information or state changes of various components in the circuit of the touch panel.

[0183] In some examples, the electronic device can obtain capacitance information of the touch panel. As described above, the capacitance information can include one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel.

[0184] The touch panel can be provided with multiple capacitance detection sites. In some scenarios, the aforementioned capacitance information can also be understood as including one or more of the following: the capacitance value of the detection site of the touch panel, the relationship between the capacitance value of the detection site of the touch panel and time, or the relationship between the capacitance value of the detection site of the touch panel and the position of the detection site.

[0185] In one possible implementation, the process of an electronic device obtaining capacitance information may include: obtaining capacitance information detected at different locations on the touch panel through a data processing unit (such as an MCU) set in the touch panel, or obtaining capacitance information detected at different locations on the touch panel through a CPU, or obtaining capacitance information detected at different locations on the touch panel through the data processing unit of the touch panel, the data processing unit of the touch panel may perform preliminary processing on the obtained capacitance information to generate a preliminary processing result, and obtaining the processing result obtained by the preliminary processing of the capacitance information through the CPU.

[0186] S120: The electronic device determines whether a first event and a second event are detected according to the capacitance information.

[0187] Whether the first event and the second event occur can be determined based on capacitance information acquired by the electronic device.

[0188] In some examples, the electronic device can simultaneously detect whether the first event and the second event occur, or the electronic device can detect whether the second event occurs after detecting the first event, or the electronic device can detect whether the first event occurs after detecting the second event. This application does not impose any restrictions on this.

[0189] Here, in a scenario where the electronic device simultaneously detects whether the first event and the second event occur, the first event and the second event may also be regarded as one event.

[0190] In some examples, the first event may include: the capacitance value detected by at least a predetermined number of capacitance value detection sites among a plurality of capacitance value detection sites of the touch panel reaches a predetermined threshold. Assuming that the number of detection sites included in the touch panel is M and the predetermined capacitance value threshold is Ci, the first event may be understood to include: the capacitance value of at least N detection sites among the M detection sites is greater than or equal to Ci, where N≤M, and N and M are both positive integers.

[0191] It should be noted that, in the first event, there is no restriction on the distribution of the preset number of capacitance detection sites.

[0192] In some examples, the second event may include: the duration of the first event is longer than or equal to a preset duration, and the preset duration is recorded as T1. The second event can be understood as the duration of the first event is greater than or equal to T1.

[0193] In some examples, the second event may include: the fluctuation (change, increment) of the capacitance value of the touch panel within a preset time period meets a preset requirement, and the fluctuation of the capacitance value of the touch panel is recorded as ΔC. Exemplarily, the aforementioned preset requirement may be β≤ΔC≤γ, where 0<β<γ. Exemplarily, the aforementioned preset condition may also be β≤ΔC, where 0<β. Exemplarily, the aforementioned preset condition may also be ΔC≤γ. Here, β and γ may be preset values.

[0194] In some examples, the second event may include: the distribution of the capacitance value of the touch panel meets the preset requirements. Depending on the direction, angle, etc. when the electronic device enters the target state, the order in which the capacitance values ​​of the detection sites in different areas of the touch panel change may be different. In other words, when the capacitance values ​​of the detection sites of the touch panel and the number of detection sites meet the requirements of the first event, the relative position relationship of the multiple detection sites or the distribution within the plane can have multiple situations. Among these multiple situations, if the relative position relationship of the multiple detection sites meets the aforementioned preset requirements, it can be determined that the second event is triggered.

[0195] For example, the aforementioned preset requirement may mean that the detection sites whose capacitance values ​​meet the preset threshold Ci are not in a relatively separated distribution state. In other words, the detection sites whose capacitance values ​​meet the preset threshold Ci are continuous in spatial distribution.

[0196] In some examples, the second event may include one or more of the above three situations.

[0197] It should be noted that for a determined first event, the aforementioned second event may be associated with the first event, for example, the second event being the first event's duration meeting a preset duration requirement. Alternatively, the aforementioned second event may be independent of the first event, for example, the first event being the capacitance detected by a certain number of capacitance detection sites on the touch panel being greater than or equal to a preset capacitance value, and the second event being the capacitance distribution of the touch panel meeting a preset requirement.

[0198] S130: Determine whether the electronic device is in a target state.

[0199] The target state may include a state where the electronic device is partially or completely covered by the conductive liquid, or in other words, the electronic device is partially or completely immersed in the conductive liquid. For example, if the conductive liquid is water, the target state may be that the electronic device is partially or completely immersed in water.

[0200] The conductive liquid covering the surface of the touch panel will couple with the electrode sheets in the touch panel to form coupling capacitance, thereby affecting the capacitance values ​​detected by different detection points of the touch panel.

[0201] In some examples, when the first event and the second event are determined to have occurred based on capacitance information obtained from the touch panel, the electronic device can determine that the electronic device is in a target state, for example, at least partially submerged in water.

[0202] In other words, if the capacitance information of the touch panel indicates that the requirements of the first event and the second event in S120 are met at the same time, the electronic device may determine that the electronic device is in the target state.

[0203] It should be noted that, in one possible implementation, the electronic device may determine whether the electronic device is in the target state based solely on whether the first event is triggered. In this case, the threshold value of the touch panel capacitance value involved in the first event and / or the threshold value of the number of detection sites that meet the capacitance value threshold requirement need to be more precise, or in other words, the electronic device needs to have a higher resolution for different capacitance values ​​of the touch panel, or in other words, the electronic device needs to have better performance in detecting capacitance values.

[0204] Taking the second event as an example where the duration of the first event meets the preset requirement, FIG6 exemplarily provides a schematic diagram of a method for detecting whether an electronic device is in a submerged state.

[0205] Curve S1 in FIG7 shows the continuous change of the capacitance value detected by the capacitance value detection site Loc1 of the touch panel of an electronic device from the out-of-water state to the in-water state, and from the in-water state to the out-of-water state.

[0206] Before entering the water, the capacitance value detected by the capacitance detection site Loc1 is C0. As the capacitance detection site Loc1 is gradually immersed in water, the capacitance value detected gradually increases from C0 to C1 at time t2, and then increases to Cm at time tm. After that, the capacitance value detected by the capacitance detection site Loc1 gradually decreases to C1 at time t4.

[0207] In some examples, the capacitance value C1 at time t2 can serve as a preset threshold for detecting whether event E has been triggered. For example, if the capacitance information of the touch panel indicates that the capacitance values ​​detected by no fewer than N detection sites out of M detection sites are greater than or equal to C1, the electronic device can determine that event E has been detected. Based on this, the electronic device can continuously acquire capacitance information from the touch panel to detect the duration of event E.

[0208] Exemplarily, the shortest duration of event E can be the time difference between tm and t2. In other words, after the electronic device detects event E at time t2, if the capacitance information of the touch panel indicates that event E is triggered within the duration (tm-t2), the electronic device can determine that the duration of event E meets the preset requirements. In this way, the electronic device can determine that it is in a water-immersion state.

[0209] In some scenarios, the capacitance value detected by the detection site at time tm reaching Cm can be considered another event W that is different from event E. Based on this, the above solution can also be understood as follows: after the electronic device detects event E at time t2, if the capacitance information of the touch panel indicates the triggering event W within the time duration (tm-t2), the electronic device can determine that it is in a submerged state.

[0210] Exemplarily, the shortest duration of event E can also be the difference between t4 and t2. In other words, after the electronic device detects event E at time t2, if the capacitance information of the touch panel indicates the triggering of event E within the duration (t4-t2), the electronic device can determine that the duration of event E meets the preset requirements. In this way, the electronic device can determine that it is in a water-immersion state.

[0211] It should be noted that the variation of curve S1 in Figure 7 is merely exemplary and is not limited in this application. For example, during the time period t2-t4, the capacitance value detected by the detection site may fluctuate, and the detection site may detect the capacitance value Cm multiple times.

[0212] Taking the second event that the change in capacitance information of the touch panel meets a preset requirement as an example, FIG8 exemplarily provides a schematic diagram of another method for detecting whether an electronic device is in a submerged state.

[0213] The electronic device can determine whether to trigger event E based on the capacitance information of the touch panel. When the trigger event E is detected, the electronic device can determine whether the change in the capacitance information of the touch panel meets the preset requirements. If the change in the capacitance information also meets the preset requirements, the electronic device can determine that it is in a water-immersion state.

[0214] In some examples, referring to FIG. 7 , event E may refer to the case where the capacitance values ​​of at least N detection sites among the M detection sites of the touch panel are greater than or equal to C1 .

[0215] For example, the electronic device can detect the change in the capacitance value of the touch panel after detecting event E at time t2. If the increase in the capacitance value of the touch panel is greater than or equal to (Cm-C1) within the preset time length, it can be determined that the change in the capacitance value of the touch panel meets the preset requirements, and then the electronic device can determine that it is in a water-immersion state. The preset time length here can refer to the time difference between time tm and time t2.

[0216] Exemplarily, the electronic device can detect the change in the capacitance value of the touch panel starting at time 0. After the electronic device detects event E at time t2, it continues to read the change in the capacitance value of the touch panel. If the increase in the capacitance value of the touch panel is greater than or equal to (Cm-C0) within the preset time length, it can be determined that the change in the capacitance value of the touch panel meets the preset requirements, and then the electronic device can determine that it is in a water-immersion state. Exemplarily, the preset time length here can refer to the time difference between time tm and time 0, that is, tm.

[0217] In some examples, referring to FIG. 9 , event E may refer to the case where the capacitance values ​​of at least N detection sites among the M detection sites of the touch panel are greater than or equal to Cm.

[0218] For example, the electronic device can detect the change in the capacitance value of the touch panel after detecting event E at time tm. If the absolute value of the change in the capacitance value of the touch panel is not greater than △C within the preset time length, it can be determined that the change in the capacitance value of the touch panel meets the preset requirements, and then the electronic device can determine that it is in a water-immersion state. The preset time length here can refer to the time difference between time tm and time t6.

[0219] In one possible implementation, the change in capacitance value of the above-mentioned touch panel may refer to the average change in capacitance detected by the M detection sites of the touch panel, or it may refer to the average change in capacitance detected by N detection sites among the M detection sites of the touch panel whose capacitance values ​​are greater than or equal to Ci, or it may refer to the average change in capacitance detected by (MN) detection sites among the M detection sites of the touch panel whose capacitance values ​​are less than Ci.

[0220] In a possible implementation, the capacitance change of the touch panel may also refer to the median of capacitance changes detected by multiple detection points on the touch panel. This application does not limit the calculation method of the capacitance change.

[0221] Taking the second event that the capacitance distribution of the touch panel meets the preset requirements as an example, FIG10 exemplarily provides a schematic diagram of another method for detecting whether an electronic device is in a submerged state.

[0222] The electronic device can determine whether to trigger event E based on the capacitance information of the touch panel. When the trigger event E is detected, the electronic device can determine whether the distribution of capacitance values ​​detected at different detection points of the touch panel meets the preset requirements. If the distribution of capacitance values ​​of the touch panel also meets the preset requirements, the electronic device can determine that it is in a water-immersion state.

[0223] Figure 11 exemplarily provides schematic diagrams of several electronic devices entering water. In schematic diagram 1101, the electronic device enters water vertically along the thickness direction of the display screen and the display screen enters the water later. In schematic diagram 1102, the electronic device enters water along the length direction or the width direction of the display screen. In schematic diagram 1103, the electronic device enters water at a certain angle to the length direction or the width direction of the display screen. In schematic diagram 1104, the electronic device enters water along the thickness direction of the display screen and the display screen enters the water first.

[0224] Schematic diagrams 1201 to 1205 in FIG12 are schematic diagrams of the capacitance value distribution of the touch panel of the electronic device in FIG11 under different water immersion states, and schematic diagram 1206 in FIG12 is a schematic diagram of the capacitance value distribution of the touch panel in a scenario where the display screen surface of the electronic device is wet.

[0225] Schematic diagram 1201 shows the capacitance distribution of the touch panel of an electronic device when the electronic device is immersed in water in the manner shown in schematic diagram 1101. In schematic diagram 1101, the surrounding areas of the display screen of the electronic device are below the liquid surface, while the middle area is above the liquid surface. In other words, the surrounding areas of the touch panel of the electronic device are covered by the conductive liquid, while the middle area of ​​the touch panel is not covered by the conductive liquid. The capacitance values ​​detected by the detection points located in the surrounding areas of the touch panel are larger, while the capacitance values ​​detected by the detection points located in the middle area of ​​the touch panel are smaller.

[0226] Schematic diagram 1202 shows the distribution of capacitance values ​​of the touch panel of the electronic device when the electronic device is immersed in water in the manner shown in schematic diagram 1102. In schematic diagram 1102, the lower area of ​​the display screen of the electronic device is located below the liquid surface, and the upper area is located above the liquid surface. The plane where the liquid surface is located is parallel to the length direction or width direction of the display screen of the electronic device. In other words, the lower area of ​​the touch panel of the electronic device is immersed in the conductive liquid, and the upper area of ​​the touch panel is not immersed in the conductive liquid. The capacitance value detected by the detection point located in the lower area of ​​the touch panel is larger, and the capacitance value detected by the detection point located in the upper area of ​​the touch panel is smaller.

[0227] Schematic diagram 1203 shows the distribution of capacitance values ​​of the touch panel of the electronic device when the electronic device is immersed in water in the manner of schematic diagram 1103. In schematic diagram 1103, the lower area of ​​the display screen of the electronic device is located below the liquid surface, and the upper area is located above the liquid surface. The plane where the liquid surface is located forms a certain angle with the length direction or width direction of the display screen of the electronic device. In other words, the lower area of ​​the touch panel of the electronic device is immersed in the conductive liquid, and the upper area of ​​the touch panel is not immersed in the conductive liquid. The capacitance value detected by the detection point located in the lower area of ​​the touch panel is larger, and the capacitance value detected by the detection point located in the upper area of ​​the touch panel is smaller.

[0228] Schematic diagram 1204 shows the capacitance distribution of the touch panel of an electronic device when the electronic device is immersed in water in the manner shown in schematic diagram 1104. In schematic diagram 1104, the center area of ​​the display screen of the electronic device is below the liquid surface, while the surrounding areas are above the liquid surface. In other words, the center area of ​​the touch panel of the electronic device is covered by the conductive liquid, while the surrounding areas of the touch panel are not covered by the conductive liquid. The capacitance value detected by the detection points located in the center area of ​​the touch panel is larger, while the capacitance value detected by the detection points located in the surrounding areas of the touch panel is smaller.

[0229] Schematic diagram 1205 shows another possible distribution of capacitance values ​​of the touch panel of the electronic device when it is submerged in water. Schematic diagram 1206 shows the distribution of capacitance values ​​of the touch panel when water droplets are applied to different areas of the display screen of the electronic device.

[0230] In schematic diagram 1205, the detection sites that meet the threshold requirements for capacitance values ​​are continuously distributed, or in other words, the capacitance values ​​that meet the threshold requirements in schematic diagram 1205 are distributed over multiple continuous regions on the touch panel. In schematic diagram 1206, the detection sites that meet the threshold requirements for capacitance values ​​are dispersed, or in other words, the capacitance values ​​that meet the threshold requirements in schematic diagram 1206 are distributed over multiple separate regions on the touch panel.

[0231] In conjunction with the capacitance distribution of the touch panel of the electronic device under different submersion conditions, in some examples, the preset conditions that the capacitance distribution of the touch panel of the electronic device must meet may include: the detection sites indicating the trigger event E are continuously distributed on the touch panel. In other words, the N sites that meet the preset threshold requirement are partially or completely continuous. For example, of the N sites that meet the preset threshold requirement, N-3 sites are continuous, and 3 sites are not continuous.

[0232] In some examples, the electronic device can determine the direction or even the angle of entry of the electronic device into water based on the distribution of capacitance values ​​and / or changes in the distribution of capacitance values ​​on the touch panel.

[0233] Figure 13 exemplarily provides a schematic diagram of the relationship between the capacitance value distribution of the touch panel of an electronic device and time during a water entry event. As shown in Figure 13, during the time period from t1 to t5, the number of detection sites on the touch panel that meet the preset threshold requirements gradually increases, and at time t1, the detection sites that meet the preset threshold requirements first appear in the lower right corner of the touch panel. As time goes on, these detection sites that meet the preset threshold requirements gradually increase from the lower right corner to the upper left corner of the touch panel. In other words, in this water entry event, the lower right corner of the electronic device enters the water first, and the upper left corner enters the water last.

[0234] By studying the angle between the boundary line between the detection sites that meet the preset threshold requirements and the detection sites that do not meet the preset threshold requirements and the border (length direction or width direction) of the electronic device, the direction of the electronic device's entry into water can be roughly determined.

[0235] For example, at five moments in the time period from t1 to t5, the angles between the aforementioned dividing line and the length direction of the electronic device were 40°, 43°, 45°, 48°, and zero (i.e., the capacitance values ​​of all detection points on the touch panel met the preset threshold requirements). Based on this, it can be roughly determined that the direction of the electronic device's entry into water in this water immersion event formed a roughly 45° angle with the length direction of the electronic device.

[0236] In one possible implementation, the electronic device can also obtain the relationship between the average capacitance value of the touch panel and time during the water entry process to verify the relationship between the capacitance value distribution of the touch panel and time. For example, at the five moments in the time period from t1 to t5, the average capacitance values ​​of the touch panel are C1, C2, C3, C4, and C5, respectively. One possible scenario is that as the number of detection points that meet the preset threshold requirements gradually increases, the average value of the capacitance values ​​detected at all detection points on the touch panel can gradually increase, that is, C5>C4>C3>C2>C1.

[0237] When the electronic device is in the target state, the electronic device can determine whether the electronic device has left the target state, or in other words, whether the electronic device is no longer in the target state, based on the capacitance information of the touch panel. FIG. 14 exemplarily provides a method for determining whether the electronic device is no longer in the target state based on capacitance information.

[0238] S210: The electronic device obtains capacitance information of the touch panel.

[0239] Here, the capacitance information may include one or more of the following: a capacitance value of the touch panel, a relationship between the capacitance value of the touch panel and time, or a distribution of the capacitance value of the touch panel.

[0240] In some scenarios, the above-mentioned capacitance information can also be understood as including one or more of the following: the capacitance value of the detection point of the touch panel, the relationship between the capacitance value of the detection point of the touch panel and time, or the relationship between the capacitance value of the detection point of the touch panel and the position of the detection point.

[0241] In some examples, the electronic device may obtain capacitance information through a data processing unit of the touch panel, or may obtain capacitance information through a central processing unit of the electronic device. In the case of obtaining capacitance information using the central processing unit, the capacitance information may include the result of preliminary processing by the data processing unit of the touch panel on the capacitance value detected by the detection point of the touch panel.

[0242] S220: The electronic device determines whether a third event and / or a fourth event is detected according to the capacitance information.

[0243] The third event and / or the fourth event can be used to determine whether the electronic device is no longer in the target state, or in other words, the third event and / or the fourth event can be used to determine whether the electronic device is no longer immersed in the conductive liquid.

[0244] In the process of an electronic device changing from a state immersed in a conductive liquid to a state no longer immersed in the conductive liquid, the touch panel of the electronic device changes from a state covered by the conductive liquid to a state no longer covered by the conductive liquid, so that the capacitance values ​​detected by multiple detection points on the touch panel will also change accordingly.

[0245] In some examples, the third event may include a significant decrease in capacitance values ​​detected by multiple detection sites of the touch panel.

[0246] For example, when the electronic device is in the target state, the capacitance values ​​detected by at least N of the M detection sites on the touch panel are greater than or equal to a preset threshold value Ci, where N ≤ M, and both N and M are positive integers. Based on this, the third event may include: the capacitance values ​​of at least Q of the M detection sites are less than or equal to a preset threshold value Cj, where Q ≤ M, and Q is a positive integer.

[0247] Here, the preset threshold Cj is less than the preset threshold Ci. In other words, when the electronic device is not in the target state, such as not submerged in water, the capacitance values ​​detected by the multiple detection sites in the touch panel of the electronic device will decrease.

[0248] It should be noted that when the electronic device is in the target state, the capacitance values ​​detected by MN detection points on the touch panel of the electronic device are less than the preset threshold value Ci. Since the electronic device is not in the target state and is not in the target state at the same time, to avoid misunderstanding, in some examples, the value of Q can satisfy: Q>MN, that is, Q+N>M.

[0249] Taking the curve S1 in Figure 7 as an example, the preset threshold Ci used to determine whether the electronic device is in the target state can be taken as C1 in Figure 7, and the preset threshold Cj used to determine whether the electronic device is no longer in the target state can be taken as (C1-δ) in Figure 7, where δ>0.

[0250] In other words, when the electronic device is in the target state, the capacitance values ​​detected by at least N of the M detection sites of the touch panel are greater than or equal to C1 in Figure 7, and when the electronic device is not in the target state, the capacitance values ​​detected by at least Q of the M detection sites of the touch panel are less than or equal to (C1-δ) in Figure 7.

[0251] As an example but not a limitation, the electronic device may detect the aforementioned third event at the moment when it detects that it is in the target state or slightly later than that moment (eg, at time tm in FIG. 7 or slightly later than time tm).

[0252] In some examples, the fourth event may include a change (decrease) in capacitance values ​​detected by a plurality of detection sites of the touch panel within a preset time period being greater than or equal to a preset threshold.

[0253] Taking curve S1 in FIG7 as an example, during the time period from t4 to t5, the capacitance value detected by the touch panel gradually decreases from (C1-δ) at time t4 to C2 at time t5. In some examples, C2 may be slightly greater than C0, or C2 may be equal to C0.

[0254] Taking the case where the electronic device is no longer in the target state at time t5 as an example, the above-mentioned preset time length can be less than or equal to the length of the time period from t4 to t5, and the change in the capacitance value of the touch panel within the preset time length can be the difference between C2 and (C1-δ) (a negative value, indicating that the capacitance value decreases).

[0255] In some examples, the electronic device may begin detecting changes in the capacitance information of the touch panel and detecting the fourth event at the moment it detects that it is in the target state, such as at time tm in FIG7 . For example, starting from time tm, if the change in the capacitance value of the touch panel within a preset time length (such as the interval length between t4 and t5 above) is greater than or equal to a preset threshold value (such as the difference between C2 and (C1-δ) above), the electronic device may determine that the fourth event has been detected.

[0256] In some examples, the electronic device may begin detecting changes in the capacitance information of the touch panel and detecting the fourth event after detecting that it is in the target state (after time tm in FIG. 7 ), for example, time t4. For example, starting from time t4, if the change in the capacitance value of the touch panel within a preset time length (for example, the interval length between t4 and t5 above) is greater than or equal to a preset threshold value (for example, the difference between C2 and (C1-δ) above), the electronic device may determine that the fourth event has been detected.

[0257] One possible scenario is that, in this example, the change (decrease) in the capacitance value detected by multiple detection sites of the touch panel during the time period from tm to t4 is greater than or equal to the preset threshold, that is, the electronic device may detect the above-mentioned third event during the time period from tm to t4. In this case, the solution of this example can also be understood as that after the electronic device detects the third event during the time period from tm to t4, it starts detecting the above-mentioned fourth event from time t4 and detects the fourth event at time t5.

[0258] Taking curve S2 in FIG9 as an example, during the time period from t6 to t7, the capacitance value detected by the touch panel gradually decreases from (Cm-δ) at time t6 to C3 at time t7. In some examples, C3 may be slightly greater than C0, or C3 may be equal to C0.

[0259] Taking the case where the electronic device is no longer in the target state at time t7 as an example, the above-mentioned preset time length can be less than or equal to the length of the time period from t6 to t7, and the change in the capacitance value of the touch panel can be the difference between C3 and (Cm-δ) (a negative value, indicating that the capacitance value decreases).

[0260] In some examples, the electronic device may begin detecting the fourth event at the moment it detects that it is in the target state, such as time tm in Figure 9. For example, starting from time tm, if the change in the capacitance value of the touch panel within a preset time period (such as the interval between t6 and t7 above) is greater than or equal to a preset threshold value (such as the difference between C3 and (Cm-δ) above), the electronic device may determine that the fourth event has been detected.

[0261] In some examples, the electronic device may detect a change in the capacitance information of the touch panel and detect the fourth event after detecting that the electronic device is in the target state (after time tm in FIG9 ), for example, at time t6 in FIG9 . For example, from time t6 onwards, if the change in the capacitance value of the touch panel within a preset time length (for example, the interval length between t6 and t7 above) is greater than or equal to a preset threshold value (for example, the difference between C3 and (Cm-δ) above), the electronic device may determine that the fourth event has been detected.

[0262] One possible scenario is that, in this example, the change (decrease) in the capacitance value detected by multiple detection sites of the touch panel during the time period from tm to t6 is greater than or equal to the preset threshold, that is, the electronic device may detect the above-mentioned third event during the time period from tm to t6. In this case, the solution of this example can also be understood as that after the electronic device detects the third event during the time period from tm to t6, it starts detecting the above-mentioned fourth event from time t6, and detects the fourth event at time t7.

[0263] In some examples, the third event and the fourth event may be the same event, or the third event may include the fourth event, or the electronic device may detect the third event and the fourth event simultaneously.

[0264] S230: When it is determined that the third event and / or the fourth event is detected, the electronic device may determine that it is not in the target state.

[0265] That the electronic device is not in the target state may include a state in which the electronic device is not immersed in the conductive liquid, for example, a state in which the electronic device is not in water.

[0266] When the electronic device is not immersed in the conductive liquid, the capacitance of the coupling capacitor on the surface of the touch panel decreases, thereby triggering the aforementioned third event and / or fourth event.

[0267] In some examples, the electronic device may determine that it is not in the target state when detecting the third event or the fourth event. In this case, the electronic device detects the third event or the fourth event, respectively.

[0268] In some examples, the electronic device may determine that it is not in the target state when it detects the aforementioned third and fourth events simultaneously. In this case, the electronic device may detect the third and fourth events simultaneously. In this scenario, the third and fourth events detected by the electronic device may be treated as a single event. Alternatively, the electronic device may detect the fourth event based on the detection of the third event. Alternatively, the electronic device may detect the third event based on the detection of the fourth event.

[0269] The touch panel of an electronic device may be provided with an automatic power-off function. For example, in response to detecting no user operation on the electronic device within a preset time period, the electronic device may power off the touch panel. One possible scenario is that, after detecting the aforementioned first event, the electronic device continues to detect a second event. If the second event is not detected, the countdown for the touch panel's automatic power-off expires, and the electronic device powers off the touch panel, resulting in failure to successfully detect the second event and, consequently, the electronic device's inability to successfully determine whether it is in the target state.

[0270] In order to solve the above problems, the present application provides another method for detecting the status of an electronic device. When the automatic power-off function of the touch panel of the electronic device is turned on, in response to the electronic device detecting a first event, the electronic device can perform delayed power-off for the touch panel to increase the probability of the electronic device successfully detecting a second event, as explained below in conjunction with Figures 15 and 16.

[0271] Take the process of an electronic device entering a target state from a non-target state as shown in Figure 15 as an example. From time x0 before entering the target state, the electronic device enters a countdown for automatic power off of the touch panel, with a countdown duration of △x1. If processed according to the automatic power-off method, the touch panel will automatically power off after the countdown △x1 ends, that is, at time x2. At time x1 before the automatic power-off countdown ends, the electronic device detects the aforementioned first event (the capacitance value detected by a certain proportion of the multiple detection sites on the touch panel reaches a preset threshold).

[0272] In order to determine whether the electronic device itself is in the target state, the electronic device can perform a delayed power-off operation for the touch panel after detecting the first event, or in other words, the electronic device can automatically power off the touch panel after a delay of △x2 after detecting the first event.

[0273] The delay time Δx2 can meet the need of the electronic device to detect one or more of the aforementioned second events.

[0274] In some examples, the second event may be that the duration of the first event is greater than or equal to a preset duration T1. In this case, the delay duration Δx2 should be greater than or equal to T1.

[0275] In some examples, the second event may be that the capacitance value of the touch panel fluctuates (changes, increments) within a preset time period T2 and meets preset requirements. In this case, the delay time period Δx2 should be greater than or equal to T2.

[0276] In some examples, the aforementioned second event may be: the distribution of the capacitance value of the touch panel meets the preset requirements. In this case, the above-mentioned delay time △x2 should not be shorter than the shortest time during which the electronic device can obtain the distribution of the capacitance value of the touch panel.

[0277] One possible scenario is that the electronic device detects one or more of the aforementioned second events at time x3 within the delay time △x2 after time x1, and can then determine that it is in the target state. The electronic device can power off the touch panel at time x3 or slightly later than time x3. Alternatively, the electronic device can also enter an automatic power-off countdown from time x3. If no user operation of the electronic device is detected during the countdown, the touch panel is powered off. Alternatively, the electronic device powers off the touch panel when the delay time △x2 after time x1 expires (i.e., at time x4).

[0278] One possible scenario is that the electronic device does not detect any of the aforementioned second events within the delay time △x2 after time x1, and thus cannot determine that it is in the target state. When the electronic device obtains the detection result, it can perform a power-off operation on the touch panel. In other words, the electronic device can perform a power-off operation on the touch panel at time x4 or slightly later than time x4.

[0279] In some possible scenarios, the touch panel of the electronic device is already in a power-off state before entering the target state. In this case, the electronic device cannot obtain the capacitance information detected by the touch panel in the target state.

[0280] To solve the above problem, the electronic device can use other sensors to determine whether it is in the target state. If it is determined that it is in the target state, it can power on the touch panel to obtain the capacitance information detected by the touch panel. The following is explained with reference to Figures 17 and 18.

[0281] As shown in Figure 17, at time x1 before the electronic device enters the target state, the electronic device has already powered off the touch panel. For example, if no user operation is detected before the countdown for the touch panel to automatically power off ends, the electronic device powers off the touch panel. For another example, in response to a user operation to turn off the display (such as a lock screen operation), the electronic device powers off the touch panel.

[0282] At time x2, after time x1, the electronic device enters the target state in response to a user operation, for example, by being submerged in water. Because the touch panel of the electronic device was powered off before time x2, the electronic device cannot determine whether it is in the target state based on the capacitance information detected by the touch panel. In this case, in some examples, the electronic device can combine detection information from other sensors to determine whether it is in the target state.

[0283] In some examples, the electronic device can determine whether it is in a target state based on detection data from a barometer.

[0284] For example, in response to the detection data of the barometer being greater than or equal to a preset pressure, the electronic device may determine that it is in the target state.

[0285] In some examples, the electronic device can determine whether it is in a target state based on detection data from ECG electrodes.

[0286] Exemplarily, in response to the electrical signal detected by the ECG electrode meeting a preset requirement, for example, the strength of the electrical signal is greater than or equal to a preset strength, the electronic device can determine that it is in the target state.

[0287] In some examples, the electronic device can combine detection data from a barometer and detection data from ECG electrodes to determine whether it is in a target state.

[0288] Exemplarily, in response to the detection data of the barometer being greater than or equal to a preset pressure and the electrical signal strength detected by the ECG electrode being greater than or equal to a preset threshold, the electronic device may determine that it is in the target state.

[0289] To obtain capacitance information of the electronic device in the target state, the electronic device may power on the touch panel in response to the sensor indicating that the electronic device is in the target state. In other words, at time x3 after time x2 in FIG. 17 , the electronic device may power on the touch panel. Here, time x3 may be considered to be simultaneous with time x2, or may be slightly later than time x2.

[0290] After the touch panel is powered on, the electronic device can obtain the capacitance information of the touch panel and determine the device status based on the capacitance information, for example, detecting whether the aforementioned third event or fourth event occurs, and determining whether the device is no longer in the target state.

[0291] In some scenarios, an electronic device may not be in the target state, but the capacitance information from the touch panel may indicate that it is. In other words, in some scenarios, the capacitance information from the touch panel may be falsely reported. In such cases, the electronic device can use the event indicated by the capacitance information from the touch panel as a reference event and, in combination with the data detected by other sensors, determine whether it is in the target state. Figure 19 provides a schematic diagram of a method for an electronic device to determine the device state in the scenario where a reference event occurs.

[0292] In some scenarios, the above-mentioned reference events may also be referred to as abnormal events. For example, the reference events may include: a user pressing the display screen of the electronic device for a long time, an increase in ambient temperature, or a user powering on a touch panel in a target state.

[0293] For the reference event of a user pressing the display screen of an electronic device for a long time (hereinafter referred to as reference event A), the capacitance value detected by the touch panel will also increase after the user's skin contacts the touch panel of the display screen, and the user pressing the display screen for a long time may also trigger the electronic device to detect any of the aforementioned multiple second events (for example, the distribution of capacitance values ​​meets preset requirements). Therefore, in this case, determining whether the device is in the target state only based on the capacitance information of the touch panel will result in misjudgment.

[0294] For the reference event of an increase in ambient temperature (hereinafter referred to as reference event B), since the increase in ambient temperature will also cause the capacitance value detected by the touch panel to increase, it may also trigger the electronic device to detect any of the aforementioned second events (for example, the change in the capacitance value of the touch panel within a preset time period meets the preset requirements). Therefore, in this case, determining whether the device is in the target state only based on the capacitance information of the touch panel will also lead to misjudgment.

[0295] Regarding the reference event of the user powering on the touch panel in the target state (hereinafter referred to as reference event C), for example, the electronic device is submerged in water and the touch panel is powered off, and the user powers on the touch panel by pressing a button. Because the device is already in the target state before the touch panel detects the capacitance information, or in other words, the touch panel cannot detect the device's change from being in a non-target state to being in the target state, if the second event is whether the change in capacitance value within a preset time period meets a preset condition, the touch panel of the electronic device may not be able to detect the second event within the preset time period. Therefore, in this case, determining whether the device is in the target state based solely on the capacitance information of the touch panel will also result in a misjudgment.

[0296] In one possible implementation, the electronic device can distinguish the aforementioned multiple reference events based on the capacitance information of the touch panel. For example, for the aforementioned reference events A, B, and C, the capacitance value detected by the touch panel in reference event C is larger, the capacitance value detected by the touch panel in reference event A is smaller, and the capacitance value detected by the touch panel in reference event B is between the detection results of the aforementioned two reference events. In view of this, the electronic device can use the average capacitance value detected at multiple detection points on the touch panel as the basis for distinguishing between the aforementioned reference events A, B, and C.

[0297] In some examples, in response to the electronic device detecting one or more of the aforementioned reference events, the electronic device can combine sensor information to determine whether it is in a target state.

[0298] Exemplarily, the above-mentioned sensor may include one or more of the following: a barometer, an ECG electrode, a temperature sensor, a gyroscope, an accelerometer, a temperature sensor or a magnetometer, etc.

[0299] In some examples, in response to the electronic device detecting the aforementioned reference event A, the electronic device may determine whether it is in the target state in combination with the detection data of the barometer. For example, if the pressure value detected by the barometer is greater than or equal to a preset pressure, the electronic device may determine that it is in the target state; if the pressure value detected by the barometer is less than the preset pressure, the electronic device may determine that it is not in the target state.

[0300] In some examples, in response to the electronic device detecting the aforementioned reference event B, the electronic device may determine whether it is in the target state in combination with the detection data of the temperature sensor. For example, if the temperature detected by the temperature sensor is within a preset temperature range (e.g., approximately 23°C), the electronic device may determine that it is in the target state; if the temperature detected by the temperature sensor increases by a magnitude greater than or equal to a preset threshold within a preset time period, the electronic device may determine that it is not in the target state.

[0301] In some examples, in response to the electronic device detecting the aforementioned reference event C, the electronic device may determine whether it is in the target state based on the detection data from the ECG electrodes. For example, if the strength of the electrical signal detected by the ECG electrodes is greater than or equal to a preset strength, the electronic device may determine that it is in the target state; if the strength of the electrical signal detected by the ECG electrodes is less than the preset strength, the electronic device may determine that it is not in the target state.

[0302] In some examples, the electronic device may also combine detection data from two or more of the aforementioned sensors to determine whether it is in the target state.

[0303] The device state of an electronic device can, to a certain extent, reflect the activity state of its user. In other words, the sensor information and capacitance information recorded by the electronic device can, to a certain extent, be used to reflect the user's activity state. For example, the electronic device may be a wearable device such as a watch or a bracelet. If the watch is submerged in water, the user wearing the watch may also be submerged in water, such as when swimming or diving.

[0304] By analyzing the capacitance information of the touch panel of a wearable device, it is possible to determine, to a certain extent, the different activity states of a user during an activity. The following uses swimming as an example to illustrate the swimming state detection method provided by an embodiment of the present application. Figure 20 shows a schematic diagram of a method for detecting a user's swimming state provided by an embodiment of the present application.

[0305] S310 , in response to the operation of starting swimming, the electronic device obtains capacitance information of the touch panel.

[0306] Here, the electronic device may be a wearable device such as a watch or a bracelet.

[0307] A touch panel can be a component of an electronic device's display screen, and can be used to enable the electronic device to respond to user touch operations. The touch panel can be provided with multiple capacitance detection sites, which can detect the capacitance of coupling capacitance generated in response to user touch operations, etc. For an introduction to touch panels, please refer to the relevant description above and will not be repeated here.

[0308] In some examples, the capacitance information may include one or more of the following: a capacitance value of the touch panel, a relationship between the capacitance value of the touch panel and time, or a distribution of the capacitance value of the touch panel. In some scenarios, the aforementioned capacitance information may also be understood to include one or more of the following: a capacitance value of a detection point on the touch panel, a relationship between the capacitance value of the detection point on the touch panel and time, or a relationship between the capacitance value of the detection point on the touch panel and the position of the detection point.

[0309] The electronic device may identify the user's active activation of the swimming status detection function as the user's swimming start operation. Alternatively, the electronic device may detect the user's heart rate, movement, and other information to determine whether the user is swimming. The method for determining whether swimming has begun will be explained in detail below and will not be elaborated here.

[0310] S320: Determine stroke information of the user during swimming based on the capacitance information.

[0311] Stroke count during swimming can, to a certain extent, reflect a user's swimming efficiency. For the same swimming distance, fewer strokes indicate a greater distance covered with a single stroke, and thus, relatively speaking, higher swimming efficiency. Determining stroke count using capacitance information during swimming helps to more accurately and reliably analyze a user's swimming activity.

[0312] In some examples, the stroke information may include one or more of the following: whether the current stroke is valid, the number of valid strokes or the number of invalid strokes, etc.

[0313] When the user is swimming, as the user's arm switches between the water and water states, the electronic device worn on the user's arm also constantly switches between the water and water states. By obtaining the capacitance information of the electronic device, the length of time the electronic device is out of the water, the length of time it is in the water, the number of times it is out of the water and the number of times it is in the water, etc. can be determined. Based on this information, the electronic device can determine the stroke information of the user during swimming.

[0314] In some examples, the electronic device may determine stroke information of the user during swimming according to the method shown in FIG. 21 .

[0315] S321: Determine the number of effective sites according to the capacitance information.

[0316] In some examples, a valid site may refer to a capacitance detection point at which a capacitance value detected by all capacitance detection sites on the touch panel is greater than or equal to a preset capacitance value.

[0317] Here, the preset capacitance value can be a certain value, such as 10 units, or the preset capacitance value can also be a value determined according to the actual detection situation. For example, the maximum capacitance value detected by all detection sites in the same batch is a, then the preset capacitance value can be 0.7a or 0.8a, etc.

[0318] In some examples, the electronic device may obtain capacitance information of the touch panel multiple times within one swipe cycle. Hereinafter, obtaining capacitance information of the touch panel once is referred to as one acquisition frequency.

[0319] The above-mentioned valid sites may refer to all valid sites included in multiple acquisition frequencies within a stroke period, or the above-mentioned valid sites may also refer to the valid sites included in each acquisition frequency within a stroke period.

[0320] For example, the electronic device may determine that the duration of a swipe cycle is 200 milliseconds, and within these 200 milliseconds, capacitance information may be acquired every 25 milliseconds, i.e., every 25 milliseconds is used as an acquisition frequency. In one possible scenario, the number of valid sites may refer to the number of valid sites contained in the touch panel within every 25 milliseconds (or in one frequency of acquiring capacitance information). In another possible scenario, the number of valid sites may refer to the number of valid sites contained in the touch panel within 200 milliseconds (or within one swipe cycle).

[0321] Figure 22 shows the number of valid locations at each acquisition frequency within a swipe information determination cycle. Taking the total number of touch panel capacitance detection locations as 10 as an example, the number of valid locations within 0-200 milliseconds is as follows:

[0322] Table 1

[0323] According to the above table, if the number of valid sites refers to the number of valid sites contained in the touch panel within every 25 milliseconds, the number of valid sites can be: 8, 10, 7, 9, 7, 5, 4, 8 respectively; if the number of valid sites refers to the number of valid sites contained in the touch panel within 200 milliseconds, the number of valid sites can be: 58.

[0324] S322: Determine the water entry duration and / or water entry state frequency according to the number of valid locations.

[0325] In some examples, the electronic device may determine whether the frequency is a water entry state frequency based on whether the number of valid sites included in each acquisition frequency in a stroke cycle is greater than or equal to a preset number.

[0326] Taking Figure 22 as an example, the preset number of frequencies for determining whether it belongs to the water entry state can be 7. Then, among the 8 acquisition frequencies within 0-200 milliseconds, the two frequencies of 125 milliseconds-150 milliseconds and 150 milliseconds-175 milliseconds do not belong to the water entry state frequencies, and the remaining frequencies belong to the water entry state frequencies. The water entry state frequency in the 0-200 millisecond period is 6.

[0327] In some examples, the electronic device can analyze the duration corresponding to each frequency separately to determine whether the duration corresponding to each frequency is valid, and then summarize to determine the total valid duration contained in a stroke.

[0328] For example, the electronic device may define the duration corresponding to a frequency in which the number of valid sites is greater than or equal to a preset number as the valid duration.

[0329] For example, taking the preset number of 7 as an example, the duration corresponding to the frequency in which the number of valid sites is greater than or equal to 7 is the valid duration, and the duration corresponding to the frequency in which the number of valid sites is less than 7 is the invalid duration. Referring to FIG22 , within 0-200 milliseconds, the durations corresponding to the eight frequencies are: valid duration, valid duration, valid duration, valid duration, valid duration, valid duration, invalid duration, invalid duration, and valid duration. Furthermore, within 200 milliseconds, the valid duration determined based on the valid sites can be estimated to be 25 milliseconds × 6 = 150 milliseconds.

[0330] In some examples, the electronic device can count the total number of valid sites in all frequencies included in a stroke, and determine the effective duration included in the stroke based on the total number of valid sites.

[0331] For example, within the above 0-200 milliseconds, the number of valid sites detected every 25 milliseconds are 8, 10, 7, 9, 7, 5, 4, and 8 respectively, and the total number of valid sites is 58. The total effective duration within the cycle can be estimated by the number of total valid sites: 25 milliseconds / 10 × 58 = 145 milliseconds.

[0332] S323: Determine stroke count information based on the water entry duration and / or water entry frequency.

[0333] In some examples, for a stroke cycle in which the number of valid sites is greater than or equal to a preset number, the electronic device can determine that the stroke is a valid stroke; for a stroke cycle in which the number of valid sites is less than a preset number, the electronic device can determine that the stroke is an invalid stroke.

[0334] Taking Figure 22 as an example, in one stroke cycle, the total number of valid sites is 58. The preset threshold of valid sites for judging whether a stroke is a valid stroke can be 48. Since 58>48, that is, the number of valid sites contained in the current stroke is greater than the preset number, the current stroke is a valid stroke.

[0335] In some examples, for a stroke cycle including a water entry duration greater than or equal to a preset duration, the electronic device may determine that the stroke is a valid stroke, and for a stroke cycle including a water entry duration less than the preset duration, the electronic device may determine that the stroke is an invalid stroke.

[0336] Still taking Figure 22 as an example, the water entry duration included in the current stroke cycle is 145 milliseconds or 150 milliseconds. The above-mentioned preset duration threshold for determining whether the stroke cycle is a valid stroke can be 120 milliseconds. Since 145 milliseconds > 120 milliseconds, that is, the water entry duration included in the current stroke cycle is longer than the preset duration, the current stroke is a valid stroke.

[0337] In some examples, for a stroke cycle in which the frequency of water entry is greater than or equal to a preset number, the electronic device may determine that the stroke is a valid stroke, and for a stroke cycle in which the frequency of water entry is less than the preset number, the electronic device may determine that the stroke is an invalid stroke.

[0338] Still taking Figure 22 as an example, the frequency of water entry status included in the current stroke is 6. The above-mentioned threshold value of the preset water entry status frequency for judging whether it is a valid stroke can be 5. Since 6>5, that is, the number of water entry status frequencies included in the current stroke cycle is greater than the preset number, the current stroke is a valid stroke.

[0339] S330: Determine the number of laps according to the stroke information of the user during swimming.

[0340] The lap count during swimming can be used to measure the distance a user has swum. Combined with time information, it can reflect the user's athletic performance during a swimming activity and reflect the user's physical condition and physical fitness changes.

[0341] In some examples, the trip number information may include one or more of the following: the number of valid trips, the number of invalid trips, the number of valid strokes included in the valid trips, etc.

[0342] In some examples, the electronic device may determine whether the current pass is a valid pass based on whether the number of valid strokes included in the current pass is greater than or equal to a preset number.

[0343] The preset number of valid strokes used to determine whether the current stroke is valid can be determined based on existing swimming experience data, or can also be determined based on historical data of the user's swimming activities.

[0344] For example, for a 25m long swimming lane, existing data records show that the minimum number of strokes is 4, so the above-mentioned preset number can be 4.

[0345] For example, the preset number can be calculated according to an empirical formula, which can be expressed as: preset number = lane length × p, where p is an empirical constant that can be determined based on statistical data. For example, the value of the empirical constant p can be: 0.15 < p < 0.35. Substituting this value range into the empirical formula, for a 25m long lane, the preset number can be between 4 and 9 times.

[0346] For example, the electronic device may collect historical data from the user's swimming sessions to determine the preset number. For example, if the electronic device records that the user's average minimum stroke count for a 25m lane during their first five swimming sessions was 10, the electronic device may convert the average minimum stroke count based on this historical data to serve as the updated preset number of minimum stroke counts. For example, the updated preset number of minimum stroke counts may be 4, 5, or the like.

[0347] For example, the electronic device may also determine the preset number of valid strokes based on the total number of strokes detected by the user in the current trip. For example, the preset number may be 0.6×the total number of strokes or 0.7×the total number of strokes.

[0348] For example, if the electronic device detects that the total number of strokes performed by the user in the current trip is 10, the preset number of valid strokes may be 6 or 7, etc.

[0349] In some examples, the electronic device may determine whether the current trip is a valid trip based on whether the total water entry duration included in the current trip is greater than or equal to a preset duration.

[0350] For example, the electronic device may separately count the water entry durations of all strokes included in the current trip, and sum up the water entry durations of all strokes to obtain the total water entry duration of the current trip.

[0351] In some examples, when it is determined that the current trip is a valid trip, the electronic device can update the data of the user's swimming exercise, for example, performing the "valid number of trips + 1" operation. Accordingly, in response to the user's operation of viewing the swimming data, the electronic device can update the content of the user interface for displaying the number of trips the user has swum.

[0352] In some examples, if the electronic device determines that the current lap is not a valid lap, it may not update the swimming data. Accordingly, when the user views a user interface displaying the number of laps the user has swum, the lap number information in the user interface will not change. In this case, the electronic device may prompt the user that the total water entry time or total valid stroke count for the current lap has not yet met the requirements. For example, the electronic device may display a prompt message stating, "The total water entry time for the current lap has not yet met the requirements. Please keep working hard!"

[0353] In order to improve the efficiency of electronic devices in updating sports information and enable users to view their swimming data in a timely manner, the electronic device can pre-process the number of laps information during the user's swimming. The pre-processed results can be directly updated and displayed on the user interface of the electronic device. At the end of the user's swimming, the swimming data can be more accurately post-processed based on the overall data of the swimming process, thereby improving the user experience.

[0354] Figures 23 and 24 provide two exemplary schemes based on different bases for determining whether the number of trips is valid. The scheme shown in Figure 23 is based on whether the entry time of the current trip meets the requirements, while the scheme shown in Figure 24 is based on whether the effective number of strokes of the current trip meets the requirements.

[0355] In some examples, the electronic device can use the same judgment basis during pre-processing and post-processing of the trip number information, as shown in the schemes in Figures 23 or 24. In some examples, the electronic device can use different judgment basis during pre-processing and post-processing of the trip number information. For example, in the pre-processing stage, the judgment basis may be whether the entry time of the current trip meets the requirements, and in the post-processing stage, the judgment basis may be whether the effective stroke count of the current trip meets the requirements. For another example, in the pre-processing stage, the judgment basis may be whether the effective stroke count of the current trip meets the requirements, and in the post-processing stage, the judgment basis may be whether the entry time of the current trip meets the requirements. Figures 23 and 24 are merely exemplary and should not be considered as limiting the present application.

[0356] As shown in FIG23 , in the stage of preprocessing the number of trips information, if the electronic device detects that the water entry duration contained in the first T strokes in the current trip is greater than or equal to S1, the electronic device can preset the current trip as a valid trip, so that the electronic device can update the number of trips information on the user interface, for example, displaying “valid number of trips + 1”; if the electronic device detects that the water entry duration contained in the first T strokes in the current trip is less than S1, the electronic device can preset the current trip as not a valid trip, and the electronic device may not update the number of trips information on the user interface.

[0357] In the lap information post-processing stage, based on the processing in the lap information pre-processing stage, the electronic device can obtain the water entry duration of all strokes in each lap. For a lap that has been preset as a valid lap, if it is determined that the total water entry duration in the lap is greater than or equal to S2, the electronic device can determine that the lap is a valid lap. If it is determined that the total water entry duration in the lap is less than S2, the electronic device can cancel the preset setting of the lap as a valid lap, determine that the lap is not a valid lap (for example, a false lap), and perform an operation to reduce the total valid lap count of this swimming session by one.

[0358] In the above solution, T can be a positive integer, for example, T=5, and the values ​​of S1 and S2 can satisfy that S2 is greater than S1.

[0359] In the scheme shown in FIG24 , in the stage of preprocessing the number of strokes information, if the electronic device detects that the number of valid strokes included in the first T strokes in the current stroke is greater than or equal to L1, the electronic device can preset the current stroke as a valid stroke, so that the electronic device can update the number of strokes information on the user interface, for example, displaying "valid number of strokes + 1"; if the electronic device detects that the number of valid strokes included in the first T strokes in the current stroke is less than S1, the electronic device can preset the current stroke as not a valid stroke, and the electronic device may not update the number of strokes information on the user interface.

[0360] In the lap number information post-processing stage, based on the processing in the lap number information pre-processing stage, the electronic device can obtain the number of all valid strokes contained in each lap. For a lap that has been pre-set as a valid lap, if it is determined that the total number of valid strokes in the lap is greater than or equal to L2, the electronic device can determine that the lap is a valid lap. If it is determined that the total number of valid strokes in the lap is less than S2, the electronic device can cancel the pre-setting of the lap as a valid lap, determine that the lap is not a valid lap (for example, called a false lap), and perform an operation of subtracting one from the total number of valid laps of this swimming session.

[0361] In the above solution, T can be a positive integer, for example, T=5, and the values ​​of L1 and L2 can satisfy that L2 is greater than L1.

[0362] To more accurately and reliably identify a user's swimming style, in some examples, the electronic device can combine capacitance information detected by an accelerometer, gyroscope, and touch panel to determine the user's swimming style. FIG25 is a schematic diagram of a method for determining a user's swimming style based on capacitance information, provided in an embodiment of the present application.

[0363] S410: Acquire capacitance information and sensor information.

[0364] Here, capacitance information refers to the capacitance value, time or position information detected by the capacitance value detection site of the touch panel of the electronic device, and the correlation relationship between these information. Specifically, the capacitance information may include one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel. Alternatively, the capacitance information may also be understood to include one or more of the following: the capacitance value of the detection site of the touch panel, the relationship between the capacitance value of the detection site of the touch panel and time, or the positional relationship between the capacitance value of the detection site of the touch panel and the detection site.

[0365] Sensor information may include data information detected by one or more sensors on the electronic device, including but not limited to: accelerometer, gyroscope, magnetometer, barometer or heart rate sensor (such as ECG electrode, etc.).

[0366] The capacitance information of the touch panel can be used to determine the device's water exit and water entry times for a certain swimming style during swimming. Since different swimming styles correspond to different water exit and water entry times, the accuracy of swimming style recognition can be improved to a certain extent with the help of capacitance information.

[0367] The accelerometer allows users to obtain changes in the acceleration of electronic devices in multiple directions in three-dimensional space. These changes in acceleration can be used to determine the user's arm and leg paddling and kicking movements, as well as the ups and downs of the body during swimming. Based on this, the data information detected by the accelerometer during swimming can improve the accuracy of swimming posture recognition by electronic devices.

[0368] The gyroscope can be used to measure information such as the angular velocity of the user's wrist or other body parts rotating around different axes, which is helpful in distinguishing different rotation and swinging patterns in different swimming styles.

[0369] The magnetometer can be used to determine the direction of the user's movement during swimming. Combined with the detection data of the accelerometer and gyroscope, it can also achieve direction positioning, which is helpful for determining the changes in the user's posture when turning during swimming.

[0370] The barometer can be used to determine changes in the device's underwater depth during swimming. The heart rate sensor can be used to monitor changes in the user's heart rate during swimming. In some scenarios, the user's heart rate may vary depending on the swimming style.

[0371] During the process of swimming posture recognition, the electronic device can make a comprehensive judgment based on the detection data of one or more of the above sensors to improve the accuracy and reliability of swimming posture recognition.

[0372] S420: Determine a swimming style based on a swimming style recognition model and / or a single water entry duration.

[0373] In some examples, a model can be trained based on data detected by the touch panel and different sensors during swimming to build a swimming style recognition model. During the actual swimming style recognition process, the electronic device can input the capacitance information and sensor information obtained in S410 into the swimming style recognition model and determine the user's swimming style based on the output of the swimming style recognition model.

[0374] Exemplarily, the input data for swimming stroke recognition model training may include detection data of an accelerometer, detection data of a gyroscope, and capacitance information of a touch panel.

[0375] Among them, the detection data of the accelerometer may include the numerical values ​​of acceleration in multiple directions and the correspondence between the numerical values ​​of acceleration and time. For example, the detection data of the accelerometer may include the numerical value of acceleration in a first direction, the numerical value of acceleration in a second direction, and the numerical value of acceleration in a third direction. Any two directions of the first direction, the second direction, and the third direction may be perpendicular to each other.

[0376] Similarly, the detection data of the gyroscope may include the numerical values ​​of the angular velocity of rotation about multiple axes and the corresponding relationship between the numerical values ​​of these angular velocities and time. For example, the detection data of the gyroscope may include the numerical value of the angular velocity of rotation about a first axis, the numerical value of the angular velocity of rotation about a second axis, and the numerical value of the angular velocity of rotation about a third axis, and any two of the first axis, the second axis, and the third axis may be perpendicular to each other.

[0377] In one possible implementation, before model training, the detection data of the accelerometer, the detection data of the gyroscope, and the capacitance information of the touch panel may be preprocessed, for example, by aligning different types of data according to a time relationship.

[0378] In one possible implementation, the termination of model training can be controlled by setting the loss function and accuracy.

[0379] In the scenario of swimming stroke recognition, in response to a user's request for swimming stroke recognition, the electronic device can input the detection data of the accelerometer, the detection data of the gyroscope and the capacitance information detected during a swimming activity of the user into a trained swimming stroke recognition model to determine the result of the swimming stroke recognition.

[0380] In some examples, the electronic device can determine the duration of the user's entry and exit phases of the water based on capacitance information, and based on this, identify a swimming style that requires a longer period than the entry phase (breaststroke). If it is determined that the user's swimming style does not belong to breaststroke, the electronic device can further identify the swimming style by combining detection data from other sensors such as accelerometers and gyroscopes.

[0381] Exemplarily, the electronic device can determine the duration of a single water entry based on the capacitance information. When the duration of the single water entry is greater than or equal to the preset duration, the electronic device can determine that the user's swimming style is breaststroke; when the duration of the single water entry is less than the preset duration, the electronic device can further obtain detection data from sensors such as accelerometers and magnetometers, and combine the detection data of these sensors to identify the user's swimming style as any one of backstroke, freestyle, butterfly stroke, etc.

[0382] The above-mentioned single water entry duration can be understood as the length of the time interval between the user's arm entering the water once and the next time it exits the water during swimming (that is, the duration of the user's arm remaining in the water). In some scenarios, it can also be understood as the length of time between the start of the water entry state and the end of the water entry state of the electronic device worn by the user. In one possible implementation method, the electronic device can determine the user's motion characteristics such as stroke frequency, action cycle, body posture and rotation mode during swimming based on the detection data of sensors such as accelerometers and magnetometers. Based on these characteristics, the electronic device can determine the user's swimming posture.

[0383] In some examples, the electronic device can identify the user's swimming style for a single lap, or it can identify the user's swimming style for the entire swimming activity. In the case of identifying the user's swimming style for the entire swimming activity, the electronic device can determine the user's swimming style for each of multiple laps, and then count whether there is a dominant swimming style during the multiple laps. If there is an active swimming style, the electronic device determines that the user's swimming style is the dominant swimming style; otherwise, the electronic device determines that the user's swimming style is a mixed swimming style.

[0384] The above-mentioned dominant swimming style can be understood as: the swimming distance using this swimming style accounts for a higher proportion in the total swimming distance or the swimming time using this swimming style accounts for a higher proportion in the total swimming time.

[0385] During swimming, the pressure hole of the barometer used to detect pressure may be blocked by water disturbance, and the detection data of the barometer may become abnormal. For example, when the user is resting on the shore, the pressure hole is blocked, and the detection data of the barometer still indicates that the user is in the water.

[0386] In order to more accurately and reliably determine whether the user is in a swimming state or a resting state during swimming, the electronic device can combine the detection data of the barometer and the capacitance information of the touch panel to make a judgment. Figures 26 and 27 exemplarily provide schematic diagrams of another method for detecting the user's swimming state.

[0387] S510 , the electronic device obtains detection data of the barometer and capacitance information of the touch panel.

[0388] Here, the detection data of the barometer may refer to the pressure value detected by the barometer and the relationship between the pressure value and time.

[0389] For example, the pressure data of standard atmospheric pressure detected by the barometer is approximately 100kPa. When the barometer is immersed in water, the data detected by the barometer will increase by approximately 100kPa for every increase of 1 meter in water depth. For example, the detection data value of the barometer at 2 meters underwater is approximately 300kPa.

[0390] Capacitance information refers to information related to the capacitance value detected by the touch panel, and may include one or more of the following: the capacitance value of the touch panel, the relationship between the capacitance value of the touch panel and time, or the distribution of the capacitance value of the touch panel. A touch panel may be provided with multiple capacitance detection sites. In some scenarios, the aforementioned capacitance information may also be understood to include one or more of the following: the capacitance value of the detection site of the touch panel, the relationship between the capacitance value of the detection site of the touch panel and time, or the relationship between the capacitance value of the detection site of the touch panel and the position of the detection site.

[0391] S520: Determine whether the device is submerged in water based on the detection data of the barometer.

[0392] In some examples, whether the device is submerged in water can be determined based on whether the detection data of the barometer meets preset conditions.

[0393] For example, the electronic device may obtain a pressure value detected by a barometer within a preset time period, and determine whether the device is in a submerged state based on whether the pressure value within the preset time period meets a preset requirement.

[0394] For example, the electronic device can obtain the pressure value detected by the barometer within 3 seconds. If the pressure value detected by the barometer within 3 seconds is less than 200kPa, the electronic device can determine that it is in the out-of-water state; otherwise, the electronic device can determine that it is in the submerged state.

[0395] S530: Verify whether the user is swimming based on the capacitance information.

[0396] 27 , depending on the different judgment results in S520 , the electronic device may determine the user's swimming status according to different judgment criteria based on the capacitance information.

[0397] In some examples, when the barometer indicates that the device is in the water state in S520, the electronic device can determine whether the number of valid strokes and / or the number of valid swimming strokes generated by the user meets the preset requirements based on the capacitance information. When the number of valid strokes and / or the number of valid swimming strokes meet the preset requirements, the electronic device can determine that the user is in the swimming state; when the number of valid strokes and / or the number of valid swimming strokes do not meet the preset requirements, the electronic device can determine that the user is in the resting state.

[0398] For example, when the detection data of the barometer indicates that the device is in the water state, if the capacitance information indicates that the number of valid strokes detected is greater than or equal to D1, and the number of strokes containing valid swimming strokes is greater than or equal to D2, the electronic device can determine that the user is in the swimming state; otherwise, the electronic device can determine that the user is in the resting state.

[0399] In some examples, when the barometer indicates that the device is in the out-of-water state in S520, the electronic device can determine, based on the capacitance information, whether the duration of the device's entry into the water meets the preset requirements within the preset time period, and / or whether the number of strokes including valid swimming styles in the most recent multiple strokes meets the preset requirements. If the duration of the entry into the water and the number of strokes including valid swimming styles both meet the preset requirements, the electronic device can determine that the user is in the swimming state; otherwise, the electronic device can determine that the user is in the resting state.

[0400] For example, when the detection data of the barometer indicates that the device is in the out-of-water state, if the capacitance information indicates that the device's water entry time is greater than or equal to F1, and the number of strokes containing valid swimming strokes in the most recent P strokes is greater than or equal to F2, then the electronic device can determine that the user is in the swimming state; otherwise, the electronic device can determine that the user is in the resting state.

[0401] In some examples, the valid swimming stroke may refer to any one of breaststroke, butterfly stroke, backstroke or freestyle, or in other words, in a stroke, if it can be identified that the user's swimming stroke is any one of breaststroke, butterfly stroke, backstroke or freestyle, the electronic device may determine that the stroke is regarded as a stroke containing a valid swimming stroke.

[0402] S540: Determine whether the user is in a swimming state or a resting state.

[0403] The electronic device can combine the detection data of the barometer and the capacitance information to comprehensively judge whether the user is in a swimming state or a resting state.

[0404] In some examples, the barometer indicates that the device is in a submerged state, and the capacitance information indicates that the user is swimming, so the electronic device can determine that the user is swimming.

[0405] In some examples, if the barometer indicates that the device is out of water and the capacitance information indicates that the user is swimming, the electronic device can determine that the user is swimming. In this case, the barometer may be in a failed state, for example, the barometer is blocked.

[0406] In some examples, the barometer indicates that the device is in a submerged state, and the capacitance information indicates that the user is in a resting state. The electronic device can then determine that the user is in a resting state, or in other words, that the user is in the water but not swimming.

[0407] In some examples, the barometer indicates that the device is in a water-out state, and the capacitance information indicates that the user is in a resting state, then the electronic device can determine that the user is in a resting state.

[0408] When the electronic device determines that the user is swimming by combining the detection data of the barometer and the capacitance information, the electronic device can collect statistics on the user's swimming status, such as the swimming time, the aforementioned stroke information, the number of laps, or the swimming style.

[0409] When the electronic device determines that the user is in a resting state by combining the detection data of the barometer and the capacitance information, the electronic device can collect statistics on the information of the user's resting state, but not on the information of the swimming state. For example, the electronic device can collect statistics on the user's resting time, but does not record or collect statistics on information related to the number of strokes, laps, and swimming style during this period.

[0410] Based on a similar principle, an embodiment of the present application also provides a method for detecting a swimming status. During swimming, the electronic device can obtain capacitance information of the touch panel. Based on the capacitance information, the electronic device can determine its own status, such as whether it is in a water state. On this basis, the electronic device can determine the user's swimming duration, stroke information, etc. based on information such as the duration the device is in the water state and the duration it is out of the water. This is explained below in conjunction with Figures 28 to 35.

[0411] S610 , in response to the operation of starting swimming, the electronic device obtains capacitance information of the touch panel.

[0412] In some examples, the electronic device may display a first user interface 2901 as shown in the left figure of Figure 29. The first user interface 2901 may also be called a motion mode selection interface. In response to the user selecting the "swimming" motion mode on the first user interface 2901, the electronic device may display a second user interface 2902 as shown in the right figure of Figure 29. The second user interface 2902 may display a first prompt message 2903. The first prompt message 2903 may be used to prompt the user to turn on the touch panel to assist in detecting the swimming status. For example, the first prompt message 2903 may be: "Use the screen to assist in obtaining more accurate swimming data?" In response to the user's confirmation operation on the first prompt message, the electronic device may start to obtain the capacitance information of the touch panel. In response to the user's cancellation operation on the first prompt message, the electronic device does not obtain the capacitance information of the touch panel, or in other words, the electronic device does not use capacitance information to determine the user's swimming data.

[0413] In some examples, if a user begins swimming without selecting the "Swimming" exercise mode, the electronic device may obtain capacitance information from the touch panel to determine whether the device is in the water (for specific determination methods, refer to the description of determining whether the device is in the target state above), and then determine whether the user is likely to be in the swimming state using one or more of an accelerometer, gyroscope, magnetometer, and barometer. If it is determined that the user is likely to be in the swimming state, the electronic device may display a second prompt message 3001 as shown in FIG. 30 , which indicates that the function of detecting the swimming state using the touch panel has been enabled.

[0414] In some scenarios, the above-mentioned acquisition of capacitance information of the touch panel of the electronic device can also be understood as: the electronic device can obtain capacitance information in response to the user's active operation, or the electronic device can automatically obtain capacitance information after determining the user's approximate motion state.

[0415] Capacitance information refers to information such as capacitance values ​​detected by multiple capacitance detection sites on the touch panel. For a detailed description of the capacitance information, please refer to the relevant description above and will not be repeated here.

[0416] In some examples, in response to the user starting to swim, the electronic device may also display a third user interface 3101, as shown in FIG31 , which may prompt the user to enter a lane length. For example, third user interface 3101 may include a lane length selection control 3102, which may contain multiple lane length options, such as "25m," "50m," or "Not Set." In response to the user swiping left or right, the electronic device may determine the lane length selected by the user.

[0417] In response to the user selecting the "25m" or "50m" option, the electronic device can set the lane length to 25 meters or 50 meters. During the subsequent swimming process, the electronic device can also count the user's swimming information based on the set lane length. For example, as described above, the minimum stroke value is determined based on the lane length, and then it is determined whether the user's single lap is a valid lap, etc.

[0418] In response to the user selecting the "Do not set" option, the electronic device may set the lane length to a pending value. In one possible implementation, the electronic device may determine the pending value based on data monitored during the user's swimming process.

[0419] S620: The electronic device determines whether it is in a submerged state based on the capacitance information.

[0420] In some examples, the electronic device may determine whether the first event and the second event are detected based on the capacitance information. If the first event and the second event are detected, the electronic device may determine that it is in a submerged state.

[0421] For a detailed description of the first event and the second event, please refer to the relevant description of S120 in the previous text, and will not be repeated here.

[0422] S630, the electronic device monitors information such as the time the device is in the water state and the time the device is in the water state during swimming.

[0423] In some examples, the electronic device can monitor status information of the device during swimming, and the status information may include one or more of the following: the length of time the device is in the water state, the length of time the device is in the water state, the frequency of the device being in the water state, or the frequency of the device being in the water state.

[0424] In one possible implementation, when the electronic device is in the submerged state, the electronic device may determine whether the device is in the out-of-water state in the manner described in S210 to S230 above, i.e., by detecting whether the third event and / or the fourth event occurs to determine whether the device is in the out-of-water state. The period from when the device determines that it has entered the submerged state to when the device determines that it has entered the out-of-water state may be considered the duration of the electronic device being in the submerged state.

[0425] In one possible implementation, when the electronic device is in the out-of-water state, the electronic device may determine whether the device is in the submerged state in the manner described in S110 to S130 above, i.e., by detecting whether the first event and the second event occur. The period from when the device determines that it has entered the out-of-water state to when the device determines that it has entered the submerged state may be considered the duration of the electronic device being in the out-of-water state.

[0426] During a swimming session, the electronic device can continuously detect information such as the length of time it is in the water and the length of time it is out of the water. After processing and analysis, this information can be used to update some information that the user needs to use during the swimming session. Alternatively, after processing and analysis, this information can also be used to reflect various indicators of the user's swimming session after the user finishes swimming.

[0427] S640, the electronic device determines the user's swimming time, stroke information, and number of laps based on the monitored information.

[0428] In some examples, the electronic device can determine information about the user's swimming status based on information about the monitored device status. The swimming status information may include one or more of the following: swimming style, whether the user is in a swimming state, stroke information, or number of laps information.

[0429] While a user is swimming, wristbands, watches, and other electronic devices worn on their arms experience multiple in-water and out-of-water events due to arm movements. In other words, electronic devices such as wristbands and watches are constantly switching between in-water and out-of-water states. By monitoring, recording, and analyzing information such as the duration of time a device is in and out of water during a user's swimming, various swimming data can be roughly analyzed.

[0430] For example, in the scheme for identifying the user's swimming style (see the relevant content of S410 and S420 in the previous text), by analyzing the time intervals between adjacent water entry and exit events of the electronic device, that is, analyzing the duration of the electronic device being in the water state, it is possible to roughly determine whether the user's swimming style is breaststroke.

[0431] For another example, in determining whether a user's stroke is valid (see steps S321 to S323 above), the electronic device's submerged duration or frequency within a stroke meets preset requirements to determine whether the current stroke is valid. Based on this, the electronic device can further determine whether the current stroke is valid based on whether a single stroke contains a sufficient number of valid strokes.

[0432] For another example, in a scheme that combines the detection data of the barometer to determine whether the user is in a swimming state (see the relevant content of S510 to S540 in the previous text), by verifying information such as the number of valid strokes and the length of time the device is in the water state, it can be determined whether the user is in the water state.

[0433] In some examples, the electronic device can determine the minimum number of strokes required for the user to complete each swim by monitoring the length of time the device is in the water and out of the water during the first few swims. During subsequent swims, the electronic device can use the re-determined minimum number of strokes to determine whether the user's single swim is a valid swim.

[0434] For example, during a swimming session, the electronic device may record the average minimum number of strokes of the user in the first three swimming sessions as 10, and display a fourth user interface 3201 as shown in FIG32 . The fourth user interface 3201 may be used to prompt the user that the minimum number of strokes for a single swimming session has been updated to 4 or 5 times, and the number of the updated minimum strokes may be obtained by converting the average minimum number of strokes of the user in the first three swimming sessions.

[0435] In one possible implementation, in response to the user's confirmation operation, the electronic device may use a minimum of 6 valid strokes as a determination condition when later determining whether the user's single lap swimming is a valid lap.

[0436] In some examples, the electronic device can update the user's swimming lap information by monitoring the length of time the device is in the water state and the length of time it is in the water state during the user's completed swimming laps, that is, performing the preprocessing operation of the lap information in the aforementioned embodiment.

[0437] For example, if the electronic device detects that the user has completed four swims but not yet completed five, it continuously monitors information such as the duration of the device's submerged state and the duration of the device's out-of-water state. If this information indicates that the device has been submerged for longer than a preset duration within T strokes, the electronic device can determine that the user is currently swimming their fifth swim and, in turn, update the user's completed swim information in advance. Specifically, the electronic device can display fifth user interface 3301, as shown in FIG33 , indicating that the user has currently completed five swims. In other words, the electronic device can update the user's swim count information in advance.

[0438] In some examples, when the electronic device determines the user's swimming status by combining the barometer's detection data and the capacitance information of the touch panel, if the barometer's detection data indicates that the device is in an out-of-water state, and the electronic device determines that the user is in a swimming state by continuously monitoring information such as the length of time the device is in the submerged state and the length of time it is in the out-of-water state, then the electronic device may determine that the barometer is in an inoperative state. In this case, for example, the electronic device may display a sixth user interface 3401 as shown in FIG. 34 , which may be used to prompt the user that the barometer is in an inoperative state and that the device will deactivate the barometer.

[0439] In a possible implementation, in response to the user's confirmation operation, the electronic device may disable the barometer during the subsequent swimming process and enable the touch panel to assist in detecting the swimming status.

[0440] In some examples, the electronic device can determine that the user is in a resting state by displaying information such as the length of time the device has been in the water and out of the water. In this case, in order to save energy consumption of the electronic device and extend the usage time of the electronic device, the electronic device can display the seventh user interface 3501 as shown in Figure 35. The seventh user interface 3501 can be used to prompt the user that the user is currently in a resting state, and the function of using the screen to assist in detecting the swimming status will be disabled.

[0441] In a possible implementation, in response to the user's confirmation operation, the electronic device may immediately power off the touch panel or power off the touch panel of the electronic device after a preset period of time.

[0442] It should be noted that, since the user may be in motion, in order to better realize the interaction between the user and the electronic device, the aforementioned user confirmation operation can include the operation of the user clicking the "OK" button on the user interface, and can also include the event that the electronic device does not detect the user clicking the "OK" button on the user interface within a preset time period.

[0443] It should also be noted that since the user may be in motion, in order to better remind the user and enable the user to interact with the electronic device, when the user interface of the electronic device changes, the electronic device can also vibrate or ring to remind the user.

[0444] Figure 36 shows an apparatus 3600 for detecting device status, provided in an embodiment of the present application. This apparatus 3600 may have the functionality of an electronic device for detecting device status in the aforementioned method embodiment, and may be used to execute the steps performed by the functionality of the electronic device in the aforementioned method embodiment. This functionality may be implemented in hardware, or in software, or in hardware executing corresponding software implementations. The hardware or software may include one or more modules corresponding to the aforementioned functionality.

[0445] In a possible implementation, the device status detection apparatus 3600 may include an acquisition module 3610 and a processing module 3620 , and the acquisition module 3610 and the processing module 3620 are coupled to each other.

[0446] In some examples, the acquisition module 3610 can be used to support the electronic device in the aforementioned embodiments in acquiring capacitance information of the touch panel, etc.

[0447] The processing module 3620 is used to support the electronic device in executing the processing actions in the above method embodiments, for example, determining whether a first event or a second event is detected based on the capacitance information of the touch panel.

[0448] Optionally, the device status detection apparatus 3600 may further include a storage unit 3630 for storing program codes and data of the device status detection apparatus 3600 .

[0449] Figure 37 shows a swimming status detection device 3700 provided in an embodiment of the present application. This device 3700 may have the functionality of an electronic device for detecting a user's swimming status in the aforementioned method embodiment, and may be used to execute the steps performed by the functionality of the electronic device in the aforementioned method embodiment. This functionality may be implemented in hardware, or in software, or in hardware executing corresponding software implementations. The hardware or software may include one or more modules corresponding to the aforementioned functionality.

[0450] In a possible implementation, the swimming status detection device 3700 may include an acquisition module 3710 and a processing module 3720 , and the acquisition module 3710 and the processing module 3720 are coupled to each other.

[0451] In some examples, the acquisition module 3710 can be used to support the electronic device in the aforementioned embodiments to obtain user input, such as obtaining the user's operation of selecting the lane length.

[0452] The processing module 3720 is used to support the electronic device in executing the processing actions in the above method embodiments, such as determining the threshold value of the minimum number of strokes based on the length of the lane.

[0453] Optionally, the swimming state detection device 3700 may further include a storage unit 3730 for storing program codes and data of the swimming state detection device 3700 .

[0454] Figure 38 shows an electronic device 3800 provided in an embodiment of the present application. As shown in the figure, the electronic device 3800 includes at least one processor 3810 and a transceiver 3820. The processor 3810 is coupled to a memory and is configured to execute instructions stored in the memory to control the transceiver 3820 to send and / or receive signals.

[0455] Optionally, the electronic device 3800 further includes a memory 3830 for storing instructions.

[0456] In some embodiments, the processor 3810 and memory 3830 may be combined into a processing device, and the processor 3810 is configured to execute program codes stored in the memory 3830 to implement the aforementioned functions. In specific implementations, the memory 3830 may also be integrated into the processor 3810 or independent of the processor 3810.

[0457] In some embodiments, the transceiver 3820 may include a receiver (or receiver) and a transmitter (or transmitter).

[0458] The transceiver 3820 may further include an antenna, and the number of antennas may be one or more. The transceiver 3820 may be a communication interface or an interface circuit.

[0459] When the electronic device 3800 is a chip, the chip includes a transceiver module and a processing module. The transceiver module may be an input / output circuit or a communication interface; and the processing module may be a processor, microprocessor, or integrated circuit integrated on the chip.

[0460] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the device status detection method or swimming status detection method in the above-mentioned embodiment.

[0461] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the device status detection method or swimming status detection method in the above-mentioned embodiment.

[0462] In addition, embodiments of the present application further provide a device, which may be a chip, component, or module, and may include a processor and a memory connected thereto. The memory is used to store computer-executable instructions. When the device is running, the processor may execute the computer-executable instructions stored in the memory to cause the chip to perform the device status detection method or swimming status detection method described in the above-mentioned method embodiments.

[0463] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0464] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0465] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0466] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0467] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0468] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0469] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for detecting device status, applied to electronic equipment, characterized in that: The electronic device includes a touch panel, the touch panel includes M sites, and the method includes: Acquiring capacitance information of the touch panel, where the capacitance information includes one or more of the following: capacitance values ​​of the M sites, a relationship between the capacitance values ​​of the M sites and time, or a relationship between the capacitance values ​​of the M sites and positions of the M sites; Upon detecting the first event and the second event, determining that the electronic device is in a target state, the target state comprising the electronic device being at least partially immersed in a conductive liquid; The first event includes: the capacitance values ​​of at least N sites among the M sites are greater than or equal to a first threshold, N≤M, and both N and M are positive integers; The second event includes one or more of the following: The duration of the first event is greater than or equal to the first duration, At least P of the N sites have capacitance value changes greater than or equal to the second threshold value within the second time period. Alternatively, the N sites are distributed continuously, P≤N, and P is a positive integer.

2. The method according to claim 1, characterized in that The method further comprises: When the electronic device is in the target state, detecting a third event; In case the third event is detected, determining that the electronic device is not in the target state; The third event includes at least one of the following: The capacitance values ​​of at least Q sites among the M sites are less than or equal to a third threshold, Q≤M, where Q is a positive integer; Alternatively, the capacitance value changes of at least R sites among the N sites within the second time period are greater than or equal to the fourth threshold, R≤N, and R is a positive integer.

3. The method according to claim 1 or 2, characterized in that The method further comprises: When the automatic power-off function of the touch panel is turned on, in response to detecting the first event, the touch panel is powered off after a third time period, and the third time period is greater than or equal to the first time period.

4. The method according to any one of claims 1 to 3, characterized in that The electronic device further comprises a barometer and / or electrocardiogram electrodes, and the method further comprises: When the touch panel is powered off, the touch panel is powered on in response to the barometer and / or the electrocardiogram electrodes indicating that the electronic device is in the target state.

5. The method according to any one of claims 1 to 4, characterized in that The electronic device further includes a sensor, wherein the sensor includes one or more of the following: an accelerometer, a gyroscope, a magnetometer, an electrocardiogram electrode, or a barometer, and the method further includes: In response to the abnormal capacitance values ​​of the M sites, it is determined whether the electronic device is in the target state in combination with the information of the sensor.

6. A method for detecting swimming status, applied to electronic equipment, characterized in that: The electronic device includes a touch panel, and the method includes: Acquiring capacitance information of the touch panel; Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information; The capacitance information includes one or more of the following: a capacitance value of the touch panel, a relationship between the capacitance value of the touch panel and time, or a distribution of the capacitance value of the touch panel.

7. The method according to claim 6, characterized in that Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information, includes: determining a frequency and / or duration of water immersion of the electronic device according to the capacitance information; When the frequency of the water entry state within the preset time period is greater than or equal to the first number, and / or when the water entry duration within the preset time period is greater than or equal to the first duration, the stroke count recorded by the electronic device within the preset time period is determined to be a valid stroke count.

8. The method according to claim 7, characterized in that The determining, based on the capacitance information, the frequency and / or duration of the submersion of the electronic device in water includes: Determining a valid site based on the capacitance information, wherein a ratio of a capacitance value of the valid site to a maximum capacitance value of a site on the touch panel is greater than or equal to a preset value; The water entry frequency and / or the water entry duration are determined according to the number of valid sites.

9. The method according to claim 7 or 8, characterized in that Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information, includes: The current trip is determined to be a valid trip if the total water entry duration of all strokes in the current trip is greater than or equal to the second duration and / or if the number of valid strokes in the current trip is greater than or equal to the second number.

10. The method according to any one of claims 6 to 9, characterized in that Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information, includes: determining a single water immersion duration of the electronic device according to the capacitance information; When the single water entry duration is greater than or equal to the third duration, it is determined that the user's swimming style is breaststroke.

11. The method according to any one of claims 6 to 10, characterized in that The electronic device further comprises an accelerometer and a gyroscope, Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information, includes: The user's swimming style is determined by combining the accelerometer information, the gyroscope information, and the capacitance information.

12. The method according to any one of claims 6 to 11, characterized in that The electronic device further comprises a barometer, Determining one or more of the following based on the capacitance information: swimming style, whether the user is swimming, stroke information or lap number information, includes: The barometer information and the capacitance information are combined to determine whether the user is in a swimming state.

13. The method according to claim 12, characterized in that The determining whether the user is in a swimming state by combining the information of the barometer and the capacitance information includes: If the barometer indicates that the electronic device is in the submerged state and the capacitance information indicates that the number of valid swimming strokes in the M valid strokes is greater than or equal to N, it is determined that the user is in the swimming state, where N≤M, and N and M are positive integers; or When the barometer indicates that the electronic device is in a non-water state, and the capacitance information indicates that the water entry time of the electronic device is greater than or equal to a fourth time period, and the number of strokes containing valid swimming strokes in the most recent P strokes is greater than or equal to Q, it is determined that the user is in a swimming state, where Q≤P, and Q and P are positive integers.

14. The method according to claim 12 or 13, characterized in that The determining whether the user is in a swimming state by combining the information of the barometer and the capacitance information includes: When the barometer indicates that the electronic device is in a submerged state and the capacitance information indicates that the number of valid swimming strokes included in the M valid strokes is less than N, it is determined that the user is in a submerged and non-swimming state, where N≤M, and N and M are positive integers.

15. The method according to any one of claims 12 to 14, characterized in that The determining whether the user is in a swimming state by combining the information of the barometer and the capacitance information includes: When the barometer indicates that the electronic device is in a non-water state, and the touch panel indicates that the electronic device's water entry time is less than a fourth time duration and / or the number of strokes containing valid swimming strokes in the most recent P strokes is less than Q, it is determined that the user is in a non-water state, where Q≤P, and Q and P are positive integers.

16. A method for detecting swimming status, applied to an electronic device, characterized in that: The electronic device includes a touch panel, and the method includes: In response to an operation of starting swimming, displaying a prompt message, wherein the prompt message is used to prompt the user to enable the touch panel to detect the swimming status; In response to the confirmed operation, acquiring capacitance information of the touch panel; The capacitance information includes one or more of the following: a capacitance value on the touch panel, a relationship between the capacitance value of the touch panel and time, or a capacitance value distribution on the touch panel.

17. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the method according to any one of claims 1 to 6, claims 7 to 15, or claim 16.

18. A device for detecting equipment status, characterized in that: The method comprises means for implementing the method of any one of claims 1 to 6 or claims 7 to 12.

19. A device for detecting swimming status, characterized in that: Comprising modules for implementing the method of any one of claims 7 to 15 or claim 16.

20. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 6, claims 7 to 15 or claim 16 is implemented.

21. A chip, characterized in that: The chip comprises a processor and a memory, wherein the processor is used to read instructions stored in the memory. When the processor executes the instructions, the chip implements the method according to any one of claims 1 to 6, claims 7 to 15, or claim 16.

Citation Information

Patent Citations

  • Equipment state detection method, swimming state detection method and electronic equipment

    CN120695418A

  • Swimming lap counter

    CN101091832A

  • Touch screen point reporting method and related equipment

    CN110475000A

  • Swimming monitoring method and device based on multi-sensor fusion, storage medium and program product

    CN113713358A

  • Water entry detection method and device, wearable equipment and storage medium

    CN115148004A