Electronic device and USB interface switching method

By detecting the data transmission status of the USB interface and only switching the interface when there is no data transmission when the operating system is switched, the problem of data loss and waiting for the USB interface when the operating system is switched is solved and the user experience is improved.

CN114201428BActive Publication Date: 2024-10-15K TRONICS (SUZHOU) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010987327.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-18
Publication Date
2024-10-15
Estimated Expiration
2040-09-18

AI Technical Summary

Technical Problem

When the operating system is switched, the USB interface is transmitting data, resulting in data loss or waiting for the transmission to be completed, which affects the user experience.

Method used

By detecting the data transmission status of the USB interface, it only switches the USB interface to the target operating system when there is no data transmission, ensuring the integrity of data transmission and reducing waiting time.

Benefits of technology

It protects the transmission data of the USB interface, avoids data loss and waiting, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114201428B_ABST
    Figure CN114201428B_ABST
Patent Text Reader

Abstract

This disclosure discloses an electronic device and a USB interface switching method. The electronic device includes: a first control component corresponding to a first operating system, a second control component corresponding to a second operating system, a USB interface, and a USB interface switching circuit. The first control component is used to detect the data transmission status between the USB interface and the first control component. The second control component is used to detect the data transmission status between the USB interface and the second control component. The first and / or second control components are further used to: after the operating system of the electronic device is switched, determine whether there is data transmission between the USB interface and the control component corresponding to the previous operating system; when it is determined that there is no data transmission between the USB interface and the control component corresponding to the previous operating system, control the USB interface switching circuit to connect to the control component corresponding to the new operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more particularly to an electronic device and a USB interface switching method. Background Art

[0002] At present, in order to meet the requirements of users in various scenarios and enrich functions, commonly used conference machines or educational machines will be set up with dual systems. For example, an open pluggable specification (OPS) box will be added. The OPS box is inside or on the side of the conference machine. It is not very convenient to connect the universal serial bus (USB) interface, so the conference machine (or educational machine) and the OPS box share a USB interface. The operating system of the conference machine (or educational machine) is generally the Android system, and the operating system of the OPS box is generally the Windows operating system. The operating interfaces of the two operating systems are on the conference machine (or educational machine). At present, the USB interface will automatically switch to the device corresponding to the operating system after the operating system is switched. The problem is that if the USB interface is transmitting data when the operating system is switched, then directly switching the USB interface will cause the loss of USB data, data transmission interruption, and file damage; if the operating system is switched after the USB interface has transmitted data, the user needs to wait for the USB data transmission to be completed before switching the operating system to the required operating system, so the user waits for a long time, affecting the user experience. Summary of the invention

[0003] The present disclosure provides an electronic device and a USB interface switching method, the specific scheme is as follows:

[0004] An electronic device provided by an embodiment of the present disclosure includes: a first control component corresponding to a first operating system, a second control component corresponding to a second operating system, a USB interface, and a USB interface switching circuit; wherein:

[0005] The USB interface is connected to the first control component or the second control component through the USB interface switching circuit;

[0006] The USB interface switching circuit is used to connect the USB interface to the first control component or the second control component;

[0007] The first control component is used to detect the data transmission status between the USB interface and the first control component;

[0008] The second control component is used to detect the data transmission status between the USB interface and the second control component;

[0009] The first control component and / or the second control component is also used to: after the operating system corresponding to the operating interface of the electronic device is switched, determine whether there is data being transmitted between the USB interface and the control component corresponding to the operating system before switching based on the data transmission status between the USB interface detected by the control component corresponding to the operating system before switching and the control component corresponding to the operating system before switching; when it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, control the USB interface switching circuit to switch the USB interface to connect to the control component corresponding to the operating system after switching.

[0010] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component and / or the second control component is specifically used for:

[0011] When it is determined that there is data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is switched to connect to the control component corresponding to the operating system after switching after the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed;

[0012] When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is directly switched to connect to the control component corresponding to the operating system after switching.

[0013] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component is used to start detecting the data transmission status between the USB interface and the first control component after the operation interface of the electronic device is switched from the first operating system to the second operating system.

[0014] Optionally, in the electronic device provided in an embodiment of the present disclosure, the second control component is used to start detecting the data transmission status between the USB interface and the second control component after the operation interface of the electronic device is switched from the second operating system to the first operating system.

[0015] Optionally, in the electronic device provided by an embodiment of the present disclosure, the first control component is used to control the USB interface switching circuit to switch the USB interface to connect to the first control component or the second control component;

[0016] The second control component is further configured to send the detected data transmission status information between the USB interface and the second control component to the first control component.

[0017] Optionally, in the electronic device provided in the embodiment of the present disclosure, the second control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the first control component or the second control component; the first control component is also used to send the detected data transmission status information between the USB interface and the first control component to the second control component.

[0018] Optionally, in the electronic device provided by the embodiment of the present disclosure, data transmission status information is transmitted between the first control component and the second control component via a UART serial port circuit, a USB interface, or an I2C interface.

[0019] Optionally, in the electronic device provided by the embodiment of the present disclosure, the first control component is used to control the USB interface switching circuit to switch the USB interface to connect with the second control component;

[0020] The second control component is used to control the USB interface switching circuit to switch the USB interface to connect with the first control component.

[0021] Optionally, the electronic device provided in the embodiment of the present disclosure further includes a display screen, and the first control component and the second control component are both connected to the display screen, and the display screen is used to display an operation interface of the first operating system or an operation interface of the second operating system.

[0022] Optionally, in the electronic device provided in an embodiment of the present disclosure, the first operating system is an Android system, and the second operating system is a Windows system.

[0023] Optionally, in the electronic device provided by the embodiment of the present disclosure, the USB interface switching circuit includes at least one control terminal, a first signal terminal, a second signal terminal and a third signal terminal;

[0024] The first signal terminal is connected to the USB interface, the second signal terminal is connected to the first control component, and the third signal terminal is connected to the second control component;

[0025] The at least one control terminal is connected to the GPIO port of the first control component;

[0026] Alternatively, the at least one control terminal is connected to the GPIO port of the second control component;

[0027] Alternatively, when the USB interface switching circuit includes multiple control terminals, a part of the control terminals are connected to the GPIO ports of the first control component, and the remaining part of the control terminals are respectively connected to the GPIO ports of the second control component.

[0028] Accordingly, the embodiment of the present disclosure further provides a USB interface switching method applied to the above electronic device, comprising:

[0029] After the operating system corresponding to the operating interface of the electronic device is switched, determining whether data is being transmitted between the USB interface and the control component corresponding to the operating system before the switching;

[0030] When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface switching circuit is controlled to switch the USB interface to connect to the control component corresponding to the operating system after switching.

[0031] Optionally, in the USB interface switching method provided by the present disclosure, until it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before the switching, controlling the USB interface switching circuit to switch the USB interface to connect to the control component corresponding to the operating system after the switching, specifically includes:

[0032] When it is determined that there is data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is switched to connect to the control component corresponding to the operating system after switching after the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed;

[0033] When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is directly switched to connect to the control component corresponding to the operating system after switching.

[0034] Accordingly, an embodiment of the present disclosure further provides a computer-readable non-volatile storage medium, wherein the computer-readable non-volatile storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above method provided in the embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is one of the structural schematic diagrams of an electronic device provided in an embodiment of the present disclosure;

[0036] Figure 2 A second structural schematic diagram of an electronic device provided in an embodiment of the present disclosure;

[0037] Figure 3 One of the partial structural schematic diagrams of a UART serial port circuit provided in an embodiment of the present disclosure;

[0038] Figure 4 A second partial structural diagram of a UART serial port circuit provided in an embodiment of the present disclosure;

[0039] Figure 5 One of the structural schematic diagrams of a USB interface switching circuit provided in an embodiment of the present disclosure;

[0040] Figure 6 A second structural diagram of a USB interface switching circuit provided in an embodiment of the present disclosure;

[0041] Figure 7 One of the flowcharts of a USB interface switching method provided by an embodiment of the present disclosure;

[0042] Figure 8 The present invention provides a second flowchart of a USB interface switching method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the above-mentioned purposes, features and advantages of the present disclosure more obvious and easy to understand, the present disclosure will be further described below with reference to the accompanying drawings and examples. However, the example embodiments can be implemented in various forms and should not be understood as being limited to the embodiments described herein; on the contrary, these embodiments are provided to make the present disclosure more comprehensive and complete, and to fully convey the concepts of the example embodiments to those skilled in the art. The same figure marks in the figures represent the same or similar structures, and thus their repeated descriptions will be omitted. The words expressing position and direction described in the present disclosure are all explained using the accompanying drawings as examples, but changes can be made as needed, and the changes made are all included in the scope of protection of the present disclosure. The drawings of the present disclosure are only used to illustrate the relative position relationship and do not represent the true proportion.

[0044] It should be noted that specific details are described in the following description to facilitate a full understanding of the present disclosure. However, the present disclosure can be implemented in a variety of other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present disclosure. Therefore, the present disclosure is not limited to the specific implementation methods disclosed below. The subsequent description of the specification is a preferred implementation method for implementing the present application, but the description is for the purpose of illustrating the general principles of the present application and is not intended to limit the scope of the present application. The scope of protection of the present application shall be determined by the definition of the attached claims.

[0045] The electronic device and the USB interface switching method provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0046] An electronic device provided by an embodiment of the present disclosure is Figure 1 As shown, it includes: a first control component 01 corresponding to the first operating system, a second control component 02 corresponding to the second operating system, a USB interface 03, and a USB interface switching circuit 04;

[0047] The USB interface 03 is electrically connected to the first control component 01 or the second control component 02 via the USB interface switching circuit 04;

[0048] The USB interface switching circuit 04 is used to connect the USB interface 03 to the first control component 01 or the second control component 02;

[0049] The first control component 01 is used to detect the data transmission status between the USB interface 03 and the first control component 01;

[0050] The second control component 02 is used to detect the data transmission status between the USB interface 03 and the second control component 02;

[0051] The first control component 01 and / or the second control component 02 are also used for: after the operating system corresponding to the operating interface of the electronic device is switched, determining whether there is data being transmitted between the USB interface 03 and the control component corresponding to the operating system before switching according to the data transmission status between the USB interface 03 detected by the control component corresponding to the operating system before switching and the control component corresponding to the operating system before switching; until it is determined that there is no data transmission between the USB interface 03 and the control component corresponding to the operating system before switching, controlling the USB interface switching circuit 04 to switch the USB interface 03 to connect to the control component corresponding to the switched operating system.

[0052] The above-mentioned electronic device provided by the embodiment of the present disclosure can determine whether there is data being transmitted between the USB interface and the control component corresponding to the operating system before the switching according to the data transmission status between the USB interface and the control component corresponding to the operating system before the switching detected by the control component. When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before the switching, the USB interface switching circuit is controlled to switch the USB interface to connect to the control component corresponding to the operating system after the switching. This can protect the transmission data of the USB interface and can switch the operation interface without waiting, thereby improving the user experience.

[0053] Optionally, in the electronic device provided by the embodiment of the present disclosure, the first control component and / or the second control component is specifically used to: when it is determined that there is data transmission between the USB interface and the control component corresponding to the operating system before switching, after the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed, switch the USB interface to connect to the control component corresponding to the operating system after switching;

[0054] When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is directly switched to connect to the control component corresponding to the operating system after switching.

[0055] The electronic device provided in the embodiment of the present disclosure may be any electronic device including a first control component and a second control component with different operating systems, and the two control components need to share a USB interface. For example, the electronic device is an educational machine or a conference machine, the first control component may include a system on a chip (SOC), a memory, a DC power supply, a high definition multimedia interface (HDMI), etc., and the second control component is an OPS box, which is not limited here.

[0056] In a specific implementation, in the electronic device provided in the embodiment of the present disclosure, if Figure 2 As shown, it also includes a display screen 05, and the first control component 01 and the second control component 02 are both connected to the display screen 05, and the display screen 05 is used to display the operation interface of the first operating system or the operation interface of the second operating system.

[0057] In a specific implementation, the first control component and the display screen can be connected via a low-voltage differential signaling (LVDS) line, the second control component and the display screen can also be connected via an LVDS line, and the first control component and the second control component can be connected via an HDMI line.

[0058] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component is the main control component, the second control component is the auxiliary control component, and the operation interfaces of the first operating system and the second operating system are both displayed on the display screen. When the main control component is turned on, the first operating system is turned on, the operation interface displayed on the display screen is the first operating system, and the main control component controls the USB interface switching circuit to connect the USB interface to the main control component, that is, when the main control component is turned on, the USB interface is connected to the main control component by default. When it is necessary to turn on the second operating system, the second operating system can be turned on by controlling the second control component through the first control component under the operation interface of the first operating system displayed on the display screen. Of course, an opening key is set on the second control component, and the second operating system is turned on directly by triggering the opening key.

[0059] When the second operating system is turned on, when the operating interface of the operating system displayed on the display screen is switched to the second operating system, the first control component and / or the second control component will determine whether there is data being transmitted between the USB interface and the main control component; when there is data transmission, the USB interface switching circuit is controlled after the data transmission is completed, so that the USB interface switches to connect with the auxiliary control component, and when there is no data transmission, the USB interface switching circuit is directly controlled to switch the USB interface to connect with the auxiliary control component. When the operating interface of the operating system displayed on the display screen is switched to the first operating system, the first control component and / or the second control component will determine whether there is data being transmitted between the USB interface and the auxiliary control component; when there is data transmission, the USB interface switching circuit is controlled after the data transmission is completed, so that the USB interface switches to connect with the main control component, and when there is no data transmission, the USB interface switching circuit is directly controlled to switch the USB interface to connect with the main control component. In this way, the transmission data of the USB interface can be protected, and the operating system can be switched without waiting, thereby improving the user experience.

[0060] In specific implementation, in the disclosed embodiment, each control component may start to detect the data transmission status between it and the USB interface after being connected to the USB interface, and stop detecting until the connection between it and the USB interface is disconnected. For example, the first control component starts to detect the data transmission status between it and the USB interface after being connected to the USB interface, and stops detecting until the connection between it and the USB interface is disconnected; the second control component starts to detect the data transmission status between it and the USB interface after being connected to the USB interface, and stops detecting until the connection between it and the USB interface is disconnected.

[0061] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component is used to start detecting the data transmission status between the USB interface and the first control component after the operation interface displayed on the display screen switches from the first operating system to the second operating system, thereby reducing the computing power of the first control component.

[0062] Similarly, optionally, in the electronic device provided in the embodiment of the present disclosure, the second control component is used to start detecting the data transmission status between the USB interface and the second control component after the operating interface displayed on the display screen switches from the second operating system to the first operating system, thereby reducing the computing power of the second control component.

[0063] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first operating system is an Android system, and the bottom layer of the first operating system can send and receive byte type (Byte) data (i.e., USB data) through a USB standard interface function (Public Void). As long as the first control component can read the Byte data, it means that data is being transmitted between the first control component and the USB interface. If no Byte data can be read, it means that no data is being transmitted between the first control component and the USB interface.

[0064] Optionally, in the electronic device provided in the embodiment of the present disclosure, the second operating system is a Windows system, and the second control component can obtain the unique identifier of the USB interface by calling an application programming interface (API) function in the Windows system, thereby obtaining the USB interface, and then reading the data of the USB interface. If the USB interface is transmitting data, the data can be read; if the USB interface has no data being transmitted, no data can be read.

[0065] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the first control component or the second control component; the second control component is used to send the detected data transmission status information between the USB interface and the second control component to the first control component. In this way, when the operation interface displayed on the display screen switches from the second operating system to the first operating system, the second control component is required to send the detected data transmission status information between the USB interface and the second control component to the first control component so that the first control component can control the USB interface switching circuit. When the operation interface displayed on the display screen switches from the first operating system to the second operating system, it is the first control component that detects the data transmission status between the USB interface and the first control component. Since it is the first control component that controls the USB interface switching circuit, the first control component does not need to send the data transmission status information to the second control component.

[0066] In a specific implementation, the first control component is connected to the USB interface switching circuit via a general-purpose input / output (GPIO) port.

[0067] Optionally, in the electronic device provided in the embodiment of the present disclosure, the second control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the first control component or the second control component; the first control component is also used to send the detected data transmission status information between the USB interface and the first control component to the second control component. In this way, when the electronic device switches from the first operating system to the second operating system, the first control component is required to send the detected data transmission status information between the USB interface and the first control component to the second control component so that the second control component can control the USB interface switching circuit. When the operating interface displayed on the display screen switches from the second operating system to the first operating system, it is the second control component that detects the data transmission status between the USB interface and the second control component. Since it is the second control component that controls the USB interface switching circuit, the second control component does not need to send the data transmission status information to the first control component.

[0068] In a specific implementation, the second control component is connected to the USB interface switching circuit via the GPIO port.

[0069] Optionally, in the electronic device provided in the embodiment of the present disclosure, data transmission status information can be transmitted between the first control component and the second control component through a UART serial port circuit, a USB interface, or an I2C interface, which is not limited here.

[0070] Specifically, take the first operating system as an Android system and the second operating system as a Windows system as an example. The first control component and the second control component use a Universal Asynchronous Receiver / Transmitter (UART) serial port circuit for data exchange, such as an RS232UART serial port circuit. When the first control component sends data to the second control component, Figure 3 As shown, in the UART serial port circuit, the resistance value of resistor RR4 is about 10KΩ, which plays a pull-up role, the resistance value of resistor RR6 is about 10KΩ, which plays a current limiting role, the resistance value of resistor RR2 is about 10K, the transistor QR1 is an NPN transistor, the voltage level of the UART serial port circuit connected to the first control component is 3.3V, and the voltage level of the UART serial port circuit connected to the second control component is 12V. When the first control component receives the data sent by the second control component, as shown in FIG. Figure 4 As shown, in the UART serial port circuit, the resistance value of resistor RR3 is about 10KΩ, which plays a pull-up role, the resistance values ​​of resistors RR8 and RR9 are about 10KΩ, which play a current limiting and voltage dividing role, the transistor QR2 is an NPN transistor, the voltage level of the UART serial port circuit connected to one end of the first control component is 3.3V, and the voltage level of the UART serial port circuit connected to one end of the second control component is 12V.

[0071] In specific implementation, the UART serial port circuit can be set on the first control component, and the second control component is connected to the UART serial port circuit through a signal line, so that data transmission status information is transmitted between the first control component and the second control component through the UART serial port circuit.

[0072] Optionally, in the electronic device provided in the embodiment of the present disclosure, the first control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the second control component; the second control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the first control component. In this way, when the operation interface displayed on the display screen switches from the second operating system to the first operating system, it is the second control component that detects the data transmission status between the USB interface and the second control component. Therefore, the second control component does not need to send the data transmission status information to the first control component. The second control component directly controls the USB interface switching circuit so that the USB interface switches to connect with the first control component. When the operation interface displayed on the display screen switches from the first operating system to the second operating system, it is the first control component that detects the data transmission status between the USB interface and the first control component. Therefore, the first control component does not need to send the data transmission status information to the second control component. The first control component directly controls the USB interface switching circuit so that the USB interface switches to connect with the second control component.

[0073] In a specific implementation, the first control component is connected to the control USB interface switching circuit through the GPIO port, and the second control component is connected to the control USB interface switching circuit through the GPIO port.

[0074] Optionally, in the electronic device provided in the embodiment of the present disclosure, the USB interface switching circuit includes at least one control terminal, a first signal terminal, a second signal terminal and a third signal terminal; the first signal terminal is connected to the USB interface, the second signal terminal is connected to the first control component, and the third signal terminal is connected to the second control component;

[0075] At least one control terminal is connected to the GPIO port of the first control component;

[0076] Alternatively, at least one control terminal is connected to the GPIO port of the second control component;

[0077] Alternatively, when the USB interface switching circuit includes multiple control terminals, a portion of the control terminals are connected to the GPIO ports of the first control component, and the remaining portion of the control terminals are respectively connected to the GPIO ports of the second control component.

[0078] Take the USB interface switching circuit including two control terminals as an example. Figure 5As shown, the structure of the USB interface switching circuit may include a first control terminal SEL0 and a second control terminal SEL1, connected to the first signal terminal IN1 of the USB interface, the second signal terminal IN2 of the first control component, and the third signal terminal IN3 of the second control component; the USB interface switching circuit controls whether the first signal terminal IN1 is connected to the second signal terminal IN2 or the third signal terminal IN3 by the first control terminal SEL0 and the second control terminal SEL1. Wherein, the first control terminal SEL0 and the second control terminal SEL1 are both connected to the GPIO port of the first control component, or the first control terminal SEL0 and the second control terminal SEL1 are both connected to the GPIO port of the second control component, or the first control terminal SEL0 and the second control terminal SEL1 are respectively connected to the GPIO port of the first control component and the GPIO port of the second control component; the first signal terminal IN1 is connected to the USB interface, the second signal terminal IN2 is connected to the first control component, and the third signal terminal IN3 is connected to the second control component. The logic state corresponding to the USB interface switching circuit can be shown in Table 1 below.

[0079] SEL0 SEL1 IN2 IN3 0 0 OFF OFF 0 1 ON OFF 1 0 OFF ON 1 1 OFF OFF

[0080] Table 1.

[0081] In a specific implementation, when the USB interface switching circuit includes a control terminal, the specific structure of the USB interface switching circuit can be referred to in Figure 6 , may also include filter capacitors C1 and C2, resistors RS21, RS23, RS24 and RS25, and a pair of transient voltage suppression diodes DS7 and DS8 located at the signal terminal IN2, and a pair of transient voltage suppression diodes DS5 and DS6 located at the signal terminal IN3.

[0082] Based on the same inventive concept, the embodiment of the present disclosure also provides a USB interface switching method applied to any of the above electronic devices, such as Figure 7 As shown, including:

[0083] S701: After the operating system corresponding to the operating interface of the electronic device is switched, determine whether data is being transmitted between the USB interface and the control component corresponding to the operating system before the switching.

[0084] S702: until it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, control the USB interface switching circuit to switch the USB interface to connect to the control component corresponding to the operating system after switching.

[0085] The USB interface switching method provided by the embodiment of the present disclosure can determine whether there is data being transmitted between the USB interface and the control component corresponding to the operating system before the switching according to the data transmission status between the USB interface detected by the control component corresponding to the operating system before the switching, after the operating system is switched; until it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before the switching, the USB interface switching circuit is controlled to switch the USB interface to connect to the control component corresponding to the operating system after the switching, so that the transmission data of the USB interface can be protected and the operating system can be switched without waiting, thereby improving the user experience.

[0086] Optionally, in the USB interface switching method provided in the present application, such as Figure 8 As shown, specifically including:

[0087] S801: After the operating system corresponding to the operating interface of the electronic device is switched, determine whether data is being transmitted between the USB interface and the control component corresponding to the operating system before the switching.

[0088] If yes, then go to step S802. If no, then go to step S803.

[0089] S802: After the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed, the USB interface is switched to connect to the control component corresponding to the operating system after switching.

[0090] S803: directly switch the USB interface to connect to the control component corresponding to the switched operating system.

[0091] Based on the same inventive concept, an embodiment of the present disclosure provides a computer-readable non-volatile storage medium, which stores computer-executable instructions. The computer-executable instructions are used to enable a computer to execute any of the above methods provided by the embodiments of the present disclosure.

[0092] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0096] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.

[0097] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. An electronic device, in, include: A first control component corresponding to the first operating system, a second control component corresponding to the second operating system, a USB interface, and a USB interface switching circuit; wherein: The USB interface is connected to the first control component or the second control component through the USB interface switching circuit; the USB interface switching circuit is used to connect the USB interface to the first control component or the second control component; The first control component is used to detect the data transmission status between the USB interface and the first control component; The second control component is used to detect the data transmission status between the USB interface and the second control component; The first control component and / or the second control component is further used to: after the operating system corresponding to the operation interface of the electronic device is switched, determine whether there is data being transmitted between the USB interface and the control component corresponding to the operating system before switching according to the data transmission state between the USB interface and the control component corresponding to the operating system before switching detected by the control component corresponding to the operating system before switching; when it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, control the USB interface switching circuit to switch the USB interface to connect to the control component corresponding to the operating system after switching; The first control component is used to control the USB interface switching circuit to switch the USB interface to connect with the first control component or the second control component; the second control component is also used to send the detected data transmission status information between the USB interface and the second control component to the first control component; or, The second control component is used to control the USB interface switching circuit to switch the USB interface to connect with the first control component or the second control component; the first control component is also used to send the detected data transmission status information between the USB interface and the first control component to the second control component; or, The first control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the second control component; the second control component is used to control the USB interface switching circuit so that the USB interface switches to connect with the first control component.

2. The electronic device according to claim 1, in, The first control component and / or the second control component are specifically used for: When it is determined that there is data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is switched to connect to the control component corresponding to the operating system after switching after the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed; When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is directly switched to connect to the control component corresponding to the operating system after switching.

3. The electronic device according to claim 1, in, The first control component is used to start detecting the data transmission status between the USB interface and the first control component after the operation interface of the electronic device is switched from the first operating system to the second operating system.

4. The electronic device as claimed in claim 1, in, The second control component is used to start detecting the data transmission status between the USB interface and the second control component after the operation interface of the electronic device is switched from the second operating system to the first operating system.

5. The electronic device as claimed in claim 1, in, The data transmission status information is transmitted between the first control component and the second control component via a UART serial port circuit, a USB interface, or an I2C interface.

6. The electronic device according to any one of claims 1 to 4, in, It also includes a display screen, to which the first control component and the second control component are both connected, and the display screen is used to display an operation interface of the first operating system or an operation interface of the second operating system.

7. The electronic device according to any one of claims 1 to 4, in, The first operating system is an Android system, and the second operating system is a Windows system.

8. The electronic device as claimed in claim 1, in, The USB interface switching circuit includes at least one control terminal, a first signal terminal, a second signal terminal and a third signal terminal; The first signal terminal is connected to the USB interface, the second signal terminal is connected to the first control component, and the third signal terminal is connected to the second control component; The at least one control terminal is connected to the GPIO port of the first control component; Alternatively, the at least one control terminal is connected to the GPIO port of the second control component; Alternatively, when the USB interface switching circuit includes multiple control terminals, a part of the control terminals are connected to the GPIO ports of the first control component, and the remaining part of the control terminals are respectively connected to the GPIO ports of the second control component.

9. A USB interface switching method applied to the electronic device as claimed in claim 1, in, include: After the operating system corresponding to the operating interface of the electronic device is switched, determining whether data is being transmitted between the USB interface and the control component corresponding to the operating system before the switching; Until it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface switching circuit is controlled to switch the USB interface to connect to the control component corresponding to the operating system after switching.

10. The USB interface switching method according to claim 9, in, The method further comprises: controlling the USB interface switching circuit to switch the USB interface to connect to the control component corresponding to the operating system after switching until it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching. When it is determined that there is data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is switched to connect to the control component corresponding to the operating system after switching after the data transmission between the USB interface and the control component corresponding to the operating system before switching is completed; When it is determined that there is no data transmission between the USB interface and the control component corresponding to the operating system before switching, the USB interface is directly switched to connect to the control component corresponding to the operating system after switching.

11. A computer-readable non-volatile storage medium, in, The computer-readable non-volatile storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 9 or 10.