CN117630756A - TYPE-C interface line sequence identification method and device, electrical equipment and medium - Google Patents

TYPE-C interface line sequence identification method and device, electrical equipment and medium Download PDF

Info

Publication number
CN117630756A
CN117630756A CN202311592396.9A CN202311592396A CN117630756A CN 117630756 A CN117630756 A CN 117630756A CN 202311592396 A CN202311592396 A CN 202311592396A CN 117630756 A CN117630756 A CN 117630756A
Authority
CN
China
Prior art keywords
type
interface
signal
load object
line
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.)
Pending
Application number
CN202311592396.9A
Other languages
Chinese (zh)
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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202311592396.9A priority Critical patent/CN117630756A/en
Publication of CN117630756A publication Critical patent/CN117630756A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/50Testing of electric apparatus, lines, cables or components for short-circuits, continuity, leakage current or incorrect line connections
    • G01R31/58Testing of lines, cables or conductors
    • G01R31/60Identification of wires in a multicore cable

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The invention relates to the technical field of automatic detection, and discloses a TYPE-C interface line sequence identification method, a TYPE-C interface line sequence identification device, electrical equipment and a medium, wherein the TYPE-C interface line sequence identification method comprises the following steps: when the TYPE-C interface is monitored to be accessed to a load object, respectively transmitting a clock signal and a data signal to the load object through a clock line and a data line of the TYPE-C interface; judging whether a response signal fed back by a load object through a TYPE-C interface is received or not; and when receiving a response signal fed back by the load object through the TYPE-C interface, determining the access line sequence of the load object on the TYPE-C interface based on the signal transmission corresponding relation between the clock line and the data line and between the clock signal and the data signal. And the software processing mode of transmitting the clock signal and the data signal to the load object through the TYPE-C interface identifies the access line sequence of the load object according to the response signal of the load object, and a differential signal chip or a protocol chip is not required to be additionally arranged, so that the cost of the whole product is reduced.

Description

TYPE-C interface line sequence identification method and device, electrical equipment and medium
Technical Field
The invention relates to the technical field of automatic detection, in particular to a TYPE-C interface line sequence identification method, a TYPE-C interface line sequence identification device, electrical equipment and a medium.
Background
The household beauty instrument products and similar portable products mostly adopt TYPE-C interfaces, and the number of data wires which can be transmitted by the TYPE-C interfaces is limited, but the TYPE-C interfaces support the condition of positive and negative insertion, so that the number of available data wires can be reduced by half, and only positive and negative insertion conditions of an access load need to be identified before use, namely line sequence identification is needed. In the related art, a differential signal chip or a protocol chip is generally required to be additionally arranged to control and realize a line sequence identification function, but the transmission cost of TYPE-C signals can be increased by additionally arranging the differential signal chip and the protocol chip, and the product cost is increased.
Disclosure of Invention
In view of the above, the invention provides a TYPE-C interface line sequence identification method, a device, electrical equipment and a medium, so as to solve the problem that the TYPE-C interface line sequence identification in the related art requires additional arrangement of a differential signal chip or a protocol chip, and has high cost.
In a first aspect, the present invention provides a TYPE-C interface line sequence identification method, including:
when the TYPE-C interface is monitored to be accessed to a load object, respectively transmitting a clock signal and a data signal to the load object through a clock line and a data line of the TYPE-C interface;
judging whether a response signal fed back by the load object through the TYPE-C interface is received or not;
And when receiving a response signal fed back by the load object through the TYPE-C interface, determining an access line sequence of the load object on the TYPE-C interface based on the corresponding relation between the clock line and the data line and the signal transmission of the clock signal and the data signal.
Therefore, the software processing mode of sending the clock signal and the data signal to the load object through the TYPE-C interface identifies the access line sequence of the load object according to the response signal of the load object, a differential signal chip or a protocol chip is not required to be additionally arranged, the TYPE-C signal transmission cost is reduced, the cost of the whole product is further reduced, the line sequence identification mode is simple, convenient and quick, the transmission efficiency of the TYPE-C signal is guaranteed, and the product performance is improved.
In an alternative embodiment, the method further comprises:
and when the response signal fed back by the load object through the TYPE-C interface is not received, changing the corresponding relation between the clock line and the data line and the sending signals of the clock signal and the data signal, re-sending the signals, and returning to the step of judging whether the response signal fed back by the load object through the TYPE-C interface is received.
When the load object does not feed back the response signal, the clock signal and the data signal are sent to the load object again through the interaction of the clock signal and the data signal sending position, so that the accuracy of the line sequence identification result is further improved.
In an optional implementation manner, the determining the access line sequence of the load object at the TYPE-C interface based on the signal sending correspondence relationship between the clock line and the data line and the clock signal and the data signal includes:
when the clock line correspondingly transmits the clock signal and the data line correspondingly transmits the data signal, determining that the access line sequence of the load object on the TYPE-C interface is positive;
and when the clock line correspondingly transmits the data signal and the data line correspondingly transmits the clock signal, determining that the access line sequence of the load object on the TYPE-C interface is in a reverse sequence.
Therefore, when the load object feedback response signal is received, the corresponding relation between the clock signal and the data signal and the corresponding relation between the clock line and the data line are utilized to determine the line sequence of the load object access, and the accuracy of the line sequence detection result is ensured.
In an alternative embodiment, the method further comprises:
Monitoring an access signal of the TYPE-C interface;
and when the access signal of the TYPE-C interface is monitored to be the preset signal corresponding to the load object, determining that the TYPE-C interface is accessed to the load object.
Therefore, whether a load object is accessed to the TYPE-C interface or not is monitored in a mode of comparing access signals of the TYPE-C interface, automatic identification of the load object access is further achieved, and line sequence identification efficiency of the TYPE-C interface is further improved.
In a second aspect, the present invention provides an electrical device comprising: TYPE-C interface, load object and controller,
the controller is in communication connection with the TYPE-C interface;
the controller is configured to perform the TYPE-C interface line sequence identification method according to the first aspect or any implementation manner corresponding to the first aspect.
Therefore, the controller of the electrical equipment is utilized to send clock signals and data signals to the load object through the TYPE-C interface in a software processing mode, the access line sequence of the load object is identified according to the response signals of the load object, a differential signal chip or a protocol chip is not required to be additionally arranged, the TYPE-C signal transmission cost is reduced, the cost of the whole product is further reduced, the line sequence identification mode is simple, convenient and quick, the transmission efficiency of the TYPE-C signals is guaranteed, and the product performance is improved.
In an alternative embodiment, the electrical device further comprises: the first controlled switch, the second controlled switch, the first energy storage capacitor, the second energy storage capacitor, the inductor and the internal power supply source, wherein,
the first end of the first controlled switch is connected with the TYPE-C interface and one end of the first energy storage capacitor respectively, the second end of the first controlled switch is connected with the first end of the second controlled switch and one end of the inductor respectively, and the control end of the first controlled switch is connected with the first driving end of the controller;
the other end of the inductor is connected with one end of the second energy storage capacitor and the positive electrode of the internal power supply respectively;
the second end of the second controlled switch is respectively connected with the other end of the first energy storage capacitor, the other end of the second energy storage capacitor, the negative electrode of the internal power supply and the grounding end of the TYPE-C interface, and the control end is connected with the second driving end of the controller;
the controller outputs a first switch control signal through the first driving end and outputs a second switch control signal through the second driving end according to the TYPE of the TYPE-C interface access object so as to realize charging/discharging control of the internal power supply, and the first switch control signal and the second switch control signal are complementary signals.
Thereby through utilizing controller output first switch control signal and second switch control signal, realize the inside power supply's of electrical equipment charge-discharge integrated design based on TYPE-C interface, realize the inside power supply's of electrical equipment automatic charge and automatic discharge's accurate control, promote the product performance of whole electrical equipment, promote user's use experience.
In an alternative embodiment, when the TYPE of the TYPE-C interface access object is an adapter, the controller determines a duty ratio of a first switch control signal based on a voltage output by the adapter and a charging voltage of the internal power supply, and determines a duty ratio of the second switch control signal based on the duty ratio of the first switch control signal;
or when the TYPE of the TYPE-C interface access object is a load object, the controller determines the duty ratio of a second switch control signal based on the discharge voltage of the internal power supply and the power supply voltage of the load object, and determines the duty ratio of the first switch control signal based on the duty ratio of the second switch control signal.
Therefore, the TYPE of the TYPE-C interface access object is identified through the controller, the first switch control signal and the second switch control signal are automatically adjusted, so that the accurate control of the charging and discharging of the internal power supply is realized, the flexibility of the TYPE-C interface access object is improved, the application range of an electrical product is enlarged, and the use experience of a user is further improved.
In an alternative embodiment, the electrical device further comprises: the first voltage acquisition circuit, the second voltage acquisition circuit, the first current acquisition circuit and the second current acquisition circuit, wherein,
the first input end of the first voltage acquisition circuit is connected with the first end of the first controlled switch, the second input end of the first voltage acquisition circuit is grounded, and the output end of the first voltage acquisition circuit is connected with the first voltage acquisition end of the controller;
the first input end of the second voltage acquisition circuit is connected with the positive electrode of the internal power supply, the second input end of the second voltage acquisition circuit is grounded, and the output end of the second voltage acquisition circuit is connected with the second voltage acquisition end of the controller;
the first end of the first current acquisition circuit is connected with the TYPE-C interface, the second end of the first current acquisition circuit is connected with the first end of the first controlled switch, and the output end of the first current acquisition circuit is connected with the first current acquisition end of the controller;
the first end of the second current acquisition circuit is connected with the other end of the inductor, the second end of the second current acquisition circuit is connected with the positive electrode of the internal power supply, and the output end of the second current acquisition circuit is connected with the second current acquisition end of the controller;
the controller is used for detecting voltage/current faults of the electrical equipment according to the first voltage of the first voltage acquisition end, the second voltage of the second voltage acquisition end, the first current of the first current acquisition end and the second current of the second current acquisition end, and stopping outputting the first switch control signal and the second switch control signal when the voltage/current faults exist in the electrical equipment.
Therefore, the voltage and current parameters of the internal power supply of the electrical equipment in the charging and discharging processes are acquired by utilizing the voltage and current acquisition circuit, the voltage/current protection function is realized by the controller, the safe use of the electrical equipment is ensured, and the service life of the electrical equipment is prolonged.
In an alternative embodiment, the controller is an MCU, and/or the first controlled switch is a PMOS tube, and/or the second controlled switch is an NMOS tube, and/or the electrical device is a portable cosmetic instrument, and the load object is a mask of the portable cosmetic instrument.
The portable beauty instrument provided by the invention can automatically realize line sequence identification and automatic charging and discharging functions of the TYPE-C interface, thereby improving the product performance and further improving the use experience of users.
In a third aspect, the present invention provides a TYPE-C interface line sequence identification device, where the device includes:
the first processing module is used for sending clock signals and data signals to a load object through clock lines and data lines of the TYPE-C interface respectively when the TYPE-C interface is monitored to be accessed to the load object;
the second processing module is used for judging whether a response signal fed back by the load object through the TYPE-C interface is received or not;
And the third processing module is used for determining the access line sequence of the load object on the TYPE-C interface based on the corresponding relation between the clock line and the data line and the signal transmission of the clock signal and the data signal when receiving the response signal fed back by the load object through the TYPE-C interface.
In a fourth aspect, the present invention provides a computer readable storage medium, where computer instructions are stored on the computer readable storage medium, where the computer instructions are configured to cause a computer to perform the TYPE-C interface line sequence identification method of the first aspect or any implementation manner corresponding to the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural view of an electrical device according to an embodiment of the present invention;
fig. 2 is a schematic circuit configuration diagram of an electrical device according to an embodiment of the present invention;
FIG. 3 is a flow chart of a TYPE-C interface line sequence identification method according to an embodiment of the present invention;
FIG. 4 is a flow chart of another TYPE-C interface line sequence identification method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a TYPE-C interface connection according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a specific operational procedure for TYPE-C interface line sequence identification in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of a TYPE-C interface line sequence identification device according to an embodiment of the present invention;
fig. 8 is a schematic structural view of a controller in an electrical device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The household beauty instrument products and similar portable products mostly adopt TYPE-C interfaces, and the number of data wires which can be transmitted by the TYPE-C interfaces is limited, but the TYPE-C interfaces support the condition of positive and negative insertion, so that the number of available data wires can be reduced by half, and only positive and negative insertion conditions of an access load need to be identified before use, namely line sequence identification is needed. In the related art, a differential signal chip or a protocol chip is generally required to be additionally arranged to control and realize a line sequence identification function, but the transmission cost of TYPE-C signals can be increased by additionally arranging the differential signal chip and the protocol chip, and the product cost is increased.
In an embodiment of the present invention, as shown in fig. 1, there is provided an electrical apparatus, including: a TYPE-C interface 102, a load object 101, and a controller 103, the controller 103 being communicatively connected to the TYPE-C interface 102;
the process of the controller 103 for executing the TYPE-C interface 102 line sequence identification method is referred to as related description of the method embodiment below, and will not be described herein.
Specifically, in the embodiment of the present invention, the description is given taking the electrical apparatus as the portable beauty apparatus as an example, and accordingly, the load object 101 is a mask of the portable beauty apparatus. In practical application, the electrical equipment may be other electrical equipment that uses the TYPE-C interface 102 to perform charging and communication, and the corresponding load object 101 is also a load corresponding to the electrical equipment.
In the embodiment of the present invention, the controller 103 is exemplified by the MCU, and in practical application, the controller 103 may be another processing chip such as a single chip microcomputer, and may be specifically set according to the design requirement of the electrical equipment, which is not limited to this.
Therefore, the controller of the electrical equipment is utilized to send clock signals and data signals to the load object through the TYPE-C interface in a software processing mode, the access line sequence of the load object is identified according to the response signals of the load object, a differential signal chip or a protocol chip is not required to be additionally arranged, the TYPE-C signal transmission cost is reduced, the cost of the whole product is further reduced, the line sequence identification mode is simple, convenient and quick, the transmission efficiency of the TYPE-C signals is guaranteed, and the product performance is improved.
In some alternative embodiments, as shown in fig. 2, the electrical device further comprises: the first controlled switch Q1, the second controlled switch Q2, the first energy storage capacitor C1, the second energy storage capacitor C2, the inductor L1 and the internal POWER supply POWER, wherein,
the first end of the first controlled switch Q1 is respectively connected with the TYPE-C interface 102 and one end of the first energy storage capacitor C1, the second end of the first controlled switch Q1 is respectively connected with the first end of the second controlled switch Q2 and one end of the inductor L1, and the control end of the first controlled switch Q1 is connected with the first driving end of the controller 103;
the other end of the inductor L1 is respectively connected with one end of the second energy storage capacitor C2 and the positive electrode of the internal POWER supply POWER;
the second end of the second controlled switch Q2 is respectively connected with the other end of the first energy storage capacitor C1, the other end of the second energy storage capacitor C2, the negative electrode of the internal POWER supply POWER and the grounding end of the TYPE-C interface 102, and the control end is connected with the second driving end of the controller 103;
The controller 103 outputs a first switch control signal through the first driving end and outputs a second switch control signal through the second driving end according to the TYPE of the TYPE-C interface 102 access object so as to realize charging/discharging control of the internal POWER supply POWER, wherein the first switch control signal and the second switch control signal are complementary signals.
Specifically, in the embodiment of the present invention, the first controlled switch Q1 is a PMOS transistor, and the second controlled switch Q2 is an NMOS transistor, and in practical application, the first controlled switch Q1 and the second controlled switch Q2 may also select transistors or other IGBT devices, so long as functions similar to the PMOS transistor and the NMOS transistor can be implemented, and the circuit structure and the specific connection mode may be adaptively adjusted.
The internal POWER supply POWER may be a rechargeable POWER source, such as a lithium battery, a lead-acid battery, or the like, which is hereinafter referred to as a battery, but the present invention is not limited thereto.
Thereby through utilizing controller output first switch control signal and second switch control signal, realize the inside power supply's of electrical equipment charge-discharge integrated design based on TYPE-C interface, realize the inside power supply's of electrical equipment automatic charge and automatic discharge's accurate control, promote the product performance of whole electrical equipment, promote user's use experience.
In some alternative embodiments, when the TYPE of the object to which the TYPE-C interface 102 is connected is an adapter, the controller 103 determines the duty cycle of the first switch control signal PWM1 based on the voltage output by the adapter and the charging voltage of the internal POWER supply POWER, and determines the duty cycle of the second switch control signal PWM2 based on the duty cycle of the first switch control signal PWM 1.
For example, when the TYPE of the object to be accessed by the TYPE-C interface 102 is an adapter, assuming that the output voltage of the adapter is Vo and the input voltage of the battery is Vin, the duty ratio d=vo/Vin of the first switch control signal PWM1, the second switch control signal PWM2 is complementary to the first switch control signal PWM1, that is, when the first switch control signal PWM1 is at a high level, the second switch control signal PWM2 is at a low level, and when the first switch control signal PWM1 is at a low level, the second switch control signal PWM2 is at a high level. In addition, in practical application, in order to avoid short circuit fault caused by the fact that the first switch control signal PWM1 and the second switch control signal PWM2 are at high level at the same time, by setting the first switch control signal PWM1 and the second switch control signal PWM2 to have a certain dead zone, both are prevented from being at high level at the same time, the setting of specific dead zone duration can be flexibly set according to the needs of practical electrical products, and the invention is not limited to this. In addition, the frequencies of the first switch control signal PWM1 and the second switch control signal PWM2 can be determined according to different inductances L1 and the charging conditions.
When the TYPE of the connection object of the TYPE-C interface 102 is the load object 101, the controller 103 determines the duty ratio of the second switch control signal PWM2 based on the discharging voltage of the internal POWER supply POWER and the POWER supply voltage of the load object 101, and determines the duty ratio of the first switch control signal PWM1 based on the duty ratio of the second switch control signal PWM 2.
For example, when the TYPE of the connection object of the TYPE-C interface 102 is the load object 101, i.e., the mask of the beauty apparatus, assuming that the power supply voltage of the mask is Vo and the output voltage of the battery is Vin, the duty ratio d= (Vo-Vin)/Vo of the second switch control signal PWM2 is complementary to the first switch control signal PWM 1. In addition, in practical application, in order to avoid short circuit fault caused by the fact that the first switch control signal PWM1 and the second switch control signal PWM2 are at high level at the same time, by setting the first switch control signal PWM1 and the second switch control signal PWM2 to have a certain dead zone, both are prevented from being at high level at the same time, the setting of specific dead zone duration can be flexibly set according to the needs of practical electrical products, and the invention is not limited to this. In addition, the frequencies of the first switch control signal PWM1 and the second switch control signal PWM2 can be determined according to different inductances L1 and the charging conditions.
Therefore, the TYPE of the TYPE-C interface access object is identified through the controller, the first switch control signal and the second switch control signal are automatically adjusted, so that the accurate control of the charging and discharging of the internal power supply is realized, the flexibility of the TYPE-C interface access object is improved, the application range of an electrical product is enlarged, and the use experience of a user is further improved.
In some alternative embodiments, as shown in fig. 2, the electrical apparatus further includes: a first voltage acquisition circuit 104, a second voltage acquisition circuit 105, a first current acquisition circuit 106, and a second current acquisition circuit 107, wherein,
a first input end of the first voltage acquisition circuit 104 is connected with a first end of the first controlled switch Q1, a second input end of the first voltage acquisition circuit is grounded, and an output end of the first voltage acquisition circuit is connected with a first voltage acquisition end of the controller 103;
the first input end of the second voltage acquisition circuit 105 is connected with the positive electrode of the internal POWER supply POWER, the second input end is grounded, and the output end is connected with the second voltage acquisition end of the controller 103;
the first end of the first current acquisition circuit 106 is connected with the TYPE-C interface 102, the second end is connected with the first end of the first controlled switch Q1, and the output end is connected with the first current acquisition end of the controller 103;
The first end of the second current acquisition circuit 107 is connected with the other end of the inductor L1, the second end is connected with the positive electrode of the internal POWER supply POWER, and the output end is connected with the second current acquisition end of the controller 103;
the controller 103 is configured to determine whether an overvoltage/overcurrent fault exists in the electrical device according to the first voltage of the first voltage acquisition terminal, the second voltage of the second voltage acquisition terminal, the first current of the first current acquisition terminal, and the second current of the second current acquisition terminal, and stop outputting the first switch control signal PWM1 and the second switch control signal PWM2 when the overvoltage/overcurrent fault exists in the electrical device.
Specifically, as shown in fig. 2, the embodiment of the present invention is described taking the first voltage acquisition circuit 104 and the second voltage acquisition circuit 105 as voltage dividing circuits and the first current acquisition circuit 106 and the second current acquisition circuit 107 as resistors as examples, and in practical application, the voltage acquisition circuit and the current acquisition circuit may be implemented by other circuit structures in the prior art, such as a current transformer, etc., which is not limited to this embodiment.
Further, the specific implementation process of the controller 103 for detecting the voltage/current fault based on the collected voltage and current signals is the prior art, and will not be described herein.
Illustratively, when the TYPE-C interface 102 is connected to the adapter, overvoltage protection is provided for the internal POWER supply POWER; overcurrent protection and voltage abnormality protection are provided for the TYPE-C input end, under-voltage protection is provided for the internal POWER supply POWER when the TYPE-C interface 102 is connected with the object which is the load object 101, and overcurrent protection is provided for the TYPE-C output end.
Therefore, the voltage and current parameters of the internal power supply of the electrical equipment in the charging and discharging processes are acquired by utilizing the voltage and current acquisition circuit, the voltage/current protection function is realized by the controller, the safe use of the electrical equipment is ensured, and the service life of the electrical equipment is prolonged.
The portable beauty instrument provided by the embodiment of the invention can automatically realize the line sequence identification and automatic charging and discharging functions of the TYPE-C interface, thereby improving the product performance and further improving the use experience of users.
According to an embodiment of the present invention, there is provided a TYPE-C interface line sequence identification method embodiment, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical sequence is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in a different order than that illustrated herein.
In this embodiment, a TYPE-C interface line sequence identification method is provided, where the TYPE-C interface line sequence identification method may be used for a controller 103 of an electrical device shown in fig. 1, such as an MCU, a single-chip microcomputer, etc., and fig. 3 is a flowchart of the TYPE-C interface line sequence identification method according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
in step S301, when it is monitored that the TYPE-C interface accesses the load object, the clock signal and the data signal are sent to the load object through the clock line and the data line of the TYPE-C interface, respectively.
Specifically, the transmission relationship between the clock line and the data line and between the clock signal and the data signal may be random or may be transmitted according to a preset sequence, and in this embodiment of the present invention, for example, a default load object, that is, a manner that the mask and the TYPE-C interface are connected in positive sequence is taken as an example, the clock signal is transmitted through the clock line, and the data signal is transmitted through the data line, and in practical application, the data signal may be transmitted through the clock line and the clock signal is transmitted through the data line, which is not limited to this embodiment.
Step S302, judging whether a response signal fed back by the load object through the TYPE-C interface is received.
Specifically, since pins of the TYPE-C interface generally have pins 1-12, only 1-12 opposite insertion or 12-1 opposite insertion is possible when a USB wire is used, that is, the positive and negative wire sequences can only exist under the condition of no abnormality; when the clock signal and the data signal are consistent with the connection line corresponding to the TYPE-C interface to which the load object is actually connected, the load object feeds back a response signal through the TYPE-C interface, for example, by using a conventional communication IIC as an example, the controller sends address information to the load object through the data line of the TYPE-C interface, if the address information is received by a receiver, a high level is fed back at the falling edge of the clock signal sent by the clock line, so that the data line of the TYPE-C interface is the actual data line of the load object, and the specific communication principle can refer to a general IIC communication protocol. If no feedback signal is received, it is stated that the data line of the TYPE-C interface is not actually the data line of the load object.
In step S303, when receiving the response signal fed back by the load object through the TYPE-C interface, the access line sequence of the load object at the TYPE-C interface is determined based on the signal transmission correspondence relationship between the clock line and the data line and the clock signal and the data signal.
Specifically, if the clock line sends a clock signal when receiving a response signal fed back by the load, the data line sends a data signal, then the access line sequence of the load object at the TYPE-C interface is determined to be positive, and if the clock line sends a data signal when receiving a response signal fed back by the load, then the data line sends a clock signal, then the access line sequence of the load object at the TYPE-C interface is determined to be reverse.
Therefore, the software processing mode of sending the clock signal and the data signal to the load object through the TYPE-C interface identifies the access line sequence of the load object according to the response signal of the load object, a differential signal chip or a protocol chip is not required to be additionally arranged, the TYPE-C signal transmission cost is reduced, the cost of the whole product is further reduced, the line sequence identification mode is simple, convenient and quick, the transmission efficiency of the TYPE-C signal is guaranteed, and the product performance is improved.
In this embodiment, a TYPE-C interface line sequence identification method is also provided, where the TYPE-C interface line sequence identification method may be used for the controller 103 of the electrical apparatus shown in fig. 1, such as an MCU, a single-chip microcomputer, etc., and fig. 4 is a flowchart of the TYPE-C interface line sequence identification method according to an embodiment of the present invention, as shown in fig. 4, where the flowchart includes the following steps:
In step S401, an access signal of a TYPE-C interface is monitored.
Step S402, when the access signal of the TYPE-C interface is monitored to be the preset signal corresponding to the load object, determining that the TYPE-C interface is accessed to the load object.
Specifically, the preset signal is a signal that is correspondingly sent when the load object accesses the TYPE-C interface, and the preset signal is an exemplary high-level signal, and in practical application, the preset signal may also be an encrypted signal of a custom protocol, or may also be a conventional IIC or SPI signal, etc. used for controlling the mask phototherapy lamp and assisting in identifying the mask, or may also be another fixed signal, such as a high-low-level signal with a certain duty ratio, which is only for example, but not limited thereto. Illustratively, when a load object is inserted into the TYPE-C interface, such as when a mask of a cosmetic instrument is inserted into the TYPE-C interface, a signal is provided to the controller, such as providing a high level, and the controller determines that the TYPE-C interface is connected to the load object, i.e., to the mask, when the high level signal is received through the TYPE-C interface.
Therefore, whether a load object is accessed to the TYPE-C interface or not is monitored in a mode of comparing access signals of the TYPE-C interface, automatic identification of the load object access is further achieved, and line sequence identification efficiency of the TYPE-C interface is further improved.
In step S403, when it is monitored that the TYPE-C interface accesses the load object, the clock signal and the data signal are transmitted to the load object through the clock line and the data line of the TYPE-C interface, respectively. Details refer to the related description of step S301 shown in fig. 3, and will not be described herein.
Step S404, judging whether a response signal fed back by the load object through the TYPE-C interface is received. Details refer to the related description of step S302 shown in fig. 3, and will not be described herein.
In step S405, when receiving a response signal fed back by the load object through the TYPE-C interface, an access line sequence of the load object at the TYPE-C interface is determined based on the signal transmission correspondence between the clock line and the data line and the clock signal and the data signal.
Specifically, the step S405 includes:
in step S4051, when the clock line corresponds to the transmission clock signal and the data line corresponds to the transmission data signal, it is determined that the access line sequence of the load object at the TYPE-C interface is positive.
In step S4052, when the clock line corresponds to the transmission data signal and the data line corresponds to the transmission clock signal, it is determined that the access line sequence of the load object at the TYPE-C interface is the reverse sequence.
Therefore, when the load object feedback response signal is received, the corresponding relation between the clock signal and the data signal and the corresponding relation between the clock line and the data line are utilized to determine the line sequence of the load object access, and the accuracy of the line sequence detection result is ensured.
In step S406, when the response signal fed back by the load object through the TYPE-C interface is not received, the correspondence relationship between the clock line and the data line and the transmission signals of the clock signal and the data signal is changed, and the signal transmission is performed again, and the process returns to step S404.
Specifically, when the response signal fed back by the load object through the TYPE-C interface is not received, the data content sent by the clock line and the data line is exchanged, for example, the clock signal originally sent by the clock line is sent through the data line, and the data signal originally sent by the data line is sent through the clock line.
Further, if the response signal fed back by the load object through the TYPE-C interface is still not received after the step S404 is re-executed, the line sequence recognition is described as abnormal, and a corresponding abnormal alarm signal may be generated to prompt the user to overhaul.
When the load object does not feed back the response signal, the clock signal and the data signal are sent to the load object again through the interaction of the clock signal and the data signal sending position, so that the accuracy of the line sequence identification result is further improved.
The process of performing TYPE-C interface line sequence identification and automatic charging and discharging on the electrical equipment provided by the embodiment of the invention will be described in detail below with reference to specific application examples.
As shown in fig. 2, when the TYPE-C interface is plugged into the TYPE-C adapter, the MCU detects the POWER input by using AD through the R2/R3 voltage division, and detects the input current through R1, at this time, the MCU adjusts PWM1 and PWM2, and the output POWER source charges the battery, i.e., POWER, detects the charging voltage of the battery through the R5/R6 voltage division, detects the charging current of the battery through R4, provides overvoltage protection for the battery, and provides overcurrent protection and voltage abnormality protection for the TYPE-C input terminal.
When the TYPE-C interface is inserted into the mask of the beauty instrument, the connection mode of the TYPE-C load end, namely the mask and the TYPE-C interface is shown in fig. 5, wherein SDA is a serial data line for short, and is responsible for transmitting data under the synchronization of SCL clock signals, while SCL is a serial clock line for short, and is responsible for providing synchronized clock signals. Performing line sequence identification according to the scheme shown in fig. 6, confirming the connected line sequence, adjusting the PWM1 and PWM2 to reversely output power through TYPE-C, enabling an MCU to output corresponding control signals to a mask through a TYPE-C interface, dividing voltage through R2/R3, detecting voltage output by the power supply by using AD, and detecting output current by using R1; the discharging voltage of the battery is detected through R5/R6 voltage division, the discharging current of the battery is detected through R4, under-voltage protection is provided for the battery, and overcurrent protection is provided for the TYPE-C output end.
The electrical equipment provided by the embodiment of the invention can be household beauty instrument products powered by a lithium battery and similar portable products. The main design functions of the electrical equipment are as follows: firstly, line sequence identification of TYPE-C, because the quantity of data lines which can be transmitted by TYPE-C is limited, the quantity of available data lines can be reduced by half because the TYPE-C supports the condition of positive and negative insertion, and differential signal chips or protocol chips are saved through software identification; secondly, the charge-discharge integrated circuit is designed, the charge-discharge integrated circuit and the charge-discharge integrated circuit are of the same circuit architecture, a separate circuit is not required to be added, and when the charge-discharge integrated circuit is identified as being input into the TYPE-C adapter, a charging mode is entered to charge a battery; and when the load is identified to be output by the line sequence, a discharging mode is entered, and a power supply and a control signal are provided for the load. Therefore, the line sequence identification is performed in a software mode to realize low cost of TYPE-C signal transmission, and the control mode is simpler; and the charging and discharging integration of the electrical equipment is realized by utilizing the same circuit architecture, so that the output capacity of the electrical equipment is accurately controlled.
The embodiment also provides a TYPE-C interface line sequence identification device, which is used for implementing the above embodiment and the preferred implementation manner, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a TYPE-C interface line sequence identification device, which is applied to a controller 103 of an electrical apparatus shown in fig. 1, as shown in fig. 7, and includes:
the first processing module 701 is configured to send a clock signal and a data signal to a load object through a clock line and a data line of the TYPE-C interface, respectively, when it is monitored that the TYPE-C interface accesses the load object;
the second processing module 702 is configured to determine whether a response signal fed back by the load object through the TYPE-C interface is received;
the third processing module 703 is configured to determine an access line sequence of the load object on the TYPE-C interface based on the signal transmission correspondence between the clock line and the data line and the clock signal and the data signal when receiving a response signal fed back by the load object through the TYPE-C interface.
In some optional embodiments, the TYPE-C interface line sequence identification apparatus further includes:
and the fourth processing module is configured to, when no response signal fed back by the load object through the TYPE-C interface is received, change the corresponding relationship between the clock line and the data line and the transmission signals of the clock signal and the data signal, re-perform signal transmission, and call the second processing module 702 to operate.
In some alternative embodiments, the third processing module 703 specifically includes:
the first processing unit is used for determining that the access line sequence of the load object on the TYPE-C interface is positive when the clock line corresponds to the transmission clock signal and the data line corresponds to the transmission data signal;
and the second processing unit is used for determining that the access line sequence of the load object on the TYPE-C interface is in a reverse sequence when the clock line corresponds to the data signal and the data line corresponds to the clock signal.
In some optional embodiments, the TYPE-C interface line sequence identification apparatus further includes:
the fifth processing module is used for monitoring the access signal of the TYPE-C interface;
and the sixth processing module is used for determining that the TYPE-C interface is connected to the load object when the access signal of the TYPE-C interface is monitored to be the preset signal corresponding to the load object.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding method embodiments, and are not repeated here.
The TYPE-C interface line sequence identification device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit ) circuit, a processor and a memory executing one or more software or fixed programs, and/or other devices that can provide the above-described functions.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a controller 103 in the above electrical apparatus according to an alternative embodiment of the present invention, as shown in fig. 8, the controller 103 includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 8.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The controller 103 also includes a communication interface 30 for the controller to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (11)

1. A TYPE-C interface line sequence identification method is characterized by comprising the following steps:
when the TYPE-C interface is monitored to be accessed to a load object, respectively transmitting a clock signal and a data signal to the load object through a clock line and a data line of the TYPE-C interface;
judging whether a response signal fed back by the load object through the TYPE-C interface is received or not;
and when receiving a response signal fed back by the load object through the TYPE-C interface, determining an access line sequence of the load object on the TYPE-C interface based on the corresponding relation between the clock line and the data line and the signal transmission of the clock signal and the data signal.
2. The TYPE-C interface line sequence identification method of claim 1, further comprising:
and when the response signal fed back by the load object through the TYPE-C interface is not received, changing the corresponding relation between the clock line and the data line and the sending signals of the clock signal and the data signal, re-sending the signals, and returning to the step of judging whether the response signal fed back by the load object through the TYPE-C interface is received.
3. The TYPE-C interface line sequence identification method according to claim 1 or 2, wherein the determining the access line sequence of the load object at the TYPE-C interface based on the signal transmission correspondence relationship between the clock line and the data line and the clock signal and the data signal includes:
when the clock line correspondingly transmits the clock signal and the data line correspondingly transmits the data signal, determining that the access line sequence of the load object on the TYPE-C interface is positive;
and when the clock line correspondingly transmits the data signal and the data line correspondingly transmits the clock signal, determining that the access line sequence of the load object on the TYPE-C interface is in a reverse sequence.
4. The TYPE-C interface line sequence identification method of claim 1, further comprising:
monitoring an access signal of the TYPE-C interface;
and when the access signal of the TYPE-C interface is monitored to be the preset signal corresponding to the load object, determining that the TYPE-C interface is accessed to the load object.
5. An electrical device, comprising: TYPE-C interface, load object and controller, characterized in that,
the controller is in communication connection with the TYPE-C interface;
The controller is configured to perform the TYPE-C interface line sequence identification method according to any one of claims 1 to 4.
6. The electrical device of claim 5, wherein the electrical device further comprises: the first controlled switch, the second controlled switch, the first energy storage capacitor, the second energy storage capacitor, the inductor and the internal power supply source, wherein,
the first end of the first controlled switch is connected with the TYPE-C interface and one end of the first energy storage capacitor respectively, the second end of the first controlled switch is connected with the first end of the second controlled switch and one end of the inductor respectively, and the control end of the first controlled switch is connected with the first driving end of the controller;
the other end of the inductor is connected with one end of the second energy storage capacitor and the positive electrode of the internal power supply respectively;
the second end of the second controlled switch is respectively connected with the other end of the first energy storage capacitor, the other end of the second energy storage capacitor, the negative electrode of the internal power supply and the grounding end of the TYPE-C interface, and the control end is connected with the second driving end of the controller;
the controller outputs a first switch control signal through the first driving end and outputs a second switch control signal through the second driving end according to the TYPE of the TYPE-C interface access object so as to realize charging/discharging control of the internal power supply, and the first switch control signal and the second switch control signal are complementary signals.
7. The electrical device of claim 6, wherein the electrical device comprises a plurality of electrical conductors,
when the TYPE of the TYPE-C interface access object is an adapter, the controller determines the duty ratio of a first switch control signal based on the voltage output by the adapter and the charging voltage of the internal power supply, and determines the duty ratio of a second switch control signal based on the duty ratio of the first switch control signal;
or when the TYPE of the TYPE-C interface access object is a load object, the controller determines the duty ratio of a second switch control signal based on the discharge voltage of the internal power supply and the power supply voltage of the load object, and determines the duty ratio of the first switch control signal based on the duty ratio of the second switch control signal.
8. The electrical device of claim 6, further comprising: the first voltage acquisition circuit, the second voltage acquisition circuit, the first current acquisition circuit and the second current acquisition circuit, wherein,
the first input end of the first voltage acquisition circuit is connected with the first end of the first controlled switch, the second input end of the first voltage acquisition circuit is grounded, and the output end of the first voltage acquisition circuit is connected with the first voltage acquisition end of the controller;
The first input end of the second voltage acquisition circuit is connected with the positive electrode of the internal power supply, the second input end of the second voltage acquisition circuit is grounded, and the output end of the second voltage acquisition circuit is connected with the second voltage acquisition end of the controller;
the first end of the first current acquisition circuit is connected with the TYPE-C interface, the second end of the first current acquisition circuit is connected with the first end of the first controlled switch, and the output end of the first current acquisition circuit is connected with the first current acquisition end of the controller;
the first end of the second current acquisition circuit is connected with the other end of the inductor, the second end of the second current acquisition circuit is connected with the positive electrode of the internal power supply, and the output end of the second current acquisition circuit is connected with the second current acquisition end of the controller;
the controller is used for detecting voltage/current faults of the electrical equipment according to the first voltage of the first voltage acquisition end, the second voltage of the second voltage acquisition end, the first current of the first current acquisition end and the second current of the second current acquisition end, and stopping outputting the first switch control signal and the second switch control signal when the voltage/current faults exist in the electrical equipment.
9. The electrical device according to any one of claims 5-8, wherein the controller is an MCU, and/or the first controlled switch is a PMOS tube, and/or the second controlled switch is an NMOS tube, and/or the electrical device is a portable cosmetic instrument, and the load object is a mask of the portable cosmetic instrument.
10. A TYPE-C interface line sequence identification device, the device comprising:
the first processing module is used for sending clock signals and data signals to a load object through clock lines and data lines of the TYPE-C interface respectively when the TYPE-C interface is monitored to be accessed to the load object;
the second processing module is used for judging whether a response signal fed back by the load object through the TYPE-C interface is received or not;
and the third processing module is used for determining the access line sequence of the load object on the TYPE-C interface based on the corresponding relation between the clock line and the data line and the signal transmission of the clock signal and the data signal when receiving the response signal fed back by the load object through the TYPE-C interface.
11. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1 to 4.
CN202311592396.9A 2023-11-24 2023-11-24 TYPE-C interface line sequence identification method and device, electrical equipment and medium Pending CN117630756A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311592396.9A CN117630756A (en) 2023-11-24 2023-11-24 TYPE-C interface line sequence identification method and device, electrical equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311592396.9A CN117630756A (en) 2023-11-24 2023-11-24 TYPE-C interface line sequence identification method and device, electrical equipment and medium

Publications (1)

Publication Number Publication Date
CN117630756A true CN117630756A (en) 2024-03-01

Family

ID=90031496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311592396.9A Pending CN117630756A (en) 2023-11-24 2023-11-24 TYPE-C interface line sequence identification method and device, electrical equipment and medium

Country Status (1)

Country Link
CN (1) CN117630756A (en)

Similar Documents

Publication Publication Date Title
US9553460B2 (en) Wireless battery management system
US9595847B2 (en) Uninterrupted lithium battery power supply system
KR102070044B1 (en) Battery charging apparatus and method
US11041889B2 (en) Method for estimating load current of power supply, and USB-type converter
KR20200052132A (en) Battery Module System
CN106100858B (en) Standard POE and force non-standard POE integration to receive power supply circuit
CN104239240A (en) Electronic device with universal serial bus (USB) interface with integration function
CN104216499A (en) Equipment cabinet and power source control method thereof
JP2018513660A (en) CHARGE CONTROL METHOD AND DEVICE AND ELECTRONIC DEVICE
EP3148039A1 (en) Fast charging method, power source adapter and mobile terminal
US11641124B2 (en) Electronic device and charging method thereof
US20220166232A1 (en) Charging management system and method, device, and storage medium
US20220277914A1 (en) Circuit Breaker Identification Method and Apparatus, and Device
US20230196269A1 (en) Method for setting shipping mode, electronic device, and computer-readable storage medium
WO2023184830A1 (en) Control circuit, method, and apparatus for backup battery unit, and storage system
US11316351B2 (en) Power bridge device using mobile robot battery
CN112865248B (en) Method and device for detecting box entering of wireless earphone, charging box and readable storage medium
EP3330835A1 (en) Power adapter, terminal device, charging system, and charging method
US10461555B2 (en) Battery charging for mobile devices
CN113329286B (en) Wireless earphone and wireless earphone system
KR102678278B1 (en) Terminating resistance setting circuit and battery management system including same
CN117630756A (en) TYPE-C interface line sequence identification method and device, electrical equipment and medium
CN112838645A (en) Charging control method and device for charging box, charging box and readable storage medium
CN109378891B (en) Charging and discharging method, mobile power supply and computer storage medium
CN107196770B (en) System for supplying power through signal wire

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