CN113360331A - OTG test switching equipment, method, device, equipment and storage medium - Google Patents

OTG test switching equipment, method, device, equipment and storage medium Download PDF

Info

Publication number
CN113360331A
CN113360331A CN202110714836.8A CN202110714836A CN113360331A CN 113360331 A CN113360331 A CN 113360331A CN 202110714836 A CN202110714836 A CN 202110714836A CN 113360331 A CN113360331 A CN 113360331A
Authority
CN
China
Prior art keywords
interface
tested
connection
switching
device interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110714836.8A
Other languages
Chinese (zh)
Other versions
CN113360331B (en
Inventor
刘勇杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202110714836.8A priority Critical patent/CN113360331B/en
Publication of CN113360331A publication Critical patent/CN113360331A/en
Application granted granted Critical
Publication of CN113360331B publication Critical patent/CN113360331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention provides switching equipment, a method, a device, equipment and a storage medium for an OTG test. This switching equipment of OTG test includes: a control interface to connect with a control device; the device interface to be tested is used for connecting the OTG device to be tested; a first device interface to connect a first device; a second device interface to connect to a second device; and the control unit is used for receiving a switching instruction from the control equipment through the control interface, and controlling the interface of the device to be tested to be in first connection with the first equipment interface based on the switching instruction so that the OTG equipment to be tested is suitable for being used as the master equipment of the first equipment in the OTG test process, or controlling the interface of the device to be tested to be in second connection with the second equipment interface so that the OTG equipment to be tested is suitable for being used as the slave equipment of the second equipment in the OTG test process. The invention can realize the automation of equipment mode switching in the OTG test process.

Description

OTG test switching equipment, method, device, equipment and storage medium
Technical Field
The present invention relates to the field of OTG testing technologies, and in particular, to a switching device, a method, an apparatus, a device, and a storage medium for OTG testing.
Background
Since The intelligent terminal product generally has only one USB interface, when performing an OTG (i.e., On-The-Go) test, The intelligent terminal product can only select one Device mode at a time, i.e., select a master Device mode (i.e., Host mode) or a slave Device mode (i.e., Device mode). In addition, when testing in different modes is replaced, the equipment modes are required to be switched through manual plugging, and different peripherals are required to be replaced for testing according to different USB protocols, so that the requirement for automatic testing cannot be met.
Disclosure of Invention
An object of the present invention is to provide a switching device, a method, an apparatus, a device and a storage medium for an OTG test, so as to implement automation of device mode switching in an OTG test process.
The switching equipment for the OTG test provided by the embodiment of the invention comprises: a control interface to connect with a control device; the device interface to be tested is used for connecting the OTG device to be tested; a first device interface to connect a first device; a second device interface to connect to a second device; and the control unit is used for receiving a switching instruction from the control equipment through the control interface, and controlling the interface of the device to be tested to be in first connection with the first equipment interface based on the switching instruction so that the OTG equipment to be tested is suitable for being used as the master equipment of the first equipment in the OTG test process, or controlling the interface of the device to be tested to be in second connection with the second equipment interface so that the OTG equipment to be tested is suitable for being used as the slave equipment of the second equipment in the OTG test process.
Optionally, the control interface comprises a MicroB interface.
Optionally, the device interface to be tested, the first device interface, and the second device interface are each one of a TypeA interface, a TypeB interface, a MicroB interface, and a TypeC interface.
Optionally, the switching instruction includes a switching state, and the switching state includes a master device state or a slave device state; the control unit is suitable for controlling the device interface to be tested to be in first connection with the first device interface when the switching state comprises a master device state and controlling the device interface to be tested to be in second connection with the second device interface when the switching state comprises a slave device state.
Optionally, the first connection includes a connection of a power pin between the device interface to be tested and the first device interface; the second connection includes a connection of a power pin between the device interface to be tested and the second device interface.
Optionally, the handover instruction comprises a handover protocol; the first connection comprises the connection of a data pin between the interface of the equipment to be tested and the first equipment interface; the second connection comprises the connection of a data pin between the interface of the equipment to be tested and the second equipment interface; the control unit is adapted to control the connection of the data pins based on a switching protocol.
Optionally, the control unit is adapted to disconnect the device interface to be tested from the first device interface or from the second device interface before making the first connection and to disconnect the device interface to be tested from the first device interface or from the second device interface before making the second connection.
Optionally, the switching device comprises: the first switch is connected between the equipment interface to be tested and the first equipment interface, and the second switch is connected between the equipment interface to be tested and the second equipment interface; the control unit is suitable for controlling the first switch to complete connection or disconnection between the device interface to be tested and the first device interface and controlling the second switch to complete connection or disconnection between the device interface to be tested and the second device interface.
The switching method for the OTG test provided by the embodiment of the invention comprises the following steps: receiving a switching instruction; and controlling the interface of the device to be tested to perform first connection with the first device interface based on the switching instruction so that the OTG device to be tested, which is suitable for being connected with the interface of the device to be tested, is used as a master device of the first device suitable for being connected with the first device interface in the OTG test process, or controlling the interface of the device to be tested to perform second connection with the second device interface so that the OTG device to be tested is used as a slave device of the second device suitable for being connected with the second device interface in the OTG test process.
Optionally, the switching instruction includes a switching state, and the switching state includes a master device state or a slave device state; the switching method further comprises the following steps: and controlling the device interface to be tested to be in first connection with the first device interface when the switching state comprises a master device state, and controlling the device interface to be tested to be in second connection with the second device interface when the switching state comprises a slave device state.
Optionally, the first connection includes a connection of a power pin between the device interface to be tested and the first device interface; the second connection includes a connection of a power pin between the device interface to be tested and the second device interface.
Optionally, switching the instruction switching protocol; the first connection comprises the connection of a data pin between the interface of the equipment to be tested and the first equipment interface; the second connection comprises the connection of a data pin between the interface of the equipment to be tested and the second equipment interface; the switching method comprises the following steps: the connection of the data pin is controlled based on a switching protocol.
Optionally, the handover method further includes: before the first connection, the connection between the interface of the equipment to be tested and the first equipment interface or the second equipment interface is disconnected; or before the second connection, the connection between the device interface to be tested and the first device interface or the second device interface is disconnected.
The switching device for the OTG test provided by the embodiment of the invention comprises: a receiving module for receiving a switching instruction; and the control module is used for controlling the interface of the device to be tested and the first device interface to be in first connection based on the switching instruction so that the OTG device to be tested, which is suitable for being connected with the interface of the device to be tested, is used as a master device of the first device suitable for being connected with the first device interface in the OTG test process, or controlling the interface of the device to be tested and the second device interface to be in second connection so that the OTG device to be tested is used as a slave device of the second device suitable for being connected with the second device interface in the OTG test process.
An electronic device provided in an embodiment of the present invention includes: a processor; a memory storing a computer program executable on the processor; wherein, the computer program realizes the switching method of the OTG test provided by the embodiment of the present invention when being executed by the processor.
The storage medium provided by the embodiment of the present invention stores a computer program, and the computer program implements the switching method of the OTG test provided by the embodiment of the present invention when executed.
Compared with the prior art, the technical scheme of the embodiment of the invention has the beneficial effect.
For example, the device mode of the to-be-tested OTG device in the OTG test process can be flexibly switched based on the switching instruction, and the test device does not need to be manually plugged or unplugged when the device mode is switched, so that automation of device mode switching in the OTG test process is realized.
For another example, the test protocol of the to-be-tested OTG device in the OTG test process can be flexibly switched based on the switching instruction, and the test device does not need to be manually plugged or unplugged when the test protocol is switched, so that automation of switching the test protocol in the OTG test process is realized.
For another example, in the OTG testing process, the switching on and off of the to-be-tested OTG device, and the switching on and off of the master device or the slave device of the to-be-tested OTG device can be realized without manual frequent plugging.
Drawings
Fig. 1 is a schematic diagram of a switching device for OTG testing in an embodiment of the present invention;
fig. 2 is a flowchart of a switching method of an OTG test in the embodiment of the present invention.
Detailed Description
In the prior art, the OTG test process cannot realize the automation of the device mode switching.
Different from the prior art, the invention provides switching equipment, a method, a device, equipment and a storage medium for OTG test. Wherein, this switching equipment of OTG test includes: a control interface to connect with a control device; the device interface to be tested is used for connecting the OTG device to be tested; a first device interface to connect a first device; a second device interface to connect to a second device; and the control unit is used for receiving a switching instruction from the control equipment through the control interface, and controlling the interface of the device to be tested to be in first connection with the first equipment interface based on the switching instruction so that the OTG equipment to be tested is suitable for being used as the master equipment of the first equipment in the OTG test process, or controlling the interface of the device to be tested to be in second connection with the second equipment interface so that the OTG equipment to be tested is suitable for being used as the slave equipment of the second equipment in the OTG test process.
Compared with the prior art, the technical scheme of the embodiment of the invention has the beneficial effect. For example, the device mode of the to-be-tested OTG device in the OTG test process can be flexibly switched based on the switching instruction, and the test device does not need to be manually plugged or unplugged when the device mode is switched, so that automation of device mode switching in the OTG test process is realized.
In order to make the objects, features and advantages of the present invention more comprehensible, embodiments accompanying the drawings are described in detail below. It is to be understood that the following detailed description is only illustrative of the invention and is not to be taken in a limiting sense. In addition, for convenience of description, only a part of structures related to the embodiments of the present invention, not all of the structures, are shown in the drawings.
Fig. 1 is a schematic diagram of a switching device for OTG test in the embodiment of the present invention.
Referring to fig. 1, a switching device 10 for an OTG test provided in an embodiment of the present invention includes a control interface 11, a device interface 12 to be tested, a first device interface 13, a second device interface 14, and a control unit 15.
Specifically, the control interface 11 is used to connect the control device 20. The device under test interface 12 is used to connect the OTG device under test 30. The first device interface 13 is used to connect the first device 40. The second device interface 14 is used to connect the second device 50. The control unit 15 is configured to receive a switching instruction from the control device 20 through the control interface 11, and control the device interface 12 to be tested to make a first connection with the first device interface 13 based on the switching instruction, so that the OTG device 30 to be tested is suitable as a master device of the first device 40 in the OTG test process, or control the device interface 12 to be tested to make a second connection with the second device interface 14 based on the switching instruction, so that the OTG device 30 to be tested is suitable as a slave device of the second device 50 in the OTG test process.
In specific implementation, the OTG device 30 to be tested may include any intelligent terminal device supporting the OTG function. For example, the OTG device 30 to be tested may include a mobile phone, a computer, a financial POS machine, a vehicle-mounted IVI, and a television, which support OTG functions.
In a specific implementation, the first device 40 may include any terminal device that can be connected to the OTG device 30 to be tested in an OTG manner and is suitable to be a slave device of the OTG device to be tested in an OTG connection. For example, the first device 40 may include a U disk, a hard disk, a mouse, a keyboard, and the like.
In a specific implementation, the second device 50 may include any terminal device that can be connected to the OTG device 30 to be tested in an OTG manner and is suitable to be used as a main device of the OTG device to be tested in an OTG connection. For example, the second device 50 may include a computer or the like supporting OTG functions.
In some embodiments, the device under test interface 12, the first device interface 13, and the second device interface 14 may each employ one of a TypeA interface, a TypeB interface, a MicroB interface, and a TypeC interface.
For example, in the example shown in fig. 1, the device interface 12 to be tested may adopt a TypeC interface, the first device interface 13 may adopt a TypeA interface, and the second device interface 14 may adopt a TypeC interface.
In some embodiments, the control device 20 may be a host computer that controls OTG testing.
In some embodiments, the control interface 11 may comprise a MicroB interface.
In a specific implementation, the control device 20 may send a switching instruction to the switching device 10 via the control interface 11.
In a specific implementation, the switching device 10 is adapted to control, through a switching instruction, whether the OTG device 30 to be tested connected to the device interface 12 is a master device or a slave device in the OTG test process.
Therefore, the device mode of the to-be-tested OTG device 30 in the OTG test process can be flexibly switched based on the switching instruction, and the to-be-tested OTG device 30, the corresponding first device 40 and the corresponding second device 50 do not need to be manually plugged and unplugged when the device mode is switched, so that the automation of device mode switching in the OTG test process is realized.
In particular implementations, the switch instruction may include a switch state.
In particular, the switching state may comprise a master device state or a slave device state.
Accordingly, the control unit 15 is adapted to control the device interface under test 12 to make a first connection with the first device interface 13 when the switching state comprises the master device state and to control the device interface under test 12 to make a second connection with the second device interface 14 when the switching state comprises the slave device state.
In the case that the device interface 12 to be tested is connected to the first device interface 13 in the first connection mode, the OTG device 30 to be tested connected to the device interface 12 to be tested is suitable to be used as a master device of the first device 40 connected to the first device interface 13 in the OTG testing process.
In the case that the device interface to be tested 12 is in the second connection with the second device interface 14, the OTG device to be tested 30 connected with the device interface to be tested 14 is suitable to be used as a slave device of the second device 50 connected with the second device interface 14 in the OTG testing process.
In a specific implementation, the first connection may include a connection of a power pin between the device under test interface 12 and the first device interface 13. The second connection may include a connection of a power pin between device under test interface 12 and second device interface 14.
In a specific implementation, the control unit 15 is adapted to control the device under test interface 12 and the first device interface 13 to make a connection of a power supply pin therebetween when the switching state comprises the master device state, and to control the device under test interface 12 and the second device interface 14 to make a connection of a power supply pin therebetween when the switching state comprises the slave device state.
Specifically, the power pin may be a VBUS pin in the device interface under test 12, the first device interface 13, and the second device interface 14. The connection of the power pin between the device interface 12 to be tested and the first device interface 13 includes the connection of the VBUS pin of the device interface 12 to be tested and the VBUS pin of the first device interface 13. The connection of the power pin between the device interface 12 to be tested and the second device interface 14 includes the connection of the VBUS pin of the device interface 12 to be tested and the VBUS pin of the second device interface 14.
In a specific implementation, the handover instruction further includes a handover protocol.
The first connection also includes connection of a data pin based on a switching protocol between the device interface under test 12 and the first device interface 13. The second connection also includes a connection of data pins between device under test interface 12 and second device interface 14 based on a switching protocol.
In a specific implementation, the control unit 15 is adapted to control the device under test interface 12 and the first device interface 13 to make a connection of the data pin therebetween based on the switching protocol when the switching state includes the master device state, and to control the device under test interface 12 and the second device interface 14 to make a connection of the data pin therebetween based on the switching protocol when the switching state includes the slave device state.
Specifically, the data pins of the device interface to be tested 12, the first device interface 13, and the second device interface 14 may include pins used in the OTG test process and performing communication based on a switching protocol.
In particular, the switching protocol comprises the USB protocol.
In a specific implementation, the handover protocol may include at least one of a USB2.0 protocol, a USB3.2 Gen1 protocol, a USB3.2 Gen2 x 2 protocol, and a USB4.0 protocol.
In some embodiments, the handover protocol may further include at least two of a USB2.0 protocol, a USB3.2 Gen1 protocol, a USB3.2 Gen2 x 2 protocol, and a USB4.0 protocol. In this case, the control unit 15 is adapted to control the device interface under test 12 to make the connection of the corresponding data pins with the first device interface 13 based on the different switching protocols, respectively, when the switching state includes the master device state, and to control the device interface under test 12 to make the connection of the corresponding data pins with the second device interface 14 based on the different switching protocols, respectively, when the switching state includes the slave device state.
For example, when the switching state includes a master device state and the switching protocol includes the USB2.0 protocol and the USB3.2 Gen1 protocol, the control unit 15 is adapted to control the device under test interface 12 to make a connection with the first device interface 13 regarding a data pin of the USB2.0 protocol based on the USB2.0 protocol and to control the device under test interface 12 to make a connection with the first device interface 13 regarding a data pin of the USB3.2 Gen1 protocol based on the USB3.2 Gen1 protocol.
It will be appreciated that the switching protocol included in the switching instruction is related to the USB protocol supported by device under test interface 12. In particular, the switching protocol may include at least one of all USB protocols supported by device under test interface 12.
Based on the technical scheme, the test protocol of the to-be-tested OTG equipment 30 in the OTG test process can be flexibly switched based on the switching instruction, and the test equipment does not need to be manually plugged and pulled when the test protocol is switched, so that the automation of switching the test protocol in the OTG test process is realized.
In some embodiments, the control unit 15 is further adapted to determine whether the device interface 12 under test has established a connection with the first device interface 13 or with the second device interface 14 before controlling the first connection or the second connection, and to control the established connection between the device interface 12 under test and the first device interface 13 or the second device interface 14 to be disconnected in case the device interface 12 under test has established a connection with the first device interface 13 or with the second device interface 14. After the established connection is broken, the first connection or the second connection is made.
In some embodiments, the control unit 15 is further adapted to trigger an OTG test between the OTG device under test 30 and the first device 40 when the first connection is completed.
In some embodiments, the control unit 15 is further adapted to trigger an OTG test between the OTG device under test 30 and the second device 50 when the second connection is completed.
In some embodiments, when the first connection is completed, the control unit 15 is further adapted to trigger the OTG device under test 30 to complete the self-switching of the device mode and identify the first device 40.
In some embodiments, when the second connection is completed, the control unit 15 is further adapted to trigger the OTG device under test 30 to complete the self-switching of the device mode and trigger the second device 50 to identify the OTG device under test 30.
In a specific implementation, the device under test interface 12 further includes an OTG _ ID pin. The to-be-tested OTG device 30 may complete the self-switching of the device mode by detecting the state of the OTG _ ID pin.
When the device interface 12 to be tested and the first device interface 13 complete the first connection, the state of the OTG _ ID pin is grounded. In this case, the OTG device 30 under test is usually the master device by default.
When the device interface 12 to be tested and the second device interface 14 complete the second connection, the state of the OTG _ ID pin is floating. In this case, the OTG device 30 under test is typically the slave device by default.
In a specific implementation, the switching device 10 further comprises a first switch 16 and a second switch 17.
Specifically, the first switch 16 is connected between the device interface 12 to be tested and the first device interface 13, and is adapted to make a first connection between the device interface 12 to be tested and the first device interface 13 under the control of the control unit 15, or to break an established connection between the device interface 12 to be tested and the first device interface 13 under the control of the control unit 15.
The second switch 17 is connected between the device interface 12 to be tested and the second device interface 14, and is adapted to complete a second connection between the device interface 12 to be tested and the second device interface 14 under the control of the control unit 15, or disconnect an established connection between the device interface 12 to be tested and the second device interface 14 under the control of the control unit 15.
In some embodiments, the control Unit 15 may include a micro control Unit (i.e., a Microcontroller Unit, abbreviated as MCU).
In some embodiments, the first switch 16 may include a first relay K1.
In some embodiments, the second switch 17 may include a second relay K2.
Fig. 2 is a flowchart of a switching method of an OTG test in the embodiment of the present invention.
Referring to fig. 2, a method 60 for switching an OTG test provided in an embodiment of the present invention includes:
s61, receiving a switching instruction;
s62, based on the switching instruction, controlling the device interface 12 to be tested to perform the first connection with the first device interface 13, or controlling the device interface 12 to be tested to perform the second connection with the second device interface 14.
In a specific implementation of step S61, a switching instruction may be received from the control device 20.
In the specific implementation of step S62, the device interface 12 to be tested and the first device interface 13 are controlled to perform the first connection based on the switching instruction, which is suitable for enabling the OTG device 30 to be tested connected to the device interface 12 to be used as the master device of the first device 40 connected to the first device interface 13 in the OTG test process.
In the specific implementation of step S62, the device interface 12 to be tested is controlled to perform the second connection with the second device interface 14 based on the switching instruction, which is suitable for enabling the OTG device 30 to be tested connected to the device interface 12 to be used as a slave device of the second device 50 connected to the second device interface 14 during the OTG test.
In particular implementations, the switch instruction may include a switch state. The switching state may in turn comprise a master device state or a slave device state.
Accordingly, the handover method 60 may further include:
the device interface 12 to be tested is controlled to make a first connection with the first device interface 13 when the switching state includes the master device state, and the device interface 12 to be tested is controlled to make a second connection with the second device interface 14 when the switching state includes the slave device state.
In a specific implementation, the first connection includes a connection of a power pin between the device under test interface 12 and the first device interface 13. The second connection includes a connection of a power pin between device under test interface 12 and second device interface 14.
In a specific implementation, the handover instruction further includes a handover protocol.
The first connection also includes connection of a data pin based on a switching protocol between the device interface under test 12 and the first device interface 13. The second connection also includes a connection of data pins between device under test interface 12 and second device interface 14 based on a switching protocol.
Correspondingly, the handover method 60 further includes: the connection of the data pin is controlled based on a switching protocol.
Specifically, the data pins of the device interface to be tested 12, the first device interface 13, and the second device interface 14 may include pins used in the OTG test process and performing communication based on a switching protocol.
In particular, the switching protocol comprises the USB protocol.
In a specific implementation, the handover protocol may include at least one of a USB2.0 protocol, a USB3.2 Gen1 protocol, a USB3.2 Gen2 x 2 protocol, and a USB4.0 protocol.
In some embodiments, the handover protocol may further include at least two of a USB2.0 protocol, a USB3.2 Gen1 protocol, a USB3.2 Gen2 x 2 protocol, and a USB4.0 protocol. In this case, the controlling of the connection of the data pins based on the switching protocol includes controlling the device interface 12 to be tested to make the connection of the corresponding data pins with the first device interface 13 based on different switching protocols, respectively, when the switching state includes the master device state, and controlling the device interface 12 to be tested to make the connection of the corresponding data pins with the second device interface 14 based on different switching protocols, respectively, when the switching state includes the slave device state.
For example, when the switching state includes the master device state and the switching protocol includes the USB2.0 protocol and the USB3.2 Gen1 protocol, the device interface 12 under test is controlled to make a connection with the first device interface 13 regarding a data pin of the USB2.0 protocol based on the USB2.0 protocol, and the device interface 12 under test is controlled to make a connection with the first device interface 13 regarding a data pin of the USB3.2 Gen1 protocol based on the USB3.2 Gen1 protocol.
It will be appreciated that the switching protocol included in the switching instruction is related to the USB protocol supported by device under test interface 12. In particular, the switching protocol may include at least one of all USB protocols supported by device under test interface 12.
In some embodiments, the handover method 60 may further include:
before the first connection, the connection between the device interface 12 to be tested and the first device interface 13 or the second device interface 14 is disconnected; or
Before the second connection is made, the connection between the device interface 12 to be tested and the first device interface 13 or the second device interface 14 is disconnected.
Specifically, before controlling the first connection or the second connection, it may be determined whether the device interface 12 under test has established a connection with the first device interface 13 or the second device interface 14, and in a case that the device interface 12 under test has established a connection with the first device interface 13 or the second device interface 14, the established connection between the device interface 12 under test and the first device interface 13 or the second device interface 14 may be controlled to be disconnected. After the established connection is broken, the first connection or the second connection is made.
It is understood that the switching method 60 provided in the embodiment of the present invention may be implemented based on the switching device 10 provided in the embodiment of the present invention. Further, the execution of each step and the relationship between each step in the switching method 60 may also refer to the foregoing description about the switching device 10, and are not described herein again.
The switching device 10 and the switching method 60 provided by the embodiments of the present invention are provided for ease of understanding. A specific application example is given below.
In this application example, before switching the device mode of the OTG device 30 to be tested, the OTG device 30 to be tested as a slave device of the second device 50 completes the OTG test based on the USB2.0 protocol, the USB3.2 Gen1 protocol, and the USB3.2 Gen2 protocol.
In this application example, it is desirable to switch the OTG device under test 30 to be the primary device of the first device 40 to complete the OTG test based on the USB2.0 protocol and the USB3.2 Gen1 protocol.
In a specific implementation, the switching instruction may be sent to the control port 11 of the switching device 10 by the control device 20.
Specifically, the switching instruction may include the following information:
switch VBUS channel (for indicating switch status): for example, the VBUS pin (for indicating the master status) connecting the device interface under test 12 and the first device interface 13;
switching USB2.0 protocol (for indicating switching protocol): for example, the data pin may be a data pin for connecting the USB2.0 protocol between the device interface 12 to be tested and the first device interface 13;
handover USB3.2 Gen1 protocol (for indicating handover protocol): for example, the data pin for connecting the USB3.2 Gen1 protocol between the device interface 12 to be tested and the first device interface 13;
disconnect USB3.2 Gen2 protocol (for indicating handover protocol): for example, the data pin related to the USB3.2 Gen2 protocol between the device interface 12 to be tested and the second device interface 14 may be disconnected;
triggering the OTG test.
In a specific implementation, the control unit 15 in the switching device 10 is adapted to receive the above-mentioned switching instruction through the control interface 11, and parse the switching instruction to control the switching of the device mode and the test protocol of the OTG device 30 to be tested and trigger the OTG test based on the switching instruction. Specific reference is made to the following procedure:
switching of VBUS channel: for example, the VBUS pin between the device interface under test 12 and the second device interface 14 may be turned off, and the VBUS pin between the device interface under test 12 and the first device interface 13 may be turned on;
switching of USB2.0 protocol: for example, the data pin related to the USB2.0 protocol between the device interface 12 to be tested and the second device interface 14 may be turned off, and the data pin related to the USB2.0 protocol between the device interface 12 to be tested and the first device interface 13 may be turned on;
switching of USB3.2 Gen1 protocol: for example, the data pin related to the USB3.2 Gen1 protocol between the device interface 12 to be tested and the second device interface 14 may be turned off, and the data pin related to the USB3.2 Gen1 protocol between the device interface 12 to be tested and the first device interface 13 may be turned on;
switching of USB3.2 Gen2 protocol: for example, the data pin related to the USB3.2 Gen2 protocol between the device interface 12 to be tested and the second device interface 14 may be disconnected;
triggering the OTG test between the OTG device 30 to be tested and the first device 40.
After the OTG test between the to-be-tested OTG device 30 and the first device 40 is triggered, the to-be-tested OTG device 30 may automatically complete the conversion of the device mode.
The embodiment of the invention also provides a switching device for the OTG test.
Specifically, the switching device comprises a receiving module and a control module. The receiving module is used for receiving a switching instruction. The control module is configured to control the to-be-tested device interface 12 and the first device interface 13 to perform a first connection based on the switching instruction, so that the to-be-tested OTG device 30 connected to the to-be-tested device interface 12 serves as a master device of the first device 40 connected to the first device interface 13 in the OTG testing process, or control the to-be-tested device interface 12 and the second device interface 14 to perform a second connection so that the to-be-tested OTG device 30 connected to the to-be-tested device interface 12 serves as a slave device of the second device 50 connected to the second device interface 14 in the OTG testing process.
It can be understood that the switching apparatus provided in the embodiment of the present invention may be implemented based on the switching method 60 provided in the embodiment of the present invention. For further embodiments of the switching device, reference may be made to the foregoing description of the switching method 60, which is not repeated herein.
In a specific implementation, the switching device may be, for example: a chip, a chip module, or a terminal.
The embodiment of the invention also provides the electronic equipment.
In particular, the electronic device includes a processor and a memory. Wherein the memory has stored thereon a computer program operable on the processor. Which when executed by a processor implements the handover method 60 provided by an embodiment of the present invention.
The embodiment of the invention also provides a storage medium.
The storage medium stores a computer program. Which when executed implements the handover method 60 provided by embodiments of the present invention.
In the embodiment of the present invention, the Processor may be a Central Processing Unit (CPU), other general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA), other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In embodiments of the invention, the memory may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous linked dynamic random access memory (Synchlink DRAM SLDRAM), and direct memory bus RAM (DR RAM).
In the embodiment of the present invention, the storage medium includes various media that can store program codes, such as a usb disk, a removable hard disk, a ROM, a RAM, a Non-volatile memory (Non-volatile), a Non-transitory memory (Non-transitory) memory, a magnetic disk, or an optical disk.
Each module/unit included in each device or apparatus described in the embodiments of the present invention may be a software module/unit, or may also be a hardware module/unit, or may also be a part of a software module/unit and a part of a hardware module/unit. For example, for each device or apparatus applied to or integrated into a chip, each module/unit included in the device or apparatus may be implemented by hardware such as a circuit, or at least a part of the module/unit may be implemented by a software program running on a processor integrated within the chip, and the rest (if any) part of the module/unit may be implemented by hardware such as a circuit; for each device or apparatus applied to or integrated in the chip module, each module/unit included in the device or apparatus may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules/units may be implemented by using a software program running on a processor integrated inside the chip module, and the rest (if any) of the modules/units may be implemented by using hardware such as a circuit; for each device or apparatus applied to or integrated in the terminal, each module/unit included in the device or apparatus may be implemented by hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least a part of the modules/units may be implemented by a software program running on a processor integrated in the terminal, and the remaining part (if any) of the modules/units may be implemented by hardware such as a circuit.
While specific embodiments have been described above, these embodiments are not intended to limit the scope of the present disclosure, even where only a single embodiment is described with respect to a particular feature. The characteristic examples provided in the present disclosure are intended to be illustrative, not limiting, unless differently stated. In particular implementations, the features of one or more dependent claims may be combined with those of the independent claims as technically feasible according to the actual requirements, and the features from the respective independent claims may be combined in any appropriate manner and not merely by the specific combinations enumerated in the claims.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A switching device for OTG testing, comprising:
a control interface to connect with a control device;
the device interface to be tested is used for connecting the OTG device to be tested;
a first device interface to connect a first device;
a second device interface to connect to a second device;
a control unit, configured to receive a switching instruction from the control device through the control interface, and control the device interface to be tested to perform a first connection with the first device interface based on the switching instruction, so that the OTG device to be tested is suitable for being a master device of the first device in the OTG test process, or control the device interface to be tested to perform a second connection with the second device interface, so that the OTG device to be tested is suitable for being a slave device of the second device in the OTG test process.
2. The switching device of claim 1, wherein the control interface comprises a MicroB interface.
3. The switching device according to claim 1, wherein the device interface under test, the first device interface, and the second device interface are each one of a type a interface, a type b interface, a micro b interface, and a type c interface.
4. The switching device of claim 1, wherein the switching instruction comprises a switching state, the switching state comprising a master device state or a slave device state; the control unit is suitable for controlling the device interface to be tested to be connected with the first device interface in the first connection mode when the switching state comprises the master device state, and controlling the device interface to be tested to be connected with the second device interface in the second connection mode when the switching state comprises the slave device state.
5. The switching device according to claim 1 or 4, wherein the first connection comprises a connection of a power pin between the device interface under test and the first device interface; the second connection comprises a connection of a power supply pin between the device interface to be tested and the second device interface.
6. The switching device according to claim 1 or 4, wherein the switching instruction comprises a switching protocol; the first connection comprises the connection of a data pin between the equipment interface to be tested and the first equipment interface; the second connection comprises the connection of a data pin between the equipment interface to be tested and the second equipment interface; the control unit is adapted to control the connection of the data pins based on the switching protocol.
7. The switching device according to claim 1, wherein the control unit is adapted to disconnect the device interface under test from the first device interface or from the second device interface before making the first connection and to disconnect the device interface under test from the first device interface or from the second device interface before making the second connection.
8. The switching device according to claim 1, 4 or 7, comprising:
the first switch is connected between the equipment interface to be tested and the first equipment interface, and the second switch is connected between the equipment interface to be tested and the second equipment interface;
the control unit is suitable for controlling the first switch to complete connection or disconnection between the device interface to be tested and the first device interface and controlling the second switch to complete connection or disconnection between the device interface to be tested and the second device interface.
9. A switching method of OTG test is characterized by comprising the following steps:
receiving a switching instruction;
and controlling a device interface to be tested to perform first connection with a first device interface based on the switching instruction so that the OTG device to be tested, which is suitable for being connected with the device interface to be tested, is used as a master device of first equipment suitable for being connected with the first device interface in the OTG test process, or controlling the device interface to be tested to perform second connection with a second device interface so that the OTG device to be tested is used as a slave device of second equipment suitable for being connected with the second device interface in the OTG test process.
10. The switching method according to claim 9, wherein the switching instruction includes a switching state, the switching state including a master device state or a slave device state; the switching method comprises the following steps: and when the switching state comprises the master equipment state, controlling the equipment interface to be tested to be connected with the first equipment interface to be connected, and when the switching state comprises the slave equipment state, controlling the equipment interface to be tested to be connected with the second equipment interface to be connected.
11. The switching method according to claim 9 or 10, wherein the first connection comprises a connection of a power supply pin between the device interface under test and the first device interface; the second connection comprises a connection of a power supply pin between the device interface to be tested and the second device interface.
12. The handover method according to claim 9 or 10, wherein the handover command switches a protocol; the first connection comprises the connection of a data pin between the equipment interface to be tested and the first equipment interface; the second connection comprises the connection of a data pin between the equipment interface to be tested and the second equipment interface; the switching method comprises the following steps: controlling connection of the data pin based on the switching protocol.
13. The handover method according to claim 9 or 10, comprising:
before the first connection is carried out, the connection between the equipment interface to be tested and the first equipment interface or the second equipment interface is disconnected; or
Before the second connection, the connection between the device interface to be tested and the first device interface or the second device interface is disconnected.
14. A switching device for OTG testing, comprising:
a receiving module for receiving a switching instruction;
and the control module is used for controlling a device interface to be tested and a first device interface to be connected in a first connection mode based on the switching instruction so that the OTG device to be tested, which is suitable for being connected with the device interface to be tested, is used as a master device of the first device which is suitable for being connected with the first device interface in the OTG testing process, or controlling the device interface to be tested and a second device interface to be connected in a second connection mode so that the OTG device to be tested is used as a slave device of the second device which is suitable for being connected with the second device interface in the OTG testing process.
15. An electronic device, comprising:
a processor;
a memory storing a computer program executable on the processor;
wherein the computer program when executed by the processor implements the handover method of any of claims 9 to 13.
16. A storage medium storing a computer program, wherein the computer program when executed implements the handover method according to any one of claims 9 to 13.
CN202110714836.8A 2021-06-25 2021-06-25 OTG test switching equipment, method, device, equipment and storage medium Active CN113360331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110714836.8A CN113360331B (en) 2021-06-25 2021-06-25 OTG test switching equipment, method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110714836.8A CN113360331B (en) 2021-06-25 2021-06-25 OTG test switching equipment, method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113360331A true CN113360331A (en) 2021-09-07
CN113360331B CN113360331B (en) 2023-01-10

Family

ID=77536616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110714836.8A Active CN113360331B (en) 2021-06-25 2021-06-25 OTG test switching equipment, method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113360331B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946286A (en) * 2012-10-26 2013-02-27 株洲南车时代电气股份有限公司 Method, device and system for controlling detection of equipment
CN103002473A (en) * 2012-11-27 2013-03-27 上海创远仪器技术股份有限公司 Method, device and system for testing wireless terminal
CN103051395A (en) * 2012-12-06 2013-04-17 国家无线电监测中心检测中心 General purpose interface bus (GPIB) integrated radio frequency test system controlled by digital signal processor
CN205982507U (en) * 2016-08-23 2017-02-22 广州视睿电子科技有限公司 Testing arrangement of USB3. 0 equipment
CN109298266A (en) * 2018-10-29 2019-02-01 Oppo广东移动通信有限公司 Test macro, test method, test device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946286A (en) * 2012-10-26 2013-02-27 株洲南车时代电气股份有限公司 Method, device and system for controlling detection of equipment
CN103002473A (en) * 2012-11-27 2013-03-27 上海创远仪器技术股份有限公司 Method, device and system for testing wireless terminal
CN103051395A (en) * 2012-12-06 2013-04-17 国家无线电监测中心检测中心 General purpose interface bus (GPIB) integrated radio frequency test system controlled by digital signal processor
CN205982507U (en) * 2016-08-23 2017-02-22 广州视睿电子科技有限公司 Testing arrangement of USB3. 0 equipment
CN109298266A (en) * 2018-10-29 2019-02-01 Oppo广东移动通信有限公司 Test macro, test method, test device and storage medium

Also Published As

Publication number Publication date
CN113360331B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN103237189A (en) Electronic equipment, MHL (mobile high-definition link) connector, MHL system and connector detection method
CN109298266B (en) Test system, test method, test apparatus, and storage medium
CN112041827B (en) Automatic USB host detection and port configuration method and device
US20100064036A1 (en) Peripheral device operation method, peripheral device and host
US8964610B2 (en) System and method of reducing factory program time for wireless devices
US10140231B2 (en) Flexible port configuration based on interface coupling
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN110908682A (en) Firmware upgrading method and system for vehicle controller, vehicle and storage medium
CN112000351A (en) Updating method, updating device, updating equipment and storage medium of BMC (baseboard management controller) firmware
CN110459260B (en) Automatic test switching device, method and system
CN112732616A (en) BMC starting method, device and equipment based on SPI controller
CN111143898B (en) Data protection method for pluggable memory device
CN103092648A (en) Method and system of mirror image upgrade and user device and personal computer
CN113360331B (en) OTG test switching equipment, method, device, equipment and storage medium
JP6434630B2 (en) USB OTG device identification system and apparatus
CN113238904A (en) Interface switching device, interface testing method and interface switching system
CN107885674B (en) Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN111831214A (en) Method for optimizing input/output delay, system and memory device using the same
CN113934661B (en) Electronic equipment, control method, device and medium
US7613865B2 (en) Automated switching for executing tests involving electronic devices
CN115913800A (en) Communication connection control method, vehicle-mounted device, communication system, and storage medium
CN110837450B (en) Test method and device of USB TYPE-C docking station, electronic equipment and storage medium
CN101751276A (en) Starting method of data card and data card equipment
CN105589823A (en) Method, apparatus and circuit for realizing USB (universal serial bus) interface multiplexing MHL (mobile high-definition link)
CN111210863B (en) Method, device and equipment for testing embedded memory and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant