Hardware port matching method and device and storage medium

Obtain matching signals through the power pin power-on and functional pin interrupt mode of the hardware port, automatically determine the device type and set the target pin, solving the problems of pin waste and high cost in the existing hardware port design, and realizing efficient hardware Port matching and adaptation.

CN118779269APending Publication Date: 2024-10-15UBTECH ROBOTICS CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410823439.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing hardware port design doubles the number of pins due to the symmetrical method, resulting in waste of resources and increased costs, making it difficult to achieve efficient matching and adaptation.

Method used

By powering on the power pin of the hardware port and setting the function pin to interrupt mode, the pin matching signal of the slave device is obtained, the device type is determined based on the signal and the target pin is set, realizing automatic adaptation, reducing the number of pins and reducing costs.

Benefits of technology

It realizes automatic adaptation of hardware ports, reduces the number of pins, reduces the cost of hardware ports, and improves connection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779269A_ABST
    Figure CN118779269A_ABST
Patent Text Reader

Abstract

The invention provides a hardware port matching method and device and a storage medium, and the method comprises the steps: controlling a power pin of a hardware port to be powered on, and supplying power to slave equipment through the power pin; setting each function pin of the hardware port to be in an interrupt mode; obtaining a pin matching signal sent by a secondary pin of the slave device, and determining the device type of the slave device according to the pin matching signal; and determining a target pin corresponding to the equipment type from the plurality of function pins, and setting the target pin to be in a normal mode. According to the invention, automatic adaptation of the hardware port can be realized, the number of pins is greatly reduced, and the cost of the hardware port is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hardware ports, and in particular to a hardware port matching method, device and storage medium. Background Art

[0002] Hardware ports are necessary devices for realizing information exchange between devices or between modules of devices. In order to achieve matching, most existing hardware ports adopt type-c interface mode, and all functional pins are designed and wired in a symmetrical manner to ensure that both forward access and reverse access of the port can correspond to each functional pin. However, this symmetrical design method will cause the number of pins to double, resulting in waste of pin resources and increased costs. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide a hardware port matching method, device and storage medium.

[0004] The present invention provides the following technical solutions:

[0005] In a first aspect, the present application provides a hardware port matching method, which is applied to a master device, wherein the master device is connected to a slave device via a hardware port, wherein the hardware port includes: a power pin and a plurality of function pins, and the method includes:

[0006] Controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin;

[0007] Setting each of the function pins of the hardware port to an interrupt mode;

[0008] Acquire a pin matching signal sent by a secondary pin of the slave device, and determine a device type of the slave device according to the pin matching signal;

[0009] A target pin corresponding to the device type is determined from the plurality of function pins, and the target pin is set to a normal mode.

[0010] In one implementation, determining the device type of the slave device according to the pin matching signal includes:

[0011] Determining whether the pin matching signal is a preset matching signal; each preset matching signal corresponds to one of the device types;

[0012] If it is the preset matching signal, the device type of the slave device is determined according to the preset matching signal.

[0013] In one implementation, after determining whether the pin matching signal is a preset matching signal, the method includes:

[0014] If the pin matching signal is not the preset matching signal, each of the functional pins of the hardware port is set to an interrupt mode, and the step of obtaining the pin matching signal sent by the secondary pin of the slave device is re-executed.

[0015] In one implementation, the preset matching signal includes a 0x55 signal and a square wave signal, and determining the device type of the slave device according to the preset matching signal includes:

[0016] If the pin matching signal is a 0x55 signal, it is determined that the slave device is a serial port device;

[0017] If the pin matching signal is a square wave signal, it is determined that the slave device is an IIC device.

[0018] In one implementation, determining the corresponding target pin in the function pin according to the device type includes:

[0019] If the slave device is a serial port device, determining the function pin corresponding to the serial port device among the function pins as the target pin;

[0020] If the slave device is an IIC device, a function pin among the function pins corresponding to the IIC device is determined as the target pin.

[0021] In one implementation manner, the number of the power pins is at least two and they are symmetrically arranged; and the determining, according to the device type, the corresponding target pin in the function pins further includes:

[0022] Acquire a power supply signal of the power supply pin, and determine a target pin for supplying power to the slave device according to the power supply signal;

[0023] Determining, according to the target pin, an insertion mode of inserting the hardware port into the slave device; the insertion mode includes forward insertion and reverse insertion;

[0024] According to the insertion mode and the device type, a corresponding target pin among the function pins is determined.

[0025] In one implementation manner, after turning on the function of the function pin corresponding to the device type, the method includes:

[0026] A matching information closing instruction is sent to the slave device, and the slave device is controlled to stop sending the pin matching signal through the matching information closing instruction.

[0027] In a second aspect, the present application provides a master device, wherein the master device is connected to a slave device via a hardware port, wherein the hardware port includes: a power pin and a plurality of function pins, and the master device includes:

[0028] A control module, used for controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin;

[0029] A setting module, used for setting each of the function pins of the hardware port to an interrupt mode;

[0030] A matching module, used for acquiring a pin matching signal sent by a secondary pin of the slave device, and determining a device type of the slave device according to the pin matching signal;

[0031] The determination module is used to determine a target pin corresponding to the device type from the plurality of function pins, and set the target pin to a normal mode.

[0032] In a third aspect, the present application provides an electronic device, comprising a memory and at least one processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the hardware port matching method as described in the first aspect.

[0033] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the hardware port matching method as described in the first aspect is implemented.

[0034] The embodiments of the present invention have the following beneficial effects:

[0035] The hardware port matching method provided in the present application determines the target pin corresponding to the slave device from multiple functional pins of the hardware port through the port matching method, and then connects with the slave device through the target pin, thereby realizing automatic adaptation of the hardware port, greatly reducing the number of pins, and reducing the cost of the hardware port.

[0036] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A schematic diagram of a hardware port matching method flow is shown;

[0039] Figure 2 A schematic diagram of the first hardware port structure is shown;

[0040] Figure 3 A schematic diagram of the second hardware port structure is shown;

[0041] Figure 4 A third hardware port structure schematic diagram is shown;

[0042] Figure 5 A schematic flow chart of a target pin determination method is shown;

[0043] Figure 6 A schematic diagram of the main equipment framework structure is shown.

[0044] Description of main component symbols:

[0045] 600, main device; 601, control module; 602, setting module; 603, matching module; 604, determination module. DETAILED DESCRIPTION

[0046] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0047] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0049] Example 1

[0050] Traditional hardware ports are adapted to be inserted into slave devices in either forward or reverse directions, usually using a type-C interface, or anti-reverse insertion port design to avoid reverse insertion. However, these methods either increase the number of pins or make reverse insertion easy due to poor terminal design, resulting in circuit damage. To this end, the present application provides a hardware port matching method.

[0051] See also Figure 1 , Figure 1 A flowchart of a hardware port matching method provided in this embodiment is provided. The method is applied to a master device, which can be various electronic devices. The master device is connected to a slave device via a hardware port. The hardware port includes: a power pin and multiple function pins. The method includes:

[0052] S101, controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin.

[0053] Specifically, in order to ensure that the hardware port can be powered normally when the slave device is inserted forward or reversely, the power pins can be symmetrically arranged, such as symmetrical in the middle or symmetrical at both ends. Alternatively, a corresponding symmetrical design can be performed according to actual conditions.

[0054] See also Figure 2 , Figure 3 and Figure 4 , Figure 2 , Figure 3 and Figure 4 This is a schematic diagram of the structures of three different hardware ports provided in this embodiment.

[0055] The hardware port provided in this embodiment has a power pin VCC set in the middle position. Therefore, except for adding a ground pin GND to the normal port design, the other pins are the same as the normal port design, which greatly saves the number of pins, making the port design more compact and exquisite, and greatly saving costs.

[0056] like Figure 2 , Figure 3 and Figure 4 The power pin VCC of the hardware port shown is set in the middle position, so only one power pin needs to be set. If the power pin VCC is set at both ends, at least two power pins VCC need to be set, and the two power pins VCC are set symmetrically to ensure that the hardware port can power the slave device when the slave device is inserted forward or reverse.

[0057] S102: Set each of the function pins of the hardware port to an interrupt mode.

[0058] Interrupt is a powerful mechanism for responding to and processing external events or internal state changes. It is used to implement operations such as timers, serial communications, input and output, etc. Interrupt mode can interrupt the executing program.

[0059] S103: Acquire a pin matching signal sent by a secondary pin of the slave device, and determine a device type of the slave device according to the pin matching signal.

[0060] See also Figure 5 , step S103 includes:

[0061] S1031. Determine whether the pin matching signal is a preset matching signal; each preset matching signal corresponds to one device type.

[0062] Specifically, when the slave device is powered on, different slave devices will automatically send different matching signals through the secondary pins. Therefore, in order to achieve port adaptation, the hardware port will set corresponding function pins according to the purpose to connect different slave devices. Among them, the secondary pin is also a kind of function pin.

[0063] Therefore, when the master device receives the pin matching signal sent by the secondary pin of the slave device, it needs to determine whether it is one of the preset matching signals. If it is, it means that the hardware port can be connected to the slave device normally. If not, it means that the applicable port is wrong, or the slave device is wrong, that is, the two do not match. At this time, an alarm or the like can be used to remind the user whether the wrong hardware port is used or the wrong slave device is connected.

[0064] Common preset matching signals include 0x55 signal and square wave signal, among which, the serial port device will automatically and continuously send data 0x55 signal on its TX pin, and the IIC device will output a square wave signal of a specific frequency on the CLK pin. Other similar devices can also send corresponding pin matching signals through corresponding pins.

[0065] S1032: If it is the preset matching signal, determine the device type of the slave device according to the preset matching signal.

[0066] If the master device determines that the pin matching signal sent by the slave device is a preset matching signal, the type of the slave device can be determined.

[0067] For example, if it is determined that the pin matching signal sent by the slave device is a 0x55 signal, then the slave device is determined to be a serial port device.

[0068] If it is determined that the pin matching signal sent by the slave device is a square wave signal, it is determined that the slave device is an IIC device.

[0069] If the pin matching signal is not the preset matching signal, each of the functional pins of the hardware port is set to an interrupt mode, and the step of obtaining the pin matching signal sent by the secondary pin of the slave device is re-executed.

[0070] For example: when designing a hardware port, it can only be connected to a serial port device and an IIC device. The master device can only recognize 0x55 signals and square wave signals. If the pin matching signal sent by the slave device is not 0x55 signals and square wave signals, it means that the signal sent by the slave device is wrong. At this time, the pin matching signal can be re-acquired. If the pin matching signals obtained multiple times are not 0x55 signals or square wave signals, an alarm prompt can be issued.

[0071] S104: Determine a target pin corresponding to the device type from the plurality of function pins, and set the target pin to a normal mode.

[0072] like Figure 2-Figure 4 As shown, a hardware port has multiple function pins. When connecting different slave devices, the target pins used are also different. Therefore, it is necessary to determine the target pin corresponding to the slave device from the multiple function pins of the hardware port according to the type of the slave device.

[0073] For example: if the slave device is a serial port device, the function pin corresponding to the serial port device among the function pins is determined as the target pin;

[0074] If the slave device is an IIC device, a function pin among the function pins corresponding to the IIC device is determined as the target pin.

[0075] For example, a hardware port has six pins, ABCDEF, where CD is the power supply pin and ground pin, respectively, and is usually set to a common mode. AB is used to connect to a serial device, and EF is used to connect to an IIC device. When the slave device is a serial device, AB is the target pin, and when the slave device is an IIC device, EF is the target pin.

[0076] See also Figure 5 , when the number of the power pins is at least two and they are symmetrically arranged; the method further comprises:

[0077] S1041. Obtain a power supply signal from the power supply pin, and determine a target pin for supplying power to the slave device according to the power supply signal.

[0078] Specifically, if there is only one power pin and it is set in the middle of the hardware port, then no matter whether the hardware port is inserted forward or reverse, the power pin can supply power normally. At this time, you only need to determine the type of the slave device.

[0079] If the power pins are set at both ends, you need to first determine the target power pins for powering the slave device.

[0080] S1042: Determine, according to the target pin, an insertion mode of the hardware port into the slave device; the insertion mode includes forward insertion and reverse insertion.

[0081] After determining the target power supply pin, it can be determined whether the hardware port is inserted in the forward direction or the reverse direction.

[0082] When the hardware port has two power pins, the judgment logic of the insertion mode is defined in advance. For example, when power is supplied through the first power pin, it is determined to be a forward insertion. When power is supplied through the second pin, it is determined to be a reverse insertion. Alternatively, the corresponding judgment logic can be set according to the actual situation.

[0083] S1043: Determine a corresponding target pin among the function pins according to the insertion mode and the device type.

[0084] Specifically, the corresponding target pin may be determined according to the insertion mode and the type of the slave device.

[0085] For example, when it is determined that the insertion mode of the hardware port is forward insertion, and the slave device is a serial port device, it is possible to determine which of the multiple function pins of the hardware port are the first target pins.

[0086] When it is determined that the insertion mode of the hardware port is reverse insertion and the slave device is a serial port device, it can be determined which of the multiple function pins of the hardware port are the second target pins.

[0087] When it is determined that the insertion mode of the hardware port is forward insertion, and the slave device is an IIC device, it can be determined which of the multiple function pins of the hardware port are the third target pins.

[0088] When it is determined that the insertion mode of the hardware port is reverse insertion, and the slave device is an IIC device, it can be determined which of the multiple function pins of the hardware port are the fourth target pins.

[0089] Among them, the first target pin, the second target pin, the third target pin and the fourth target pin are only used to distinguish the target pins of the hardware port in different situations. The user can set or define them in advance according to the actual situation, so that the hardware port can better and more accurately determine the corresponding target pin when sampling different insertion modes and connecting different slave devices, thereby improving the efficiency of connection or pin identification.

[0090] In one implementation, after enabling the function of the function pin corresponding to the device type, the method further includes:

[0091] A matching information closing instruction is sent to the slave device, and the slave device is controlled to stop sending the pin matching signal through the matching information closing instruction.

[0092] After the type of the slave device is determined and the hardware port is connected to the slave device through the target pin, the slave device no longer needs to send the pin matching signal. Therefore, the master device can control the slave device to stop sending the pin matching signal by issuing a matching information shutdown instruction to avoid affecting the type judgment of other slave devices and avoid wasting resources such as power caused by the slave device continuing to send the pin matching signal.

[0093] Example 2

[0094] See also Figure 6 The present application also provides a master device 600, the master device 600 is connected to the slave device through a hardware port, the hardware port includes: a power pin and a plurality of function pins, the master device 600 includes:

[0095] A control module 601, used for controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin;

[0096] A setting module 602, used for setting each of the function pins of the hardware port to an interrupt mode;

[0097] A matching module 603, configured to obtain a pin matching signal sent by a secondary pin of the slave device, and determine a device type of the slave device according to the pin matching signal;

[0098] The determination module 604 is used to determine a target pin corresponding to the device type from the plurality of function pins, and set the target pin to a normal mode.

[0099] It can be understood that the implementation method of the hardware port matching method described in the above embodiment 1 is also applicable to this embodiment, so it will not be described repeatedly here.

[0100] Example 3

[0101] The embodiment of the present application also provides a computer device, for example, the computer device can be, but is not limited to, a desktop computer, a notebook, etc., and its existence form is not limited, mainly depending on whether it needs to support the interface display function of the browser web page, etc. Exemplarily, the computer device includes a memory and at least one processor, the memory stores a computer program, and the processor is used to execute the computer program to implement the hardware port matching method described in the above embodiment 1.

[0102] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0103] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0104] Furthermore, the memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data (such as iteration data, version data, etc.) created according to the use of the computer device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0105] Example 4

[0106] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the hardware port matching method described in the above embodiment 1.

[0107] It can be understood that the implementation method of the hardware port matching method described in the above embodiment 1 is also applicable to this embodiment, so it will not be described repeatedly here.

[0108] The computer-readable storage medium may be either a non-volatile storage medium or a volatile storage medium. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0109] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0111] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0112] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

[0113] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0114] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0115] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A hardware port matching method, characterized in that: Applied to a master device, the master device is connected to a slave device via a hardware port, the hardware port includes: a power pin and a plurality of function pins, the method includes: Controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin; Setting each of the function pins of the hardware port to an interrupt mode; Acquire a pin matching signal sent by a secondary pin of the slave device, and determine a device type of the slave device according to the pin matching signal; A target pin corresponding to the device type is determined from the plurality of function pins, and the target pin is set to a normal mode.

2. The hardware port matching method according to claim 1, characterized in that: The determining the device type of the slave device according to the pin matching signal comprises: Determining whether the pin matching signal is a preset matching signal; each preset matching signal corresponds to one of the device types; If it is the preset matching signal, the device type of the slave device is determined according to the preset matching signal.

3. The hardware port matching method according to claim 2, characterized in that: After determining whether the pin matching signal is a preset matching signal, the method further comprises: If the pin matching signal is not the preset matching signal, each of the functional pins of the hardware port is set to an interrupt mode, and the step of obtaining the pin matching signal sent by the secondary pin of the slave device is re-executed.

4. The hardware port matching method according to claim 2, characterized in that: The preset matching signal includes a 0x55 signal and a square wave signal, and determining the device type of the slave device according to the preset matching signal includes: If the pin matching signal is a 0x55 signal, it is determined that the slave device is a serial port device; If the pin matching signal is a square wave signal, it is determined that the slave device is an IIC device.

5. The hardware port matching method according to claim 4, characterized in that: The step of determining, according to the device type, a corresponding target pin in the function pins includes: If the slave device is a serial port device, determining the function pin corresponding to the serial port device among the function pins as the target pin; If the slave device is an IIC device, a function pin among the function pins corresponding to the IIC device is determined as the target pin.

6. The hardware port matching method according to claim 1, characterized in that: The number of the power pins is at least two and they are symmetrically arranged; the determining the corresponding target pins in the function pins according to the device type also includes: Acquire a power supply signal of the power supply pin, and determine a target power supply pin for supplying power to the slave device according to the power supply signal; Determining, according to the target power supply pin, an insertion mode of inserting the hardware port into the slave device; the insertion mode includes forward insertion and reverse insertion; According to the insertion mode and the device type, a corresponding target pin among the function pins is determined.

7. The hardware port matching method according to claim 1, characterized in that: After the function of the function pin corresponding to the device type is turned on, the method includes: A matching information closing instruction is sent to the slave device, and the slave device is controlled to stop sending the pin matching signal through the matching information closing instruction.

8. A master device, characterized in that: The master device is connected to the slave device via a hardware port, wherein the hardware port includes: a power pin and a plurality of function pins, and the master device includes: A control module, used for controlling the power pin of the hardware port to be powered on, and supplying power to the slave device through the power pin; A setting module, used for setting each of the function pins of the hardware port to an interrupt mode; A matching module, used for acquiring a pin matching signal sent by a secondary pin of the slave device, and determining a device type of the slave device according to the pin matching signal; The determination module is used to determine a target pin corresponding to the device type from the plurality of function pins, and set the target pin to a normal mode.

9. An electronic device, characterized in that: The method comprises a memory and at least one processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the hardware port matching method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the hardware port matching method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Interface chip, electric vehicle controller and control system thereof

    CN120491521A