CN113656342A - USB interface switching control method and device, all-in-one machine equipment and storage medium - Google Patents

USB interface switching control method and device, all-in-one machine equipment and storage medium Download PDF

Info

Publication number
CN113656342A
CN113656342A CN202110974238.4A CN202110974238A CN113656342A CN 113656342 A CN113656342 A CN 113656342A CN 202110974238 A CN202110974238 A CN 202110974238A CN 113656342 A CN113656342 A CN 113656342A
Authority
CN
China
Prior art keywords
usb
switching
equipment
information source
target
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
CN202110974238.4A
Other languages
Chinese (zh)
Other versions
CN113656342B (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.)
Shenzhen KTC Commercial Technology Co Ltd
Original Assignee
Shenzhen KTC Commercial Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen KTC Commercial Technology Co Ltd filed Critical Shenzhen KTC Commercial Technology Co Ltd
Priority to CN202110974238.4A priority Critical patent/CN113656342B/en
Publication of CN113656342A publication Critical patent/CN113656342A/en
Application granted granted Critical
Publication of CN113656342B publication Critical patent/CN113656342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • 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/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

The embodiment of the invention discloses a USB interface switching control method, a device, all-in-one machine equipment and a storage medium, wherein the method comprises the following steps: if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal; judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode; if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment; if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub; and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment. The invention can control the switching of a single USB device.

Description

USB interface switching control method and device, all-in-one machine equipment and storage medium
Technical Field
The invention relates to the technical field of USB control, in particular to a USB interface switching control method, a USB interface switching control device, all-in-one machine equipment and a storage medium.
Background
In a device such as a conference all-in-one machine or an education all-in-one machine, a plurality of USB downlink interfaces and USB uplink interfaces are usually provided, wherein the USB downlink interfaces are used for connecting USB devices, the USB uplink interfaces are used for connecting a host, a USB hub and a USB switch are connected between the USB downlink interfaces and the USB uplink interfaces, and the USB hub can be connected to different USB uplink interfaces through the USB switch and then connected to different hosts, so that the USB devices can be connected to different hosts through the USB hub. However, when the connection host of the USB hub is switched by the USB switch, the connection hosts of all the USB devices connected to the USB hub are simultaneously switched, and if one of the USB devices is in a communication state, the communication of the USB device is interrupted, which greatly affects the user experience.
Disclosure of Invention
The embodiment of the invention provides a USB interface switching control method, a USB interface switching control device, all-in-one machine equipment and a storage medium, which can control the switching of single USB equipment.
In a first aspect, an embodiment of the present invention provides a method for controlling USB interface switching, where the method specifically includes:
if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal;
judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode;
if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment;
if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub;
and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment.
In a second aspect, an embodiment of the present invention further provides a USB interface switching control apparatus, where the apparatus specifically includes: the target confirmation unit is used for confirming the target USB concentrator according to the information source switching signal if the information source switching signal is received;
the device comprises a preset mode judging unit, a signal source processing unit and a signal source processing unit, wherein the preset mode judging unit is used for judging a preset mode of the USB device, and the preset mode comprises a selectable following signal source mode, a forced following signal source mode and a fixed signal source mode;
the first confirmation unit is used for confirming the communication state of the USB equipment if the preset mode of the USB equipment is the optional following information source mode;
the first execution unit is used for switching the USB equipment to be connected with the target USB hub if the preset mode of the USB equipment is the forced following information source mode;
and the second execution unit is used for not switching the connection of the USB equipment if the preset mode of the USB equipment is the fixed information source mode.
In a third aspect, an embodiment of the present invention further provides an all-in-one machine device, which includes a memory and a main control chip, where the memory stores a computer program, and the main control chip implements the method when executing the computer program.
Further, the USB interface switching control circuit comprises a plurality of USB devices, a plurality of USB switches and a plurality of USB hubs; each USB device is correspondingly connected with one USB selector switch, each USB selector switch is connected with a plurality of USB hubs, each USB hub is correspondingly connected with one information source host, and each USB selector switch and each USB hub are further connected with the main control chip; the main control chip can control the USB concentrator communicated with the USB selector switch according to the information source switching signal.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program, when executed by the main control chip, may implement the method described above.
The embodiment of the invention provides a USB interface switching control method, a USB interface switching control device, all-in-one machine equipment and a storage medium, wherein the method comprises the following steps: if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal; judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode; if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment; if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub; and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment. The embodiment of the invention can confirm the target USB concentrator to be connected according to the information source switching signal when receiving the information source switching signal, then judge the preset mode of the USB equipment, further confirm the communication state of the USB equipment when the preset mode of the USB equipment is the optional following information source mode, switch the USB equipment to be connected with the target USB concentrator when the preset mode is the forced following information source mode, and skip the switching of the USB equipment when the preset mode is the fixed information source mode, thereby realizing the control of the switching of the single USB equipment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a schematic flowchart of a USB interface switching control method according to an embodiment of the present invention;
FIG. 1b is a schematic flowchart illustrating a USB interface switch control method according to another embodiment of the present invention;
FIG. 2 is a schematic view of an operation interface provided in an embodiment of the present invention;
fig. 3 is a schematic sub-flow chart of a USB interface switching control method according to an embodiment of the present invention;
fig. 4 is a schematic sub-flow chart of a USB interface switching control method according to an embodiment of the present invention;
fig. 5 is a schematic sub-flow chart of a USB interface switching control method according to an embodiment of the present invention;
fig. 6 is a schematic sub-flow chart of a USB interface switching control method according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a USB interface switching control apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a USB interface switch control apparatus according to another embodiment of the present invention;
fig. 9 is a schematic block diagram of a first confirmation unit of the USB interface switching control apparatus according to the embodiment of the present invention;
fig. 10 is a schematic block diagram of a first obtaining unit of the USB interface switching control apparatus according to the embodiment of the present invention;
fig. 11 is a schematic block diagram of a second switching unit of the USB interface switching control apparatus according to the embodiment of the present invention;
fig. 12 is a schematic block diagram of a third switching unit of the USB interface switching control apparatus according to the embodiment of the present invention;
FIG. 13 is a schematic block diagram of a computer apparatus provided by an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a USB interface switching control circuit of the all-in-one machine device according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
Referring to fig. 1a, fig. 1a is a schematic flow chart illustrating a USB interface switching control method according to an embodiment of the present invention. The USB interface switching control method can be applied to a main control chip, and can control the USB equipment to be connected with different USB hubs through the main control chip. The method of the invention can control the switching of a single USB device.
In some embodiments, such as this embodiment, as shown in fig. 1b, the step S110 may be preceded by a step S110 a.
S110a, changing the preset mode of the USB device according to the user instruction.
In the embodiment of the present invention, the preset mode may include a plurality of different modes, for example, a selectable following source mode, a forced following source mode, and a fixed source mode, and the USB device is in one of the preset modes, the current preset mode of the USB device may be modified according to an instruction of a user, and when the preset mode is not specified by the user, the selectable following source mode is selected by default.
S110, if the information source switching signal is received, the target USB hub is confirmed according to the information source switching signal.
In the embodiment of the invention, one USB device is connected with one USB switching control switch, one USB switching control switch can be connected with a plurality of USB hubs, that is, a plurality of USB devices are respectively connected with different USB switching control switches, each USB switching control switch can be connected with a plurality of USB hubs, a main control chip comprises a plurality of GPIO ports, each GPIO port is connected with one USB switching control switch, the main control chip can control the USB hubs specifically connected with the different USB switching control switches through the GPIO ports, wherein each USB hub is connected to an information source host through one USB uplink interface. When the main control chip receives the signal source switching signal, it indicates that the signal source host that needs to be connected, that is, the USB device needs to be switched from the currently connected USB hub to the target USB hub, and the main control chip may confirm the target USB hub according to the signal source switching signal, for example, when the signal source host 1 is switched to the signal source host 2, the USB hub 2 connected to the signal source host 2 is the target USB hub. The information source switching signal may specifically be an instruction received to switch one of the USB devices to be connected to another USB hub, or an instruction received by the main control chip to switch a connected information source host.
And S120, judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode.
In the embodiment of the present invention, the types of USB devices include, but are not limited to, a touch frame, a camera, a microphone, and various types of mobile storage devices, and the USB devices to be confirmed generally refer to a USB device connected to the current USB hub and a USB device connected to the target USB hub. For example, the USB devices connected to the current USB hub include USB device 1 and USB device 2, and the USB devices connected to the target USB hub include USB device 3 and USB device 4, then the USB devices 1-4 all need to confirm their preset modes. The optional following information source mode is to further confirm a communication state of the USB device when receiving an information source switching signal, and determine whether to switch according to the communication state of the USB, the forced following information source mode is to forcibly switch to be connected with a target USB hub when receiving the information source switching signal, and the fixed information source mode is to receive an information source switching signal, and does not need the USB device that is synchronously switched with the information source switching signal, as shown in fig. 2, the OPS, Android, and other information sources of fig. 2 are one of fixed information source modes, that is, the USB device is fixedly connected with a certain information source, for example, if the USB device is set as the OPS, the USB device is fixedly connected with the OPS. Each USB device is in a following information source mode or a fixed information source mode, the preset mode of each USB device can be specified by a user, and the USB device is in an optional following information source mode by default under the condition that the user does not specify the USB device.
And S130, if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment.
In the embodiment of the present invention, when the USB device is in the optional following source mode, the communication state of the USB device may be further determined, and whether to switch the USB device may be determined according to the communication state, for example, if the USB device is in the communication state, a plurality of options may be generated for a user to select whether to switch the connection, or when the USB device is not in the communication state, the USB device may be switched to be connected to the target USB hub.
In some embodiments, such as this embodiment, the step S130 may include steps S131-S134, as shown in fig. 3.
S131, judging whether the USB equipment is in the communication state.
In the embodiment of the present invention, it is necessary to determine whether the USB device is in a communication state to further determine whether to switch the USB device to be connected to the target USB hub.
S132, if the USB equipment is in the communication state, generating a plurality of selection items for a user to select.
In the embodiment of the invention, when the USB equipment is in a communication state, a selection prompt box is generated, and the selection prompt box comprises a plurality of selection items, so that a user can conveniently select how to process the USB equipment, and an instruction corresponding to the selection item is executed according to the selection of the user.
S133, acquiring the selected option selected by the user as a target option and executing the instruction corresponding to the target option.
In the embodiment of the invention, after a plurality of selection items are generated, a user can select one selection item according to own requirements, the selection item is used as a target selection item after the selection item is obtained, and an instruction corresponding to the target selection item is executed. Wherein the plurality of options may include switching the source signal, maintaining the source signal, etc.
S134, if the USB device is not in the communication state, switching the USB device to be connected to the target USB hub.
In the embodiment of the invention, when the USB equipment is not in the communication state, the USB equipment is switched to be connected with the target USB hub.
In some embodiments, such as this embodiment, the multiple options include maintaining the current source, switching to the next source, and waiting for communication to be completed, as shown in fig. 4, the step S132 may include steps S1321-S1324.
S1321, acquiring the selected option selected by the user as the target option.
In the embodiment of the invention, the selection items can comprise maintaining the current information source, switching to the next information source and waiting for the completion of communication, and a user can select one of the selection items as an instruction to be sent to the main control chip.
S1322, if the target option is the current information source, maintaining the current connection of the USB device.
In the embodiment of the present invention, maintaining the current source means skipping the processing of the USB device as in the fixed source mode, and maintaining the current connection state of the USB device.
S1323, if the option selected by the target is the switching to the next information source, switching the USB equipment to be connected with the target USB hub.
In the embodiment of the present invention, switching to the next source means to interrupt the communication status of the USB device and switch the following USB device to connect with the target USB hub.
S1324, if the target option is that the waiting communication is finished, monitoring the communication state of the USB equipment, and when the USB equipment finishes the communication state, switching the USB equipment to be connected with the target USB concentrator.
In the embodiment of the present invention, the waiting for the completion of the communication means waiting for the USB device to end the communication state, for example, the USB device is a USB disk, and the USB disk is performing data transmission, and then the USB disk is switched to be connected to the target USB hub after the USB disk completes the data transmission.
In some embodiments, such as this embodiment, the step S1323 may include steps S13231-S13232, as shown in fig. 5.
S13231, interrupting the communication state of the USB device.
S13232, switching the USB device to be connected with the target USB hub.
In the embodiment of the invention, when the user selects to switch to the next information source, the communication state of the USB equipment is interrupted firstly, so that the USB equipment is switched to be connected with the target USB hub.
In some embodiments, such as this embodiment, the step S1324 may include steps S13241-S13243, as shown in FIG. 6.
S13241, determining whether the USB device is in the communication state.
In the embodiment of the invention, the main control chip can access by reading the currently accessed USB hub interface of the USB equipment and detect whether the USB equipment is in a communication state in real time.
S13242, if the USB device is in the communication state, returning to the step of judging whether the USB device is in the communication state.
In the embodiment of the present invention, when the USB device is in the communication state, the process returns to step S13241 to continuously determine whether the USB device is in the communication state.
S13243, if the USB device is not in the communication state, switching the USB device to be connected to the target USB hub.
In the embodiment of the invention, when the USB equipment is not in the communication state, the USB equipment is switched to be connected with the target USB hub.
Fig. 7 is a schematic block diagram of a USB interface switching control apparatus 100 according to an embodiment of the present invention. As shown in fig. 7, the present invention further provides a USB interface switching control apparatus 100 corresponding to the above USB interface switching control method. The USB interface switching control apparatus 100 includes a unit for executing the above-described USB interface switching control method. Specifically, referring to fig. 7, the USB interface switching control apparatus 100 includes a target confirmation unit 110, a predetermined mode determination unit 120, a first confirmation unit 130, a first execution unit 140, and a second execution unit 150.
The target confirmation unit 110 is configured to, if a source switching signal is received, confirm the target USB hub according to the source switching signal; the preset mode determining unit 120 is configured to determine a preset mode of the USB device, where the preset mode includes a selectable following source mode, a forced following source mode, and a fixed source mode; the first confirming unit 130 is configured to confirm the communication state of the USB device if the preset mode of the USB device is the optional following source mode; the first executing unit 140 is configured to switch the USB device to be connected to the target USB hub if the preset mode of the USB device is the forced following source mode; the second executing unit 150 is configured to not switch the connection of the USB device if the preset mode of the USB device is the fixed source mode.
In some embodiments, for example, in this embodiment, referring to fig. 8, the USB interface switching control apparatus 100 further includes a modification unit 110 a.
The modification unit 110a is configured to modify the preset mode of the USB device according to a user instruction.
In some embodiments, for example, in the present embodiment, referring to fig. 9, the first confirming unit 130 includes a first judging unit 131, a first generating unit 132, a first acquiring unit 133, and a first switching unit 134.
The first determining unit 131 is configured to determine whether the USB device is in the communication state; the first generating unit 132 is configured to generate a plurality of selection items for a user to select if the USB device is in the communication state; the first obtaining unit 133 is configured to obtain a selection item selected by a user as a target selection item and execute an instruction corresponding to the target selection item; the first switching unit 134 is configured to switch the USB device to be connected to the target USB hub if the USB device is not in the communication state.
In some embodiments, for example, in this embodiment, referring to fig. 10, the first obtaining unit 133 includes a second obtaining unit 1331, a third executing unit 1332, a second switching unit 1333, and a third switching unit 1334.
The second obtaining unit 1331 is configured to obtain a selection item selected by the user as the target selection item; the third executing unit 1332 is configured to maintain the current connection of the USB device if the target option is the current source; a second switching unit 1333, configured to switch the USB device to be connected to the target USB hub if the option selected by the target is the next source; the third switching unit 1334 is configured to monitor a communication status of the USB device if the target option is the waiting for communication, and switch the USB device to be connected to the target USB hub when the USB device finishes the communication status.
In some embodiments, for example in this embodiment, see fig. 11, the second switching unit 1333 comprises a sixth performing unit 13331 and a fourth switching unit 13332.
The sixth execution unit 13331 is configured to interrupt the communication status of the USB device; a fourth switching unit 13332 is used for switching the USB device to connect with the target USB hub.
In some embodiments, for example in the present embodiment, referring to fig. 12, the third switching unit 1334 includes a second judging unit 13341, a returning unit 13342 and a fifth switching unit 13343.
The second determining unit 13341 is configured to determine whether the USB device is in the communication state; a returning unit 13342, configured to return to the step of determining whether the USB device is in the communication state if the USB device is in the communication state; the fifth switching unit 13343 is configured to switch the USB device to be connected to the target USB hub if the USB device is not in the communication state.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the USB interface switching control device and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described USB interface switching control apparatus may be implemented in the form of a computer program that can be run on the all-in-one machine device shown in fig. 13.
Referring to fig. 14, in an embodiment, the all-in-one device includes a USB interface switching control circuit 506, and the USB interface control circuit 506 includes a plurality of USB devices, a plurality of USB switches, and a plurality of USB hubs; each USB device is correspondingly connected with one USB selector switch, each USB selector switch is connected with a plurality of USB hubs, each USB hub is correspondingly connected with one information source host, and each USB selector switch and each USB hub are further connected with the main control chip; the main control chip can control the USB concentrator communicated with the USB selector switch according to the information source switching signal.
The USB devices correspond to the USB device 1 and the USB device 2 … …, the USB switches correspond to the USB switch 1 and the USB switch 2 … …, the USB hubs correspond to the USB hub 1 and the USB hub 2 … …, the USB uplink interface 1 to the USB uplink interface X and the information source host 1 to the information source host X are correspondingly arranged, the USB device 1 is connected with the USB switch 1, the USB hub 1 is connected with the USB uplink interface 1, the USB uplink interface 1 is connected with the information source host 1, the USB switch 1 can be simultaneously connected with the USB hubs and can be communicated with one of the USB hubs under the control of the main control chip, so that the USB devices can be connected to different information source hosts, and meanwhile, the main control chip can detect the communication state of the USB devices through the USB hubs.
Referring to fig. 13, fig. 13 is a schematic block diagram of an all-in-one machine device according to an embodiment of the present application. The kiosk apparatus 500 may be a conference kiosk, an educational kiosk, or the like.
Referring to fig. 13, the all-in-one device 500 includes a main control chip 502, a memory and an interface 507 connected by a system bus 501, wherein the memory may include a nonvolatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, causes the main control chip 502 to perform a USB interface switching control method.
The main control chip 502 is used to provide computing and control capabilities to support the operation of the entire all-in-one machine 500.
The internal memory 504 provides an environment for the computer program 5032 in the non-volatile storage medium 503 to run, and when the computer program 5032 is executed by the main control chip 502, the main control chip 502 can execute a USB interface switching control method.
The interface 505 is used to communicate with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 13 is a block diagram of only a portion of the configuration associated with the disclosed aspects and does not constitute a limitation on the all-in-one device 500 to which the disclosed aspects apply, as a particular all-in-one device 500 may include more or less components than shown, or combine certain components, or have a different arrangement of components.
The main control chip 502 is configured to run a computer program 5032 stored in the memory, so as to implement the following steps:
if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal;
judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode;
if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment;
if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub;
and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment.
It should be understood that, in the embodiment of the present Application, the main control chip 502 may be a Central Processing Unit (CPU), and the main control chip 502 may also be other general purpose main control chips, Digital Signal main control chips (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. The general main control chip may be a micro main control chip or the main control chip may be any conventional main control chip.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one main control chip in the computer system to implement the flow steps of the above-mentioned method embodiments.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When executed by the main control chip, the computer program causes the main control chip to execute the following steps:
if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal;
judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode;
if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment;
if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub;
and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing an all-in-one device to perform all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A USB interface switching control method is characterized by comprising the following steps:
if an information source switching signal is received, confirming a target USB concentrator according to the information source switching signal;
judging a preset mode of the USB equipment, wherein the preset mode comprises a selectable following information source mode, a forced following information source mode and a fixed information source mode;
if the preset mode of the USB equipment is the optional following information source mode, confirming the communication state of the USB equipment;
if the preset mode of the USB equipment is the forced following information source mode, switching the USB equipment to be connected with the target USB hub;
and if the preset mode of the USB equipment is the fixed information source mode, not switching the connection of the USB equipment.
2. The method as claimed in claim 1, wherein the step of confirming the communication status of the USB device if the predetermined mode of the USB device is the optional following source mode comprises:
judging whether the USB equipment is in the communication state or not;
if the USB equipment is in the communication state, generating a plurality of selection items for a user to select;
acquiring a selection item selected by a user as a target selection item and executing an instruction corresponding to the target selection item;
and if the USB equipment is not in the communication state, switching the USB equipment to be connected with the target USB hub.
3. The method as claimed in claim 2, wherein the step of obtaining the option selected by the user as the target option and executing the command corresponding to the target option comprises the steps of maintaining the current source, switching to the next source and waiting for the communication to be completed, and the step of:
acquiring a selection item selected by a user as the target selection item;
if the target option is the current information source, maintaining the current connection of the USB equipment;
if the selection item selected by the target is the switching to the next information source, switching the USB equipment to be connected with the target USB hub;
and if the target option is that the communication waiting is finished, monitoring the communication state of the USB equipment, and switching the USB equipment to be connected with the target USB concentrator when the USB equipment finishes the communication state.
4. The USB interface switching control method according to claim 3, wherein the switching the USB device to connect to the target USB hub includes:
interrupting the communication state of the USB equipment;
switching the USB device to connect with the target USB hub.
5. The method as claimed in claim 3, wherein the step of monitoring the communication status of the USB device and switching the USB device to connect to the target USB hub when the USB device ends the communication status comprises:
judging whether the USB equipment is in the communication state or not;
if the USB equipment is in the communication state, returning to the step of judging whether the USB equipment is in the communication state;
and if the USB equipment is not in the communication state, switching the USB equipment to be connected with the target USB hub.
6. The method for controlling switching of USB interfaces according to claim 1, wherein said step of confirming the target USB hub according to the source switching signal if the source switching signal is received further comprises:
and changing the preset mode of the USB equipment according to a user instruction.
7. A USB interface switching control apparatus, comprising:
the target confirmation unit is used for confirming the target USB concentrator according to the information source switching signal if the information source switching signal is received;
the device comprises a preset mode judging unit, a signal source processing unit and a signal source processing unit, wherein the preset mode judging unit is used for judging a preset mode of the USB device, and the preset mode comprises a selectable following signal source mode, a forced following signal source mode and a fixed signal source mode;
the first confirmation unit is used for confirming the communication state of the USB equipment if the preset mode of the USB equipment is the optional following information source mode;
the first execution unit is used for switching the USB equipment to be connected with the target USB hub if the preset mode of the USB equipment is the forced following information source mode;
and the second execution unit is used for not switching the connection of the USB equipment if the preset mode of the USB equipment is the fixed information source mode.
8. The all-in-one machine equipment is characterized by comprising a memory and a main control chip connected with the memory; the memory is used for storing a computer program; the main control chip is used for operating the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 6.
9. The all-in-one machine device of claim 8, comprising a USB interface switching control circuit, the USB interface control circuit comprising a plurality of USB devices, a plurality of USB switches, and a plurality of USB hubs;
each USB device is correspondingly connected with one USB selector switch, each USB selector switch is connected with a plurality of USB hubs, each USB hub is correspondingly connected with one information source host, and each USB selector switch and each USB hub are further connected with the main control chip;
the main control chip can control the USB concentrator communicated with the USB selector switch according to the information source switching signal.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a master control chip, implements the steps of the method according to any one of claims 1-6.
CN202110974238.4A 2021-08-24 2021-08-24 USB interface switching control method and device, all-in-one machine equipment and storage medium Active CN113656342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110974238.4A CN113656342B (en) 2021-08-24 2021-08-24 USB interface switching control method and device, all-in-one machine equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110974238.4A CN113656342B (en) 2021-08-24 2021-08-24 USB interface switching control method and device, all-in-one machine equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113656342A true CN113656342A (en) 2021-11-16
CN113656342B CN113656342B (en) 2022-05-03

Family

ID=78492645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110974238.4A Active CN113656342B (en) 2021-08-24 2021-08-24 USB interface switching control method and device, all-in-one machine equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113656342B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1380615A (en) * 2001-04-09 2002-11-20 华邦电子股份有限公司 USB concentrator with several upstream port and computer system using said concentrator
US7260616B1 (en) * 2001-08-13 2007-08-21 Sprint Communications Company L.P. Communication hub with automatic device registration
CN103151074A (en) * 2007-12-20 2013-06-12 莫塞德技术公司 Dual function compatible non-volatile memory device
CN103529339A (en) * 2013-10-30 2014-01-22 陕西省地方电力(集团)有限公司 Circuit interface and state monitoring IED
US20140207977A1 (en) * 2013-01-22 2014-07-24 Silergy Semiconductor Technology (Hangzhou) Ltd Usb device and control method thereof
CN105095132A (en) * 2014-04-30 2015-11-25 名硕电脑(苏州)有限公司 Electronic device capable of automatically switching Universal Serial Bus master-slave device modes and operating method of electronic device
CN105094037A (en) * 2014-05-13 2015-11-25 Ls产电株式会社 Expansion module for programmable logic controller using usb communication
US20170249271A1 (en) * 2016-02-26 2017-08-31 Essential Products, Inc. Systems and techniques for intelligently switching between multiple sources of universal serial bus signals
CN110389920A (en) * 2019-07-18 2019-10-29 深圳市立顺电通科技有限公司 A kind of switching circuit and device
CN111078616A (en) * 2019-12-30 2020-04-28 深圳创维汽车智能有限公司 Port control method, device, equipment and storage medium of USB hub

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1380615A (en) * 2001-04-09 2002-11-20 华邦电子股份有限公司 USB concentrator with several upstream port and computer system using said concentrator
US7260616B1 (en) * 2001-08-13 2007-08-21 Sprint Communications Company L.P. Communication hub with automatic device registration
CN103151074A (en) * 2007-12-20 2013-06-12 莫塞德技术公司 Dual function compatible non-volatile memory device
US20140207977A1 (en) * 2013-01-22 2014-07-24 Silergy Semiconductor Technology (Hangzhou) Ltd Usb device and control method thereof
CN103529339A (en) * 2013-10-30 2014-01-22 陕西省地方电力(集团)有限公司 Circuit interface and state monitoring IED
CN105095132A (en) * 2014-04-30 2015-11-25 名硕电脑(苏州)有限公司 Electronic device capable of automatically switching Universal Serial Bus master-slave device modes and operating method of electronic device
CN105094037A (en) * 2014-05-13 2015-11-25 Ls产电株式会社 Expansion module for programmable logic controller using usb communication
US20170249271A1 (en) * 2016-02-26 2017-08-31 Essential Products, Inc. Systems and techniques for intelligently switching between multiple sources of universal serial bus signals
CN110389920A (en) * 2019-07-18 2019-10-29 深圳市立顺电通科技有限公司 A kind of switching circuit and device
CN111078616A (en) * 2019-12-30 2020-04-28 深圳创维汽车智能有限公司 Port control method, device, equipment and storage medium of USB hub

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
岳云天 等: "基于USB总线的随机信源设计与实现", 《电子设计应用》 *
张忠伟 等: "信源自动切换装置的设计及控制原理", 《西部广播电视》 *

Also Published As

Publication number Publication date
CN113656342B (en) 2022-05-03

Similar Documents

Publication Publication Date Title
CN105438098A (en) Vehicle control method and device
CN110913447B (en) Network control method, network control device, storage medium and electronic equipment
CN111209032A (en) Gray scale publishing method, configuration center server, user terminal, system and medium
CN109086175B (en) Board card testing method and device
EP3220669B1 (en) Method for configuring an audio rendering and/or acquiring device, and corresponding audio rendering and/or acquiring device, system, computer readable program product and computer readable storage medium
US11402819B2 (en) Screen creation device and screen creation system
US11928073B2 (en) Configurable USB-C alternate mode for multi-level controller communication
WO2021014279A1 (en) Method and apparatus for determining link bifurcation availability
CN113656342B (en) USB interface switching control method and device, all-in-one machine equipment and storage medium
WO2024094068A1 (en) Communication connection control method, vehicle-mounted device, communication system and storage medium
CN113918219A (en) Chip internal signal output control method, chip and electronic equipment
CN109614177B (en) Selection assembly and control method thereof
JP7310706B2 (en) AGENT CONTROL DEVICE, AGENT CONTROL METHOD, AND AGENT CONTROL PROGRAM
US20210357086A1 (en) Agent control device, agent control method, and recording medium
CN115576627A (en) Middleware configuration management method, device, equipment, storage medium and operating machine
CN106488030A (en) Method, router and the mobile terminal of mobile terminal is found using router
CN107515746B (en) Startup initialization method and device, electronic equipment and computer storage medium
EP3869839A1 (en) Wireless intercom system and group pairing method of wireless intercom system
CN104850522A (en) Signal output method and device
CN110399192B (en) Information processing method, electronic equipment and computer storage medium
CN113665248B (en) Consumable chip, consumable box and method for controlling communication of consumable chip
CN115184717B (en) Test method and device based on multiple devices to be tested and electronic device
CN118034748A (en) Firmware updating method and display device
CN115884147A (en) Data transmission method, device, demonstrator and storage medium
EP3381153B1 (en) Automated system setup

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