Interface detection method and device, computer equipment and storage medium

By collecting voltage characteristics and judging the voltage change rate during the voltage change of the interface pin, and automatically detecting the interface status, the unreliability problem caused by interface pin corrosion is solved, and efficient and accurate interface detection is achieved to avoid equipment failures.

CN120385955APending Publication Date: 2025-07-29BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410123863.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Unreliability problems caused by corrosion and aging of the device interface pins lead to data transmission errors and equipment failures. The existing technology relies on manual experience to detect low accuracy and difficult to detect abnormalities.

Method used

By acquiring voltage characteristics during the voltage change between interface pins, judging the interface status using the voltage change rate and reference value difference, an automated detection method is provided, including acquiring voltage change rate and reverse change detection to confirm that the interface is abnormal or normal.

Benefits of technology

It realizes high-efficiency and high-accuracy interface detection, reduces detection difficulty and cost, and improves security during interface use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120385955A_ABST
    Figure CN120385955A_ABST
Patent Text Reader

Abstract

The invention provides an interface detection method and device, computer equipment and a storage medium. The method comprises the steps that in the change process of a first voltage, the first preset type feature of the first voltage is collected, and the first voltage is the voltage between a first pin on an interface and a second pin on the interface; and in response to the fact that the difference between the first preset type feature and a first reference value is larger than a first threshold value, it is determined that the interface is in an abnormal state, and the first reference value represents the value of the first preset type feature of the first voltage when the interface is in a normal state. According to the method provided by the invention, high-efficiency and high-accuracy interface detection can be realized, the interface detection difficulty and cost are greatly reduced, and the safety in the interface use process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of interface detection, and particularly to an interface detection method, apparatus, computer device, and storage medium. Background Art

[0002] During the daily use of device interfaces, over time, corrosion and aging between interface pins are a common problem. That is, the interface pins may become unreliable due to oxidation, chemical reactions, moisture, dust, or other external factors, which may lead to problems such as data transmission errors and signal loss between the device and the connector, and even cause excessive heating of the interface and device failures.

[0003] In the related art, generally, it is necessary to rely on manual experience to complete the detection of interfaces, with a low accuracy rate. At the same time, since it is difficult for users to notice the health status of device interfaces during normal times, it is even possible that interface anomalies are not discovered by users, resulting in device failures. Summary of the Invention

[0004] To overcome the problems existing in the related art, the present disclosure provides an interface detection method, apparatus, computer device, and storage medium.

[0005] In a first aspect of the present disclosure, an interface detection method is provided. The method includes:

[0006] During the change process of a first voltage, collect first preset type features of the first voltage, where the first voltage is the voltage between a first pin and a second pin on the interface;

[0007] In response to the difference between the first preset type features and a first reference value being greater than a first threshold, determine that the interface is in an abnormal state, where the first reference value represents the value of the first preset type features of the first voltage when the interface is in a normal state.

[0008] Optionally, the first preset type features represent the change rate of the first voltage over time.

[0009] Optionally, the step of collecting first preset type features of the first voltage during the change process of the first voltage includes:

[0010] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching a time threshold, collect the first voltage;

[0011] Determine the first preset type features based on at least two of the first voltages collected and the moments corresponding to the at least two first voltages.

[0012] Optionally, during the change of the first voltage, collecting the first preset type feature of the first voltage includes:

[0013] During the change of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching a time threshold, collect the first voltage;

[0014] Determine the first preset type feature according to at least two of the collected first voltages and the moments corresponding to the at least two first voltages.

[0015] Optionally, during the change of the first voltage, collecting the first preset type feature of the first voltage includes:

[0016] During the change of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching a time threshold, collect the first voltage;

[0017] Determine the change rate of the multiple first voltages over time according to the collected multiple sets of first voltages, and determine the first preset type feature according to the average value of the determined multiple change rates, where each set of first voltages in the multiple sets of first voltages includes two first voltages and the moments corresponding to the two voltages.

[0018] Optionally, the first pin is the power pin on the interface, and / or the second pin is the ground pin on the interface.

[0019] Optionally, the method further includes, in response to the interface being determined to be in an abnormal state, performing at least one of the following operations:

[0020] Present a prompt message for prompting the user that the interface is in an abnormal state;

[0021] Stop the change of the first voltage;

[0022] Disconnect the connection between the interface and the connector connected to the interface.

[0023] Optionally, during the change of the first voltage, collecting the first preset type feature of the first voltage includes:

[0024] During the process of the first voltage monotonically non-increasing or monotonically non-decreasing, collect the first preset type feature of the first voltage.

[0025] Optionally, the method further includes:

[0026] In response to the interface being determined to be in an abnormal state, reverse the change of the first voltage, and during the reverse change of the first voltage, collect the second preset type feature of the first voltage;

[0027] In response to the difference between the second preset type feature and the second reference value being less than the second threshold, it is determined that the interface is in a normal state, where the second reference value represents the value of the second preset type feature of the first voltage when the interface is in a normal state.

[0028] Optionally, the method further includes:

[0029] In response to the interface being determined to be in a normal state, perform at least one of the following:

[0030] Power the connector connected to the interface;

[0031] Cause the connector connected to the interface to power the interface;

[0032] Perform data communication with the connector connected to the interface.

[0033] Optionally, in the process of the change of the first voltage, collecting the preset type feature of the first voltage includes:

[0034] In the process of the change of the first voltage after the interface is connected to the connector, collect the preset type feature of the first voltage.

[0035] A second aspect of the present disclosure provides an interface detection device, the device includes:

[0036] An acquisition module, configured to collect a first preset type feature of the first voltage in the process of the change of the first voltage, where the first voltage is the voltage between a first pin and a second pin on the interface;

[0037] A determination module, configured to determine that the interface is in an abnormal state in response to the difference between the first preset type feature and the first reference value being greater than the first threshold, where the first reference value represents the value of the first preset type feature of the first voltage when the interface is in a normal state.

[0038] Optionally, the first preset type feature represents the change rate of the first voltage over time.

[0039] Optionally, when the acquisition module is used to collect the first preset type feature of the first voltage in the process of the change of the first voltage, it is used to perform the following steps:

[0040] In the process of the change of the first voltage, in response to the time interval between the current moment and the time when the first voltage was last collected reaching the time threshold, collect the first voltage;

[0041] Determine the first preset type feature according to at least two of the first voltages collected and the moments corresponding to the at least two first voltages.

[0042] Optionally, when the acquisition module is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0043] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was acquired reaching a time threshold, acquire the first voltage;

[0044] Determine the first preset type feature according to at least two of the acquired first voltages and the moments corresponding to the at least two first voltages.

[0045] Optionally, when the acquisition module is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0046] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was acquired reaching a time threshold, acquire the first voltage;

[0047] Determine the change rate of the multiple first voltages over time according to the multiple sets of first voltages acquired, and determine the first preset type feature according to the average value of the determined multiple change rates, where each set of first voltages in the multiple sets of first voltages includes two first voltages and the moments corresponding to the two voltages.

[0048] Optionally, the first pin is the power supply pin on the interface, and / or the second pin is the ground wire pin on the interface.

[0049] Optionally, the device further includes an exception response module, which is used to perform at least one of the following operations in response to the interface being determined to be in an abnormal state:

[0050] Present a prompt message for prompting the user that the interface is in an abnormal state;

[0051] Stop the change of the first voltage;

[0052] Disconnect the connection between the interface and the connector to which the interface is connected.

[0053] Optionally, when the acquisition module is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0054] During the change process of the first voltage when it is monotonically non-increasing or monotonically non-decreasing, acquire the first preset type feature of the first voltage.

[0055] Optionally, the device further includes a step-down conversion module, which is used to perform the following steps:

[0056] In response to the interface being determined to be in an abnormal state, reverse the change of the first voltage, and collect the second preset type characteristics of the first voltage during the reverse change of the first voltage;

[0057] In response to the difference between the second preset type characteristics and the second reference value being less than the second threshold, determine that the interface is in a normal state, where the second reference value represents the value of the second preset type characteristics of the first voltage when the interface is in a normal state.

[0058] Optionally, the device further includes a normal response module, configured to, in response to the interface being determined to be in a normal state, perform at least one of the following:

[0059] Power the connector connected to the interface;

[0060] Cause the connector connected to the interface to power the interface;

[0061] Perform data communication with the connector connected to the interface.

[0062] Optionally, when the acquisition module is used to acquire the preset type characteristics of the first voltage during the change process of the first voltage, it is used for:

[0063] Acquire the preset type characteristics of the first voltage during the change process of the first voltage after the interface is connected to the connector.

[0064] A third aspect of the present disclosure provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method as described in the first aspect when executing the program.

[0065] A fourth aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and the program implements the method as described in the first aspect when executed by a processor.

[0066] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0067] In the embodiments of the present disclosure, by collecting the first preset type characteristics of the first voltage during the change process of the first voltage, and determining that the interface is in an abnormal state when the difference between the first preset type characteristics and the first reference value is greater than the first threshold, high-efficiency and high-accuracy interface detection is achieved, the interface detection difficulty and cost are greatly reduced, and the safety during the use of the interface is improved.

[0068] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Description of the Drawings

[0069] The accompanying drawings here are incorporated into the specification and constitute a part of this disclosure, showing embodiments consistent with this disclosure, and are used together with the specification to explain the principles of this disclosure.

[0070] Figure 1 is a flowchart of an interface detection method shown in some exemplary embodiments.

[0071] Figure 2 is a schematic diagram of an equivalent circuit shown in some exemplary embodiments.

[0072] Figure 3 is a schematic diagram of a rising curve of a first voltage shown in some exemplary embodiments.

[0073] Figure 4 is a flowchart of another interface detection method shown in some exemplary embodiments.

[0074] Figure 5 is a selection branch diagram of an interface detection method shown in some exemplary embodiments.

[0075] Figure 6 is a block diagram of an interface detection device shown in some exemplary embodiments.

[0076] Figure 7 is a hardware structure diagram of a computer device shown in some exemplary embodiments. Detailed Description of the Embodiments

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

[0078] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit this disclosure. The singular forms "a", "the", and "said" used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0079] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0080] During the daily use of a device interface, over time, corrosion and aging between interface pins are a common problem, that is, the interface pins may become unreliable due to oxidation, chemical reactions, moisture, dust, or other external factors, which may lead to problems such as data transmission errors and signal loss between the device and the connector, and even cause the interface to overheat and the device to malfunction.

[0081] In related technologies, generally, it is necessary to rely on manual experience to complete the detection of the interface, and the accuracy rate is relatively low. At the same time, since it is difficult for users to notice the health status of the device interface usually, it is even possible that the interface is abnormal but not discovered by the user, resulting in device failures.

[0082] In view of this, the present disclosure provides an interface detection method, device, computer device, and storage medium. First, an exemplary introduction to the application scenarios and concepts involved in the present disclosure will be given below.

[0083] In the present disclosure, a connector is a device used to connect electronic components, circuit boards, or cables, such as a USB-C (Universal Serial Bus Type-C) connector, a Micro USB connector (Micro Universal Serial Bus interface), etc. The connector and its corresponding interface usually have a specific physical shape and pin layout, and can be used to provide or receive electrical energy and conduct data transmission. An interface is a connection point or contact point between a connector and an external device or system, such as metal pins, pins, or sockets. In actual applications, the interface is usually located on the device or is connected to the device through a virtual or physical medium. In the present disclosure, a device may have one or more connection interfaces, and the present disclosure does not limit the quantitative relationship between the connection interfaces and the device. By reusing the method provided in the present disclosure, an interface detection method for multiple interfaces on the same device can be obtained.

[0084] Next, the embodiments of the present disclosure will be described in detail.

[0085] The first aspect of the present disclosure provides an interface detection method. Please refer toFigure 1 , which includes the following steps:

[0086] Step S101, during the change process of the first voltage, collect the first preset type of characteristics of the first voltage, where the first voltage is the voltage between the first pin and the second pin on the interface.

[0087] Wherein, the first pin and the second pin are two pins on the interface, and the first preset type of characteristics can be the rising slope, falling slope, maximum voltage of the first voltage in the line graph or curve graph of voltage changing with time, the voltage corresponding to when the first voltage does not change within a preset time threshold, etc. In addition, it can also be the average value determined based on multiple characteristic values of the same type, or the comprehensive value determined based on the above multiple types of characteristics according to a preset formula.

[0088] The change of the first voltage can be caused by the connection of the interface and the connector (that is, during the change process of the first voltage, collecting the preset type of characteristics of the first voltage includes collecting the preset type of characteristics of the first voltage during the change process of the first voltage after the interface and the connector are connected), or can be caused by the device actively sending an electrical signal (for example, in a preset dedicated detection scenario, the device will cause the voltage change of one or more pins on the interface). In addition, the method may further include stopping the change of the first voltage in response to the first voltage reaching the voltage threshold.

[0089] In other words, the change of the first voltage can be caused by inserting the connector. For example, when a charger is inserted, the charger will provide a voltage that continuously increases and finally stabilizes at the voltage threshold to the device based on a preset protocol and preset pins. Another example is that when the device is connected to a flash drive, the device will provide a voltage that continuously increases and finally stabilizes at the voltage threshold to the flash drive based on a preset protocol and preset pins. And between the preset pins and other pins (such as the ground wire pin), a changing voltage will be formed. The above conditions add a trigger condition and a cut-off condition to the interface detection method, ensuring the timeliness of the interface detection. At the same time, it avoids the method from collecting invalid data (such as voltage changes caused by static electricity) resulting in incorrect judgment results, and further improves the accuracy of the method.

[0090] Step S102, in response to the difference between the first preset type of characteristics and the first reference value being greater than the first threshold, determine that the interface is in an abnormal state, where the first reference value represents the value of the first preset type of characteristics of the first voltage when the interface is in a normal state.

[0091] Among them, the first reference value can be determined by pre - conducted experiments or by the device receiving instructions or data packets from users or the network. When the difference between the first preset - type feature and the first reference value is greater than the first threshold, it can be determined that the interface is in an abnormal state, that is, the interface may be in a state of excessive corrosion, aging, or being contaminated with foreign objects, etc.

[0092] In the present disclosure, the first pin can be a power - supply pin, a configuration - channel pin, etc., and the second pin can be a ground - wire pin, a spare pin, etc. The specific situation can be determined according to the interface type and the detection requirements. Here, taking the first pin as the VBUS pin on USB - C and the second pin as the GND pin on USB - C as an example to further illustrate the detection principle of the present disclosure, please refer to Figure 2 , which shows an equivalent RC (resistance - capacitance) circuit formed between the VBUS pin (power - supply pin) and the GND pin (ground - wire pin) on the USB - C interface after the charger is inserted into the USB - C interface. The time constant (τ) of the RC circuit can be calculated by the following formula (1).

[0093] τ = R * C (1)

[0094] Among them, R represents the resistance of the equivalent circuit, C represents the capacitance of the equivalent circuit, and τ characterizes the response speed of the circuit when the input signal changes (that is, after the input signal of the circuit changes, the time required for the circuit to reach a new stable state). When corrosion occurs or the two pins are blocked by foreign objects between them, the values of R and C of the RC equivalent circuit formed between them will change, which will cause a change in the time constant, and further lead to a change in the boost curve between the two pins.

[0095] In addition, according to the characteristics of the RC circuit, when the time approaches infinity, the voltage across the circuit will approach the input voltage. However, in actual situations, due to the internal losses of resistance and capacitance in the circuit, as well as the influence of other factors (such as the specific coverage area and degree of corrosion and foreign objects), the voltage across the RC circuit may not fully reach the input voltage. Therefore, in the scenario where the circuit reaches a stable state within a certain time range, the time it consumes, the generated boost curve, the final voltage value generated across the circuit, and the current value flowing through the circuit may all change due to the degree of interface corrosion and the influence of foreign objects.

[0096] Please refer to Figure 3 , which shows the VBUS boost curves in two abnormal situations (here, the boost curve can be the boost curve relative to any pin, preferably, it can be the boost curve relative to the ground - wire pin, so as to provide a good potential reference point for the VBUS voltage). In abnormal situations, the time required for VBUS to reach the preset voltage and the climbing slope of each voltage - climbing interval may be different from the normal situation. For example, inFigure 3 -a, the voltage change rate in abnormal conditions is greater than that in normal conditions, while in Figure 3 -b, the voltage change rate in abnormal conditions is less than that in normal conditions.

[0097] In the embodiments of the present disclosure, during the change process of the first voltage, the first preset type of feature of the first voltage is collected, and when the difference between the first preset type of feature and the first reference value is greater than the first threshold, it is determined that the interface is in an abnormal state, thereby realizing high-efficiency and high-accuracy interface detection, greatly reducing the difficulty and cost of interface detection, and improving the safety during the use of the interface.

[0098] In some embodiments of the present disclosure, the first preset type of feature characterizes the change rate of the first voltage over time. Its advantage is that it can be closer to the above formula (1), thereby improving the accuracy of interface detection, and can combine experimental data to determine the overall corrosion degree or foreign object blockage degree between pins.

[0099] Specifically, the collecting the first preset type of feature of the first voltage during the change process of the first voltage may include:

[0100] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching the time threshold, the first voltage is collected;

[0101] According to at least two of the first voltages collected and the moments corresponding to the at least two first voltages, the first preset type of feature is determined.

[0102] In addition, the collecting the first preset type of feature of the first voltage during the change process of the first voltage may include:

[0103] According to multiple sets of the first voltages collected, the change rates of the multiple first voltages over time are determined, and the average value of the determined multiple change rates is determined as the first preset type of feature, where each set of the first voltages in the multiple sets of the first voltages includes two first voltages and the moments corresponding to the two voltages.

[0104] In the above embodiments, an interface detection method based on the change rate of the first voltage over time is given. Take Figure 3Taking -a as an example, the rate of change of the first voltage over time during the boost of the first voltage from V1 to V2 can be determined based on the three physical quantities V2, V1, and t1, and this rate of change is matched with a pre - determined standard rate of change during the process of boosting from V1 to V2 (or within the interval from the start time point of t1 to the end time point). If the difference (such as the difference value, or a mathematical quantity obtained based on other algorithms) is greater than the first threshold, it can be considered that the interface is in an abnormal state. In addition, multiple sets of the first voltage (i.e., at least 3 first voltages) can be collected, and based on the average value of the rates of change of the multiple sets of voltages. Preferably, the multiple sets of voltages can have corresponding physical meanings, so as to Figure 3 Taking -a as an example, during the boost process of the first voltage, the first voltage can be collected once every step duration (step size), and based on the rates of change of the voltages at the same time intervals (such as the rates of change corresponding to the time periods t1 and t2, where both t1 and t2 are one step size), the average value of the slopes is calculated, and the obtained average value is matched with the standard value. If the difference is greater than the first threshold, it can be considered that the interface is in an abnormal state.

[0105] Since in an RC circuit, the changes in resistance and capacitance are prominently reflected in the response speed of the circuit when the input signal changes, the above - mentioned embodiments improve the accuracy of the interface detection method by collecting the rate of change of the first voltage or the average value of the rates of change of the first voltage.

[0106] In some embodiments of the present disclosure, the first pin is the power supply pin on the interface, and the second pin is the ground pin on the interface. Since when the interface is connected to the connector, usually one party needs to supply power to the other party based on the power supply pin, and the ground pin is usually connected to the ground body or other potential reference points, when the first pin is the power supply pin on the interface and the second pin is the ground pin on the interface, a more general and stable interface detection process can be provided.

[0107] In some embodiments of the present disclosure, during the change process of the first voltage, collecting the first - preset - type feature of the first voltage includes collecting the first - preset - type feature of the first voltage during the change process of the first voltage being monotonically non - increasing or monotonically non - decreasing. Based on this, the method provided by the present disclosure can avoid collecting data before and after voltage fluctuations when the voltage fluctuates, thus preventing the occurrence of a situation where the accuracy of the data is reduced. It should be understood that if the voltage fluctuates, the fluctuation process can be split into multiple monotonically non - increasing or monotonically non - decreasing change intervals. At this time, reusing the method provided by the present disclosure does not affect the realization of its original technical effects.

[0108] In some embodiments of the present disclosure, the method further includes, in response to the interface being determined to be in an abnormal state, performing at least one of the following operations:

[0109] Present a prompt message for prompting the user that the interface is in an abnormal state;

[0110] Stop the change of the first voltage;

[0111] Disconnect the connection between the interface and the connector to which the interface is connected.

[0112] Among them, the prompt message can be presented based on a visual manner, or based on an audio or other manner. Based on this, after the interface is determined to be abnormal, a response can be made in a timely manner so that the abnormal interface will not damage the device due to reasons such as overheating.

[0113] In some embodiments of the present disclosure, please refer to Figure 4 , the method further includes:

[0114] Step S401, in response to the interface being determined to be in an abnormal state, reverse the change of the first voltage, and collect the second preset type features of the first voltage during the reverse change of the first voltage;

[0115] Step S402, in response to the difference between the second preset type features and the second reference value being less than the second threshold, determine that the interface is in a normal state, where the second reference value represents the value of the second preset type features of the first voltage when the interface is in a normal state.

[0116] In the above embodiments, after the interface is determined to be in an abnormal state, secondary detection can also be performed. Taking the connection between a mobile phone and a charger as an example, after the mobile phone and the charger complete protocol communication, the charger provides a gradually increasing voltage to the mobile phone based on the power supply pin (for example, increasing from 0V to 5V, and this voltage can be determined based on the ground pin). When the difference between the first preset type of feature collected by the device and the first reference value is greater than the first threshold during the process of the voltage increasing from 0V to 5V, the device determines that the interface is in an abnormal state. At this time, the voltage on the power supply pin can be changed in the reverse direction. For example, while stopping the voltage increase, the power supply pin is connected to the ground body (such as the ground pin) through a MOS (Metal-Oxide-Semiconductor Field-Effect Transistor) circuit or a triode circuit, so that the voltage (the first voltage) on the power supply pin drops back to the ground voltage. During this process, the second preset type of feature of the first voltage is collected, and in response to the difference between the second preset type of feature and the second reference value being less than the second threshold, it is determined that the interface is in a normal state (at this time, the aforementioned RC circuit principle also applies). The above judgment process avoids the occurrence of dangerous situations by changing the voltage of the pin on the interface in an abnormal state in the reverse direction, and also provides a secondary detection process, thereby further reducing the false detection rate and improving the accuracy of the method of the present disclosure. For the specific details in the above steps, please refer to the relevant descriptions in the foregoing embodiments and will not be elaborated here.

[0117] In some embodiments of the present disclosure, the method further includes, in response to the interface being determined to be in a normal state, performing at least one of the following:

[0118] Powering the connector connected to the interface;

[0119] Causing the connector connected to the interface to power the interface;

[0120] Performing data communication with the connector connected to the interface.

[0121] Next, through Figure 5 the selection branch diagram shown below, and using the above example, the above at least one embodiment will be described.

[0122] In the first step, in response to detecting the insertion of the charger, before the VUS voltage rises to 5V, calculate the average rising slope (change rate) V2 of VBUS in several step time periods, and calculate whether the absolute value of the difference between V2 and the first reference value V1 is greater than or equal to the first threshold A. If not, the normal charging process can be started until the charging ends or the charger is unplugged.

[0123] Second step, if the absolute value of the difference between V2 and V1 is greater than or equal to the first threshold A, it is determined that the interface is in an abnormal state. At this time, the VBUS voltage can be reversed (for example, connecting VBUS to the ground pin through a MOS transistor), and during the reverse change process, the average decrease slope V2' is determined in several step time intervals, and it is calculated whether the absolute value of the difference between V2' and the second reference value V1' is less than or equal to the second threshold B. If so, the interface can be determined to be normal and the normal charging process can be carried out. If not, the voltage can continue to be reversed (that is, the detection is repeated a preset number of times), or a prompt message can be sent to the user to prompt the user to check the interface status or perform after-sales maintenance.

[0124] For the specific details and related beneficial effects in the above example, please refer to the foregoing embodiments and will not be elaborated herein.

[0125] Corresponding to the embodiments of the foregoing method, the present disclosure also provides embodiments of a device and a terminal to which the device is applied.

[0126] A second aspect of the present disclosure provides an interface detection device, please refer to Figure 6 , the device includes:

[0127] An acquisition module 601, configured to acquire a first preset type feature of the first voltage during a change process of the first voltage, where the first voltage is a voltage between a first pin and a second pin on the interface;

[0128] A determination module 602, configured to determine that the interface is in an abnormal state in response to a difference between the first preset type feature and a first reference value being greater than a first threshold, where the first reference value represents a value of the first preset type feature of the first voltage when the interface is in a normal state.

[0129] Optionally, the first preset type feature represents a change rate of the first voltage over time.

[0130] Optionally, when the acquisition module 601 is configured to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is configured to perform the following steps:

[0131] During the change process of the first voltage, in response to a time interval between the current moment and the time when the first voltage was last acquired reaching a time threshold, the first voltage is acquired;

[0132] According to at least two first voltages among the acquired multiple first voltages and the moments corresponding to the at least two first voltages, the first preset type feature is determined.

[0133] Optionally, when the acquisition module 601 is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0134] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was acquired reaching the time threshold, acquire the first voltage;

[0135] Determine the first preset type feature according to at least two of the acquired first voltages and the moments corresponding to the at least two first voltages.

[0136] Optionally, when the acquisition module 601 is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0137] During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was acquired reaching the time threshold, acquire the first voltage;

[0138] Determine the change rate of the first voltage over time according to multiple sets of acquired first voltages, and determine the first preset type feature according to the average value of the determined multiple change rates, where each set of first voltages in the multiple sets of first voltages includes two first voltages and the moments corresponding to the two voltages.

[0139] Optionally, the first pin is the power supply pin on the interface, and / or the second pin is the ground wire pin on the interface.

[0140] Optionally, the device further includes an exception response module, which is used to perform at least one of the following operations in response to the interface being determined to be in an abnormal state:

[0141] Present a prompt message for prompting the user that the interface is in an abnormal state;

[0142] Stop the change of the first voltage;

[0143] Disconnect the connection between the interface and the connector connected to the interface.

[0144] Optionally, when the acquisition module 601 is used to acquire the first preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0145] During the monotonic non-increasing or non-decreasing change process of the first voltage, acquire the first preset type feature of the first voltage.

[0146] Optionally, the device further includes a step-down conversion module for performing the following steps:

[0147] In response to the interface being determined to be in an abnormal state, reverse the change of the first voltage, and during the reverse change of the first voltage, collect the second preset type feature of the first voltage;

[0148] In response to the difference between the second preset type feature and the second reference value being less than the second threshold, determine that the interface is in a normal state, where the second reference value represents the value of the second preset type feature of the first voltage when the interface is in a normal state.

[0149] Optionally, the device further includes a normal response module, configured to, in response to the interface being determined to be in a normal state, perform at least one of the following:

[0150] Power the connector connected to the interface;

[0151] Cause the connector connected to the interface to power the interface;

[0152] Perform data communication with the connector connected to the interface.

[0153] Optionally, when the acquisition module 601 is configured to acquire the preset type feature of the first voltage during the change process of the first voltage, it is used for:

[0154] Acquire the preset type feature of the first voltage during the change process of the first voltage after the interface is connected to the connector.

[0155] For the implementation processes of the functions and effects of each module in the above device, specifically refer to the implementation processes of the corresponding steps in the above method, which will not be elaborated here.

[0156] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiments described above are only illustrative, where the modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0157] In a third aspect, the embodiments of the interface detection device provided by the present disclosure can be applied to a computer device. Please refer to the attached Figure 7 , which exemplarily shows a hardware schematic diagram of a computer device. For example, the device 700 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0158] Device 700 may include one or more of the following components: a processing component 701, a memory 702, a power component 703, a multimedia component 704, an audio component 705, an input / output (I / O) interface 706, a sensor component 707, and a communication component 708.

[0159] The processing component 701 generally controls the overall operation of the device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 701 may include one or more processors 709 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 701 may include one or more modules to facilitate interaction between the processing component 701 and other components. For example, the processing component 701 may include a multimedia module to facilitate interaction between the multimedia component 704 and the processing component 701.

[0160] The memory 702 is configured to store various types of data to support the operation of the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, and the like. The memory 702 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0161] The power component 703 provides power to the various components of the device 700. The power component 703 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 700.

[0162] The multimedia component 704 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of a touch or swipe action but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 704 includes a front camera and / or a rear camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0163] The audio component 705 is configured to output and / or input audio signals. For example, the audio component 705 includes a microphone (MIC) that is configured to receive external audio signals when the device 700 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 702 or transmitted via the communication component 708. In some embodiments, the audio component 705 further includes a speaker for outputting audio signals.

[0164] The I / O interface 706 provides an interface between the processing component 701 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0165] The sensor component 707 includes one or more sensors for providing an assessment of the various aspects of the state of the device 700. For example, the sensor component 707 can detect the on / off state of the device 700, the relative positioning of components, such as the display and the keypad of the device 700. The sensor component 707 can also detect a change in the position of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the device 700. The sensor component 707 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 707 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 707 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0166] The communication component 708 is configured to facilitate communication between the device 700 and other devices in a wired or wireless manner. The device 700 can access a communication standard-based wireless network, such as WiFi, 2G or 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 708 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 708 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0167] In an exemplary embodiment, the device 700 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the interface detection method of the above computer device.

[0168] Fourthly, in an exemplary embodiment of the present disclosure, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory 702 including instructions, and the above instructions can be executed by a processor 709 of the device 700 to complete the interface detection method of the above computer device. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0169] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0170] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not claimed in the present disclosure. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0171] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

[0172] The above are only the preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.

Claims

1. An interface detection method, characterized in that, The method includes: During the change process of the first voltage, collecting first preset type features of the first voltage, where the first voltage is the voltage between a first pin and a second pin on an interface; In response to the difference between the first preset type features and a first reference value being greater than a first threshold, determining that the interface is in an abnormal state, where the first reference value represents the value of the first preset type features of the first voltage when the interface is in a normal state.

2. The interface detection method according to claim 1, wherein The first preset type features represent the rate of change of the first voltage over time.

3. The interface detection method according to claim 2, wherein The step of collecting the first preset type features of the first voltage during the change process of the first voltage includes: During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching a time threshold, collecting the first voltage; Based on at least two of the first voltages collected and the moments corresponding to the at least two first voltages, determining the first preset type features.

4. The interface detection method according to any one of claims 2, characterized in that The step of collecting the first preset type features of the first voltage during the change process of the first voltage includes: During the change process of the first voltage, in response to the time interval between the current moment and the last time the first voltage was collected reaching a time threshold, collecting the first voltage; Based on multiple sets of the first voltages collected, determining the rates of change of the multiple first voltages over time, and determining the average value of the determined multiple rates of change to determine the first preset type features, where each set of the first voltages in the multiple sets of first voltages includes two first voltages and the moments corresponding to the two voltages.

5. The interface detection method according to claim 1, characterized in that The first pin is a power supply pin on the interface, and / or the second pin is a ground pin on the interface.

6. The interface detection method according to claim 1, wherein The method further includes, in response to the interface being determined to be in an abnormal state, performing at least one of the following operations: Presenting a prompt message for prompting the user that the interface is in an abnormal state; Stopping the change of the first voltage; Disconnecting the connection between the interface and the connector connected to the interface.

7. The interface detection method according to claim 1, characterized in that The step of collecting the first preset type features of the first voltage during the change process of the first voltage includes: During the change process of the first voltage when it is monotonically non-increasing or monotonically non-decreasing, collecting the first preset type features of the first voltage.

8. The interface detection method according to claim 1, characterized in that, The method further includes: In response to the interface being determined to be in an abnormal state, reversing the change of the first voltage, and during the reverse change process of the first voltage, collecting second preset type features of the first voltage; In response to the difference between the second preset type features and a second reference value being less than a second threshold, determining that the interface is in a normal state, where the second reference value represents the value of the second preset type features of the first voltage when the interface is in a normal state.

9. The interface detection method according to claim 8, wherein The method further includes: In response to the interface being determined to be in a normal state, performing at least one of the following: Powering the connector connected to the interface; Enabling the connector connected to the interface to supply power to the interface; Performing data communication with the connector connected to the interface.

10. The interface detection method according to claim 1, wherein The step of collecting the preset type features of the first voltage during the change process of the first voltage includes: During the change process of the first voltage after the interface is connected to the connector, collect the preset type characteristics of the first voltage.

11. An interface detection device, characterized in that, The device includes: A collection module, configured to collect the first preset type characteristics of the first voltage during the change process of the first voltage, where the first voltage is the voltage between a first pin on the interface and a second pin on the interface; A determination module, configured to determine that the interface is in an abnormal state in response to a difference between the first preset type characteristics and a first reference value being greater than a first threshold, where the first reference value represents the value of the first preset type characteristics of the first voltage when the interface is in a normal state.

12. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the method according to any one of claims 1 to 10 is implemented.