Attachment detection method, electronic device, and charging system

Through the photoelectric detection method of light-emitting devices and photosensitive devices, the problem of misfit between electronic devices and charging base during charging is solved, the detection accuracy is improved, poor contact and eddy current heating are avoided, and charging efficiency and safety are ensured.

WO2025195056A1PCT designated stage Publication Date: 2025-09-25HONOR DEVICE CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/077066
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-22
Filing Date
2025-02-12
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

During charging, if the electronic device is not in close contact with the charging base, it may cause poor charging contact or reduced charging efficiency, and metal foreign objects may cause eddy current heating, posing a risk of burns.

Method used

A photoelectric detection method using light-emitting devices and photosensitive devices is used to determine whether foreign objects are clamped by detecting the intensity of light reflected from the gap between the charging base and the electronic device. Multiple photosensitive devices are arranged in a ring around the light-emitting device to adapt to scenarios where foreign objects are clamped from different directions. Combined with filtering of ambient light interference, the detection accuracy is improved.

Benefits of technology

High-precision fitting detection is achieved, avoiding the risks of poor charging contact and eddy current heating, ensuring charging efficiency and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025077066_25092025_PF_FP_ABST
    Figure CN2025077066_25092025_PF_FP_ABST
Patent Text Reader

Abstract

An attachment detection method, an electronic device (21), and a charging system, which relate to the field of smart terminals and are used for detecting whether a foreign object is sandwiched between the electronic device (21) and a charging base (22). The attachment detection method is applied to the electronic device (21). The electronic device (21) comprises a charging chip, a light-emitting device (214) and a photosensitive device (215), wherein the light-emitting device (214) and the photosensitive device (215) are located on a surface of the electronic device (21). The method comprises: controlling a charging chip to detect that an electronic device (21) is charged by means of a charging base (22), wherein the charging base (22) is close to the surface of the electronic device (21) that has a light-emitting device (214) and a photosensitive device (215); controlling the light-emitting device (214) to emit light; performing photoelectric detection by means of the photosensitive device (215) to acquire a first electrical signal; and on the basis of the first electrical signal, determining whether the electronic device (21) is attached to the charging base (22).
Need to check novelty before this filing date? Find Prior Art

Description

Fit detection method, electronic device and charging system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 22, 2024, with application number 202410340499.4 and invention name “Fitting detection method, electronic device and charging system”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of smart terminals, and in particular to a fitting detection method, an electronic device, and a charging system. Background Art

[0003] When the charging base is charging an electronic device such as a smartwatch (wired charging or wireless charging), the electronic device and the charging base are attached together. If a foreign object is caught between the charging base and the electronic device, the electronic device and the charging base will not fit together. For wired charging, this may result in poor contact between the charging base and the electronic device, making charging impossible; for wireless charging, this will result in reduced charging efficiency. In addition, for wireless charging, if the foreign object is made of metal, it will also cause electromagnetic induction to generate eddy currents and heat, posing a risk of burns to the user. Summary of the Invention

[0004] The embodiments of the present application provide a fit detection method, an electronic device, and a charging system for detecting whether an electronic device fits in contact with a charging base during charging.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a fitting detection method is provided, which is applied to an electronic device, wherein the electronic device includes: a charging chip, a light-emitting device and a photosensitive device; the light-emitting device and the photosensitive device are located on the surface of the electronic device, and the method includes: controlling the charging chip to detect that the electronic device is charged through a charging base; wherein the charging base is close to the surface of the electronic device having the light-emitting device and the photosensitive device; controlling the light-emitting device to emit light; and performing photoelectric detection through the photosensitive device to obtain a first electrical signal.

[0007] The embodiment of the present application provides a fit detection method. When the electronic device is charged through the charging base, the charging base is close to the surface of the electronic device having a light-emitting device and a photosensitive device. When a foreign object is inserted between the charging base and the electronic device, the charging base and the electronic device will not fit together, the gap between the charging base and the electronic device will become larger, and the ambient light and the light emitted by the light-emitting device will be reflected to the photosensitive device through the gap, so that the light intensity detected by the photosensitive device becomes larger, and the electrical signal output by the photosensitive device also becomes larger. Therefore, when the charging base is charging the electronic device, the light-emitting device is controlled to emit light, and the photosensitive device is controlled to perform photoelectric detection and output a first electrical signal. According to the size of the first electrical signal, it is judged whether the charging base and the electronic device fit together, thereby judging whether a foreign object is inserted between the charging base and the electronic device.

[0008] In one possible implementation, determining whether the electronic device and the charging base are in contact with each other based on the first electrical signal includes: if the first electrical signal is greater than a first threshold, determining that the electronic device and the charging base are not in contact with each other; otherwise, determining that the electronic device and the charging base are in contact with each other.

[0009] The larger the foreign object sandwiched between the electronic device and the charging base, the greater the intensity of the ambient light and reflected light detected by the photosensitive device, and the larger the first electrical signal output by the photosensitive device. Therefore, if the first electrical signal is greater than the first threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. Because small changes in the angle between the electronic device and the charging base cause more significant changes in the first electrical signal than changes in the power loss value, the detection accuracy is higher than that of determining whether the electronic device and the charging base are in contact based on the power loss value.

[0010] In one possible implementation, there are multiple photosensitive devices, which are arranged in a ring around the light-emitting device. Judging whether the electronic device is in contact with the charging base is based on the first electrical signal, including: averaging the first electrical signals output by the multiple photosensitive devices; if the average value is greater than a first threshold, determining that the electronic device is not in contact with the charging base; otherwise, determining that the electronic device is in contact with the charging base.

[0011] Considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to a foreign object being caught between them, the charging base will reflect the reflected light at different angles for the photosensitive devices in different positions, resulting in different first electrical signals detected by different photosensitive devices. Therefore, fixedly selecting a certain photosensitive device for photoelectric detection cannot adapt to scenarios where the electronic device and the charging base are caught by foreign objects in different directions. This embodiment can adapt to scenarios where the electronic device and the charging base are caught by foreign objects in different directions.

[0012] In one possible implementation, there are multiple photosensitive devices, which are arranged in a ring around the light-emitting device. Judging whether the electronic device is in contact with the charging base is based on the first electrical signal, including: taking the minimum value of the first electrical signals output by the multiple photosensitive devices; if the minimum value is greater than a first threshold, determining that the electronic device is not in contact with the charging base; otherwise, determining that the electronic device is in contact with the charging base.

[0013] Considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to a foreign object being caught between them, the charging base will reflect the reflected light at different angles for the photosensitive devices in different positions, resulting in different first electrical signals detected by different photosensitive devices. Therefore, fixedly selecting a certain photosensitive device for photoelectric detection cannot adapt to scenarios where the electronic device and the charging base are caught by foreign objects in different directions. This embodiment can adapt to scenarios where the electronic device and the charging base are caught by foreign objects in different directions.

[0014] In one possible embodiment, the method further includes: controlling the light-emitting device not to emit light; performing photoelectric detection through a photosensitive device to obtain a second electrical signal; judging whether the electronic device is in contact with the charging base based on the first electrical signal, including: subtracting the first electrical signal from the second electrical signal to obtain a third electrical signal; and judging whether the electronic device is in contact with the charging base based on the third electrical signal.

[0015] The intensity of ambient light is significantly affected by environmental factors and can interfere with fit detection. The third electrical signal indicates the intensity of reflected light (reflected light from the light-emitting device) after filtering out the ambient light. This can be used to detect fit between the electronic device and the charging base. Eliminating the interference of ambient light allows for more accurate detection.

[0016] In one possible implementation, determining whether the electronic device and the charging base are in contact with each other based on the third electrical signal includes: if the third electrical signal is greater than a second threshold, determining that the electronic device and the charging base are not in contact with each other; otherwise, determining that the electronic device and the charging base are in contact with each other.

[0017] The larger the foreign object between the electronic device and the charging base, the greater the intensity of the reflected light detected by the photosensitive device, and the larger the third electrical signal output by the photosensitive device. Therefore, if the third electrical signal is greater than the second threshold, the electronic device is determined to be not in contact with the charging base; otherwise, the electronic device is determined to be in contact with the charging base. Compared to determining whether the electronic device and the charging base are in contact based on power loss, this method provides higher detection accuracy.

[0018] In one possible implementation, there are multiple photosensitive devices, which are arranged in a ring around the light-emitting device. Whether the electronic device is in contact with the charging base is determined based on the third electrical signal, including: averaging the third electrical signals corresponding to the multiple photosensitive devices, if the average value is greater than a second threshold, determining that the electronic device is not in contact with the charging base; otherwise, determining that the electronic device is in contact with the charging base.

[0019] Considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to the presence of foreign objects, the reflection angle of the reflected light by the charging base is different for the photosensitive devices in different positions, so that the first electrical signals detected by different photosensitive devices are different, the second electrical signals detected are also different, and the third electrical signals corresponding to different photosensitive devices are also different. Therefore, fixedly selecting a certain photosensitive device for photoelectric detection cannot adapt to scenarios where foreign objects are clamped between the electronic device and the charging base in different directions. This embodiment can adapt to scenarios where foreign objects are clamped between the electronic device and the charging base in different directions.

[0020] In one possible implementation, there are multiple photosensitive devices, which are arranged in a ring around the light-emitting device. Judging whether the electronic device is in contact with the charging base is based on a third electrical signal, including: taking the minimum value of the third electrical signals corresponding to the multiple photosensitive devices; if the minimum value is greater than a second threshold, determining that the electronic device is not in contact with the charging base; otherwise, determining that the electronic device is in contact with the charging base.

[0021] Considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to the presence of foreign objects, the reflection angle of the reflected light by the charging base is different for the photosensitive devices in different positions, so that the first electrical signals detected by different photosensitive devices are different, the second electrical signals detected are also different, and the third electrical signals corresponding to different photosensitive devices are also different. Therefore, fixedly selecting a certain photosensitive device for photoelectric detection cannot adapt to scenarios where foreign objects are clamped between the electronic device and the charging base in different directions. This embodiment can adapt to scenarios where foreign objects are clamped between the electronic device and the charging base in different directions.

[0022] In a possible implementation, before controlling the light-emitting device to emit light, the method further includes: controlling the charging chip to communicate with the charging base to determine that the charging base is a matching charging base.

[0023] Because the intensity of reflected light reflected by charging bases of different materials, colors, and shapes is different. For the matching charging base, the material and color of the shell are fixed, and the charging base fits the electronic device, so the shape of the charging base is also fixed. The intensity of reflected light reflected by the matching charging base has been experimentally tested in various scenarios, so the calibration of the corresponding parameters is also accurate. For unmatched charging bases, the above conditions are unknown, and the parameters used may be too high or too low, which may lead to inaccurate detection.

[0024] In one possible implementation, controlling the light-emitting device to emit light includes: obtaining a charging power loss value through a charging chip, where the charging power loss value refers to the difference between the charging power output by the charging base and the charging power input by the charging chip; if the power loss value is less than a preset loss threshold, controlling the light-emitting device to emit light.

[0025] If the charging power loss value is less than the preset loss threshold, it means that the foreign object between the charging base and the electronic device is small or there is no foreign object. Further judgment is required based on the electrical signal output by the photosensitive device.

[0026] In one possible implementation, the method further includes: if the power loss value is greater than or equal to a preset loss threshold, controlling the charging chip to communicate with the charging base to instruct the charging base to stop charging.

[0027] If the power loss value is greater than or equal to the preset loss threshold, it means that a large foreign object is sandwiched between the charging base and the electronic device, so charging is stopped.

[0028] In one possible implementation, the electronic device further includes a display screen, and the method further includes: if it is determined that the electronic device and the charging base are not in contact, controlling the display screen to display a prompt message, where the prompt message is used to prompt the user that the electronic device and the charging base are not in contact.

[0029] This embodiment makes it easy for the user to see the prompt information that the electronic device and the charging base are not in contact. The user can remove the foreign object sandwiched between the user's electronic device and the charging base and adjust the angle between the user's electronic device and the charging base to charge normally.

[0030] In a second aspect, an electronic device is provided, including a charging chip, a light-emitting device, a photosensitive device, a processor and a memory, wherein instructions are stored in the memory. When the processor executes the instructions, the method described in the first aspect and any one of its embodiments is performed; the processor is used to control the charging chip to detect that the electronic device is charging through the charging base, control the light-emitting device to emit light, and perform photoelectric detection through the photosensitive device to obtain an electrical signal.

[0031] In a third aspect, a charging system is provided, comprising a charging base and the electronic device as described in the second aspect, wherein the charging base is used to charge the electronic device.

[0032] In a fourth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method as described in the first aspect and any embodiment thereof.

[0033] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the first aspect and any embodiment thereof.

[0034] Among them, the technical effects brought about by any implementation of the second to fifth aspects can refer to the technical effects brought about by the first aspect and any implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] FIG1 is a schematic diagram of a principle for generating a photoplethysmography signal according to an embodiment of the present application;

[0036] FIG2 is a schematic diagram of a charging system provided in an embodiment of the present application;

[0037] FIG3 is a schematic diagram of another charging system provided in an embodiment of the present application;

[0038] FIG4 is a bottom schematic diagram of an electronic device provided in an embodiment of the present application;

[0039] FIG5 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

[0040] FIG6 is a schematic diagram of a foreign object being caught between an electronic device and a charging base according to an embodiment of the present application;

[0041] FIG7 is a schematic diagram of a fit detection function switch provided in an embodiment of the present application;

[0042] FIG8 is a schematic flow chart of a bonding detection method provided in an embodiment of the present application;

[0043] FIG9 is a schematic diagram of a charging base for charging a mobile phone provided in an embodiment of the present application;

[0044] FIG10 is a schematic diagram of information displayed when an electronic device and a charging base are not in contact with each other according to an embodiment of the present application;

[0045] FIG11 is a schematic diagram of information displayed when an electronic device is attached to a charging base according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] It should be noted that the terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0047] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0048] The terms "coupling" and "connection" involved in the embodiments of this application should be understood in a broad sense. For example, they may refer to a physical direct connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

[0049] First, some concepts involved in this application are described:

[0050] Photoplethysmographic (PPG): The principle of PPG is shown in Figure 1. A light-emitting device 11 (such as a light-emitting diode) illuminates the skin tissue 13. The light reflected by the skin tissue 13 is received by a photosensitive device 12 (such as a photodiode) and converted into an analog electrical signal. The electrical signal is then converted into a digital signal through analog-to-digital conversion for further processing, such as detecting vital signs. The electrical signal output by each photosensitive device 12 is collectively referred to as an electrical signal of a channel, and multiple photosensitive devices 12 can output electrical signals of multiple channels. The size of the electrical signal output by the photosensitive device 12 is related to the intensity of the light detected by the photosensitive device 12. The greater the intensity of the light detected by the photosensitive device 12, the larger the electrical signal output by the photosensitive device 12, and the smaller the intensity of the light detected by the photosensitive device 12, the smaller the electrical signal output by the photosensitive device 12.

[0051] Because the absorption of light by human tissues such as muscle, bone, and veins is essentially constant, the electrical signal output by photosensitive device 12 from detecting light reflected from these tissues is a DC signal. However, due to the cyclical changes in blood flow in arteries (dilation and contraction), the electrical signal output by photosensitive device 12 from detecting light reflected from arterial blood is an AC signal. Therefore, the electrical signal output by photosensitive device 12 includes both DC and AC signals. By extracting the AC signal, vital signs can be detected, including but not limited to heart rate and blood oxygen saturation (including oxyhemoglobin and reduced hemoglobin).

[0052] The light-emitting device 11 can emit monochromatic light such as red light, infrared light, and green light. Among them, red light and infrared light are easier to penetrate skin tissue than other colors of light, and green light is more easily absorbed by blood, thereby better detecting changes in blood. In addition, when the light-emitting device 11 emits green light, the electrical signal output by the photosensitive device 12 can be used to detect heart rate (i.e., output heart rate). When the light-emitting device 11 emits red light, the electrical signal output by the photosensitive device 12 can be used to detect oxygenated hemoglobin (i.e., output the ratio of oxygenated hemoglobin). When the light-emitting device 11 emits infrared light, the electrical signal output by the photosensitive device 12 can be used to detect reduced hemoglobin (i.e., output the ratio of reduced hemoglobin).

[0053] As shown in Figures 2 and 3, an embodiment of the present application provides a charging system, including an electronic device 21, a charging base 22, a power adapter 23 and a transmission line 24. The electronic device 21 and the charging base 22 can be coupled by wire or wirelessly. For example, as shown in Figure 2, the electronic device 21 and the charging base 22 can be coupled by electromagnetic induction between the first coil 211 and the second coil 221. In this case, the charging base 22 performs wireless charging on the electronic device 21. Alternatively, as shown in Figure 3, the electronic device 21 and the charging base 22 can be coupled by an electrical connection of a physical interface, and the charging base 22 performs wired charging on the electronic device 21. Exemplarily, the physical interface can be a pogo pin interface. This application takes the example of the charging base 22 performing wireless charging on the electronic device 21 to illustrate the fit detection method, but is not intended to be limited to this. The fit detection method is also applicable to the scenario where the charging base 22 performs wired charging on the electronic device 21.

[0054] The electronic device 21 may be a wearable device, such as a smartwatch, smart bracelet, or smart glasses. Alternatively, the electronic device may be a terminal device, such as a mobile phone, a heart rate monitor, or a blood oximeter. This embodiment of the present application uses a smartwatch as an example, but is not intended to be limiting. The electronic device 21 is used to perform the fit detection method provided in this embodiment of the present application.

[0055] The transmission line 24 may be a universal serial bus (USB) line. Both the charging base 22 and the power adapter 23 may include a USB interface. The power adapter 23 is electrically connected to the charging base 22 via the transmission line 24. The power adapter 23 charges the electronic device 21 through the charging base 22.

[0056] As shown in FIG2 and FIG3 , the electronic device 21 includes a first charging chip 212 and a battery 213 , and the charging base 22 includes a second charging chip 222 . The battery 213 is used to power various components in the electronic device 21 .

[0057] In the wireless charging scenario shown in Figure 2, the electronic device 21 further includes a first coil 211, and the charging base 22 further includes a second coil 221. The first charging chip 212 can wirelessly communicate with the second charging chip 222 through the first coil 211 and the second coil 221, for example, to negotiate the power and charging current of wireless charging according to a wireless charging protocol (such as the Qi wireless charging protocol). When the power adapter 23 is connected to a power source (such as AC power) and the electronic device 21 is placed on the charging base 22, the power adapter 23 can transmit electrical energy to the second coil 221 in the charging base 22 through the transmission line 24. The second coil 221 is coupled to the first coil 211 through electromagnetic induction, thereby transmitting electrical energy to the first coil 211, and finally transmitting it to the battery 213 to charge the battery 213.

[0058] Compared to the wireless charging scenario shown in FIG2 , in the wired charging scenario shown in FIG3 , the electronic device 21 does not include the first coil 211 shown in FIG2 , but instead includes a first spring pin interface 219 ; the charging base 22 does not include the second coil 221 shown in FIG2 , but instead includes a second spring pin interface 229 . The first charging chip 212 can communicate with the second charging chip 222 via the first spring pin interface 219 and the second spring pin interface 229 , for example, to negotiate the power and charging current for wired charging. When the power adapter 23 is connected to a power source (e.g., AC power) and the electronic device 21 is placed on the charging base 22 , the first spring pin interface 219 is electrically connected to the second spring pin interface 229 , and the power adapter 23 can transmit electrical energy to the second spring pin interface 229 and the first spring pin interface 219 in the charging base 22 via the transmission line 24 , and ultimately transmit the electrical energy to the battery 213 and charge the battery 213 .

[0059] As shown in Figures 2 and 3, the electronic device 21 may further include a light-emitting device 214 and a photosensitive device 215. For example, the light-emitting device 214 may be a light-emitting diode, and the photosensitive device 215 may be a photodiode. The light-emitting device 214 and the photosensitive device 215 are located on the surface of the electronic device 21. For example, taking the electronic device 21 as a smartwatch, a raised structure 25 is provided on the bottom of the electronic device 21, and the light-emitting device 214 and the photosensitive device 215 may be provided on the surface of the raised structure 25. When the user wears the electronic device, the raised structure 25 can fit tightly against the user's arm, allowing the light-emitting device 214 and the photosensitive device 215 to fit tightly against the user's arm, thereby enabling vital sign detection based on the electrical signals output by the photosensitive device 215. Because the intensity of ambient light is much greater than the intensity of light reflected from human tissue from the light-emitting device 214, the light-emitting device 214 and the photosensitive device 215 fit tightly against the user's arm, minimizing the risk of the photosensitive device 215 detecting ambient light and affecting detection accuracy. Accordingly, the top of the charging base 22 has a recessed structure 26, and the shape of the recessed structure 26 can be aligned with the shape of the raised structure 25. For example, the shape of the recessed structure 26 and the shape of the raised structure 25 are both arc-shaped, so that when the charging base 22 is charging the electronic device 21, the electronic device 21 can be tightly aligned with the charging base 22. At this time, the charging base 22 is close to the surface of the electronic device 21 having the light-emitting device 214 and the light-sensing device 215.

[0060] The electronic device 21 may include multiple light-emitting devices 214 and multiple photosensitive devices 215. This application does not limit the number of light-emitting devices 214 and photosensitive devices 215. For example, the number of light-emitting devices 214 may be 1, 2, 4, or another number, and the number of photosensitive devices 215 may be 1, 2, 4, 8, or another number. The greater the number of light-emitting devices 214, the higher the illumination intensity and the better the resistance to ambient light interference. Each photosensitive device 215 can output an electrical signal of one channel. The greater the number of photosensitive devices 215, the more channels of electrical signals can be output, and the higher the detection accuracy. Furthermore, the multiple light-emitting devices 214 can each emit light of a different color. For example, FIG4 is a schematic diagram of the bottom of the electronic device 21. The electronic device 21 includes two light-emitting devices 214, one of which can emit infrared light and the other can emit green light. The functions of infrared light and green light are described above and will not be repeated here.

[0061] Multiple photosensitive devices 215 should be spaced as far apart as possible to reduce correlation and thus improve measurement accuracy. For example, in Figure 4, multiple (two in Figure 4) light-emitting devices 214 are located at the center of the raised structure 25, and multiple (e.g., eight) photosensitive devices 215 are symmetrically arranged in a ring around the multiple light-emitting devices 214 within the raised structure 25, so that each photosensitive device 215 evenly receives light reflected from human tissue.

[0062] As shown in FIG. 2 and FIG. 3 , the electronic device 21 further includes a processor 216 , a memory 217 , and a display screen 218 .

[0063] The memory 217 may include at least one of a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), such as a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus RAM (DR RAM). The memory 217 is used to store programs, instructions, and related data. When the programs and instructions are executed by the processor 216, the fitting detection method provided in the embodiment of the present application can be executed.

[0064] The processor 216 can be a chip, for example, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chip. The processor 216 executes the fitting detection method provided in the embodiment of the present application by executing the programs and instructions stored in the memory 217. The memory 217 and the processor 216 can be integrated into a system on chip (SoC) chip or can be set separately. The processor 216 can communicate with the first charging chip 212. The processor 216 can also control the display screen 218 to display images, such as data showing vital signs. The display screen 218 can also have a touch function, detect the user's touch operation on the display screen 218, and feed back to the processor 216.

[0065] The electronic device 21 also includes a driving circuit, an amplifier, an acceleration sensor, a wireless communication module, a mobile communication module, an antenna, etc., which are not shown in Figures 2 and 3. The driving circuit is used to provide a driving current to the light-emitting device 214. Because the driving capabilities of the pins of the processor 216 are usually limited, it is difficult to drive the light-emitting device 214 to emit light. The processor 216 can output a control signal to the driving circuit to control the driving circuit to provide a driving current to the light-emitting device 214 to drive the light-emitting device 214 to emit light. The amplifier is used to amplify the electrical signal output by the photosensitive device 215 and output it to the processor 216. The processor 216 can also detect vital signs based on the electrical signal. The acceleration sensor is used to detect the acceleration data of the electronic device 21 and output it to the processor 216. The processor 216 can detect the motion state of the electronic device based on the acceleration data.

[0066] The wireless communication module and the mobile communication module are respectively coupled to the antenna, and the antenna is used to transmit and receive electromagnetic wave signals. The antenna can be used to cover a single or multiple communication frequency bands, and multiple antennas can also be reused to improve the utilization rate of the antenna. The mobile communication module can provide 2G, 3G, 4G, 5G and other wireless communications. The wireless communication module 260 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), and other wireless communications.

[0067] In addition, the bottom of the electronic device 21 and the top of the charging base 22 each include a magnet (not shown in Figures 2 and 3). The two magnets are arranged opposite each other and have opposite polarities on their opposite sides. When the electronic device 21 is placed on the charging base 22, the magnetic attraction of the two magnets allows the recessed structure 26 in the charging base 22 to fit tightly with the raised structure 25 in the electronic device 21, and the first coil 211 in the electronic device 21 is aligned in parallel with the second coil 221 in the charging base 22. At this time, the charging efficiency is the highest.

[0068] The program executed by the processor 216 may be based on an operating system, such as the Android operating system. As shown in FIG5 , the program running on the processor 216 is based on the Android operating system. For example, the programs run by the processor 216 are layered according to their functions, and may include an application layer, a framework layer, a system runtime layer, a hardware abstraction layer, and a kernel layer.

[0069] The kernel layer is the layer between hardware and software. For example, the kernel layer includes the operating system (OS) kernel, display driver, PPG driver, power management driver, etc. The operating system kernel is used to manage the system's processes, memory, drivers, file system, and network system. Each driver is used to drive the hardware resources of the hardware layer. For example, the display driver is used to drive the display screen described above, the PPG driver is used to drive the PPG hardware circuit (including the light-emitting device and light-sensing device described above), and the power management driver is used to drive the first charging chip described above.

[0070] The hardware abstraction layer (HAL) is used to abstract the hardware. It includes the PGG module, power management module, display module, touch module, etc. Among them, the PGG module is used to abstract the PPG hardware circuit, and the abstracted PPG hardware circuit is called by the vital signs detection algorithm and the fit detection algorithm in the system runtime layer, so as to provide the vital signs detection algorithm and the fit detection algorithm with the electrical signal output by the photosensitive device. The power management module is used to abstract the first charging chip, and the abstracted first charging chip is called by the fit detection algorithm in the system runtime layer, so as to provide the fit detection algorithm with information such as the charging status (whether charging), charging power, etc. The display module is used to abstract the display screen, and the abstracted display screen is called by the fit detection algorithm in the system runtime layer, so as to control the display screen to display images.

[0071] The system runtime layer may include a vital sign detection algorithm, a fit detection algorithm, etc. Among them, the vital sign detection algorithm is used to detect vital signs. The fit detection algorithm is used to execute the fit detection method provided in the embodiment of the present application.

[0072] The framework layer may include a vital sign detection service, a fit detection service, etc. The vital sign detection service is used to provide a service for calling a vital sign detection algorithm to a vital sign detection program, and the fit detection service is used to provide a service for calling a fit detection algorithm to a fit detection program.

[0073] The application layer may include a vital sign detection program, a fitting detection program, etc. The vital sign detection program is used to output the result of the vital sign detection, and the fitting detection program is used to output the structure of the vital sign detection.

[0074] When the charging base 22 wirelessly charges an electronic device 21, such as a smartwatch, via electromagnetic induction, the bottom of the electronic device 21 and the top of the charging base 22 can fit together, with the first coil 211 in the electronic device 21 and the second coil 221 in the charging base 22 aligned parallel to each other, resulting in the highest wireless charging efficiency. However, as shown in FIG6 , when a foreign object 51 is inserted between the charging base 22 and the electronic device 21, the bottom of the electronic device 21 and the top of the charging base 22 do not fit together, and the first coil 211 in the electronic device 21 and the second coil 221 in the charging base 22 cannot be aligned, resulting in reduced wireless charging efficiency. Furthermore, if the foreign object 51 is made of metal, electromagnetic induction can generate eddy currents in the foreign object 51, causing it to heat up, posing a risk of scalding the user. Furthermore, when the charging base 22 performs wired charging on an electronic device 21, such as a smartwatch, the electronic device 21 and the charging base 22 do not fit together, potentially resulting in poor contact between the charging base 22 and the electronic device 21, making charging impossible.

[0075] To this end, an embodiment of the present application provides a method for detecting a fit. When there is no foreign object between the charging base 22 and the electronic device 21, the charging base 22 and the electronic device 21 are in contact with each other, that is, the gap between the charging base 22 and the electronic device 21 is very small, and only a small portion of the ambient light and the light emitted by the light-emitting device 214 is reflected through the gap to the photosensitive device 215. As shown in Figure 6, if a foreign object 51 is inserted between the charging base 22 and the electronic device 21, the charging base 22 and the electronic device 21 will not fit together. The gap between the charging base 22 and the electronic device 21 becomes larger, and more ambient light and the light emitted by the light-emitting device 214 are reflected through the gap to the photosensitive device 215, resulting in an increase in the light intensity detected by the photosensitive device 215 and an increase in the electrical signal output by the photosensitive device 215. Therefore, the fit detection method of the present application controls the light-emitting device 214 to emit light while the charging base 22 is charging the electronic device 21. The magnitude of the first electrical signal output by the photosensitive device 215 is used to determine whether the charging base and the electronic device are in contact with each other, that is, to determine whether a foreign object is inserted between the charging base and the electronic device.

[0076] Taking the electronic device as a smartwatch as an example, as shown in Figure 7, a switch for the fit detection function can be displayed in the settings interface (the corresponding text in the actual product can be "Charging Foreign Object Detection"). The processor can turn the fit detection function on or off in response to the user clicking the fit detection function switch. When the switch is turned on, the electronic device can execute the fit detection method, and when the switch is turned off, the electronic device does not execute the fit detection method.

[0077] The following describes how the processor executes the fitting detection method. As shown in FIG8 , the method includes steps S101 to S107 , wherein steps S102 and S103 are optional.

[0078] S101: The processor controls the first charging chip to detect that the electronic device is being charged through the charging base.

[0079] For wired charging, the processor controls the first charging chip to detect charging through the charging base through the first spring pin interface.

[0080] For wireless charging, the processor controls the first charging chip to detect charging from the charging base via the first coil. According to the Qi wireless charging protocol, wireless charging of an electronic device by the charging base involves several phases: the ping phase, the identification and configuration phase, and the power transfer phase. When a user places an electronic device (containing metal) on the charging base, the electromagnetic coupling between the metal and the second coil changes the capacitance of the second coil. The charging base determines that metal is present based on this capacitance change, and the ping phase begins. During the ping phase, the second charging chip in the charging base sends a ping packet via the second coil and detects a response packet from the electronic device. After receiving the ping packet via the first coil, the first charging chip in the electronic device sends a response packet containing signal strength information, which indicates the degree of coupling between the first and second coils, i.e., whether they are aligned in parallel. If the second charging chip in the charging base detects the response packet from the electronic device via the second coil within a preset time, the identification and configuration phase begins. Otherwise, the metal object is determined to be a foreign object, and the entire wireless charging process ends. During the identification and configuration phase, the electronic device sends its identification information and a configuration message to the charging base, including the maximum charging power. The charging base adjusts the parameters of the second coil (such as the oscillation frequency) according to the maximum charging power and begins the power transmission phase to wirelessly charge the electronic device. The first charging chip detects wireless charging through the charging base via the first coil. In addition, during the power transmission phase, the first charging chip can also send charging status messages to the charging base via the first coil. For example, when the electronic device's battery is fully charged, a charging completion message is sent.

[0081] S102. The processor controls the first charging chip to communicate with the charging base to determine whether the charging base is a matching charging base. If the charging base is a matching charging base, continue to execute subsequent steps; otherwise, exit the fitting detection.

[0082] For wired charging, the processor controls the first charging chip to communicate with the charging base through the first spring pin interface to determine whether the charging base is a matching charging base.

[0083] For wireless charging, the processor controls the first charging chip to communicate with the charging base through the first coil to determine whether the charging base is a matching charging base. According to the Qi wireless charging protocol, the second charging chip in the charging base can send a first custom data packet to the electronic device through the second coil, and the first charging chip receives the first custom data packet through the first coil. The first custom data packet includes the identification information of the charging base. After the processor in the electronic device obtains the identification information of the charging base from the first charging chip, it determines whether the charging base is a matching charging base based on the identification information of the charging base. For example, if the identification information of the charging base is the same as the identification information of the matching charging base, it can be determined that the charging base is a matching charging base, and the subsequent steps (for example, starting from S103 or S104) are continued. Otherwise, it is determined that the charging base is not a matching charging base, and the fitting detection process is exited.

[0084] Because the intensity of reflected light is different for charging bases of different materials, colors and shapes. For a matching charging base, the material used for the shell is fixed (for example, polyvinyl chloride (PVC), the color is fixed (for example, white), and the concave structure of the charging base fits the convex structure of the electronic device, so the shape is also fixed. In addition, the intensity of the reflected light of the matching charging base has been experimentally tested in various scenarios, so the calibration of the corresponding parameters (for example, the first threshold below) is also accurate. For an unmatched charging base, such as the charging base 22 for wireless charging of a mobile phone shown in FIG9 , the above conditions are unknown, and the parameters used (for example, the first threshold below) may be too high or too low, and there may be problems with inaccurate detection, but fitting detection can still be performed.

[0085] S103. The processor obtains a charging power loss value through the first charging chip. If the power loss value is less than a preset loss threshold, step S104 is executed; otherwise, step S107 is executed.

[0086] The charging power loss value refers to the difference between the charging power output by the charging base and the charging power input by the first charging chip.

[0087] For wired charging, the processor controls the first charging chip to communicate with the charging base via the first pogo pin interface, obtaining the charging power output from the charging base. The processor also obtains the actual charging power input from the first charging chip. The difference between the charging power output from the charging base and the charging power input from the first charging chip is used to obtain the charging power loss value.

[0088] In wireless charging scenarios, according to the Qi wireless charging protocol, the second charging chip in the charging base can send a second custom data packet to the electronic device via the second coil, and the first charging chip receives the second custom data packet via the first coil. The second custom data packet includes the charging power output by the charging base. The processor in the electronic device obtains the charging power output by the charging base and the charging power input by the first charging chip from the first charging chip, and subtracts the charging power output by the charging base from the charging power input by the first charging chip to obtain the charging power loss value. If the charging power loss value is less than the preset loss threshold, it means that the foreign object between the wireless charging base and the electronic device is small or there is no foreign object, and further judgment is required.

[0089] If the charging power loss value is greater than or equal to the preset loss threshold, it indicates that a large foreign object is sandwiched between the charging base and the electronic device, and therefore S107 is executed.

[0090] S104: The processor controls the light-emitting device to emit light.

[0091] In an embodiment of the present application, an electronic device includes two light-emitting devices, one of which can emit infrared light and the other can emit green light. A processor can control one of the two light-emitting devices to emit light, or can control both light-emitting devices to emit light, or can control the two light-emitting devices to emit light alternately. Because emitting infrared light consumes less power than emitting green light, the present application can adopt a solution in which the processor controls the light-emitting device to emit infrared light.

[0092] This application does not limit the duration and number of times the light-emitting device emits light. For example, the processor can control the light-emitting device to emit light continuously, or control the light-emitting device to emit light periodically so as to continuously perform fitting detection during the charging process. The period of periodic light emission of the light-emitting device involved in this application can be 1ms. In addition, since the user will adjust the relative position of the electronic device and the charging base at the beginning of charging, the user usually does not adjust the relative position of the electronic device and the charging base after the preset charging time (for example, 10 seconds), so the processor can control the light-emitting device to emit light continuously or periodically within the preset time at the beginning of charging, and this solution has lower power consumption.

[0093] S105: The processor performs photoelectric detection through a photosensitive device to obtain a first electrical signal.

[0094] The photosensitive device may be at least one of the multiple photosensitive devices described above. The first electrical signal refers to the electrical signal output by the photosensitive device when the light-emitting device emits light. In the embodiment of the present application, the electrical signal output by the photosensitive device may be a time-domain digital signal obtained after noise reduction, bandpass filtering, analog-to-digital conversion, and other processing.

[0095] In this application, the light reflected from the light-emitting device by the charging base is referred to as reflected light. When the light-emitting device emits light, the first electrical signal output by the photodetector after photoelectric detection of the reflected light is essentially a photoelectric detection of the ambient light plus the reflected light. Therefore, the second electrical signal indicates the intensity of the combined ambient light and reflected light.

[0096] S106: The processor determines whether the electronic device is in contact with the charging base based on the first electrical signal.

[0097] The larger the foreign object between the electronic device and the charging base, the larger the gap between the electronic device and the charging base, the greater the intensity of the reflected light detected by the photosensitive device, and the larger the first electrical signal output by the photosensitive device. Therefore, if the first electrical signal is greater than the first threshold, it is determined that the electronic device and the charging base are not in contact. Otherwise, it is determined that the electronic device and the charging base are in contact.

[0098] In addition, considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to the presence of foreign objects, the first electrical signals output by the photosensitive devices in different positions may be different. Therefore, fixedly selecting a certain photosensitive device for photoelectric detection cannot widely adapt to scenarios where foreign objects are sandwiched between the electronic device and the charging base in different directions. For example, taking the electronic device as a smart watch, the different directions involved in this application can refer to the different pointing directions of the hour hand displayed on the smart watch, for example, the 2 o'clock direction, the 12 o'clock direction, etc.

[0099] Therefore, the first electrical signals output by multiple photosensitive devices can be averaged and compared with a first threshold. If the average value is greater than the first threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. Alternatively, the minimum value of the first electrical signals output by multiple photosensitive devices can be taken and compared with the first threshold. If the minimum value is greater than the first threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. This adapts to scenarios where foreign objects are caught between the electronic device and the charging base in different directions.

[0100] Due to the small range change in the angle between the electronic device and the charging base, the degree of change in the first electrical signal is more obvious than the degree of change in the power loss value. Therefore, step S106 has higher detection accuracy when determining whether the electronic device and the charging base are in contact with each other than step S103.

[0101] In order to determine the specific value of the first threshold, the following tests are performed:

[0102] Test 1: During the day, when there is no foreign object between the charging base and the electronic device, the first electrical signal is 1.4253*10^6 (pA).

[0103] Test 2: At night, when there is no foreign object between the charging base and the electronic device, the first electrical signal is 1.3049*10^6 (pA).

[0104] Test 3: During the day, when white paper is placed between the charging base and the electronic device, the first electrical signal is 1.1145*10^6 (pA).

[0105] Test 4: During the day, when there is no foreign object between the charging base and the electronic device and the recessed structure of the charging base is dotted black, the first electrical signal is 1.1012*10^6 (pA).

[0106] Test 5: During the day, when there is no foreign object between the charging base and the electronic device and half of the recessed structure of the charging base is painted black, the first electrical signal is 9.2520*10^5 (pA).

[0107] Test 6: During the day, when there is no foreign object between the charging base and the electronic device and the recessed structure of the charging base is completely black, the first electrical signal is 3.1869*10^5 (pA).

[0108] Test 7: During the day, when a screw was inserted between the charging base and the electronic device, the first electrical signal was 4.8574*10^7 (pA).

[0109] Test 8: During the day, when a metal sheet is inserted between the charging base and the electronic device, the first electrical signal is 1.7608*10^7 (pA).

[0110] Test 9: During the day, when an iron wire is inserted between the charging base and the electronic device, the first electrical signal is 8.1763*10^6 (pA).

[0111] From the above test results, it can be seen that for tests 1-4, the first electrical signals belong to the same order of magnitude and have similar values. Tests 1-4 belong to the scenario where the electronic device is fitted with the charging base. For tests 5-6, when the recessed structure of the charging base is half painted black or completely painted black, the first electrical signals of tests 5-6 are one order of magnitude lower than the first electrical signals of tests 1-4. Tests 5-6 also belong to the scenario where the electronic device is fitted with the charging base. For tests 7-9, the first electrical signals of tests 7-9 are one order of magnitude higher than the first electrical signals of tests 1-4. Tests 7-9 belong to the scenario where the electronic device is not fitted with the charging base. Therefore, the value of the first threshold can be between the following two values: the maximum value of the first electrical signal in the scenario where the electronic device is fitted with the charging base, and the minimum value of the first electrical signal in the scenario where the electronic device is not fitted with the charging base. For example, the value of the first threshold can be 4*10^6 (pA).

[0112] Additionally, as shown in FIG10 , if the electronic device is determined to be improperly seated on the charging base, the processor controls the display screen to display a prompt message, which informs the user that the electronic device and the charging base are improperly seated. For example, the processor controls the display screen to display "Please ensure there are no metal objects between the watch and the charging device to avoid affecting normal charging." The processor can also control the display screen to display the current battery level 91 (e.g., 4%) of the electronic device and a charging icon 92.

[0113] As shown in FIG11 , if it is determined that the electronic device is in contact with the charging base, the processor controls the display screen to display the current power level 91 , the charging icon 92 , and the current time 93 .

[0114] S107: The processor controls the first charging chip to communicate with the charging base, and instructs the charging base to stop charging.

[0115] For wired charging, the processor controls the first charging chip to communicate with the charging base through the first spring pin interface, and instructs the charging base to stop charging.

[0116] For wireless charging, according to the Qi wireless charging protocol, the processor can control the first charging chip to send a stop charging message to the charging base through the first coil, where the stop charging message is used to instruct the charging base to stop charging.

[0117] The embodiments of the present application provide a fit detection method, an electronic device, and a charging system. When charging, the light-emitting device and the photosensitive device are located on the surface of the electronic device facing the charging base. When a foreign object is inserted between the charging base and the electronic device, the charging base and the electronic device will not fit together, the gap between the charging base and the electronic device will become larger, and more ambient light and light emitted by the light-emitting device will be reflected to the photosensitive device through the gap, so that the light intensity detected by the photosensitive device becomes larger, and the electrical signal output by the photosensitive device also becomes larger. Therefore, when the charging base is charging the electronic device, the light-emitting device is controlled to emit light, and the photosensitive device is controlled to perform photoelectric detection and output a first electrical signal. Based on the size of the first electrical signal, it is determined whether the charging base and the electronic device fit together, thereby determining whether a foreign object is inserted between the charging base and the electronic device.

[0118] In addition, considering that the luminous intensity of the light-emitting devices of electronic devices is constant, the intensity of ambient light is greatly affected by environmental factors, such as day and night, indoor lights on and indoor lights off, indoors and outdoors, etc., the intensity of ambient light varies greatly, so ambient light is a kind of interference for fit detection.

[0119] Therefore, another fitting detection method of the present application is to control the light-emitting device to emit light or not when the charging base is charging the electronic device, and to control the photosensitive device to perform photoelectric detection to output a first electrical signal and a second electrical signal. The first electrical signal refers to the electrical signal output by the photosensitive device when the light-emitting device emits light, and the first electrical signal indicates the sum of the intensities of the reflected light and the ambient light. The second electrical signal refers to the electrical signal output by the photosensitive device when the light-emitting device does not emit light, and the second electrical signal indicates the intensity of the ambient light. The first electrical signal and the second electrical signal are subtracted to obtain a third electrical signal, and the third electrical signal indicates the intensity of the reflected light after filtering out the ambient light. The size of the third electrical signal is used to determine whether the charging base and the electronic device are fitted together, that is, to determine whether a foreign object is sandwiched between the charging base and the electronic device. This fitting detection method eliminates the interference of ambient light, so the detection is more accurate.

[0120] Therefore, in step S104 shown in FIG8 , the processor controls the light-emitting device to emit light and not emit light. For example, the processor performs the control of the light-emitting device to emit light and not emit light a preset number of times (e.g., once). Alternatively, the processor controls the light-emitting device to emit light periodically so that the bonding test can be continuously performed during the charging process. Alternatively, the processor controls the light-emitting device to emit light periodically within a preset time after the start of charging, which has lower power consumption. For details, please refer to the description of S104 and will not be repeated here.

[0121] In step S105 shown in Figure 8, the processor also performs photoelectric detection via the photosensitive device to obtain a second electrical signal. The second electrical signal is the electrical signal output by the photosensitive device when the light-emitting device is not emitting light. When the light-emitting device is not emitting light, photoelectric detection via the photosensitive device is essentially photoelectric detection of ambient light, and the second electrical signal indicates the intensity of the ambient light. The larger the foreign object caught between the electronic device and the charging base, and the larger the gap between the electronic device and the charging base, the greater the intensity of the ambient light detected by the photosensitive device, and the larger the second electrical signal output by the photosensitive device.

[0122] When the light-emitting device emits light, the photoelectric detection performed by the photosensitive device essentially performs photoelectric detection on the ambient light plus the reflected light (light from the light-emitting device reflected by the charging base). The first electrical signal indicates the intensity of the combined ambient light and reflected light. The larger the foreign object caught between the electronic device and the charging base, and the larger the gap between the electronic device and the charging base, the greater the intensity of the ambient light and reflected light detected by the photosensitive device, and the larger the first electrical signal output by the photosensitive device.

[0123] In step S106 shown in FIG8 , the processor determines whether the electronic device is properly attached to the charging base based on the first and second electrical signals. For example, the processor subtracts the first and second electrical signals obtained from a photosensitive device to obtain a third electrical signal corresponding to the photosensitive device. The third electrical signal indicates the intensity of reflected light after filtering out ambient light. The processor then determines whether the electronic device is properly attached to the charging base based on the third electrical signal.

[0124] As previously mentioned, the larger the foreign object sandwiched between the electronic device and the charging base, and the larger the gap between the electronic device and the charging base, the greater the intensity of the reflected light detected by the photosensitive device. Therefore, if the third electrical signal is greater than the second threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. Since the first threshold is used for comparison with the first electrical signal and the second threshold is used for comparison with the third electrical signal, and the third electrical signal is less than the first electrical signal, the second threshold is less than or equal to the first threshold. For example, the value of the second threshold can be 3.8*10^6 (pA).

[0125] Furthermore, considering that multiple photosensitive devices are arranged in a ring around two light-emitting devices in this application, when the electronic device and the charging base are not in contact due to a foreign object being caught between them, the charging base will reflect the reflected light at different angles for the photosensitive devices at different positions, resulting in different first and second electrical signals detected by different photosensitive devices. Therefore, the third electrical signals corresponding to different photosensitive devices are also different. Therefore, fixedly selecting a single photosensitive device for photoelectric detection cannot widely adapt to scenarios where foreign objects are caught between the electronic device and the charging base at different directions.

[0126] Therefore, the third electrical signals corresponding to multiple photosensitive devices can be averaged and compared with the second threshold. If the average value is greater than the second threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. Alternatively, the minimum value of the third electrical signals corresponding to multiple photosensitive devices can be taken and compared with the second threshold. If the minimum value is greater than the second threshold, it is determined that the electronic device and the charging base are not in contact; otherwise, it is determined that the electronic device and the charging base are in contact. This adapts to scenarios where foreign objects are caught between the electronic device and the charging base in different directions.

[0127] When a foreign object is inserted between the charging base and the electronic device, the charging base and the electronic device may not fit together properly. The gap between the two devices increases, and more ambient light and light emitted by the light-emitting device are reflected through the gap to the photosensitive device, increasing the light intensity detected by the photosensitive device and the first electrical signal output by the photosensitive device. Therefore, when the charging base is charging the electronic device, the light-emitting device is controlled to emit light, and the photosensitive device is controlled to perform photoelectric detection and output a first electrical signal. Based on the magnitude of the first electrical signal, it is determined whether the charging base and the electronic device are in contact with each other, and thus whether a foreign object is inserted between the charging base and the electronic device.

[0128] In the embodiments of the present application, the fit detection method, electronic device, and charging system provided herein are configured such that, when charging, the light-emitting device and the photosensitive device are located on the surface of the electronic device facing the charging base. If a foreign object becomes trapped between the charging base and the electronic device, the charging base and the electronic device may not fit together properly, increasing the gap between them. This increases the amount of ambient light and light emitted by the light-emitting device, which is reflected through the gap and onto the photosensitive device. This increases the intensity of the light detected by the photosensitive device and the first electrical signal output by the photosensitive device. The intensity of the light emitted by the photosensitive device is constant, while the intensity of ambient light is significantly affected by environmental factors, making ambient light a source of interference for fit detection. Therefore, when the charging base is charging the electronic device, the light-emitting device is controlled to emit and not emit light, and the photosensitive device is controlled to perform photoelectric detection to output a first electrical signal and a second electrical signal. The first electrical signal is the electrical signal output by the photosensitive device when the light-emitting device is emitting light, indicating the sum of the intensities of the reflected light and the ambient light. The second electrical signal is the electrical signal output by the photosensitive device when the light-emitting device is not emitting light, indicating the intensity of the ambient light. A third electrical signal is obtained by subtracting the first electrical signal from the second electrical signal. The third electrical signal indicates the intensity of the reflected light after filtering out the ambient light. The magnitude of the third electrical signal is used to determine whether the charging base and the electronic device are in contact with each other, that is, to determine whether a foreign object is caught between the charging base and the electronic device.

[0129] An embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps performed by the electronic device in the above-mentioned method embodiment, such as executing the method shown in Figure 8.

[0130] An embodiment of the present application also provides a computer program product including instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps performed by the electronic device in the above-mentioned method embodiment, such as executing the method shown in Figure 8.

[0131] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not 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.

[0132] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more media that can be integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0133] 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 a fit, characterized in that: Applied to an electronic device, the electronic device includes: a charging chip, a light-emitting device and a photosensitive device; the light-emitting device and the photosensitive device are located on the surface of the electronic device, and the method includes: Controlling the charging chip to detect that the electronic device is charged through a charging base; wherein the charging base is close to a surface of the electronic device having the light emitting device and the light sensing device; controlling the light emitting device to emit light; Performing photoelectric detection by the photosensitive device to obtain a first electrical signal; It is determined whether the electronic device is in contact with the charging base according to the first electrical signal.

2. The method according to claim 1, characterized in that The determining, based on the first electrical signal, whether the electronic device is in contact with the charging base includes: If the first electrical signal is greater than a first threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

3. The method according to claim 1, characterized in that There are multiple photosensitive devices, and the multiple photosensitive devices are arranged in a ring around the light-emitting device. The determining whether the electronic device is in contact with the charging base based on the first electrical signal includes: An average value is calculated for the first electrical signals output by the plurality of photosensitive devices. If the average value is greater than a first threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

4. The method according to claim 1, wherein There are multiple photosensitive devices, and the multiple photosensitive devices are arranged in a ring around the light-emitting device. The determining whether the electronic device is in contact with the charging base based on the first electrical signal includes: The minimum value of the first electrical signals output by the plurality of photosensitive devices is taken. If the minimum value is greater than a first threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

5. The method according to claim 1, characterized in that The method further includes: controlling the light emitting device to not emit light; performing photoelectric detection by the light sensing device to obtain a second electrical signal; The determining whether the electronic device is in contact with the charging base based on the first electrical signal includes: obtaining a third electrical signal by subtracting the first electrical signal from the second electrical signal; and determining whether the electronic device is in contact with the charging base based on the third electrical signal.

6. The method according to claim 5, characterized in that The determining, based on the third electrical signal, whether the electronic device is in contact with the charging base includes: If the third electrical signal is greater than the second threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

7. The method according to claim 5, characterized in that There are multiple photosensitive devices, and the multiple photosensitive devices are arranged in a ring around the light-emitting device. The determining whether the electronic device is in contact with the charging base based on the third electrical signal includes: An average value is obtained for the third electrical signals corresponding to the plurality of photosensitive devices. If the average value is greater than a second threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

8. The method according to claim 5, characterized in that There are multiple photosensitive devices, and the multiple photosensitive devices are arranged in a ring around the light-emitting device. The determining whether the electronic device is in contact with the charging base based on the third electrical signal includes: The minimum value of the third electrical signals corresponding to the plurality of photosensitive devices is taken. If the minimum value is greater than a second threshold, it is determined that the electronic device is not attached to the charging base; otherwise, it is determined that the electronic device is attached to the charging base.

9. The method according to any one of claims 1 to 8, characterized in that Before controlling the light-emitting device to emit light, the method further includes: The charging chip is controlled to communicate with the charging base to determine that the charging base is a matching charging base.

10. The method according to any one of claims 1 to 9, characterized in that The controlling the light emitting device to emit light comprises: Obtaining a charging power loss value through the charging chip, where the charging power loss value refers to the difference between the charging power output by the charging base and the charging power input by the charging chip; If the power loss value is less than a preset loss threshold, the light emitting device is controlled to emit light.

11. The method according to claim 10, characterized in that The method further comprises: If the power loss value is greater than or equal to the preset loss threshold, the charging chip is controlled to communicate with the charging base to instruct the charging base to stop charging.

12. The method according to any one of claims 1 to 11, characterized in that The electronic device further includes a display screen, and the method further includes: If it is detected that the electronic device is not in contact with the charging base, the display screen is controlled to display a prompt message, where the prompt message is used to prompt a user that the electronic device is not in contact with the charging base.

13. An electronic device, characterized in that: The electronic device comprises a charging chip, a light-emitting device, a photosensitive device, a processor and a memory, wherein the memory stores instructions. When the processor executes the instructions, the method according to any one of claims 1 to 12 is performed; the processor is used to control the charging chip to detect that the electronic device is charged through the charging base, control the light-emitting device to emit light, and perform photoelectric detection through the photosensitive device to obtain an electrical signal.

14. A charging system, characterized in that: The electronic device comprises a charging base and the electronic device as claimed in claim 13, wherein the charging base is used to charge the electronic device.

15. A computer-readable storage medium, characterized in that The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Wireless charging device employing laser

    CN105048647A

  • Foreign substance examination processing device for transmitting coil plane of wireless charging system

    CN108855999A

  • Wireless electric energy transmission system for realizing feedback and foreign matter detection based on optical signal

    CN113555977A

  • Foreign matter detection method, foreign matter detection device and storage medium

    CN113972751A

  • To-be-charged equipment, electronic equipment, charging method and device

    CN114509932A