Charging state detection method, device, electronic device and storage medium

The number of pulses output by the charging IC is collected through the interrupt method and the state is determined based on the preset threshold value, which solves the problem of inaccurate charging state detection, improves the accuracy and flexibility of charging state detection, and adapts to different charging scenarios.

CN114487644BActive Publication Date: 2024-11-26GUANGDONG SKG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111551535.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-11-26
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

During the charging process of existing electronic devices, due to fluctuations in the output pulse frequency of the charging IC's detection port, the sampling period does not match the actual output pulse group, which makes it easy to cause misjudgment, which reduces the accuracy of charging state detection.

Method used

The number of pulses output by the charging integrated circuit is collected by interrupt mode, and the number of pulses in successive cycles is obtained after the preset acquisition time is determined, and the charging state is determined based on the first preset threshold value, which avoids setting a fixed acquisition period and improves the charging state detection. accuracy.

Benefits of technology

It achieves the accuracy of charging status detection during charging electronic devices, does not require increasing hardware costs, and is adapted to different charging scenarios, expanding application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114487644B_ABST
    Figure CN114487644B_ABST
Patent Text Reader

Abstract

The present application discloses a charging status detection method, device, electronic device and storage medium, which belongs to the field of circuit control technology. Applied to electronic devices, the method includes: the electronic device collects the number of pulses output by the charging integrated circuit through an interruption method; after a preset collection time, obtains the number of pulses collected in each continuous period within the preset collection time; determines the charging status of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold. The number of pulses output by the charging IC is collected through an interruption method, and the charging status is determined based on the number of pulses in different continuous periods and the first preset threshold. The charging status can be determined according to the number of pulses output by the charging IC collected in the actual interruption method, and there is no need to set a fixed collection period for collection, which improves the accuracy of charging status detection during the charging process of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of circuit control technology, and in particular to a charging state detection method, device, electronic device and storage medium. Background Art

[0002] With the advancement of science and technology, people use more and more types of electronic devices in their daily lives. Most electronic devices need to be charged, and the charging solutions used in different electronic devices are often different.

[0003] At present, most electronic devices usually use charging integrated circuits (ICs) of the Internet Protocol (IP) series of Yingjixin. Among them, in different charging modes, the pulse groups output by the detection port of the charging IC are also different. For example, when not charging, the detection port of the charging IC usually outputs a low-level signal. During the charging process, the detection port of the charging IC usually outputs a 1.5Hz interval pulse group. When fully charged, the detection port of the charging IC usually outputs a continuous pulse group. In actual use, since the sampling period for sampling the detection port of the charging IC set by the microcontroller unit (MCU) in the electronic device is fixed, due to the differences between different charging ICs, during the charging process, the detection port of the charging IC theoretically outputs a 1.5Hz interval pulse group, but the frequency of the actual output interval pulse group fluctuates (such as 0.5Hz or 2Hz, etc.), at this time, the sampling period and the actual output interval pulse group will not match each other, which is prone to misjudgment, reducing the accuracy of the charging state detection during the charging process of the electronic device. Summary of the invention

[0004] The embodiments of the present application provide a charging status detection method, device, electronic device and storage medium, which can improve the flexibility of massage equipment in performing massage.

[0005] On the one hand, an embodiment of the present application provides a charging state detection method, which is applied to an electronic device, and the method includes:

[0006] The electronic device collects the number of pulses output by the charging integrated circuit in an interruption manner;

[0007] After the preset acquisition time, the number of pulses collected in each continuous period within the preset acquisition time is obtained;

[0008] The charging state of the electronic device is determined according to the number of pulses collected in each continuous period and a first preset threshold.

[0009] Optionally, determining the charging state of the electronic device according to the number of pulses collected in each of the continuous cycles and a first preset threshold value includes:

[0010] When the number of pulses collected in each cycle is greater than the first preset threshold, it is determined that the charging state of the electronic device is a full charge state;

[0011] When the number of pulses collected in each cycle is not greater than the first preset threshold, determining that the charging state of the electronic device is an uncharged state;

[0012] When the number of pulses collected in the consecutive cycles includes a number of pulses greater than the first preset threshold and also includes a number of pulses not greater than the first preset threshold, it is determined that the charging state of the electronic device is a charging state.

[0013] Optionally, collecting the number of pulses output by the charging integrated circuit in an interruption manner includes:

[0014] The initialization input and output interface is an interrupt input interface, and the input and output interface is used to receive the pulse output by the charging integrated circuit;

[0015] The number of pulses output by the charging integrated circuit is collected through the interrupt input interface.

[0016] Optionally, before the initialization of the input / output interface as an interrupt input interface, the method further includes:

[0017] Displaying a first setting interface on a display screen of the electronic device, wherein the first setting interface includes a type selection control;

[0018] In response to a touch operation on the type selection control, the selected interrupt input interface is set as the interface type of the input / output interface.

[0019] Optionally, before determining the charging state of the electronic device according to the number of pulses collected in each of the continuous cycles and the first preset threshold, the method further includes:

[0020] Obtaining the number of cycles of each of the consecutive cycles;

[0021] When the number of cycles is greater than a second preset threshold, performing the step of determining the charging state of the electronic device according to the number of pulses collected in each of the continuous cycles and the first preset threshold;

[0022] When the number of cycles is not greater than the second preset threshold, the step of collecting the number of pulses output by the charging integrated circuit in an interrupt manner is performed again.

[0023] Optionally, after the preset acquisition time, before obtaining the number of pulses collected in each continuous period within the preset acquisition time, the method further includes:

[0024] Obtaining the output frequency of the output pulse of the charging integrated circuit;

[0025] According to the output frequency, the period length of each continuous period and the preset acquisition period are determined.

[0026] Optionally, after determining the charging state of the electronic device according to the number of pulses collected in each continuous period and the first preset threshold, the method further includes:

[0027] Determine status display parameters according to the charging status, wherein the status display parameters include display mode and display content of the charging display device;

[0028] The charging display device is controlled to display according to the status display parameters.

[0029] On the one hand, an embodiment of the present application provides a charging state detection device, which is applied to an electronic device, and the device includes:

[0030] A pulse acquisition module, used for the electronic device to collect the number of pulses output by the charging integrated circuit through an interruption mode;

[0031] A number acquisition module is used to acquire the number of pulses collected in each continuous period within the preset collection time after the preset collection time;

[0032] The state determination module is used to determine the charging state of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold.

[0033] On the other hand, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the charging status detection method as described in one aspect above.

[0034] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the charging status detection method as described in one aspect above is implemented.

[0035] On the other hand, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the charging status detection method as described in one aspect above.

[0036] On the other hand, an embodiment of the present application provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes the charging status detection method as described in one aspect above.

[0037] The technical solution provided by the embodiments of the present application may at least include the following beneficial effects:

[0038] The electronic device provided by the present application collects the number of pulses output by the charging integrated circuit in an interruption manner; after a preset collection time, obtains the number of pulses collected in each continuous period within the preset collection time; and determines the charging state of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold. The number of pulses output by the charging IC is collected in an interruption manner, and the charging state is determined based on the number of pulses in different continuous periods and the first preset threshold. The charging state can be determined according to the number of pulses output by the charging IC collected in the actual interruption manner, and there is no need to set a fixed collection period for collection, thereby improving the accuracy of the charging state detection during the charging process of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a pulse waveform diagram of a pulse group output by a detection port of a charging IC provided by an exemplary embodiment of the present application;

[0040] Figure 2 is a method flow chart of a charging state detection method provided by an exemplary embodiment of the present application;

[0041] Figure 3 is a method flow chart of a charging state detection method provided by an exemplary embodiment of the present application;

[0042] Figure 4 is a schematic diagram of a charging circuit of an electronic device involved in an exemplary embodiment of the present application;

[0043] Figure 5 is a schematic diagram of a setting interface involved in an exemplary embodiment of the present application;

[0044] Figure 6 is a structural block diagram of a charging state detection device provided by an exemplary embodiment of the present application;

[0045] Figure 7 It is a schematic diagram of the structure of an electronic device disclosed in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0047] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0048] The solution provided by the present application can be used when people use massage equipment in daily life. They can establish a short-range wireless communication connection with the massage equipment through an electronic device or a terminal, and control the massage equipment to perform massage. Alternatively, users can also directly control the massage equipment to perform massage in real-life scenarios. For ease of understanding, some terms and application scenarios involved in the embodiments of the present application are first briefly introduced below.

[0049] With the development of science and technology, various electronic devices have appeared in people's daily lives. People can use terminals to work, entertain, study, etc. When people are physically tired, they can usually relax their bodies through health care devices. For example, massage devices with massage functions are health care devices that have significant effects in relieving stress and fatigue, and are very popular among consumers. People are increasingly using massage devices for massage and relaxation in their daily lives. For another example, mobile phones with video chat functions are communication devices, and people can also chat with each other through mobile phones and communicate about daily life through videos.

[0050] Among them, various electronic devices are powered by batteries. When the battery is low, users often need to charge it. At present, MCU and charging IC are also used in various electronic devices for charging control. The two are matched with each other to switch between different charging states. For example, the charging IC commonly used in electronic devices is based on the IP series of Ingenic. In different charging modes, the pulse group output by the detection port of the charging IC is also different. For example, when not charging, the detection port of the charging IC usually outputs a low-level signal. During the charging process, the detection port of the charging IC usually outputs a 1.5Hz interval pulse group. When fully charged, the detection port of the charging IC usually outputs a continuous pulse group.

[0051] Optionally, the electronic devices involved in the present application may be mobile phones, tablet computers, e-book readers, smart glasses, smart watches, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, notebook computers, laptop portable computers and desktop computers, etc. Alternatively, the terminal may also be a smart home device, wherein the smart home device may include but is not limited to smart TVs, smart robots, smart speakers, smart Bluetooth headsets, massage equipment, smart refrigerators, smart air conditioners, smart rice cookers, smart sensors (such as infrared sensors, light sensors, vibration sensors, and sound sensors, etc.), smart water purifiers, and other fixedly installed or small-range mobile devices.

[0052] Optionally, the electronic device may also establish a communication connection with other devices, and the communication connection is a wired network or a wireless network.

[0053] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some embodiments, the data exchanged through the network is represented by technology and / or format including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology.

[0054] Please refer to Figure 1, which shows a pulse waveform diagram of a pulse group output by a detection port of a charging IC provided by an exemplary embodiment of the present application. Figure 1 As shown, each pulse 101 and a sampling example period 102 are included.

[0055] As mentioned above Figure 1 As shown, in actual use, since the sampling period of the detection port of the charging IC set by the MCU in the electronic device is fixed (sampling example period 102), the sampling period corresponds to the 1.5Hz interval pulse group sampling output of the detection port of the charging IC in theory, but due to the differences between different charging ICs, during the charging process, the above Figure 1 The frequency between the pulses 101 may also be 3.0 Hz, that is, the detection port of the charging IC outputs a 3.0 Hz interval pulse group. At this time, the sampling period and the actual output interval pulse group will not match each other, which is prone to misjudgment.

[0056] Although it is currently possible to filter the pulses output from the detection port of the charging IC by adding a filter capacitor and a level conversion circuit to the charging IC, during the acquisition process, there is no need to acquire a small pulse group with a period less than the set fixed period, thereby improving accuracy. However, this solution also increases the hardware cost and the complexity of the circuit design. In addition, the charging scenarios of the application are not flexible enough, and the corresponding charging status obtained is not accurate enough, which cannot fundamentally solve the problem.

[0057] In order to avoid the problems existing in the above technical solutions and improve the accuracy of charging status detection during the charging process of electronic devices, the present application provides a charging status detection method, which can detect by interruption, and determine the charging status in combination with the number of pulses collected in different continuous cycles, avoiding the need to set a fixed cycle for collection, and achieving the effect of timely obtaining the charging status in any charging scenario, expanding the application scenarios, and improving the accuracy of charging status detection.

[0058] Please refer to Figure 2 , which shows a method flow chart of a charging state detection method provided by an exemplary embodiment of the present application. The method can be used in the above-mentioned scenario architecture and executed by the electronic device in the scenario, such as Figure 2 As shown, the charging state detection method may include the following steps.

[0059] Step 201: The electronic device collects the number of pulses output by the charging integrated circuit through an interruption method.

[0060] The electronic device includes an MCU and a charging IC, and the MCU is electrically connected to the charging IC. When the charging IC charges the battery, the MCU collects the pulse signal output by the detection port of the charging IC through the terminal to obtain the number of pulses of the charging IC. It should be noted that in addition to the interrupt method, the present application can also use an interval patrol method for collection, and the subsequent steps are similar to the interrupt method, which will not be repeated here.

[0061] Step 202, after the preset acquisition time, obtains the number of pulses collected in each continuous period within the preset acquisition time.

[0062] Optionally, in the process of collecting the number of pulses, the electronic device obtains the number of pulses collected in each continuous period within the preset collection time after the preset collection time. The preset collection time can be set in advance in the electronic device by the developer. For example, the preset collection time can be 200 milliseconds, and 200 milliseconds include 20 periods. The electronic device obtains the number of pulses collected in each continuous period, that is, the electronic device will obtain 20 pulses corresponding to 20 periods.

[0063] Step 203: determining the charging state of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold.

[0064] Optionally, the electronic device determines the charging status of the electronic device based on the number of pulses collected above and the first preset threshold. The first preset threshold can also be set in advance in the electronic device by the developer. In the present application, the electronic device obtains the number of pulses in each cycle and detects the number of pulses in each cycle. When the number of pulses in a certain cycle is not greater than the first preset threshold, the cycle is regarded as an invalid cycle. When the number of pulses in a certain cycle is greater than the first preset threshold, the cycle is regarded as a valid cycle, and the charging status of the electronic device is determined in combination with the number of valid cycles.

[0065] In summary, the electronic device provided by the present application collects the number of pulses output by the charging integrated circuit in an interruption manner; after a preset collection time, obtains the number of pulses collected in each continuous period within the preset collection time; and determines the charging state of the electronic device according to the number of pulses collected in each continuous period and the first preset threshold. The number of pulses output by the charging IC is collected in an interruption manner, and the charging state is determined based on the number of pulses in different continuous periods and the first preset threshold. The charging state can be determined according to the number of pulses output by the charging IC collected in the actual interruption manner, and there is no need to set a fixed collection period for collection, which improves the accuracy of the charging state detection during the charging process of the electronic device.

[0066] In one possible implementation, the electronic device needs to initialize the input and output ports of the MCU, initialize the input and output interface as an interrupt input interface, and collect the detection port of the charging IC through an interrupt method, thereby achieving the effect of timely obtaining the charging status in any charging scenario, expanding the application scenarios, and improving the accuracy of charging status detection.

[0067] Please refer to Figure 3 , which shows a method flow chart of a charging state detection method provided by an exemplary embodiment of the present application. The method can be used in the above-mentioned scenario architecture and executed by the electronic device in the scenario, such as Figure 3 As shown, the charging state detection method may include the following steps.

[0068] Step 301, initializing the input-output interface as an interrupt input interface, the input-output interface is used to receive pulses output by the charging integrated circuit.

[0069] Please refer to Figure 4 , which shows a schematic diagram of a charging circuit of an electronic device involved in an exemplary embodiment of the present application. Figure 4 As shown, it includes MCU 401, charging IC 402, and input / output (I / O) interface 403. For example, after the charger is connected, the electronic device can initialize the I / O interface 403 on the MCU 401, and detect the pulse output by the charging IC 402 through the I / O interface 403. Alternatively, the electronic device can also initialize the I / O interface 403 on the MCU 401 as an interrupt input interface during the shutdown and restart process, and detect the pulse output by the charging IC 402 through the I / O interface 403.

[0070] In a possible implementation, a first setting interface is displayed on a display screen of an electronic device, and the first setting interface includes a type selection control; in response to a touch operation on the type selection control, the selected interrupt input interface is set as the interface type of the input / output interface. Figure 5 , which shows a schematic diagram of a setting interface involved in an exemplary embodiment of the present application. Figure 5As shown, the setting interface 500 includes various interface types 501, type selection controls 502, confirmation controls 503, and cancel controls 504. The user can click the type selection control 502 corresponding to a certain interface type in the setting interface 500 and trigger the confirmation control 503, so that the electronic device selects the interface type and sets the I / O interface to the selected interface type during the above initialization process. For example, if the selected interface type is a terminal input interface, then after the confirmation control is triggered in the setting interface, or after the charger is connected, or after the electronic device is restarted, the interface can be initialized as an interrupt input interface to receive the pulse output by the charging IC.

[0071] Step 302: collecting the number of pulses output by the charging integrated circuit through the interrupt input interface.

[0072] That is, during the charging process of the electronic device, the charging IC outputs pulses to the detection port, and the electronic device collects the number of pulses output by the charging IC in an interrupt manner through the interrupt input interface of the MCU.

[0073] Step 303, after the preset acquisition time, the number of pulses collected in each continuous period within the preset acquisition time is obtained.

[0074] Optionally, after initializing the I / O interface of the MCU, the electronic device collects the pulses output by the detection port of the charging IC in each cycle, and obtains the number of pulses collected in each cycle. In this step, after the preset collection time, the number of pulses in each continuous cycle within the collection time is obtained. That is, the preset collection cycle can be regarded as a large cycle, which contains multiple small cycles. The MCU of the electronic device can record the number of pulses collected in each small cycle. When the large cycle time is reached, the electronic device obtains the number of pulses recorded in each small cycle.

[0075] In a possible implementation, before this step, the electronic device can also obtain the output frequency of the output pulse of the charging integrated circuit; and determine the cycle duration of each continuous cycle and the preset acquisition duration according to the output frequency. That is, before the electronic device collects the number of pulses by interruption, it obtains the output frequency of the output pulse of the charging IC through other ports, and calculates the cycle duration of each continuous cycle and the preset acquisition duration based on the output frequency. For example, the electronic device obtains the output cycle (t=1 / f) according to the output frequency (f), and obtains the cycle duration according to (N*t), N is a positive integer, and the preset acquisition duration can be (M*t), M is an integer multiple of N. Taking f=2.0Hz, N=1, and M=10 as an example, after the electronic device obtains the output frequency of the output pulse of the charging IC, it can obtain that the output cycle is 0.5 seconds, then the cycle duration of each continuous cycle is also 0.5 seconds, and the preset acquisition duration is 5 seconds.

[0076] Step 304: Determine the charging state of the electronic device according to the number of pulses collected in each continuous period and the first preset threshold.

[0077] Optionally, the electronic device in the present application detects the number of pulses in each continuous cycle, and determines the charging state of the electronic device according to the size relationship between the number of pulses in each cycle and the first preset threshold. When the number of pulses collected in each cycle is greater than the first preset threshold, the charging state of the electronic device is determined to be a full state; when the number of pulses collected in each cycle is not greater than the first preset threshold, the charging state of the electronic device is determined to be an uncharged state; when the number of pulses collected in each continuous cycle includes a number of pulses greater than the first preset threshold and also includes a number of pulses not greater than the first preset threshold, the charging state of the electronic device is determined to be a charging state.

[0078] Among them, the first preset threshold can be pre-set in the electronic device by the developer or operation and maintenance personnel. For example, the first preset threshold is 10 pulses. If the number of pulses collected in each cycle is greater than 10 pulses, it is determined that the charging state of the electronic device is full; when the number of pulses collected in each cycle is not greater than 10 pulses, it is determined that the charging state of the electronic device is uncharged; when the number of pulses collected in each continuous cycle includes a number of pulses greater than 10 pulses and a number of pulses not greater than 10 pulses, it is determined that the charging state of the electronic device is charging.

[0079] That is, the electronic device can detect the number of pulses in each continuous cycle, and obtain the number of cycles in which the number of pulses corresponding to each cycle is greater than the first preset threshold value according to the size relationship between the number of pulses in each cycle and the first preset threshold value, and determine the charging state of the electronic device according to the number of cycles. Alternatively, the electronic device can also detect the number of pulses in each continuous cycle, and obtain the ratio of the number of cycles in which the number of pulses corresponding to each cycle is greater than the first preset threshold value to the total number of cycles according to the size relationship between the number of pulses in each cycle and the first preset threshold value, and determine the charging state of the electronic device according to the ratio.

[0080] Optionally, there may be a corresponding relationship table between the number of cycles and the charging state of the electronic device. For example, please refer to Table 1, which shows a corresponding relationship table between the number of cycles and the charging state of the electronic device involved in an exemplary embodiment of the present application.

[0081] Number of cycles Charging status First quantity range Charging status 1 Second quantity range Charging state 2 The third quantity range Charging state three …… ……

[0082] Table 1

[0083] As shown in Table 1 above, the electronic review obtains the number of cycles in which the number of pulses corresponding to each cycle is greater than the first preset threshold value based on the size relationship between the number of pulses in each cycle and the first preset threshold value, and determines the number range based on the number of cycles, thereby querying Table 1 to obtain the corresponding charging state. For example, the first preset threshold value is 10 times, and the above preset acquisition time length includes 10 consecutive cycles. The number of pulses in each of the 10 consecutive cycles collected by the electronic device is [11, 9, 15, 12, 8, 13, 17, 18, 15, 12]. The electronic device judges the number of pulses corresponding to each cycle and determines that the number of cycles in which the number of pulses corresponding to each cycle is greater than the first preset threshold value is 8. If 8 is within the first number range, the electronic device can obtain that the charging state of the electronic device is charging state one based on the number of cycles.

[0084] It should be noted that, the above-mentioned method of obtaining the ratio of the number of cycles in which the number of pulses corresponding to each cycle is greater than the first preset threshold to the total number of cycles based on the relationship between the number of pulses in each cycle and the first preset threshold, and determining the charging status of the electronic device based on the ratio can be similar to the above-mentioned number range method, which will not be repeated here.

[0085] In a possible implementation, before the above step 304, the electronic device can also obtain the number of cycles of each continuous cycle; when the number of cycles is greater than the second preset threshold, the step of determining the charging state of the electronic device according to the number of pulses collected in each continuous cycle and the first preset threshold is performed; when the number of cycles is not greater than the second preset threshold, the step of collecting the number of pulses output by the charging integrated circuit through an interruption is re-executed. The second preset threshold can also be pre-set in the electronic device by the developer or operation and maintenance personnel.

[0086] That is, the electronic device can detect the number of each cycle within the preset collection time. If it is found that the number of cycles within the preset collection time is greater than the second preset threshold, step 304 is executed. Otherwise, it means that the number of each cycle collected within the preset collection time is insufficient, which means that there is a problem with the hardware or software during the charging process of the electronic device, resulting in an insufficient number of cycles collected within the preset collection time. The electronic device can continue to collect the number of pulses output by the charging integrated circuit through interruption, and obtain the number of pulses in each cycle after the next preset collection time.

[0087] In a possible implementation, when the number of cycles is not greater than the second preset threshold, the electronic device may also combine the two preset collection durations in the process of re-executing the step of collecting the number of pulses output by the charging integrated circuit through an interruption method, and use the number of pulses of each cycle recorded by the electronic device as the parameter for determining the charging state of the electronic device this time. For example, the second preset threshold is 15 times, and within the first preset collection duration, the number of cycles obtained by the electronic device is 10. The electronic device re-executes the step of collecting the number of pulses output by the charging integrated circuit through an interruption method, and the number of cycles obtained within the second preset collection duration is 15 times. Then, this time, the two preset collection durations can be combined, and the number of pulses of each cycle recorded by the electronic device (25 times) can be used as the parameter for determining the charging state of the electronic device this time, and the above-mentioned step of determining the charging state is performed.

[0088] Step 305: determining status display parameters according to the charging status, where the status display parameters include the display mode and display content of the charging display device.

[0089] Optionally, the electronic device determines the status display parameters according to the determined charging status, and the status display parameters include the display method and display content of the charging display device. Among them, the display method can be through light display, voice playback or icon display, etc. The display content can be a battery charging icon, or it can be a text content that is charging, etc. For example, the electronic device can be a massager with a display screen, and the charging display device is a display screen. When the charging status of the electronic device is a charging status, the display screen can display animation effects and prompt the text content that is charging. When the charging status of the electronic device is a full status, the display screen can display the icon corresponding to the full status and prompt the text content that is full. When the charging status of the electronic device is an uncharged status, the display screen can display the icon corresponding to the uncharged status and prompt the text content of the uncharged status. The present application does not limit the specific display form.

[0090] Step 306, controlling the charging display device to display according to the status display parameters.

[0091] That is, the electronic device can control the corresponding charging display device to display the above-mentioned status display parameters, so that the user can know whether the current electronic device is charging and understand the charging status of the electronic device in time.

[0092] In summary, the electronic device provided by the present application collects the number of pulses output by the charging integrated circuit in an interruption manner; after a preset collection time, obtains the number of pulses collected in each continuous period within the preset collection time; and determines the charging state of the electronic device according to the number of pulses collected in each continuous period and the first preset threshold. The number of pulses output by the charging IC is collected in an interruption manner, and the charging state is determined based on the number of pulses in different continuous periods and the first preset threshold. The charging state can be determined according to the number of pulses output by the charging IC collected in the actual interruption manner, and there is no need to set a fixed collection period for collection, which improves the accuracy of the charging state detection during the charging process of the electronic device.

[0093] In addition, the present application does not require the use of filter capacitors and level conversion circuits, which reduces costs. The corresponding preset acquisition time and acquisition cycle are obtained through frequency, and provisions are made for differences in different batches of chips. It can adapt to and tolerate output differences in different chips, making detection more accurate and flexible.

[0094] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0095] Please refer to Figure 6 , which shows a structural block diagram of a charging state detection device provided by an exemplary embodiment of the present application. The charging state detection device can be used in an electronic device to perform Figure 2 or Figure 3 All or part of the steps in the method provided by the illustrated embodiment are performed by the electronic device. The charging state detection device 600 may include the following modules:

[0096] The pulse acquisition module 601 is used for the electronic device to collect the number of pulses output by the charging integrated circuit through an interruption mode;

[0097] The number acquisition module 602 is used to acquire the number of pulses collected in each continuous period within the preset collection time after the preset collection time;

[0098] The state determination module 603 is used to determine the charging state of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold.

[0099] In summary, the electronic device provided by the present application collects the number of pulses output by the charging integrated circuit in an interruption manner; after a preset collection time, obtains the number of pulses collected in each continuous period within the preset collection time; and determines the charging state of the electronic device according to the number of pulses collected in each continuous period and the first preset threshold. The number of pulses output by the charging IC is collected in an interruption manner, and the charging state is determined based on the number of pulses in different continuous periods and the first preset threshold. The charging state can be determined according to the number of pulses output by the charging IC collected in the actual interruption manner, and there is no need to set a fixed collection period for collection, which improves the accuracy of the charging state detection during the charging process of the electronic device.

[0100] Optionally, the state determination module 603 includes: a first determination unit, a second determination unit and a third determination unit;

[0101] The first determination unit is configured to determine that the charging state of the electronic device is a full charge state when the number of pulses collected in each cycle is greater than the first preset threshold;

[0102] The second determining unit is configured to determine that the charging state of the electronic device is an uncharged state when the number of pulses collected in each cycle is not greater than the first preset threshold;

[0103] The third determination unit is used to determine that the charging state of the electronic device is the charging state when the number of pulses collected in the respective continuous cycles includes a number of pulses greater than the first preset threshold and also includes a number of pulses not greater than the first preset threshold.

[0104] Optionally, the pulse acquisition module 601 includes: an initialization unit and an acquisition unit;

[0105] The initialization unit is used to initialize the input-output interface to an interrupt input interface, and the input-output interface is used to receive the pulse output by the charging integrated circuit;

[0106] The acquisition unit is used to acquire the number of pulses output by the charging integrated circuit through the interrupt input interface.

[0107] Optionally, the device further comprises:

[0108] An interface display module, used for displaying a first setting interface on the display screen of the electronic device before the initialization input and output interface is set as an interrupt input interface, wherein the first setting interface includes a type selection control;

[0109] The interface setting module is used to set the selected interrupt input interface as the interface type of the input and output interface in response to a touch operation on the type selection control.

[0110] Optionally, the device further comprises:

[0111] A quantity acquisition module, used for acquiring the number of cycles of each continuous cycle before determining the charging state of the electronic device according to the number of pulses collected in each continuous cycle and a first preset threshold;

[0112] A first execution module, configured to, when the number of cycles is greater than a second preset threshold, execute the step of determining the charging state of the electronic device according to the number of pulses collected in each of the continuous cycles and the first preset threshold;

[0113] The second execution module is used for re-executing the step of collecting the number of pulses output by the charging integrated circuit through an interruption mode when the number of cycles is not greater than the second preset threshold.

[0114] Optionally, the device further comprises:

[0115] A frequency acquisition module, used to acquire the output frequency of the output pulse of the charging integrated circuit before acquiring the number of pulses collected in each continuous period within the preset collection time after the preset collection time;

[0116] The duration acquisition module is used to determine the period duration of each continuous period and the preset collection duration according to the output frequency.

[0117] Optionally, the device further comprises:

[0118] A parameter determination module, configured to determine a state display parameter according to the charging state after determining the charging state of the electronic device according to the number of pulses collected in each continuous period and a first preset threshold, wherein the state display parameter includes a display mode and display content of a charging display device;

[0119] The parameter display module is used to control the charging display device to display according to the status display parameters.

[0120] Please refer to Figure 7 , which shows a schematic diagram of the structure of an electronic device disclosed in an exemplary embodiment of the present application. Figure 7 As shown, it may include: Radio Frequency (RF) circuit 710, memory 720, input unit 730, display unit 740, sensor 750, audio circuit 760, WiFi module 710, processor 780, power supply 790 and other components. In the above embodiment, the electronic device can be used as a massage device or as an electronic device. Those skilled in the art can understand that Figure 7The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0121] Combine the following Figure 7 Introduce the various components of electronic equipment:

[0122] The RF circuit 710 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0123] The memory 720 can be used to store software programs and modules. The processor 780 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0124] The input unit 730 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 731 or near the touch panel 731 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch panel 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0125] The display unit 740 can be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 731 may cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event. Subsequently, the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Figure 7 In the embodiment, the touch panel 731 and the display panel 741 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 731 and the display panel 741 can be integrated to implement the input and output functions of the electronic device.

[0126] The electronic device may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the electronic device is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the electronic device can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0127] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the electronic device. The audio circuit 750 can transmit the received audio data to the speaker 761 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another electronic device through the RF circuit 710, or the audio data is output to the memory 720 for further processing.

[0128] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 710. It provides users with wireless broadband Internet access. Figure 7 A WiFi module 710 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.

[0129] The processor 780 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 780.

[0130] The electronic device also includes a power source 790 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 780 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0131] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0132] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program implements the method in the above method embodiment when executed by a processor.

[0133] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the method in the above method embodiment.

[0134] An embodiment of the present application discloses an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes the method in the above method embodiment.

[0135] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0136] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

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

[0138] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0139] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0140] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0141] The above is an introduction to a charging status detection method, device, massage equipment and storage medium disclosed in the embodiments of the present application. Individual examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present application, there will be changes in the implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A charging status detection method, It is characterized in that The method is applied to an electronic device, and the method comprises: The electronic device collects the number of pulses output by the charging integrated circuit in an interruption manner; After the preset acquisition time, the number of pulses collected in each continuous period within the preset acquisition time is obtained; Detecting the number of pulses in each continuous cycle to obtain the number of cycles of each continuous cycle; When the number of cycles is greater than a second preset threshold, determining the charging state of the electronic device according to the magnitude relationship between the number of pulses in each cycle and the first preset threshold; When the number of cycles is not greater than the second preset threshold, the step of collecting the number of pulses output by the charging integrated circuit in an interrupt manner is performed again.

2. The method according to claim 1, It is characterized in that The step of determining the charging state of the electronic device according to the relationship between the number of pulses in each cycle and the first preset threshold value includes: When the number of pulses collected in each cycle is greater than the first preset threshold, it is determined that the charging state of the electronic device is a full charge state; When the number of pulses collected in each cycle is not greater than the first preset threshold, determining that the charging state of the electronic device is an uncharged state; When the number of pulses collected in the consecutive cycles includes a number of pulses greater than the first preset threshold and also includes a number of pulses not greater than the first preset threshold, it is determined that the charging state of the electronic device is a charging state.

3. The method according to claim 1, It is characterized in that The method of collecting the number of pulses output by the charging integrated circuit in an interruption manner includes: The initialization input and output interface is an interrupt input interface, and the input and output interface is used to receive the pulse output by the charging integrated circuit; The number of pulses output by the charging integrated circuit is collected through the interrupt input interface.

4. The method according to claim 3, It is characterized in that Before the initialization input and output interface is used as an interrupt input interface, the method further includes: Displaying a first setting interface on a display screen of the electronic device, wherein the first setting interface includes a type selection control; In response to a touch operation on the type selection control, the selected interrupt input interface is set as the interface type of the input / output interface.

5. The method according to any one of claims 1 to 4, It is characterized in that After the preset acquisition time, before obtaining the number of pulses collected in each continuous period within the preset acquisition time, the method further includes: Obtaining the output frequency of the output pulse of the charging integrated circuit; According to the output frequency, the period length of each continuous period and the preset acquisition period are determined.

6. The method according to any one of claims 1 to 4, It is characterized in that After determining the charging state of the electronic device according to the magnitude relationship between the number of pulses in each cycle and the first preset threshold, the method further includes: Determine status display parameters according to the charging status, wherein the status display parameters include display mode and display content of the charging display device; The charging display device is controlled to display according to the status display parameters.

7. A charging status detection device, It is characterized in that The device is applied to electronic equipment, and the device comprises: A pulse acquisition module, used for the electronic device to collect the number of pulses output by the charging integrated circuit through an interruption mode; A number acquisition module is used to acquire the number of pulses collected in each continuous period within the preset collection time after the preset collection time; A state determination module, used to detect the number of pulses in each continuous cycle, and determine the charging state of the electronic device according to the relationship between the number of pulses in each cycle and a first preset threshold; The device also includes: A quantity acquisition module, used for acquiring the number of the consecutive cycles before determining the charging state of the electronic device according to the magnitude relationship between the number of pulses in each cycle and the first preset threshold; A first execution module, configured to, when the number of cycles is greater than a second preset threshold, execute the step of determining the charging state of the electronic device according to the magnitude relationship between the number of pulses in each cycle and the first preset threshold; The second execution module is used for re-executing the step of collecting the number of pulses output by the charging integrated circuit through an interruption mode when the number of cycles is not greater than the second preset threshold.

8. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the charging state detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the charging status detection method according to any one of claims 1 to 6 is implemented.