Electronic device and control method

By switching communication modes on electronic devices, the problem of the vehicle's infotainment system being unable to receive data was solved, resulting in a higher data transmission success rate and lower latency and power consumption, thus improving the user experience.

CN118467413BActive Publication Date: 2026-01-02HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311682869.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2026-01-02
Estimated Expiration
2043-12-07

AI Technical Summary

Technical Problem

When electronic devices are connected to the vehicle's infotainment system, there may be issues where the system cannot receive application data from the electronic devices, especially when communication modes with high transmission rates and high signal quality requirements fail to be enumerated.

Method used

By setting up switches and control units on electronic devices, the electronic devices can be controlled to switch to a second communication mode with a lower transmission rate and lower signal quality requirements when the first communication mode enumeration, which has a higher transmission rate and higher signal quality requirements, fails. For example, the enumeration can be performed by switching from the USB 2.0 protocol to the USB 1.1 protocol.

Benefits of technology

It reduces the probability of enumeration failure, lowers enumeration time and power consumption, and improves the success rate of data transmission, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467413B_ABST
    Figure CN118467413B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an electronic device and a control method, and relate to the technical field of terminals. The electronic device comprises a first universal serial bus (USB) interface, a first switch and a control unit. The first switch is connected between the first USB interface and the control unit. In the case that the electronic device fails to enumerate in a first communication mode with a higher transmission rate and higher signal quality requirement, the first switch is controlled to stop the enumeration of the electronic device in the first communication mode, and the electronic device is configured to enumerate in a second communication mode with a lower transmission rate and lower signal quality requirement. In this way, in the case that the electronic device is connected to a vehicle machine by wire, the probability of the enumeration failure of the electronic device can be reduced, and the probability of the vehicle machine failing to receive the data of the application of the electronic device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminals, and in particular to an electronic device and a control method. BACKGROUND

[0002] Some electronic devices are provided with a universal serial bus (USB) interface. The electronic device can access a USB interface of a car machine through the USB interface of the electronic device, so as to realize communication between the electronic device and the car machine.

[0003] However, in the case where the electronic device is connected with the car machine, the car machine can fail to receive data of an application of the electronic device. SUMMARY

[0004] Embodiments of the present application provide an electronic device and a control method, which are applied to the technical field of terminals. In the case where the electronic device fails to enumerate in a first communication mode with a higher transmission rate and a higher signal quality requirement, a switch on the electronic device is controlled to make the electronic device stop enumerating in the first communication mode, the electronic device is configured with a second communication mode with a lower transmission rate and a lower signal quality requirement, and enumeration is performed in the second communication mode, so as to reduce the probability of enumeration failure of the electronic device in the case where the electronic device is connected with the car machine, and further reduce the probability of failure of the car machine to receive data of an application of the electronic device.

[0005] In a first aspect, an embodiment of the present application provides an electronic device, which comprises a first universal serial bus (USB) interface, a first switch and a control unit. The first switch is connected between the first USB interface and the control unit. The control unit is configured to control the first switch to be in a conductive state and perform enumeration in a first communication mode in the case where the electronic device accesses a second USB interface of a car machine through the first USB interface. The enumeration is used to realize identification of the electronic device by the car machine. The control unit is further configured to control the first switch to disconnect the first USB interface from the control unit in the case where the control unit fails to enumerate in the first communication mode, and configure a second communication mode. The control unit is further configured to control the first switch to be in the conductive state and perform enumeration in the second communication mode in the case where the configuration of the second communication mode is completed. The transmission rate of the second communication mode is lower than that of the first communication mode.

[0006] Exemplarily, the first communication mode can be a communication mode of a USB2.0 protocol. The second communication mode can be a communication mode of a USB1.1 protocol.

[0007] Optionally, the first communication mode can also be a communication mode with a transmission rate greater than that of the USB 2.0 protocol. For example, the first communication mode can also be any one of a communication mode of the USB 3.2 Gen1 protocol, a communication mode of the USB 3.2 Gen2 protocol, a communication mode of the USB 3.2 Gen2x2 protocol, a communication mode of the USB 4 Gen3 protocol, or a communication mode of the USB 4 Gen4 protocol. The second communication mode can be a communication mode with a transmission rate lower than that of the first communication mode.

[0008] In this way, when the control unit fails to enumerate in the first communication mode with a higher transmission rate and higher signal quality requirement, enumeration can be performed in the second communication mode with a lower transmission rate and lower signal quality requirement, so as to reduce the probability of enumeration failure, and further reduce the probability of the vehicle machine failing to receive the data of the application of the electronic device when the electronic device is connected to the vehicle machine. In addition, the time consumption and power consumption of enumeration of the electronic device can also be reduced. The first switch is controlled to disconnect the first USB interface from the control unit before the second communication mode is configured, so as to stop the control unit from enumerating in the first communication mode before the second communication mode is configured, thereby reducing the interference of enumeration of the control unit in the first communication mode on the configuration of the second communication mode.

[0009] In a possible implementation, the control unit includes a first pin. The electronic device further includes a second switch. A control end of the second switch is connected to the control unit, and one end of the second switch is connected to the first pin. The control unit is further configured to, in a case where the control unit fails to enumerate in the first communication mode, control the second switch to be in a conducting state, and receive a first level signal through the first pin. The control unit is further configured to, in a case where the first level signal is received, configure the second communication mode.

[0010] In this way, the control unit can be triggered to configure the second communication mode through the first level signal. In addition, the configuration of the second communication mode can be triggered through the control of the second switch.

[0011] In a possible implementation, the electronic device further includes a third switch and a power supply unit. A control end of the third switch is connected to the control unit, one end of the third switch is connected to the control end of the second switch, the other end of the third switch is grounded, and the control end of the second switch is further connected to the power supply unit. The power supply unit is configured to provide a voltage to the control end of the second switch. The control unit is further configured to, in a case where the electronic device accesses the second USB interface of the vehicle machine through the first USB interface, control the third switch to be in a conducting state, so that the second switch is in an off state. The control unit is further configured to, in a case where the control unit fails to enumerate in the first communication mode, control the third switch to be in an off state, so that the second switch is in a conducting state.

[0012] The driving voltage of the third switch can be lower than that of the second switch. In this way, the second switch with a higher driving voltage can be turned off by controlling the third switch with a lower driving voltage to turn on, and the second switch with a higher driving voltage can be turned on by controlling the third switch with a lower driving voltage to turn off. This makes the control of the second switch's on or off more flexible and reduces the driving power consumption for turning the second switch on or off.

[0013] In one possible implementation, the electronic device further includes a power supply unit. The other end of the second switch is connected to the power supply unit. The power supply unit is used to transmit a first-level signal to the control unit when the second switch is in the ON state.

[0014] In this way, when the second switch is in the on state, the power supply unit can transmit a first level signal to the control unit to trigger the configuration of the second communication mode.

[0015] In one possible implementation, the electronic device also includes a resistor. The resistor is connected between the power supply unit and the other end of the second switch.

[0016] In this way, the resistor can reduce the probability of the control unit being damaged due to excessive current input when the second switch is on.

[0017] In one possible implementation, the control unit includes a first pin and a second pin, and the first USB interface includes a third pin and a fourth pin. A first switch is also connected between the first pin and the third pin, and further connected between the second pin and the fourth pin.

[0018] The control unit is further configured to, when the electronic device is connected to the second USB port of the vehicle's infotainment system via the first USB port, control the first switch to connect the third pin to the first pin, and also to connect the fourth pin to the second pin. It is also configured to, when the control unit fails to enumerate according to the first communication mode, control the first switch to disconnect the third pin from the first pin, and also to disconnect the fourth pin from the second pin.

[0019] This allows the electronic device to communicate with the vehicle's infotainment system via the third and fourth pins of the first USB interface for enumeration when the electronic device is wired to the vehicle's infotainment system. It also allows enumeration to stop if enumeration fails using the first communication mode.

[0020] In one possible implementation, the control unit is further configured to control the first switch such that both the third and fourth pins are left floating if the control unit fails to enumerate according to the first communication mode.

[0021] In this way, the enumeration can be stopped in the case that the enumeration according to the first communication mode is unsuccessful.

[0022] In a possible implementation, the third pin and the fourth pin are both data transmission pins.

[0023] In this way, the electronic device can communicate with the car machine through the third pin and the fourth pin of the first USB interface to perform the enumeration in the case that the electronic device is wiredly connected to the car machine. The enumeration can also be stopped in the case that the enumeration according to the first communication mode is unsuccessful.

[0024] In a possible implementation, the control unit is further configured to control the first switch to disconnect the first USB interface from the control unit and configure the second communication mode in the case that the control unit receives the first information more than a threshold number of times, the first information being used to indicate a reset, the reset being one of the stages of the enumeration. And / or, the control unit fails to perform the enumeration according to the first communication mode from the time when the electronic device accesses the second USB interface through the first USB interface to the time when a first time threshold is reached.

[0025] In this way, the electronic device fails to perform the enumeration according to the first communication mode even after multiple resets, and / or, the electronic device fails to perform the enumeration even after the first time threshold is reached since the electronic device is wiredly connected to the car machine, which can indicate that the electronic device is unable to transmit data of an application of the electronic device according to the first communication mode. Therefore, the electronic device can select the second communication mode to perform the enumeration, so as to reduce the probability of the enumeration being unsuccessful, and reduce the time and power consumption of the enumeration.

[0026] In a possible implementation, the control unit is further configured to transmit the data of the application of the electronic device to the car machine according to the second communication mode in the case that the enumeration according to the second communication mode is successful.

[0027] In this way, the car machine can obtain the data of the application of the electronic device. For example, the car machine can play music in the application of the electronic device, or display a map for navigation on the electronic device.

[0028] In a possible implementation, the control unit is further configured to control the electronic device to display a pop-up window in the case that the enumeration according to the second communication mode is unsuccessful. The pop-up window contains prompt information that wired connection to the car machine is not supported.

[0029] In this way, the user can be prompted to connect the car machine in the wireless connection mode, so as to improve the user experience. Optionally, the pop-up window can also contain prompt information that the user is prompted to connect the car machine in the wireless connection mode.

[0030] In a second aspect, the embodiments of the present application provide a control method, which is applied to the electronic device described in the first aspect or any possible implementation manner of the first aspect. The method comprises: in the case that the electronic device accesses the second USB interface of the car machine through the first USB interface, controlling the first switch to be in a conductive state and performing enumeration in a first communication mode. The enumeration is used to realize the identification of the car machine to the electronic device. In the case that the enumeration performed by the control unit in the first communication mode is unsuccessful, controlling the first switch to disconnect the first USB interface from the control unit and configuring a second communication mode. In the case that the configuration of the second communication mode is completed, controlling the first switch to be in the conductive state and performing enumeration in the second communication mode. The transmission rate of the second communication mode is lower than that of the first communication mode.

[0031] Exemplarily, the first communication mode can be a communication mode of the USB2.0 protocol. The second communication mode can be a communication mode of the USB1.1 protocol.

[0032] Optionally, the first communication mode can also be a communication mode with a transmission rate higher than that of the USB2.0 protocol. For example, the first communication mode can also be any one of a communication mode of the USB3.2 Gen1 protocol, a communication mode of the USB3.2 Gen2 protocol, a communication mode of the USB3.2 Gen2x2 protocol, a communication mode of the USB4 Gen3 protocol or a communication mode of the USB4 Gen4 protocol. The second communication mode can be a communication mode with a transmission rate lower than that of the first communication mode.

[0033] In this way, in the case that the enumeration in the first communication mode with a higher transmission rate and a higher signal quality requirement is unsuccessful, the enumeration in the second communication mode with a lower transmission rate and a lower signal quality requirement can reduce the probability of unsuccessful enumeration, thereby reducing the probability that the car machine cannot receive the data of the application of the electronic device in the case that the electronic device is connected to the car machine, and reducing the time consumption and power consumption of the enumeration of the electronic device. Controlling the first switch to disconnect the first USB interface from the control unit before configuring the second communication mode can stop the control unit from performing enumeration in the first communication mode before the second communication mode is configured, so as to reduce the interference of the enumeration of the control unit in the first communication mode on the configuration of the second communication mode.

[0034] In a possible implementation, the method further includes: in a case where the following condition is met, controlling the first switch to disconnect the first USB interface from the control unit and configuring the second communication mode: the number of times of receiving the first information reaches a number threshold, the first information being used to indicate a reset, the reset being one of the stages of enumeration. And / or, from the moment when the second USB interface is accessed by the electronic device through the first USB interface to the moment when a first time threshold is reached, the enumeration in the first communication mode is unsuccessful.

[0035] In this way, the electronic device cannot be successfully enumerated in the first communication mode even after multiple resets, and / or the enumeration is still unsuccessful from the moment when the electronic device is connected to the vehicle machine in a wired manner to the moment when the first time threshold is reached, which can indicate that the electronic device cannot transmit data of an application of the electronic device in the first communication mode. Therefore, the electronic device can select the second communication mode for enumeration, so as to reduce the probability of unsuccessful enumeration, and also reduce the time consumption and power consumption of the electronic device during enumeration.

[0036] In a possible implementation, the method further includes: in a case where the enumeration in the second communication mode is successful, transmitting, with the vehicle machine, the data of the application of the electronic device in the second communication mode.

[0037] In this way, the vehicle machine can obtain the data of the application of the electronic device.

[0038] In a possible implementation, the method further includes: in a case where the enumeration in the second communication mode is unsuccessful, controlling the electronic device to display a pop-up window. The pop-up window contains prompt information indicating that the wired connection to the vehicle machine is not supported.

[0039] In this way, the user can be prompted to connect the vehicle machine in a wireless connection manner, so as to improve the user experience. Optionally, the pop-up window can further contain prompt information prompting the user to connect the vehicle machine in the wireless connection manner.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being configured to store code instructions, and the processor being configured to execute the code instructions to perform the method described in the second aspect or any possible implementation of the second aspect.

[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium storing a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer is caused to perform the method described in the second aspect or any possible implementation of the second aspect.

[0042] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program, and when the computer program is executed on a computer, the computer is caused to perform the method described in the second aspect or any possible implementation of the second aspect.

[0043] Sixthly, this application provides a chip or chip system including at least one processor and a communication interface, wherein the communication interface and at least one processor are interconnected via a circuit, and the at least one processor is used to run a computer program or instructions to perform the methods described in the second aspect or any possible implementation thereof. The communication interface in the chip may be an input / output interface, a pin, or a circuit, etc.

[0044] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0045] It should be understood that the third to sixth aspects of this application correspond to the technical solutions of the second aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description

[0046] Figure 1 This is a schematic diagram illustrating a scenario where an electronic device is connected to a vehicle infotainment system via wired connection, as provided in an embodiment of this application.

[0047] Figure 2 A circuit diagram of the electronic device 100 provided in an embodiment of this application;

[0048] Figure 3 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application;

[0049] Figure 4 A schematic diagram relating to the software and hardware of the electronic device 100 provided in the embodiments of this application;

[0050] Figure 5 A flowchart illustrating the control method provided in an embodiment of this application;

[0051] Figure 6 This is a schematic diagram of a pop-up window provided in an embodiment of this application. Detailed Implementation

[0052] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:

[0053] 1. USB protocol

[0054] The USB protocol can include a USB 1.0 protocol, a USB 1.1 protocol, a USB 2.0 protocol, a USB 3.2 Gen1 protocol, a USB 3.2 Gen2 protocol, a USB 3.2 Gen2x2 protocol, a USB 4 Gen3 protocol, or a USB 4 Gen4 protocol, etc. The parameters related to the protocols can be seen in Table 1.

[0055] Table 1. Parameters related to USB protocols

[0056] USB protocol Transmission rate designation Maximum transmission rate USB 1.0 protocol Low-speed 1.5 Mbps USB 1.1 protocol Full-speed 12 Mbps USB 2.0 protocol High-speed 480 Mbps USB 3.2 Gen1 protocol Super speed USB 5Gbps 5 Gbps USB 3.2 Gen2 protocol Super speed USB 10Gbps 10 Gbps USB 3.2 Gen2x2 protocol Super speed USB 20Gbps 20 Gbps USB4 Gen3 protocol Ultra-fast USB4 TM 20 Gbps 20 Gbps USB4 Gen4 protocol Ultra-fast USB4 TM 40 Gbps 40 Gbps

[0057] wherein Mbps is megabits per second, Gbps is gigabits per second, and TM can represent time synchronization.

[0058] 2. Enumeration

[0059] The enumeration can be understood as a process in which a USB host device identifies a USB slave device when the USB slave device is connected to the USB host device. The USB slave device can be an electronic device such as a mobile phone or a tablet computer. The USB host device can be a car machine or a computer, etc. Both the USB slave device and the USB host device support the USB protocol.

[0060] The enumeration can include a reset phase and a descriptor acquisition phase.

[0061] By way of example, the reset phase: when the USB slave device is connected to the USB host device, the USB host device can transmit information indicating a reset to the USB slave device. The information indicating the reset is, for example, a reset instruction. Upon receiving the reset instruction, the USB slave device can be reset, and upon completion of the reset, it can transmit information indicating the completion of the reset to the USB host device at a transmission rate corresponding to the USB protocol supported by the USB slave device. The information indicating the completion of the reset can contain the transmission rate of the USB protocol adopted by the USB slave device.

[0062] The descriptor obtaining stage: in the case that the USB host device obtains the transmission rate of the USB protocol adopted by the USB slave device, the USB host device can transmit a device descriptor obtaining request to the USB slave device. In the case that the device descriptor obtaining request is received, the USB slave device can transmit the device descriptor of the USB slave device to the USB host device, and the USB slave device can also transmit the configuration descriptor of the USB slave device to the USB host device. The USB host device can parse, record and process the obtained device descriptor and configuration descriptor. In the case that the USB host device completes the parsing, recording and processing, the USB host device can transmit a configuration setting request to the USB slave device to select a suitable configuration for the USB slave device, so as to complete the descriptor obtaining stage, and then the USB host device and the USB slave device can transmit the data of the application of the USB slave device according to the transmission rate corresponding to the USB protocol adopted by the USB slave device.

[0063] The device descriptor is used to describe the information of the USB slave device, the general configuration of the USB slave device and the class to which the USB slave device belongs. The configuration descriptor is used to describe the specific configuration of the USB slave device, and the information of the functional interface of the USB slave device corresponding to the configuration, the power supply mode, the power consumption, the class definition and the endpoint in the functional interface.

[0064] 3. Other terms

[0065] In the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", etc. For example, the first chip and the second chip are only used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that "first", "second", etc. do not limit the quantity and execution sequence, and "first", "second", etc. also do not necessarily mean different.

[0066] It should be noted that in the embodiments of the present application, "exemplary" or "for example" is used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner.

[0067] In the embodiments of this application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0068] Figure 1 A schematic diagram of a scenario in which an electronic device is connected to a car machine in a wired manner is shown.

[0069] As shown in Figure 1 The scenario includes an electronic device 100 and a car machine 102. The electronic device 100 is provided with a first USB interface 101. The car machine 102 is connected with a second USB interface 103 through a USB line 104. The first USB interface 101 can be any interface type of a universal serial bus Type A (USB Type A) interface, a universal serial bus Type B (USB Type B) interface, or a universal serial bus Type C (USB Type C) interface. It should be understood that the interface type of the second USB interface 103 is the same as that of the first USB interface 101.

[0070] The electronic device 100 can access the second USB interface 103 of the car machine 102 through the first USB interface 101. Wherein, the first USB interface 101 can be referred to as a female head, and the second USB interface 103 can be referred to as a male head.

[0071] In a possible implementation, the first USB interface 101 of the electronic device 100 and the second USB interface 103 of the car machine 102 both support the USB2.0 protocol.

[0072] In the case that the electronic device 100 accesses the second USB interface 103 of the car machine 102 through the first USB interface 101, a communication link for the electronic device 100 to communicate with the car machine is constituted by the first USB interface 101, the second USB interface 103 and the USB line 104, and the electronic device 100 can perform enumeration according to the USB2.0 protocol through the communication link.

[0073] Since the transmission rate corresponding to the USB2.0 protocol is high and the signal quality requirement for transmission is high. The impedance of the communication link is positively correlated with the length of the USB line 104. If the USB line 104 is long, the impedance of the communication link is large. The large impedance of the communication link affects the signal quality of the transmission on the communication link, which may cause the signal quality of the transmission from the electronic device 100 to the car machine 102 through the communication link to fail to meet the signal quality requirement of the USB2.0 protocol, and thus the enumeration of the electronic device 100 according to the USB2.0 protocol fails.

[0074] In this way, in the case that the electronic device 100 is connected with the car machine, the phenomenon that the car machine cannot receive the data of the application of the electronic device 100 occurs. For example, in the case that the electronic device 100 is connected with the car machine, the electronic device 100 cannot play the music in the application of the electronic device 100 through the car machine, or the electronic device 100 cannot display the map for navigation on the electronic device 100 through the car machine.

[0075] It can be understood that the USB interface supporting the USB2.0 protocol also supports a USB protocol with a lower transmission rate than the USB2.0 protocol. The USB protocol with a lower transmission rate than the USB2.0 protocol is, for example, the USB1.1 protocol. Compared with the USB2.0 protocol, the transmission rate of the USB1.1 protocol is lower and the signal quality requirement for transmission is also lower. In the case that the enumeration of the electronic device 100 according to the USB2.0 protocol fails, the electronic device 100 can perform enumeration according to the USB1.1 protocol to achieve successful enumeration in the case that the impedance of the communication link is large, and thus the transmission of the data of the application of the electronic device 100 between the electronic device 100 and the car machine is achieved.

[0076] Therefore, the electronic device 100 is configured to stop enumeration according to the USB2.0 protocol, and is configured to enumerate according to the USB1.1 protocol with a lower transmission rate and lower signal quality requirement. In this way, when the electronic device 100 is connected to the vehicle machine by wire, the probability of unsuccessful enumeration of the electronic device 100 can be reduced, and the probability of the vehicle machine failing to receive the data of the application of the electronic device 100 can be reduced.

[0077] Figure 2 A circuit schematic diagram of the electronic device 100 is shown.

[0078] As shown in Figure 2 , the electronic device 100 can include a first USB interface 201, a first switch 202, and a control unit 203. The control unit 203 can be a system on a chip (SoC). The first switch 201 is connected between the first USB interface and the control unit 203.

[0079] In a case where the electronic device 100 accesses the second USB interface of the vehicle machine through the first USB interface 201, the control unit 203 can control the first switch 201 to be in a conductive state, and the control unit 203 can enumerate according to a first communication mode. The first communication mode can be a communication mode of the USB2.0 protocol. The enumeration is used to realize the identification of the electronic device 100 by the vehicle machine. The vehicle machine and the second USB interface are not shown in the figure. The first switch 201 in the conductive state can connect the first USB interface 201 and the control unit 203. Figure 2

[0080] In a case where the enumeration of the control unit 203 according to the first communication mode is unsuccessful, the control unit 203 can also control the first switch 201 to disconnect the first USB interface 201 from the control unit 203, and configure a second communication mode. The second communication mode can be a communication mode of the USB1.1 protocol.

[0081] In a case where the control unit 203 completes the configuration of the second communication mode, the control unit 203 can control the first switch 201 to be in a conductive state, and the control unit 203 can enumerate according to the second communication mode. The transmission rate of the second communication mode is lower than that of the first communication mode.

[0082] ​In this way, when the control unit fails to enumerate in the first communication mode with a higher transmission rate and a higher signal quality requirement, enumeration in the second communication mode with a lower transmission rate and a lower signal quality requirement can reduce the probability of enumeration failure, and further reduce the probability of the vehicle machine failing to receive the data of the application of the electronic device when the electronic device is connected to the vehicle machine. The first switch is controlled to disconnect the first USB interface from the control unit before the second communication mode is configured, so that the control unit can be stopped from enumerating in the first communication mode before the second communication mode is configured, to reduce the interference of enumeration in the first communication mode of the control unit on the configuration of the second communication mode.

[0083] Optionally, as shown in Figure 2 , the control unit 203 can include a first pin. The first pin is, for example, Figure 2 the D+ pin of the control unit 203 in the electronic device 100. The electronic device 100 can further include a second switch M1. The control end of the second switch M1 is connected to the control unit 203, and one end of the second switch M1 is connected to the first pin.

[0084] When the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can further control the second switch M1 to be in a conductive state, and receive the first level signal through the first pin. When the first level signal is received, the control unit 203 can configure the second communication mode.

[0085] In this way, the control unit 203 can be triggered to configure the second communication mode by the first level signal. The configuration of the second communication mode can be further triggered by controlling the second switch M1.

[0086] Optionally, as shown in Figure 2 , the electronic device 100 further includes a third switch M2 and a power supply unit 204.

[0087] The control end of the third switch M2 is connected to the control unit 203, one end of the third switch M2 is connected to the control end of the second switch M1, the other end of the third switch M2 is grounded, and the control end of the second switch M1 is further connected to the power supply unit 204.

[0088] The power supply unit 204 can provide a voltage to the control end of the second switch M1.

[0089] The second switch M1 can be an N-type metal oxide semiconductor field effect (N-metal-oxide-semiconductor, NMOS) transistor. When the voltage at the control end of the second switch M1 is not pulled down, the second switch M1 can be in a conductive state. The voltage provided by the power supply unit 204 to the control end of the second switch M1 can be Figure 2a voltage VDD3 in the electronic device 100. VDD3 can be 4 volts (V) - 5 V. The input voltage at the other end of the second switch M1 can be a voltage VDD2 in the electronic device 100. VDD2 can be 3.3 V - 3.6 V. If VDD2 is 3.3 V - 3.6 V, the probability of the car machine not supplying power to the first USB interface 201 can be reduced in the case that the first USB interface 201 is disconnected from the control unit 203, so that the related procedures of the car machine supplying power to the first USB interface 201 do not need to be re-executed before the electronic device enumerates in the second communication mode, and the enumeration time can be shortened. Alternatively, VDD2 can also be other voltage values less than VDD3. Figure 2

[0090] In the case that the electronic device 100 accesses the second USB interface of the car machine through the first USB interface 201, the control unit 203 can also control the third switch M2 to be in a conductive state, and the voltage VDD3 at the control end of the second switch M1 is pulled low due to grounding, so that the second switch M1 is in a non-conductive state.

[0091] In the case that the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can also control the third switch M2 to be in a non-conductive state, and the second switch M1 is in a conductive state due to the power supply unit 204 always providing the voltage VDD3 to the control end of the second switch M1. The control unit 203 receives the first level signal through the first pin.

[0092] The third switch M2 can be a positive channel metal oxide semiconductor (PMOS) transistor. The driving voltage of the third switch M2 can be lower than the driving voltage of the second switch M1, so that the non-conduction of the second switch M1 with a higher driving voltage can be realized by controlling the conduction of the third switch M2 with a lower driving voltage, and the conduction of the second switch M1 with a higher driving voltage can also be realized by controlling the non-conduction of the third switch M2 with a lower driving voltage, so that the conduction or non-conduction control of the second switch M1 is more flexible, and the driving power consumption of the conduction or non-conduction of the second switch M1 is lower. The power supply unit 204 can include a power management unit (PMU).

[0093] Exemplarily, as shown in FIG. 2, the first USB interface 201 can include a first pin and a second pin. The first pin can be connected to the control unit 203, and the second pin can be connected to the power supply unit 204. Figure 2 ​As shown, the control unit 203 may also include general-purpose input / output (GPIO) ports 1 and GPIO 2. When the electronic device is connected to the second USB interface via the first USB interface 201, the control unit 203 can transmit a second-level signal to the first switch via GPIO 1 and a third-level signal to the third switch via GPIO 2. The second-level signal can turn the first switch 202 on. The third-level signal can turn the third switch M2 on, thereby turning the second switch M1 off.

[0094] If the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can transmit a fourth-level signal to the first switch via GPIO1 and a fifth-level signal to the third switch via GPIO2. The fourth-level signal can disconnect the first USB interface 201 from the control unit 203. The fifth-level signal can turn the third switch M2 off, thereby turning the second switch M1 on.

[0095] When the control unit 203 completes the configuration of the second communication mode, the control unit 203 can transmit a second level signal to the first switch through GPIO1 and transmit a third level signal to the third switch through GPIO2.

[0096] The second-level signal and the third-level signal can be the same or different.

[0097] It is understood that the power supply unit 204 can supply power to both the first switch 202 and the control unit 203. For example, the power supply unit 204 can provide power to both the first switch 202 and the control unit 203. Figure 2 The voltage VDD1 shown is different from VDD3. VDD1 and VDD3 may be equal or unequal.

[0098] Optionally, such as Figure 2 As shown, the other end of the second switch M1 can also be connected to the power supply unit 204. The power supply unit 204 can output voltage VDD2, so that when the second switch M1 is in the on state, a first level signal can be transmitted to the control unit 203 to trigger the configuration of the second communication mode.

[0099] Optionally, such as Figure 2 As shown, the electronic device 100 may also include a resistor R1. Resistor R1 is connected between the power supply unit 204 and the other end of the second switch M1. The resistance value of resistor R1 can be 1 kΩ to 2 kΩ. Resistor R1 can reduce the probability of damage to the control unit 203 due to excessive current input when the second switch M1 is on.

[0100] Optionally, as shown in Figure 2 , the control unit 203 can further include a second pin. The first USB interface 201 can include a third pin and a fourth pin. The second pin can be a D- pin of the control unit 203 as shown in Figure 2 . The third pin and the fourth pin can both be data transmission pins. For example, the third pin can be a D+ pin of the first USB interface 201 as shown in Figure 2 , and the fourth pin can be a D- pin of the first USB interface 201 as shown in Figure 2 .

[0101] The first switch 202 can be further connected between the first pin and the third pin, and the first switch 202 can be further connected between the second pin and the fourth pin.

[0102] In a case where the electronic device 100 accesses the second USB interface of the car machine through the first USB interface 201, the control unit 203 can further control the first switch 202 to connect the third pin and the first pin, and to connect the fourth pin and the second pin.

[0103] In a case where the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can further control the first switch 202 to disconnect the third pin from the first pin, and to disconnect the fourth pin from the second pin.

[0104] Exemplarily, as shown in Figure 2 , in a case where the electronic device 100 accesses the second USB interface of the car machine through the first USB interface 201, the control unit 203 can further control the first switch 202 to turn on the end point A31 and the end point A33, and to turn on the end point A32 and the end point A35.

[0105] In a case where the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can control the first switch 202 to turn on the end point A31 and the end point A34, and to turn on the end point A32 and the end point A36, so that the third pin and the fourth pin are both left floating. In this way, the enumeration of the control unit 203 can be stopped.

[0106] Alternatively, in a case where the control unit 203 fails to enumerate in the first communication mode, the control unit 203 can control the first switch 202 to turn on the end point A31 and the end point A34, and to turn on the end point A32 and the end point A36, so that the third pin and the fourth pin are both left floating. In this way, the enumeration of the control unit 203 can be stopped.

[0107] Optionally, in the scenario that the electronic device 100 accesses the second USB interface of the car machine through the first USB interface, the control unit 203 can control the first switch 202 to disconnect the first USB interface 201 from the control unit 203 and configure the second communication mode in the case that the following conditions are met:

[0108] The number of times that the control unit 203 receives the first information is greater than a number threshold. The first information is used to indicate a reset, and the reset is one of the stages of enumeration. And / or, from the moment that the electronic device 100 accesses the second USB interface through the first USB interface 201 to the moment that a first time threshold is reached, the control unit 203 is unsuccessful in enumeration in the first communication mode.

[0109] The number threshold can be 10. The number threshold can also be other numerical values, which are not limited in the embodiments of the present application. The first time threshold can be 5 seconds (s), and the first time threshold can also be other numerical values, which are not limited in the embodiments of the present application.

[0110] Exemplarily, in the case that the electronic device 100 accesses the second USB interface of the car machine through the first USB interface, the control unit 203 can receive the first information transmitted by the car machine. The first information can be a reset signal or a reset instruction.

[0111] In the case that the first information is received, the control unit 203 can reset. The control unit 203 can transmit second information indicating that the reset is completed to the car machine in the case that the reset is completed. The second information can contain a transmission rate of the first communication mode. It can be understood that in the case that the electronic device 100 is enumerated in the first communication mode, the electronic device 100 can transmit the second information to the car machine in the transmission rate of the first communication mode.

[0112] In the case that the electronic device 100 transmits the second information to the car machine in the transmission rate of the first communication mode, due to the influence of the communication link impedance, the car machine can not receive the second information or receive incomplete second information, thereby the car machine cannot obtain the transmission rate of the electronic device 100. The incomplete second information, for example, contains second information with garbled code.

[0113] From the moment that the reset instruction is transmitted by the car machine to the moment that a second time threshold is reached, if the car machine cannot obtain the transmission rate of the electronic device 100 due to the influence of the communication link impedance, the car machine can transmit the first information to the electronic device 100 again. Therefore, the control unit 203 can also receive the first information transmitted by the car machine again. The first time threshold can be 10 milliseconds (ms), and the first time threshold can also be other numerical values, which are not limited in the embodiments of the present application.

[0114] In the embodiments of the present application, the electronic device cannot be enumerated successfully in the first communication mode multiple times, and / or the electronic device has not been enumerated successfully since the moment when the electronic device is connected to the vehicle machine in a wired manner to when the first time threshold is reached, indicating that the electronic device cannot transmit data of an application of the electronic device in the first communication mode. The second communication mode can be selected for enumeration to reduce the probability of unsuccessful enumeration, and also to reduce the time consumption and power consumption of enumeration of the electronic device.

[0115] Optionally, in the case where the control unit 203 is enumerated successfully in the second communication mode, the control unit 203 can also transmit data of the application of the electronic device 100 to the vehicle machine in the second communication mode.

[0116] Exemplarily, in the case where the control unit 203 is enumerated successfully in the second communication mode, the control unit 203 can transmit data of the application of the electronic device 100 to the vehicle machine at a transmission rate corresponding to the second communication mode.

[0117] In this way, the music in the application on the electronic device 100 can be played through the vehicle machine, or the map for navigation on the electronic device 100 can be displayed through the vehicle machine.

[0118] Optionally, in the case where the control unit 203 is not enumerated successfully in the second communication mode, the control unit 203 can also control the electronic device 100 to display a pop-up window. The pop-up window contains prompt information that the wired connection to the vehicle machine is not supported. The pop-up window can also contain prompt information that the user is prompted to connect to the vehicle machine in a wireless connection manner. The wireless connection manner can include a wireless fidelity (Wi-Fi) connection manner or an infrared connection manner. In this way, by prompting the user to connect to the vehicle machine in the wireless connection manner, the user experience can be improved.

[0119] As Figure 2The electronic device 100 shown can include a first switch, a second switch, a third switch, a resistor, a first USB interface, a control unit, and a power supply unit. If the second communication mode is a communication mode of the USB1.1 protocol and the first communication mode is a communication mode of the USB2.0 protocol, in a case where the control unit fails to enumerate according to the USB2.0 protocol, the control unit can control the first switch to disconnect the first USB interface from the control unit to stop the control unit from enumerating according to the USB2.0 protocol, and can also control the third switch to be in an off state and thus the second switch to be in an on state, so that the power supply unit transmits a first level signal to the control unit through the on second switch to control the control unit to configure the USB1.1 protocol. In a case where the control unit completes the configuration of the USB1.1 protocol, the first switch is controlled to be in an on state, the third switch is controlled to be in an on state and the second switch is controlled to be in an off state, and the control unit enumerates according to the USB1.1 protocol, which reduces the probability of enumeration failure and thus reduces the probability of the car machine failing to receive the data of the application of the electronic device 100 in the case where the electronic device 100 is connected to the car machine, and can also reduce the time consumption and power consumption of enumeration of the electronic device. In a case where the control unit enumerates successfully according to the USB1.1 protocol, the control unit can transmit the data of the application of the electronic device 100 to the car machine at full speed to realize playing of music in the application on the electronic device 100 through the car machine or displaying of a map for navigation on the electronic device 100 through the car machine. In a case where the control unit fails to enumerate according to the USB1.1 protocol, the control unit can also control the electronic device 100 to display a pop-up window to prompt that wired connection to the car machine is not supported, and can also prompt the user to connect to the car machine through a wireless connection mode, which can improve the user experience.

[0120] It can be understood that the first communication mode can also be a communication mode with a transmission rate greater than that of the USB2.0 protocol. For example, the first communication mode can also be any one of a communication mode of the USB3.2 Gen1 protocol, a communication mode of the USB3.2 Gen2 protocol, a communication mode of the USB3.2 Gen2x2 protocol, a communication mode of the USB4 Gen3 protocol, or a communication mode of the USB4 Gen4 protocol. The second communication mode can be a communication mode with a transmission rate lower than that of the first communication mode.

[0121] In the scenario where the transmission rate of the first communication mode is greater than that of the USB2.0 protocol, the specific implementation principle and technical effects of enumerating according to the second communication mode in a case where the electronic device fails to enumerate according to the first communication mode can be referred to Figure 2The electronic device in the embodiment shown enumerates unsuccessfully in the communication mode of the USB2.0 protocol, and enumerates in the USB1.1 protocol. The specific implementation principle and technical effect of enumeration are not described here.

[0122] The electronic device 100 of the embodiment of the present application can include a handheld device, a vehicle-mounted device, etc. with a USB communication function. For example, some electronic devices 100 are: a mobile phone, a tablet computer, a palm computer, a notebook computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with a wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved public land mobile network (PLMN), etc. The embodiment of the present application is not limited thereto.

[0123] As an example but not limitation, in the embodiments of the present application, the electronic device 100 can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that can be directly worn on the body or integrated into the clothes or accessories of the user. The wearable device is not only a hardware device, but also a powerful function achieved through software support and data interaction, cloud interaction. The general wearable smart device includes a full function, large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, and focuses on a certain application function and needs to cooperate with other devices such as a smart phone, such as various smart wristbands, smart jewelry, and other devices for monitoring vital signs.

[0124] In addition, in the embodiments of the present application, the electronic device 100 can also be a terminal device in an Internet of Things (IoT) system. The IoT is an important part of the future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.

[0125] The electronic device 100 in the embodiments of the present application can also be referred to as a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile terminal, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user equipment, etc.

[0126] In the embodiments of the present application, the electronic device 100 or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes a central processing unit (CPU), a memory management unit (MMU), and a memory (also referred to as a main memory), etc. The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system, etc. The application layer includes a browser, an address book, a word processing software, an instant messaging software, etc.

[0127] In order to further understand the electronic device provided by the embodiments of the present application, Figure 3A structural schematic diagram of the electronic device 100 is shown.

[0128] As shown in Figure 3 , the electronic device 100 can include a processor 310, an external memory interface 320, an internal memory 321, a USB interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, a headset interface 370D, a sensor module 380, a key 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc. The sensor module 380 can include a pressure sensor 380A, a gyroscope sensor 380B, a barometric pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.

[0129] As shown in Figure 3 , the USB interface 330 of the electronic device 100 can support the USB2.0 protocol. The electronic device 100 can access the second USB interface of the car machine through the USB interface 330. The processor 310 can perform enumeration according to the first communication mode. In the case that the processor 310 fails to perform enumeration according to the first communication mode, the processor 310 can control the first switch of the electronic device 100 to disconnect the USB interface 330 from the processor 310, and the processor 310 configures the second communication mode.

[0130] In the case that the processor 310 completes the configuration of the second communication mode, the processor 310 controls the first switch to be in the on state, so that the USB interface 330 and the processor 310 are connected, and the enumeration is performed according to the second communication mode. In this way, in the case that the electronic device 100 is connected to the car machine, the probability of enumeration failure can be reduced, and the probability of the car machine failing to obtain the data of the application of the electronic device 100 can be reduced.

[0131] In the case that the enumeration according to the second communication mode fails, the processor 310 can control the display screen 394 to display a pop-up window to prompt the user to use a wireless connection mode to connect the electronic device and the car machine.

[0132] The first switch, the car machine, and the second USB interface are not shown in Figure 3 .

[0133] It can be understood that the structure illustrated by the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0134] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiments of the present application take the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0135] Figure 4 FIG. 1 is a schematic diagram of the software and hardware of the electronic device 100 according to an embodiment of the present application.

[0136] The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system has an application layer, an application framework layer, and a kernel layer from top to bottom.

[0137] The application layer can include a series of application packages.

[0138] The application packages can include applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, notification management, screen display, and file management. Figure 4 Some of the application packages are shown in FIG. 2.

[0139] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0140] As shown in FIG. 3, the application framework layer can include a window manager, a content provider, a view system, a data storage, a notification manager, and the like. Figure 4

[0141] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.

[0142] The content provider is used to store and obtain data, and make the data accessible to the applications. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phonebook, and the like.

[0143] ​The view system includes visual controls, such as controls that display text, controls that display pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.

[0144] Data storage provides various resources for an application, such as localized strings, icons, pictures, layout files, video files, and the like.

[0145] The notification manager enables an application to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of a download, a message reminder, and the like. The notification manager can also be a notification that appears in the form of a chart or a scroll bar text in the top status bar of the system, such as a notification of an application running in the background, and can also be a notification that appears in the form of a dialog window on the screen. For example, a text message is prompted in the status bar, a prompt sound is emitted, the electronic device 100 vibrates, the indicator light flashes, and the like.

[0146] The kernel layer is a layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, USB drivers, and SoC drivers. Figure 4 Part of the drivers is shown in

[0147] The hardware layer can include a USB interface, a general-purpose input / output (GPIO), and a display screen, and the like.

[0148] Exemplarily, as shown in Figure 4 , in a case where the electronic device 100 accesses the second USB interface of the car machine through the USB interface of the electronic device 100, the SoC driver can transmit a second level signal to the first switch through the first GPIO and transmit a third level signal to the third switch through the second GPIO. The electronic device 100 can perform enumeration in the first communication mode.

[0149] The car machine, the second USB interface, the first switch, the second switch, and the third switch are not shown in Figure 4 . The deployment manner of the first switch, the second switch, and the third switch can refer to the deployment manner of the first switch, the second switch, and the third switch in Figure 2 , which will not be described herein again. The first GPIO can be GPIO1 in Figure 2 . The second GPIO can be GPIO2 in Figure 2 .

[0150] In a case where the electronic device 100 fails to enumerate in the first communication mode, the SoC driver can transmit a fourth level signal to the first switch through the first GPIO and transmit a fifth level signal to the third switch through the second GPIO. The fourth level signal can cause the first switch to be in an off state or cause the data transmission pin of the electronic device 100 to be in a floating state, thereby causing the electronic device 100 to stop enumerating in the first communication mode. In a case where the second switch is in an on state, the electronic device 100 can receive the first level signal. The first level signal can trigger the USB driver to perform configuration of the second communication mode.

[0151] In a case where the USB driver completes the configuration of the second communication mode, the SoC driver can transmit a second level signal to the first switch through the first GPIO and transmit a third level signal to the third switch through the second GPIO. The electronic device 100 can enumerate in the second communication mode.

[0152] In this way, in a case where the electronic device 100 is connected to the vehicle machine, the probability of enumeration failure can be reduced, and the probability that the vehicle machine cannot obtain the data of the application of the electronic device 100 can be reduced.

[0153] In a case where enumeration in the second communication mode fails, the display screen of the electronic device 100 can display an interface for notifying a management application, which can include a pop-up window for prompting a user to connect the electronic device to the vehicle machine in a wireless connection manner.

[0154] It can be understood that the electronic device provided by the embodiments of the present application is also applicable to a scenario in which the electronic device accesses the USB interface of another USB host device through the first USB interface, so as to enable the other USB host device to receive the data of the application of the electronic device. The specific implementation principles and technical effects can be referred to Figures 2-4 The specific implementation principles and technical effects of the electronic device in any of the embodiments of the present application accessing the second USB interface of the vehicle machine through the first USB interface are not described herein again.

[0155] The other USB host device can be a computer, a notebook computer, or the like.

[0156] The embodiments of the present application also provide a control method, which is applied to the electronic device provided by the embodiments of the present application described above. The electronic device provided by the embodiments of the present application described above is, for example Figures 1-4 The electronic device 100 is shown.

[0157] The control method provided in the embodiments of the present application can include: in a case where the electronic device accesses a second USB interface of the car machine through a first USB interface, controlling the first switch to be in a conducting state and performing enumeration in a first communication mode. The enumeration is used to realize the identification of the car machine to the electronic device. In a case where the enumeration performed by the control unit in the first communication mode is unsuccessful, controlling the first switch to disconnect the first USB interface from the control unit and configuring a second communication mode. In a case where the configuration of the second communication mode is completed, controlling the first switch to be in the conducting state and performing enumeration in the second communication mode. The transmission rate of the second communication mode is lower than that of the first communication mode.

[0158] Exemplarily, the first USB interface can be the first USB interface 201 in the Figure 2 , can be the USB interface 330 in the Figure 3 , can be the USB interface in the Figure 4 , or can be the first USB interface 101 in the Figure 1 . The second USB interface can be the second USB interface 103 in the Figure 1 . The first switch can be the first switch 202 in the Figure 2 . The control unit can be the control unit 203 in the Figure 2 , or can be the processor 310 in the Figure 3 . The first communication mode can be a communication mode of the USB2.0 protocol. The second communication mode can be a communication mode of the USB1.1 protocol. The specific implementation principles and technical effects of the embodiments of the present application are similar to those of the embodiments shown in Figure 2 , and will not be described here. The specific implementation principles and technical effects of the embodiments of the present application are also similar to those of the embodiments shown in Figure 3 or Figure 4 , and will not be described here.

[0159] Exemplarily, the first communication mode can also be any one of a communication mode of the USB3.2 Gen1 protocol, a communication mode of the USB3.2 Gen2 protocol, a communication mode of the USB3.2 Gen2x2 protocol, a communication mode of the USB4 Gen3 protocol or a communication mode of the USB4 Gen4 protocol. The second communication mode can be a communication mode with a transmission rate lower than that of the first communication mode. The specific implementation principles and technical effects of the embodiments of the present application can refer to the specific implementation principles and technical effects of the embodiments shown in Figure 2 , and will not be described here.

[0160] Optionally, the control method provided in the embodiments of the present application further includes:

[0161] Under the following conditions, the first switch is controlled to disconnect the first USB interface from the control unit, and a second communication mode is configured: the number of times the first message is received reaches a threshold, the first message is used to indicate a reset, and the reset is one of the stages of enumeration. And / or, from the moment the electronic device connects to the second USB interface via the first USB interface until the first duration threshold is reached, enumeration according to the first communication mode fails.

[0162] For the specific implementation principles and technical effects of the embodiments in this application, please refer to [link / reference]. Figure 2 The specific implementation principles and technical effects of the embodiments shown will not be elaborated here.

[0163] Optionally, the control method provided in this application embodiment further includes: upon successful enumeration according to the second communication mode, transmitting application data of the electronic device to the vehicle-mounted system according to the second communication mode. This enables the vehicle-mounted system to play music from applications on the electronic device, or to display navigation maps from the electronic device, etc.

[0164] Optionally, the control method provided in this application embodiment further includes: if enumeration according to the second communication mode fails, controlling the electronic device to display a pop-up window; the pop-up window contains a prompt message indicating that wired connection to the vehicle system is not supported. The pop-up window may also contain a prompt message prompting the user to connect to the vehicle system wirelessly. The wireless connection method may include Wi-Fi connection or infrared connection.

[0165] In this way, if the control unit fails to enumerate according to the second communication mode, a pop-up window can be used to prompt the user that the electronic device does not support wired connection to the vehicle system, and can also prompt the user to connect to the vehicle system wirelessly, which can improve the user experience.

[0166] The following is based on Figure 2 Taking the electronic device 100 shown as an example, combined with Figure 5 The control method provided in the embodiments of this application will be described.

[0167] Figure 5 A flowchart illustrating the control method provided in an embodiment of this application is shown.

[0168] like Figure 5 As shown, the control method provided in this application embodiment may include:

[0169] S501, electronic device 100 connects to the second USB interface of the vehicle's infotainment system via the first USB interface 201 of electronic device 100, thereby realizing a wired connection between electronic device 100 and vehicle's infotainment system.

[0170] S502, the electronic device 100 enumerates in the first communication mode, and determines whether the number of resets in the enumeration process is greater than a number threshold.

[0171] If yes, step S503 can be performed.

[0172] If no, step S509 can be performed.

[0173] Exemplarily, in the case that the electronic device 100 is wiredly connected with the car machine, the electronic device 100 can control the first switch 202 to connect the first pin and the third pin, and also to connect the second pin and the fourth pin. The electronic device 100 enumerates in the first communication mode. Since the impedance of the communication link is large, the signal quality transmitted by the electronic device 100 to the car machine cannot meet the quality requirement of the first communication mode, and thus the electronic device 100 will receive a reset instruction multiple times. It can be understood that the electronic device 100 will reset once for each reset instruction received.

[0174] In the case that the number of reset instructions received by the electronic device 100 is greater than the number threshold, the electronic device 100 can perform step S503.

[0175] In the case that the number of reset instructions received by the electronic device 100 is less than or equal to the number threshold, the electronic device 100 can perform step S509.

[0176] S503, the electronic device 100 can control the first switch 202 and the third switch M2 to switch the communication mode.

[0177] Exemplarily, the electronic device 100 can control the first switch 202 to disconnect the third pin from the first pin, and also to disconnect the fourth pin from the second pin. The electronic device 100 can control the third switch M2 to be in an off state, and thus the second switch M1 is in an on state. The power supply unit 204 transmits a first level signal to the control unit 203 through the resistance R1 and the second switch M1. The first level signal can trigger the configuration of the second communication mode, and thus the switching from the first communication mode to the second communication mode can be realized.

[0178] The resistance R1 can be referred to as a pull-up resistance. The first level can be a high level. The power supply unit 204 transmits the first level signal to the control unit 203 through the resistance R1 and the second switch M1, which can be understood as that the first pin of the control unit 203 is clamped to a high level by the pull-up resistance.

[0179] S504, in the case that the third pin is disconnected from the first pin, the fourth pin is disconnected from the second pin, and the first pin is clamped to a high level by the pull-up resistance, the electronic device 100 can configure the second communication mode.

[0180] S505, in a case where the electronic device 100 completes the configuration of the second communication mode, the electronic device 100 can control the first switch 202 such that the third pin is connected with the first pin, and the fourth pin is connected with the second pin, and the electronic device 100 can also control the third M2 to be in the on state, thereby making the second switch M1 to be in the off state. The second switch M1 in the off state makes the pull-up of the first pin to be disconnected.

[0181] In a case where the third pin is connected with the first pin, the fourth pin is connected with the second pin, and the second switch M1 is in the off state, the electronic device 100 can perform enumeration in the second communication mode.

[0182] Exemplarily, in a case where the third pin is connected with the first pin, and the fourth pin is connected with the second pin, the electronic device 100 can receive the first information. In a case where the electronic device 100 receives the first information, the electronic device 100 can perform enumeration in the second communication mode.

[0183] S506, the electronic device 100 can determine whether the enumeration in the second communication mode is successful.

[0184] If yes, step S507 can be executed.

[0185] If no, step S508 can be executed.

[0186] The successful enumeration can be understood as the completion of the enumeration.

[0187] Exemplarily, in a case where the electronic device 100 performs enumeration in the second communication mode, the electronic device 100 can transmit third information to the vehicle machine. The third information contains a transmission rate corresponding to the second communication mode.

[0188] In a case where the electronic device 100 transmits the third information to the vehicle machine, if the electronic device 100 receives a device descriptor acquisition request, the electronic device 100 can transmit the device descriptor of the electronic device 100 to the vehicle machine at a transmission rate corresponding to the second communication mode, and can also transmit the configuration descriptor of the electronic device 100 to the vehicle machine at the transmission rate corresponding to the second communication mode. In a case where the electronic device 100 transmits the configuration descriptor of the electronic device 100 to the vehicle machine, if the electronic device 100 receives a configuration setting request, it indicates that the electronic device 100 is successfully enumerated in the second communication mode, and the electronic device 100 can execute step S507.

[0189] In a case where the electronic device 100 transmits the third information to the vehicle machine, if the electronic device 100 receives the first information, it indicates that the electronic device 100 is not successfully enumerated in the second communication mode, and the electronic device 100 can execute step S508.

[0190] S507, in the case that the electronic device 100 is enumerated successfully in the second communication mode, the electronic device 100 and the vehicle machine can transmit data of an application of the electronic device 100 at a transmission rate of the second communication mode.

[0191] S508, in the case that the electronic device 100 is not enumerated successfully in the second communication mode, the electronic device 100 can display a pop-up window.

[0192] Exemplarily, in the case that the electronic device 100 is not enumerated successfully in the second communication mode, the display screen of the electronic device 100 can display a pop-up window to prompt the user to connect the electronic device 100 and the vehicle machine in a wireless connection mode. The pop-up window can be the pop-up window 601 in FIG. 6B. For the convenience of understanding, Figure 6 the subsequent embodiments are described. Figure 6

[0193] S509, in the case that the electronic device 100 judges that the number of resets in the enumeration process is less than or equal to the number threshold, the electronic device 100 can judge whether the electronic device 100 is enumerated successfully in the first communication mode from the moment when the electronic device 100 is connected with the vehicle machine in a wired manner to the moment when the first time threshold is reached.

[0194] If yes, step S510 can be executed.

[0195] If no, step S503 can be executed.

[0196] Exemplarily, when the electronic device 100 accesses the second USB interface of the vehicle machine through the first USB interface 201, the electronic device 100 can start timing to obtain the first time length.

[0197] When the first time length reaches the first time threshold, if the electronic device 100 receives the first information indicating that the electronic device 100 is not enumerated successfully in the first communication mode, the electronic device 100 can execute step S503.

[0198] When the first time length reaches the first time threshold, if the electronic device 100 receives the set configuration request indicating that the electronic device 100 is enumerated successfully in the first communication mode, the electronic device 100 can execute step S510.

[0199] S510, in the case that the electronic device 100 is enumerated successfully in the first communication mode, the electronic device 100 and the vehicle machine can transmit data of an application of the electronic device 100 at a transmission rate of the first communication mode.

[0200] ​The control method provided in the embodiments of the present application can reduce the probability of unsuccessful enumeration and in turn reduce the probability that the car machine cannot obtain the data of the application of the electronic device 100 in the scenario of enumeration in the first communication mode with higher requirements on transmission rate and signal quality, if the number of resets is greater than the number threshold and / or the first time length reaches the first time length threshold.

[0201] Figure 6 A schematic diagram of the pop-up window provided in the embodiments of the present application is shown.

[0202] In the case that the electronic device 100 is unsuccessful in enumeration in the second communication mode, the display screen of the electronic device 100 can display the pop-up window 601 as shown in Figure 6

[0203] Optionally, in the case that the electronic device 100 is unsuccessful in enumeration in the second communication mode, the user can perform a downward pulling operation on the upper end of the electronic device 100, and the electronic device 100 can display the interface as shown in Figure 6

[0204] The interface as shown in Figure 6 includes a status bar, a window 602 of the control center and a plurality of windows of a notification management application. The plurality of windows of the notification management application includes the pop-up window 601.

[0205] As shown in Figure 6 , the pop-up window 601 can include an identifier 6011 representing USB connection, an identifier 6012 representing folding, the words "setting just now", and the words "a connected device is detected, the device does not support the vehicle model, please use Bluetooth to connect the vehicle machine". Among them, the words "a connected device is detected, the device does not support the vehicle model, please use Bluetooth to connect the vehicle machine" can prompt the user to use the Bluetooth connection mode or other wireless connection mode to connect the electronic device 100 and the vehicle machine, so as to reduce the probability that the vehicle machine cannot receive the data of the application of the electronic device 100.

[0206] It can be understood that the control method provided in the embodiments of the present application is also applicable to the scenario that the electronic device accesses the USB interface of other USB host devices through the first USB interface, so as to realize that the other USB host devices receive the data of the application of the electronic device. The specific implementation principles and technical effects can be referred to the specific implementation principles and technical effects in the scenario that the electronic device accesses the second USB interface of the vehicle machine through the first USB interface, which will not be described here.

[0207] It should be noted that the module names involved in the embodiments of the present application can be defined as other names, as long as the functions of the modules can be realized, and the names of the modules are not limited specifically.​​

[0208] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0209] The control method of the embodiments of the present application has been described above, and the device for executing the above method provided by the embodiments of the present application will be described below. Those skilled in the art can understand that the method and the device can be combined and referred to each other, and the related device provided by the embodiments of the present application can execute the steps in the above control method.

[0210] The control method provided by the embodiments of the present application can be applied in an electronic device with communication function. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be described here.

[0211] The embodiments of the present application provide an electronic device, which comprises a processor and a memory. The memory stores computer execution instructions. The processor executes the computer execution instructions stored in the memory, so that the electronic device executes the above method.

[0212] The embodiments of the present application provide a chip or chip system, which comprises at least one processor and a communication interface. The communication interface and the at least one processor are interconnected through a line. The at least one processor is used to run a computer program or instruction to execute the technical solutions in the above embodiments. The implementation principle and technical effects are similar to those of the above related embodiments, which will not be described here. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.

[0213] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium stores a computer program. The computer program is executed by the processor to realize the above method. The method described in the above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. If realized in software, the functions can be stored as one or more instructions or codes on a computer readable medium or transmitted on a computer readable medium. The computer readable medium can include computer storage medium and communication medium, and can also include any medium that can transfer computer programs from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0214] In a possible implementation, the computer readable medium can include a RAM, a ROM, a compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is suitable for storing desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer readable media.

[0215] The embodiment of the present application provides a computer program product, which comprises a computer program, and when the computer program is executed, the computer executes the above method.

[0216] The embodiment of the present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or blocks

[0217] The above detailed description further describes the purpose, technical scheme, and beneficial effects of the present application. It should be understood that the above is only a specific embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical scheme of the present application should be included in the protection scope of the present application.

Claims

1. An electronic device, characterized in that, include: The system comprises a first Universal Serial Bus (USB) interface, a first switch, a second switch, and a control unit, wherein the control unit includes a first pin; the control terminal of the second switch is connected to the control unit, and one end of the second switch is connected to the first pin. The first switch is connected between the first USB interface and the control unit; The control unit is configured to, when the electronic device is connected to the second USB interface of the vehicle system via the first USB interface, control the first switch to be in a conducting state and perform enumeration according to the first communication mode; the enumeration is used to enable the vehicle system to identify the electronic device; The control unit is further configured to, if the control unit fails to enumerate according to the first communication mode, control the first switch to disconnect the first USB interface from the control unit, control the second switch to be in a conducting state, receive a first level signal through the first pin, and configure a second communication mode upon receiving the first level signal; it is also configured to, upon completing the configuration of the second communication mode, control the first switch to be in a conducting state and enumerate according to the second communication mode; the transmission rate of the second communication mode is lower than the transmission rate of the first communication mode; The electronic device also includes a third switch and a power supply unit; The control terminal of the third switch is connected to the control unit, one end of the third switch is connected to the control terminal of the second switch, the other end of the third switch is grounded, the control terminal of the second switch is also connected to the power supply unit, and the driving voltage of the third switch is lower than the driving voltage of the second switch. The power supply unit is used to provide voltage to the control terminal of the second switch; The control unit is further configured to control the third switch to be in a conducting state when the electronic device is connected to the second USB interface of the vehicle through the first USB interface, so that the second switch is in a closed state. It is also used to control the third switch to be in the off state and make the second switch in the on state if the control unit fails to enumerate according to the first communication mode.

2. The electronic device according to claim 1, characterized in that, The other end of the second switch is connected to the power supply unit; The power supply unit is used to transmit the first level signal to the control unit when the second switch is in the on state.

3. The electronic device according to claim 2, characterized in that, The electronic device also includes a resistor; the resistor is connected between the power supply unit and the other end of the second switch.

4. The electronic device according to any one of claims 1-3, characterized in that, The control unit includes a first pin and a second pin, and the first USB interface includes a third pin and a fourth pin; the first switch is also connected between the first pin and the third pin, and the first switch is also connected between the second pin and the fourth pin; The control unit is further configured to, when the electronic device is connected to the second USB interface of the vehicle system via the first USB interface, control the first switch to connect the third pin to the first pin and the fourth pin to the second pin; and to, when the control unit fails to enumerate according to the first communication mode, control the first switch to disconnect the third pin from the first pin and the fourth pin from the second pin.

5. The electronic device according to claim 4, characterized in that, The control unit is further configured to, if the control unit fails to enumerate according to the first communication mode, control the first switch to make both the third pin and the fourth pin float.

6. The electronic device according to claim 5, characterized in that, Both the third and fourth pins are data transmission pins.

7. The electronic device according to any one of claims 1-3 and 5-6, characterized in that, The control unit is further configured to control the first switch to disconnect the first USB interface from the control unit and configure a second communication mode when the following conditions are met: The number of times the control unit receives the first information exceeds a threshold, the first information being used to indicate a reset, the reset being one stage of the enumeration; and / or, From the moment the electronic device connects to the second USB interface through the first USB interface until the first duration threshold is reached, the control unit fails to enumerate according to the first communication mode.

8. The electronic device according to any one of claims 1-3 and 5-6, characterized in that, The control unit is further configured to, upon successful enumeration according to the second communication mode, transmit application data of the electronic device to the vehicle system according to the second communication mode.

9. The electronic device according to any one of claims 1-3 and 5-6, characterized in that, The control unit is further configured to control the electronic device to display a pop-up window if the enumeration according to the second communication mode fails; the pop-up window contains a prompt message indicating that wired connection to the vehicle system is not supported.

10. A control method, characterized in that, Applied to an electronic device as described in any one of claims 1-9, the method comprises: When the electronic device is connected to the vehicle's second USB interface via the first USB interface, the first switch is controlled to be in the ON state, and enumeration is performed according to the first communication mode; the enumeration is used to enable the vehicle's system to identify the electronic device; If the control unit fails to enumerate according to the first communication mode, it controls the first switch to disconnect the first USB interface from the control unit, controls the second switch to be in the conducting state, receives the first level signal through the first pin of the control unit, and configures the second communication mode when the first level signal is received. When the second communication mode is configured, the first switch is controlled to be in the on state, and enumeration is performed according to the second communication mode; the transmission rate of the second communication mode is lower than the transmission rate of the first communication mode.

11. The method according to claim 10, characterized in that, The method further includes: Under the following conditions, the first switch is controlled to disconnect the first USB interface from the control unit, and a second communication mode is configured: The number of times the first message is received reaches a threshold, and the first message is used to indicate a reset, wherein the reset is one stage of the enumeration; and / or, From the moment the electronic device connects to the second USB interface through the first USB interface until the first duration threshold is reached, the enumeration according to the first communication mode fails.

12. The method according to claim 10 or 11, characterized in that, Also includes: If the enumeration according to the second communication mode is successful, the application data of the electronic device is transmitted to the vehicle system according to the second communication mode.

13. The method according to claim 10 or 11, characterized in that, Also includes: If the enumeration according to the second communication mode fails, the electronic device is controlled to display a pop-up window; the pop-up window contains a prompt message indicating that wired connection to the vehicle system is not supported.

14. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 10-13.

15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 10-13.

16. A chip system, characterized in that, It includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a line, the at least one processor being configured to run a computer program or instructions to perform the method as described in any one of claims 10-13.

17. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 10-13.

Citation Information

Patent Citations

  • Initialization control device, method and equipment applied to multistage interface series equipment

    CN113064651A

  • System and method for powering and charging a mobile communication device

    US20030054703A1

  • Electronic device and method for controlling connections with external electronic devices

    WO2023128219A1