[go: up one dir, main page]

CN116203307B - Terminal Type-C interface foreign object detection method, device and storage medium - Google Patents

Terminal Type-C interface foreign object detection method, device and storage medium Download PDF

Info

Publication number
CN116203307B
CN116203307B CN202310187918.0A CN202310187918A CN116203307B CN 116203307 B CN116203307 B CN 116203307B CN 202310187918 A CN202310187918 A CN 202310187918A CN 116203307 B CN116203307 B CN 116203307B
Authority
CN
China
Prior art keywords
terminal
current data
data
current
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310187918.0A
Other languages
Chinese (zh)
Other versions
CN116203307A (en
Inventor
王浩
皇甫安军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Yuning Technology Group Co., Ltd.
Original Assignee
Wuxi Yuning Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Yuning Intelligent Technology Co ltd filed Critical Wuxi Yuning Intelligent Technology Co ltd
Priority to CN202310187918.0A priority Critical patent/CN116203307B/en
Publication of CN116203307A publication Critical patent/CN116203307A/en
Application granted granted Critical
Publication of CN116203307B publication Critical patent/CN116203307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/165Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values
    • G01R19/16533Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values characterised by the application
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

本申请提供一种终端Type‑C接口异物检测方法、装置及存储介质,通过采集终端充电通路上的消耗电流数据和充电器端的输出电流数据,计算输出电流和消耗电流的电流差值,从而判断充电通路上是否存在额外电流消耗;在电流差值大于预设差值阈值时,可以判断充电通路上存在额外电流消耗,而产生额外电流消耗的原因则可能是因为异物消耗,所以,此时可以判定终端与充电器端之间的接口存在异物,导致异常漏电,从而实现对终端Type‑C接口异物的检测。

This application provides a terminal Type-C interface foreign matter detection method, device and storage medium. By collecting the consumption current data on the terminal charging path and the output current data on the charger end, the current difference between the output current and the consumption current is calculated, thereby judging Whether there is extra current consumption on the charging path; when the current difference is greater than the preset difference threshold, it can be judged that there is extra current consumption on the charging path, and the reason for the extra current consumption may be due to the consumption of foreign matter, so at this time you can It is determined that there is foreign matter in the interface between the terminal and the charger, resulting in abnormal current leakage, thereby realizing the detection of foreign matter in the Type-C interface of the terminal.

Description

Terminal Type-C interface foreign matter detection method, device and storage medium
Technical Field
The application relates to the technical field of terminals, in particular to a method and a device for detecting foreign matters on a terminal Type-C interface and a storage medium.
Background
Type-C is widely used as a general interface specification of equipment, the spacing of the pins of the interface is smaller and smaller than 0.3mm, the bearing power is larger, the maximum voltage reaches 20V, and the maximum current reaches 5A.
Because the stitch interval of Type-C interface is little, and bearing power is big, so if there is foreign matter (electric conductor such as water, mud, metal piece etc.) overlap joint stitch in the interface, the incident such as fever, burning even deflagration easily causes. Therefore, how to detect foreign matters on the Type-C interface of the terminal is a technical problem to be solved.
Disclosure of Invention
The application provides a method, a device and a storage medium for detecting foreign matters in a terminal Type-C interface, and aims to timely detect the foreign matters in the terminal Type-C interface.
In a first aspect, the application provides a terminal Type-C interface foreign matter detection method, which is applied to a terminal Type-C interface charging system, wherein the terminal Type-C interface charging system comprises a terminal and a charger end;
the terminal Type-C interface foreign matter detection method comprises the following steps:
based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging communication path;
based on the configuration channel, the terminal inquires output current data of the charger end in real time;
calculating a current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
and when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger terminal.
In a second aspect, the application further provides a terminal Type-C interface foreign matter detection device, terminal Type-C interface foreign matter detection device includes:
the terminal is used for reading the consumption current data on the charging channel;
the output current data reading module is used for inquiring output current data of the charger end in real time based on the configuration channel;
the current difference calculation module is used for calculating the current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
and the interface abnormality judging module is used for determining that abnormal electric leakage exists between the terminal and the interface of the charger terminal when the current difference value is larger than a preset difference value threshold value.
In a third aspect, the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, where the computer program, when executed by a processor, implements the steps of the terminal Type-C interface foreign object detection method as described above.
The application provides a method, a device and a storage medium for detecting foreign matters on a terminal Type-C interface, wherein the method comprises the steps that based on a current data reading instruction sent by a terminal main control, the terminal reads consumption current data on a charging path; based on the configuration channel, the terminal inquires output current data of the charger end in real time; calculating a current difference between the terminal and the charger terminal based on the consumption current data and the output current data; and when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger terminal. By the mode, the current difference value between the output current and the consumption current is calculated by collecting the consumption current data of the charging path of the terminal and the output current data of the charger end, so that whether the charging path has extra current consumption is judged; when the current difference is larger than a preset difference threshold, it can be judged that extra current consumption exists on the charging path, and the reason for the extra current consumption is probably due to foreign matter consumption, so that it can be judged that foreign matters exist at the interface between the terminal and the charger end, abnormal leakage is caused, and therefore detection of foreign matters at the terminal Type-C interface is achieved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a terminal Type-C interface foreign matter detection system provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a first embodiment of a method for detecting foreign matters on a Type-C interface of a terminal according to the present application;
fig. 3 is a schematic diagram of current consumption of a charging circuit with foreign matters according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a current detection structure inside a charger according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a second embodiment of a method for detecting foreign matters on a Type-C interface of a terminal provided in the present application;
fig. 6 is a flowchart of a third embodiment of a method for detecting foreign matters on a Type-C interface of a terminal according to the present application;
fig. 7 is a schematic block diagram of a terminal Type-C interface foreign matter detection device provided in an embodiment of the present application;
fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
The embodiment of the application provides a terminal Type-C interface foreign matter detection method, a terminal Type-C interface foreign matter detection device and a storage medium, which are used for detecting the terminal Type-C interface foreign matter.
As shown in fig. 1, fig. 1 is a terminal Type-C interface foreign matter detection system provided in an embodiment of the present application, where the system includes a terminal and a charger end, and the terminal is in communication connection with the charger end.
When the terminal is in communication connection with the charger end, mutual data transmission can be achieved.
The terminal comprises electronic equipment such as a mobile phone, a tablet personal computer, a notebook computer, a desktop computer, a personal digital assistant, wearable equipment and the like.
Hereinafter, a method for detecting foreign matters on the terminal Type-C interface provided in the embodiment of the present application will be described in detail based on the foreign matters detection system on the terminal Type-C interface.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a method for detecting foreign matters on a Type-C interface of a terminal according to the present application. The terminal Type-C interface foreign matter detection method can be used in a terminal Type-C interface foreign matter detection system.
As shown in fig. 2, the terminal Type-C interface foreign matter detection method includes steps S101 to S105.
Step S101, based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging path;
in this embodiment, in the charging process of the terminal, the terminal main control of the terminal sends a current data reading instruction to the control unit of the power management module of the terminal, so as to read the consumption current data on the charging path.
In an embodiment, as shown in fig. 3, fig. 3 is a schematic diagram of current consumption of a charging circuit with foreign matters according to an embodiment of the present application. Wherein, the charging head output current is IBUS, the charging path consumption current is ICHG, and the foreign matter consumption current is IFOD.
In one embodiment, as shown in fig. 3, the output current IBUS at the charger end is the sum of the charging input current ICHG and the foreign object current branch IFOD, so that if the current IBUS and the current ICHG have a positive difference, the foreign object can be qualitatively present, and the severity of the foreign object is quantified according to the difference, and the foreign object is provided to the terminal for detection and safety decision.
In one embodiment, the terminal master control sends get_cur_ichg instructions to the control unit of the power management module through the I2C, the control unit reads the Ichg data measured by the current sampling circuit on the chg_vin path in the power management module, and then the control unit sends the Ichg data to the terminal master control through the I2C, so that the terminal master control detects the input current Ichg of the power management module in real time through the "control/data" link I2C.
Step S102, based on the configuration channel, the terminal inquires output current data of a charger end in real time;
in this embodiment, the terminal master control queries the output current IBUS of the charger terminal in real time through the configuration channel (CC channel, configuration Channel) of Type-C.
In an embodiment, as shown in fig. 4, fig. 4 is a schematic diagram of a current detection structure inside a charger according to an embodiment of the present application. Wherein, the inside of the charger end comprises current measurement, power supply control and CC communication. Wherein, CC1 or CC2 (CC channel) is responsible for the master control communication with the terminal.
In one embodiment, the communication of the CC1 or CC2 ports complies with the PDR3 specification of the USB IF, and the data packets are half duplex communication, and the data packets include a preamble, a packet control code, and an information code. The information code is defined and provided by a protocol layer and adopts 4B/5B encoding and decoding, the packet control code is provided by a physical layer and adopts 4B/5B encoding and decoding, the synchronous code is provided by the physical layer, and finally the whole data packet is encoded and decoded by a BMC encoding and decoding unit (BMC En/decoding) and then transmitted through CC1 or CC 2.
In one embodiment, the 4B/5B code is one of the line layer code types in hundred megaEthernet (i.e., fast Ethernet), which is a 5bit binary number representing a 4bit binary number. The coding is characterized in that each 4 bits of the data stream to be transmitted is used as a group, and then the data stream is converted into a corresponding 5bit code according to a 4B/5B coding rule. The 5bit codes have 32 combinations in total, but only 16 of them are employed, corresponding to 16 of the 4bit codes, and the other 16 are either unused or used as control codes to indicate the start and end of a frame, the status of the fiber line (stationary, idle, suspended), etc.
In one embodiment, the charger device internally powers the interior through the higher of the voltages in VBUS (usb charging port) and VBAT (battery). When the voltage of VBUS rises above the v_bus_uvloz value or the voltage of VBAT exceeds the v_bat_uvloz value, the sleep comparator, the battery depletion comparator and the BAT drive are active, the i2C interface is ready to communicate, and all registers are reset to default values. After the POR, the host can access all registers.
In one embodiment, the CC channel serves as configuration channel, which plays a significant role in all of the various modes of USB Type-C-Normal, PD, ALT, access-including: insert detection, identify cable direction, negotiate between two ports to establish DFP and UFP identities, discover and configure VBUS, current mode or PD mode, configure Vconn, discover and configure other peripheral mode-alternate (alt) and peripheral (access) modes.
Step S103, calculating the current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
in this embodiment, after receiving the output current data sent by the charger end, the terminal master control of the terminal may determine the corresponding consumption current data according to the synchronization code, so as to calculate a current difference between the consumption current data and the output current data.
In an embodiment, when the current difference is smaller than the preset difference threshold, the current loss is considered to be in a normal range, and it is determined that the charging interface between the terminal and the charger terminal is normal and free of foreign matters, and the charging interface is in a normal charging process.
Step S104, when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger end.
In an embodiment, when the current difference between the consumption current data and the output current data is greater than the preset difference threshold, the extra current consumption is out of the normal range at this time, which is considered to be caused by the foreign object consumption current, so that it can be determined that there is abnormal leakage at the interface, that is, that there is foreign object at the interface.
The embodiment provides a terminal Type-C interface foreign matter detection method, which comprises the steps that based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging path; based on the configuration channel, the terminal inquires output current data of the charger end in real time; calculating a current difference between the terminal and the charger terminal based on the consumption current data and the output current data; and when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger terminal. Calculating the current difference value of the output current and the consumption current by collecting the consumption current data of the charging channel of the terminal and the output current data of the charger end, so as to judge whether the charging channel has extra current consumption; when the current difference is larger than a preset difference threshold, it can be judged that extra current consumption exists on the charging path, and the reason for the extra current consumption is probably due to foreign matter consumption, so that it can be judged that foreign matters exist at the interface between the terminal and the charger end, abnormal leakage is caused, and therefore detection of foreign matters at the terminal Type-C interface is achieved.
Referring to fig. 5, fig. 5 is a flowchart of a second embodiment of a method for detecting foreign matters on a Type-C interface of a terminal according to the present application.
Based on the embodiment shown in fig. 2, in this embodiment, the step S102 specifically includes:
step S201, based on the configuration channel, a query data packet is sent to a control unit of the charger end;
step S202, based on the query data packet, the control unit at the charger end reads the output current data acquired by the current sensing unit in real time;
in this embodiment, the terminal main control of the terminal sends a GetPwrCur (control code CtrlMSG) data packet to the control unit (Digital Control Logic) at the charger end through the CC channel, and the control unit reads data of the Current sensing unit (Current Sense), that is, outputs Current data, through the internal analog differential signal channel.
In one embodiment, the current sensing unit is capable of collecting current data of a charging head output power supply (VBUS) in real time.
In one embodiment, differential transmission is a signal transmission technique, and is distinguished from conventional one signal line and one ground line, in that differential transmission transmits signals on both lines, and the two signals have the same amplitude and opposite phases. The transmitted signals on these two wires are differential signals. The signal receiving end compares the difference value of the two voltages to judge the logic state sent by the sending end. On a circuit board, the differential trace must be two wires of equal length, equal width, in close proximity and at the same level. The control unit and the current sensing unit realize simultaneous data transmission, so that the output current data is acquired and transmitted in real time.
Step 203, based on the output current data, the charger end generates a current data packet, and based on the configuration channel, sends the current data packet to the terminal.
In one embodiment, the current data packet includes an information code, a synchronization code, and a packet control code.
In an embodiment, the generating, by the charger side, a current data packet based on the output current data includes:
encoding the output current data into at least one encoded current data based on a preset data encoding rule;
generating a target information code based on the encoded current data and an additional control code;
and generating the current data packet based on the target information code, the synchronous code and the packet control code.
In an embodiment, the preset data encoding rule is a count encoding rule of 10bit data.
In one embodiment, after the control unit at the charger end reads the data of the sensing unit, 10mA per bit is used for counting and encoding 10 bits of data, an additional control code is added based on the 10 bits of data to generate a 32bit information code, and then a synchronous code and a packet control code are added to encapsulate the data into a CurDataDataMSG data packet, namely a current data packet.
In one embodiment, the core data of the CurData (data code DataMSG) packet is 10bit current data code, for example, the actual IBUS is 1810mA, then the 10bit data is 00 1011 0101, the corresponding decimal data is 181, and the current data is 10mA/bit, namely 1810mA.
In one embodiment, the encapsulation process of the data includes data processing in terms of an application layer, a transport layer, a network layer, a data link layer, and a physical layer. At the application layer, the data is translated into voice-binary coded data used in the network world; at the transport layer, the upper layer data is split into small data segments and the TCP message header is encapsulated for each segmented data. The TCP header has a key field information-port number, which is used for identifying an upper layer protocol or application program and ensuring the normal communication of upper layer application data; at the network layer, the upper layer data is encapsulated with a new message header, namely an IP header; at the data link layer, the upper layer data is encapsulated with a MAC header, and the inside of the MAC header is provided with key field information, namely a MAC address; the physical layer converts the bit stream of these binary digits into an electrical signal for transmission in the network.
In an embodiment, after the charger end generates the current data packet, the data packet is sent to the main control of the terminal through CC1 or CC2 (CC channel), the main control receives and analyzes the received data according to the reverse processing of the data packet encapsulation, so that the main control of the terminal reads the 10bit current data of the charging end, and finally generates the output current data IBUS of the charging end.
Referring to fig. 6, fig. 6 is a flowchart of a third embodiment of a method for detecting foreign matters on a Type-C interface of a terminal according to the present application.
Based on the embodiment shown in fig. 2, in this embodiment, the step S104 specifically includes:
step 301, when the current difference value is detected to be greater than the preset difference value threshold value, based on a preset period, the consumption current data and the output current data are collected again, and the current difference value is calculated;
step S302, when the number of times that the current difference value is larger than the preset difference value threshold reaches the preset number of times within the preset duration, determining that abnormal electric leakage exists at the interface between the terminal and the charger end.
In an embodiment, after obtaining consumption current data and output current data and calculating to obtain a current difference value, when the current difference value (i.e. IFOD) of the two data is in a reasonable range, the terminal master control detects and judges that the interface state is safe and normal; when the charger end data IBUS is larger than the terminal data ICHG and reaches a threshold value, the terminal main control immediately judges that the interface has abnormal electric leakage.
In an embodiment, in order to ensure that the data is reliable, the terminal main control can collect batch data at a high speed, ensure consistency and validity of all the data, further identify that the data is reliable and effective, and prevent missing detection and false detection. The detection of foreign matter can be made by periodically making the current detection so as to cover the entire charging process.
In an embodiment, in the process of charging, to avoid excessive data collection, a collection period may be set, and current data may be collected according to the collection period.
In an embodiment, a preset time period may be set, the preset time period is longer than a preset period, at least one output current data and consumption current data are collected in the preset time period, that is, at least one current difference value is obtained through calculation, if the current difference value obtained through calculation of the data collected in the preset time period is greater than a preset difference value threshold value for a preset number of times, it may be determined that abnormal leakage exists in the interface, for example, three current data are collected in the preset time period, and at least two current difference values in the three current data are greater than the preset difference value threshold value, it may be considered that the interface has abnormal leakage.
In an embodiment, when the current difference is detected to be greater than a preset difference threshold, timing may be performed, current data may be collected according to a preset period, and when a duration of the current difference greater than the preset difference threshold reaches a preset duration, abnormal leakage may be considered to exist in the interface.
In an embodiment, after determining that the interface between the terminal and the charger terminal has abnormal leakage when the current difference is greater than a preset difference threshold, the method further includes: and the terminal main control interrupts the charging process and sends an alarm signal so as to display an alarm to a user through the terminal.
In one embodiment, when it is determined that an abnormal leakage exists in the interface, the terminal master control rapidly closes the charging process, and simultaneously the system starts the terminal screen popup window, the warning tone, the indicator lamp, and the like, and the master control simultaneously notifies the control unit of the charging terminal to close the power FET (PWR FET) through the PwrCtrl (CtrlMsg) data packet of the CC, and cuts off the VBUS output.
The following describes a specific implementation principle of the foreign matter detection method for the terminal Type-C interface provided by the present application through a specific embodiment.
In a specific embodiment, referring to the embodiment shown in fig. 2, step S102 is further described in detail in this specific embodiment, and specifically, the implementation steps of the method for detecting a foreign object on a Type-C interface of a terminal provided in the present application are as follows:
step S101, based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging path;
in this embodiment, the terminal master control of the terminal sends a get_cur_ichg instruction to the control unit of the power management module through the I2C, the control unit of the terminal reads the Ichg data measured by the current sampling circuit on the chg_vin path in the power management module, and then the control unit of the terminal sends the Ichg data to the terminal master control through the I2C, so that the terminal master control detects the input current Ichg of the power management module in real time through the "control/data" link I2C, that is, the terminal reads the consumption current data collected in real time on the charging path.
Step S102, based on the configuration channel, the terminal inquires output current data of a charger end in real time;
further, the step S102 specifically includes:
based on the configuration channel, the terminal sends a data query instruction to the charger end;
based on the data query instruction, the control unit at the charger end reads the output current data acquired by the current sensing unit through an internal analog differential signal channel;
based on the control unit of the charger end, counting and encoding the output current data to generate encoded data;
packaging and generating the current data packet based on the coded data, the synchronous code and the packet control code;
based on the configuration channel, the charger end sends the current data packet to the terminal, and decodes the current data packet based on terminal main control of the terminal, so that the terminal obtains the output current data;
meanwhile, the terminal master control of the terminal inquires the output current IBUS of the charger end in real time through CC (Configuration Channel) communication of Type-C, and is responsible for communication with the master control of the terminal with reference to fig. 3 and 4, CC1 or CC2 (CC channel).
The terminal main control of the terminal sends a GetPwrCur (control code CtrlMSG) data packet to a control unit (Digital Control Logic) at the charger end through a CC channel, the control unit at the charger end reads data of a Current sensing unit (Current Sense) through an internal analog differential signal channel, and the Current sensing unit can acquire Current data of a charging head output power supply (VBUS), namely output Current data at the charger end in real time.
After the control unit at the charger end reads the data of the sensing unit, 10mA per bit is used for counting and encoding 10 bits of data, an additional control code is added to generate a 32bit information code based on the 10bit data, and then a synchronous code and a packet control code are added to encapsulate the data into a CurData (data code DataMSG) data packet.
And then the charger end sends the data packet to the terminal main control of the terminal through the CC1 or the CC2 (CC channel), the terminal main control of the terminal receives and analyzes the received data according to the reverse processing of the data packet encapsulation, so that the main control of the terminal reads the 10bit current data of the charging end and finally generates the output current data IBUS of the charging end.
Step S103, calculating the current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
the output current data IBUS at the charger end is the sum of the charging input current ICHG and the foreign matter current branch IFOD, so that if the current of IBUS and the current of ICHG have a positive difference, the foreign matter can be qualitatively present, the severity of the foreign matter is quantified according to the difference, and the foreign matter is provided for the terminal to detect the foreign matter and make a safety decision.
Step S104, when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger end.
After obtaining consumption current data and output current data and calculating to obtain a current difference value, when the current difference value (i.e. IFOD) of the two data is in a reasonable range, the terminal main control detects and judges that the interface state is safe and normal; when the charger end data IBUS is larger than the terminal data ICHG and reaches a threshold value, the terminal main control immediately judges that the interface has abnormal electric leakage.
When the interface is judged to have abnormal electric leakage, the terminal main control rapidly closes the charging process, meanwhile, the system starts a terminal screen popup window, warning sounds, indicator lights and the like, and the main control informs a control unit of the charging end to close a power FET (PWR FET) through a PwrCtrl (CtrlMsg) data packet of the CC, and cuts off VBUS output.
Referring to fig. 7, fig. 7 is a schematic block diagram of a terminal Type-C interface foreign matter detection device provided in an embodiment of the present application. The terminal Type-C interface foreign matter detection device is used for executing the terminal Type-C interface foreign matter detection method. The terminal Type-C interface foreign matter detection device can be configured in a terminal.
As shown in fig. 7, the terminal Type-C interface foreign matter detection device 300 includes: a consumption current data reading module 301, an output current data reading module 302, a current difference calculation module 303, and an interface abnormality judgment module 304.
A current consumption data reading module 301, configured to read current consumption data on a charging path based on a current data reading instruction sent by a terminal main control;
the output current data reading module 302 is configured to query output current data of the charger end in real time based on the configuration channel;
a current difference calculation module 303, configured to calculate a current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
and the interface abnormality judging module 304 is configured to determine that abnormal leakage exists between the terminal and the interface of the charger terminal when the current difference is greater than a preset difference threshold.
In an embodiment, the output current data reading module 302 is further configured to send a query packet to the control unit of the charger end based on the configuration channel; based on the query data packet, the control unit at the charger end reads the output current data acquired by the current sensing unit in real time; and generating a current data packet by the charger terminal based on the output current data, and sending the current data packet to the terminal based on the configuration channel.
In one embodiment, the current data packet includes an information code, a synchronization code, and a packet control code.
In an embodiment, the output current data reading module 302 is further configured to encode the output current data into at least one encoded current data based on a preset data encoding rule; generating a target information code based on the encoded current data and an additional control code; and generating the current data packet based on the target information code, the synchronous code and the packet control code.
In an embodiment, the preset data encoding rule is a count encoding rule of 10bit data.
In an embodiment, the interface abnormality determination module 304 is further configured to, when detecting that the current difference is greater than the preset difference threshold, re-collect the consumption current data and the output current data based on a preset period, and calculate the current difference; and when the times that the current difference value is larger than the preset difference value threshold value reach the preset times within the preset duration, determining that abnormal electric leakage exists at the interface between the terminal and the charger end.
In an embodiment, the terminal Type-C interface foreign matter detection device 300 further includes an anomaly alarm module, configured to interrupt the charging process by the terminal master control, and send an alarm signal to display an alarm to a user through the terminal.
It should be noted that, for convenience and brevity of description, specific working processes of the above-described apparatus and each module may refer to corresponding processes in the foregoing embodiment of the terminal Type-C interface foreign matter detection method, which are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a terminal.
With reference to FIG. 8, the computer device includes a processor, memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions which, when executed, cause the processor to perform any one of the terminal Type-C interface foreign object detection methods.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in the non-volatile storage medium, which when executed by the processor, causes the processor to perform any one of the terminal Type-C interface foreign object detection methods.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging communication path;
based on the configuration channel, the terminal inquires output current data of the charger end in real time;
calculating a current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
and when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger terminal.
In an embodiment, when the processor implements the configuration channel, the terminal queries output current data of the charger in real time, and is configured to implement:
based on the configuration channel, sending a query data packet to a control unit of the charger end;
based on the query data packet, the control unit at the charger end reads the output current data acquired by the current sensing unit in real time;
and generating a current data packet by the charger terminal based on the output current data, and sending the current data packet to the terminal based on the configuration channel.
In one embodiment, the current data packet includes an information code, a synchronization code, and a packet control code.
In an embodiment, when the processor implements the generating a current data packet by the charger terminal based on the output current data, the processor is configured to implement:
encoding the output current data into at least one encoded current data based on a preset data encoding rule;
generating a target information code based on the encoded current data and an additional control code;
and generating the current data packet based on the target information code, the synchronous code and the packet control code.
In an embodiment, the preset data encoding rule is a count encoding rule of 10bit data.
In an embodiment, when the processor determines that the interface between the terminal and the charger terminal has abnormal leakage when the current difference is greater than a preset difference threshold, the processor is configured to implement:
when the current difference value is detected to be larger than the preset difference value threshold value, the consumption current data and the output current data are collected again based on a preset period, and the current difference value is calculated;
and when the times that the current difference value is larger than the preset difference value threshold value reach the preset times within the preset duration, determining that abnormal electric leakage exists at the interface between the terminal and the charger end.
In an embodiment, after determining that an abnormal leakage exists at an interface between the terminal and the charger terminal when the current difference is greater than a preset difference threshold, the processor is further configured to implement:
and the terminal main control interrupts the charging process and sends an alarm signal so as to display an alarm to a user through the terminal.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any of the terminal Type-C interface foreign matter detection methods provided by the embodiment of the application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. The method is applied to a terminal Type-C interface charging system, and the terminal Type-C interface charging system comprises a terminal and a charger end;
the terminal Type-C interface foreign matter detection method comprises the following steps:
based on a current data reading instruction sent by a terminal main control, the terminal reads current consumption data on a charging communication path; the terminal main control sends a get_Cur_Ichg instruction to a control unit of the power management module through the I2C, and the control unit reads consumption current data measured by a current sampling circuit on a CHG_VIN path in the power management module and sends the consumption current data to the terminal main control through the I2C;
based on the configuration channel, sending a query data packet to a control unit of the charger end; based on the query data packet, the control unit at the charger end reads output current data acquired by the current sensing unit in real time; based on the output current data, the charger end generates a current data packet and sends the current data packet to the terminal based on the configuration channel;
calculating a current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
when the current difference value is larger than a preset difference value threshold value, determining that abnormal electric leakage exists at an interface between the terminal and the charger end;
wherein the charger side generates a current data packet based on the output current data, including:
encoding the output current data into at least one encoded current data based on a preset data encoding rule;
generating a target information code based on the encoded current data and an additional control code;
generating the current data packet based on the target information code, the synchronization code and the packet control code;
the preset data coding rule is a counting coding rule of 10bit data; the length of the 10bit data represents a current unit, and the content of the 10bit data represents a specific current value.
2. The method for detecting a foreign object on a terminal Type-C interface according to claim 1, wherein determining that an abnormal leakage exists between the terminal and the charger terminal when the current difference is greater than a preset difference threshold value comprises:
when the current difference value is detected to be larger than the preset difference value threshold value, the consumption current data and the output current data are collected again based on a preset period, and the current difference value is calculated;
and when the times that the current difference value is larger than the preset difference value threshold value reach the preset times within the preset duration, determining that abnormal electric leakage exists at the interface between the terminal and the charger end.
3. The method for detecting a foreign object on a terminal Type-C interface according to claim 1, wherein after determining that an abnormal leakage exists between the terminal and the interface of the charger terminal when the current difference is greater than a preset difference threshold, further comprises:
and the terminal main control interrupts the charging process and sends an alarm signal so as to display an alarm to a user through the terminal.
4. The method for detecting foreign matter on a Type-C interface of a terminal according to any one of claims 1-3, wherein the terminal queries output current data of a charger terminal in real time based on a configuration channel, and further comprises:
based on the configuration channel, the terminal sends a data query instruction to the charger end;
based on the data query instruction, the control unit at the charger end reads the output current data acquired by the current sensing unit through an internal analog differential signal channel;
based on the control unit of the charger end, counting and encoding the output current data to generate encoded data;
packaging and generating the current data packet based on the coded data, the synchronous code and the packet control code;
based on the configuration channel, the charger end sends the current data packet to the terminal, and decodes the current data packet based on terminal main control of the terminal, so that the terminal obtains the output current data.
5. Terminal Type-C interface foreign matter detection device, its characterized in that, terminal Type-C interface foreign matter detection device includes:
the terminal is used for reading the consumption current data on the charging channel; the terminal main control sends a get_Cur_Ichg instruction to a control unit of the power management module through the I2C, and the control unit reads consumption current data measured by a current sampling circuit on a CHG_VIN path in the power management module and sends the consumption current data to the terminal main control through the I2C;
the output current data reading module is used for sending a query data packet to the control unit at the charger end based on the configuration channel; based on the query data packet, the control unit at the charger end reads the output current data acquired by the current sensing unit in real time; based on the output current data, the charger end generates a current data packet and sends the current data packet to the terminal based on the configuration channel;
the current difference calculation module is used for calculating the current difference between the terminal and the charger terminal based on the consumption current data and the output current data;
the interface abnormality judging module is used for determining that abnormal electric leakage exists between the terminal and the interface of the charger terminal when the current difference value is larger than a preset difference value threshold value;
the output current data reading module is specifically configured to: encoding the output current data into at least one encoded current data based on a preset data encoding rule; generating a target information code based on the encoded current data and an additional control code; generating the current data packet based on the target information code, the synchronization code and the packet control code;
the preset data coding rule is a counting coding rule of 10bit data; the length of the 10bit data represents a current unit, and the content of the 10bit data represents a specific current value.
6. A computer readable storage medium, wherein a terminal Type-C interface foreign matter detection program is stored on the computer readable storage medium, and wherein the terminal Type-C interface foreign matter detection program, when executed by a processor, implements the steps of the terminal Type-C interface foreign matter detection method according to any one of claims 1 to 4.
CN202310187918.0A 2023-02-28 2023-02-28 Terminal Type-C interface foreign object detection method, device and storage medium Active CN116203307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310187918.0A CN116203307B (en) 2023-02-28 2023-02-28 Terminal Type-C interface foreign object detection method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310187918.0A CN116203307B (en) 2023-02-28 2023-02-28 Terminal Type-C interface foreign object detection method, device and storage medium

Publications (2)

Publication Number Publication Date
CN116203307A CN116203307A (en) 2023-06-02
CN116203307B true CN116203307B (en) 2024-03-12

Family

ID=86514410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310187918.0A Active CN116203307B (en) 2023-02-28 2023-02-28 Terminal Type-C interface foreign object detection method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116203307B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106374577A (en) * 2016-10-21 2017-02-01 努比亚技术有限公司 Charging protection method and device
CN107422825A (en) * 2017-07-26 2017-12-01 惠州Tcl移动通信有限公司 A kind of CDP mouths charge control method, device, storage medium and electronic equipment
CN107991571A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 It is a kind of to detect the abnormal method, apparatus of charging and power supply adaptor
CN108132401A (en) * 2017-12-28 2018-06-08 广东欧珀移动通信有限公司 Charging abnormity detection method and device, storage medium and mobile terminal
KR20180117512A (en) * 2017-04-19 2018-10-29 엘지이노텍 주식회사 Method and Apparatus for Foreign Object Detection in Wireless Charging
CN112583522A (en) * 2019-09-27 2021-03-30 华为技术有限公司 Method for sectional coding of polarization code and communication equipment
CN112803539A (en) * 2016-11-15 2021-05-14 华为技术有限公司 Charging method and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015113466A1 (en) * 2014-01-28 2015-08-06 广东欧珀移动通信有限公司 Power adapter, terminal, and method for processing exception of charging loop

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106374577A (en) * 2016-10-21 2017-02-01 努比亚技术有限公司 Charging protection method and device
CN107991571A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 It is a kind of to detect the abnormal method, apparatus of charging and power supply adaptor
CN112803539A (en) * 2016-11-15 2021-05-14 华为技术有限公司 Charging method and related equipment
KR20180117512A (en) * 2017-04-19 2018-10-29 엘지이노텍 주식회사 Method and Apparatus for Foreign Object Detection in Wireless Charging
CN107422825A (en) * 2017-07-26 2017-12-01 惠州Tcl移动通信有限公司 A kind of CDP mouths charge control method, device, storage medium and electronic equipment
CN108132401A (en) * 2017-12-28 2018-06-08 广东欧珀移动通信有限公司 Charging abnormity detection method and device, storage medium and mobile terminal
CN112583522A (en) * 2019-09-27 2021-03-30 华为技术有限公司 Method for sectional coding of polarization code and communication equipment

Also Published As

Publication number Publication date
CN116203307A (en) 2023-06-02

Similar Documents

Publication Publication Date Title
US9529411B2 (en) Power-saving mode for USB power delivery sourcing device
CN110535978A (en) Data transmission method, device, system, smart wearable device and storage medium
US8527788B2 (en) Network wake up system with protection function
US20140149609A1 (en) Detecting device disconnect in a repeater
CN112285478B (en) Method and device for detecting vehicle static current, medium, equipment and vehicle
CN110138870A (en) A kind of the sensing layer detection system and its detection method of ubiquitous electric power Internet of Things power equipment
CN108009068B (en) Information recording method, information recording device and intelligent terminal
CN116203307B (en) Terminal Type-C interface foreign object detection method, device and storage medium
CN114994558A (en) Battery life detection method, terminal device and computer-readable storage medium
CN210199664U (en) Computer host case
CN117971613B (en) Hard disk monitoring system, method, device, storage medium and baseboard management controller
CN109586788B (en) Monitoring system fault diagnosis method, device, computer equipment and storage medium
KR102557374B1 (en) Testing method and system of time parameters of adapter, computer storage medium
CN111509810A (en) Lithium battery charging state detection method and device and storage medium
CN102841877B (en) Detecting method and automatic detecting circuit of working mode
CN113484802B (en) Fault detection method and device for rotary transformer
CN117033277A (en) Single-wire communication control device and data processing method
CN115202977A (en) Chip running state monitoring method, system and chip
CN114297610A (en) Intelligent network card identity recognition method, intelligent network card and server
CN106371965B (en) The monitoring system and method for universal serial bus between a kind of hypervelocity piece
CN216647344U (en) Detection apparatus for backplate electric leakage and server
CN222482616U (en) Chip function simulation device
CN113849375B (en) Remote management method, system and medium for computer
CN110108933A (en) A kind of pluggable guide tracked three-phase multifunctional electrical energy meter of communication module compact of band
CN107102267A (en) Battery management system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 214174 Jiangsu Province, Wuxi City, Wuxi Hui Shan Economic Development Zone, Yan Xin Road No. 311 (One License for Multiple Addresses)

Patentee after: Wuxi Yuning Technology Group Co., Ltd.

Country or region after: China

Address before: 214000 No. 311, Yan Xin Road, Wuxi Huishan Economic Development Zone, Wuxi, Jiangsu

Patentee before: WUXI YUNING INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China