Electronic device and connection control method of electronic device
Patent Information
- Application Number
- CN202211102378.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-09-09
AI Technical Summary
When existing USB slave devices are connected to a microprocessor, the USB interface is only used for data communication and cannot support firmware upgrades, debugging, and automated testing at the same time. This results in the interface being occupied, making it impossible to establish data interaction with external devices.
By introducing a serial bus circuit into electronic devices, including a transmission interface, control module, and function module, and using switching units and voltage divider units to achieve interface multiplexing, data interaction between external terminal devices and control modules or function modules is allowed, supporting firmware upgrades, debugging, and automated testing.
It enables simultaneous upgrades, debugging, and automated testing of both the control module and the functional module through a single interface, simplifying the equipment structure and improving the integration effect.
Smart Images

Figure CN115408323B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and more particularly to an electronic device and a connection control method. Background Technology
[0002] Universal Serial Bus (USB) is an emerging data communication method that is gradually replacing other interface standards. As a high-speed serial bus, the USB bus has extremely high transmission speed, which can meet the application environment requirements of high-speed data transmission. In addition, the bus also has the advantages of simple power supply, convenient installation and configuration (supporting plug and play and hot-swapping), easy expansion ports, diversified transmission methods, and good compatibility.
[0003] Currently, USB slave devices, such as 4G communication modules, are typically connected to microprocessor controllers and assembled into complete devices to achieve corresponding functions. However, a USB slave device only has one USB interface for firmware upgrades, debugging, and automated testing, as well as for data communication. When a USB slave device and a microprocessor controller form a complete device, the USB interface of the USB slave device is connected to the microprocessor controller for data communication, and it cannot be connected to external devices for related firmware upgrades, device debugging, and production testing. Summary of the Invention
[0004] In view of the shortcomings of the prior art, this application provides an electronic device and connection control method with interface multiplexing.
[0005] This application discloses an electronic device, including a serial bus circuit, a control module, and a function module. The control module and the function module are electrically connected to the serial bus circuit and are used to establish data interaction based on the serial bus circuit. When the control module and the function module establish data interaction, the control module and the function module execute preset functions. The serial bus circuit also includes a transmission interface for connecting to an external terminal device. When the transmission interface is connected to an external terminal device, the control module controls the external terminal device to establish data interaction with the control module. The external terminal device performs upgrades, debugging, and automated testing on the control module. Alternatively, the control module controls the external terminal device to establish data interaction with the function module, and the external terminal device performs upgrades, debugging, and automated testing on the function module.
[0006] Optionally, the serial bus circuit further includes a switching unit connected to the control module, the function module, and the transmission interface, for controlling the electrical connection between the control module and the transmission interface, or controlling the electrical connection between the control module and the function module, or controlling the electrical connection between the function module and the transmission interface.
[0007] Optionally, the switching unit includes a first switch, a second switch, and a third switch. The first and third switches are connected in series between the control module and the transmission interface. The first and second switches are connected in series between the functional module and the control module. The second and third switches are also connected in series between the functional module and the transmission interface. The control module controls any two of the first, second, and third switches to be electrically connected, thereby controlling the control module to establish data interaction with the functional module, or controlling the control module to establish data interaction with an external terminal device connected to the transmission interface, or controlling the functional module to establish data interaction with an external terminal device connected to the transmission interface.
[0008] Optionally, the serial bus circuit further includes a first interface and a second interface. The control module connects to the first switch through the first interface, and the function module connects to the second switch through the second interface. When the transmission interface is not connected to an external terminal device, the control module controls the first switch and the second switch to be electrically connected, and at the same time controls the third switch to be disconnected, so as to control the control module and the function module to establish data interaction. The first interface is the master device mode interface, and the second interface is the slave device mode interface. The function module receives control signals from the control module through the second interface and the first interface, and executes preset functions according to the control signals.
[0009] Optionally, the serial bus circuit also includes a voltage divider unit, and the first interface also includes a mode switching port. The power port of the transmission interface is connected to the mode switching port via the voltage divider unit, which is used to divide the power supply voltage output from the power port. When an external terminal device is connected to the transmission interface, the transmission interface is a master device mode interface. The external terminal device outputs a power supply voltage through the power port, which is then divided by the voltage divider unit and transmitted as a control signal to the first interface. The first interface switches from a master device mode interface to a slave device mode interface according to the control signal. The control module controls the first and third switches to be electrically turned on, and simultaneously controls the second switch to be turned off, so as to control the external terminal device to be electrically connected to the control module, establish data interaction, and perform upgrades, debugging, and automated testing on the control module.
[0010] Optionally, the external terminal device outputs control connection commands to the control module through the transmission interface. The control module controls the second and third switches to be turned on according to the control connection commands, and at the same time controls the first switch to be turned off. The external terminal device is electrically connected to the functional module and exchanges data, and performs upgrades, debugging and automated testing on the functional module.
[0011] Optionally, the voltage divider unit includes a first resistor and a second resistor. The first resistor is connected between the power supply port and the mode switching port to divide the power supply voltage. The second resistor is connected between the mode switching port and the reference ground to provide a low voltage potential to the mode switching port. When the transmission interface is not connected to an external terminal device, the mode switching port is connected to the reference ground via the second resistor, and the first interface is the master device mode interface. When the transmission interface is connected to an external terminal device, the external terminal device provides a control signal to the first interface through the first resistor and the second resistor. The control module adjusts the first interface to the slave device mode interface according to the control signal.
[0012] This application also discloses a connection method for an electronic device, applied to the aforementioned electronic device, comprising: when the external terminal device is not connected to the transmission interface, the control function module is electrically connected to the control module and establishes data interaction, and the function module receives control signals from the control module to execute preset functions; when the transmission interface is connected to the external terminal device, the external terminal device is controlled to be electrically connected to the control module or the function module and establish data interaction, so as to control the external terminal device to perform upgrades, debugging and automated testing on the control module or the function module.
[0013] Optionally, "when the transmission interface is connected to an external terminal device, controlling the external terminal device to electrically connect with the control module or functional module and establish data interaction, so as to control the external terminal device to perform upgrades, debugging and automated testing on the control module or functional module" includes: controlling the first interface to switch to a slave device mode interface, and controlling the control module to electrically connect with the external terminal device and controlling the control module to electrically disconnect from the communication module, so as to control the external terminal device to establish data interaction with the functional module.
[0014] Optionally, "when the transmission interface is connected to an external terminal device, controlling the external terminal device to electrically connect with the control module or functional module and establish data interaction, so as to control the external terminal device to perform upgrades, debugging and automated testing on the control module or functional module" further includes: when the external terminal device is electrically connected with the control module and establishes data interaction, controlling the external terminal device to electrically conduct with the functional module through the control module, and simultaneously controlling the external terminal device to electrically disconnect from the control module, so as to control the external terminal device to electrically connect with the functional module and establish data interaction.
[0015] Compared to existing technologies, by setting up an external interface, it is possible to upgrade, debug, and automate the testing of both the control module and the functional module simultaneously. This effectively solves the problem of being unable to establish data interaction with electronic devices due to interface occupancy, simplifies the device structure, and improves the integration effect of electronic devices. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 A circuit block diagram of an electronic device provided in the first embodiment of this application;
[0018] Figure 2 The second embodiment of this application provides, as shown Figure 1 The circuit block diagram of the serial bus circuit in the image;
[0019] Figure 3 for Figure 1 Equivalent circuit diagram of electronic equipment in China;
[0020] Figure 4 A flowchart of a control method for an electronic device provided in the second embodiment of the application. Detailed Implementation
[0021] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings. Preferred embodiments of this application are shown in the drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0022] The following descriptions of the embodiments are based on the accompanying illustrations and are used to illustrate specific embodiments in which this application can be implemented. The component designations used herein, such as "first," "second," etc., are merely for distinguishing the described objects and do not have any sequential or technical meaning. Unless otherwise specified, the terms "connection" and "linkage" used in this application include both direct and indirect connections (linkages). Directional terms used in this application, such as "up," "down," "front," "rear," "left," "right," "inner," "outer," "side," etc., are merely for reference to the accompanying drawings. Therefore, the use of directional terms is for better and clearer explanation and understanding of this application, and does not indicate or imply that the referred device or element must have a specific orientation, or be constructed and operated in a specific orientation; therefore, they should not be construed as limitations on this application.
[0023] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order.
[0024] Furthermore, the terms "comprising," "may include," "include," or "may include" used in this application indicate the presence of the corresponding functions, operations, elements, etc., disclosed, but do not limit the inclusion of one or more other functions, operations, elements, etc. Additionally, the terms "comprising" or "include" indicate the presence of the corresponding features, numbers, steps, operations, elements, components, or combinations thereof disclosed in the specification, but do not exclude the presence or addition of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, and are intended to cover non-exclusive inclusion. Furthermore, when describing embodiments of this application, "may" is used to mean "one or more embodiments of this application." And the term "exemplary" is intended to refer to examples or illustrations.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0026] Please see Figure 1 , Figure 1 This is a circuit block diagram of an electronic device provided in the first embodiment of this application. (See diagram below.) Figure 1 As shown, the electronic device 100 includes a serial bus circuit 10, a control module 20, and a function module 30. The control module 20 and the function module 30 are electrically connected to the serial bus circuit 10. The control module 20 interacts with the function module 30 via the serial bus circuit 10. When the control module 20 and the function module 30 establish data interaction, they execute preset functions and realize complete machine functions.
[0027] In an exemplary embodiment, the control module 20 may be a microprocessor controller, and the functional module 30 may be a communication module, a radio frequency module, and a storage module, etc. For example, the control module 20 may be a high-performance wireless access point (AP) processor, and the functional module 30 may be a 4G communication module, which shares the network with the AP processor through the serial bus circuit 10.
[0028] The serial bus circuit 10 includes a transmission interface 13 for connecting to an external terminal device (not shown). When the transmission interface 13 is connected to the external terminal device, the control module 20 controls the external terminal device to establish data interaction with the control module 20. The external terminal device performs upgrades, debugging, and automated testing on the control module 20. Alternatively, the control module 20 controls the external terminal device to establish data interaction with the functional module 30, and the external terminal device performs upgrades, debugging, and automated testing on the functional module. Upgrading the control module 20 or functional module 30 refers to upgrading the program within the control module 20 or functional module 30. Debugging and automated testing of the control module 20 or functional module 30 involves using and debugging the program within the control module 20 or functional module 30 and performing automatic functional operation tests.
[0029] The serial bus circuit 10 also includes a first interface 11 and a second interface 12. The control module 20 is connected to the first interface 11, which is an OTG interface, i.e., the master control interface, and is in OTG mode by default. The function module 30 is connected to the second interface 12, which is a slave interface. When the control module 20 is connected to the first interface 11 and the function module 30 is connected to the second interface 12, the first interface 11 is the master device mode interface and the second interface 12 is the slave device mode interface. The control module 20 is the master control device by default, and the function module 30 is the slave device by default. The function module 30 receives the control signals output by the control module 20 through the second interface 12 and the first interface 11, and executes preset functions according to the control signals, thereby forming a complete set of functions.
[0030] When an external terminal device is connected to the transmission interface 13, the external terminal device can perform firmware upgrades, debugging, and automated testing on the microprocessor controller connected to the first interface 11 through the transmission interface 13, and can also perform firmware upgrades, debugging, and testing on the functional module 30 connected to the second interface 12 through the transmission interface 13. The first interface 11, the second interface 12, and the transmission interface 13 can all be Universal Serial Bus (USB) interfaces.
[0031] Please see Figure 2 , Figure 2 for Figure 1 The circuit block diagram of the serial bus circuit in the example. Figure 2 As shown, the serial bus circuit 10 also includes a switching unit 14 and a voltage divider unit 15. The first interface 11, the second interface 12, and the transmission interface 13 are respectively connected to the switching unit 14 and electrically connected via the switching unit 14. When the control module 20 is connected to the first interface 11, the function module 30 is connected to the second interface 12, and the external terminal device is not connected to the transmission interface 13, the first interface 11 is the master device mode interface, and the second interface 12 is the slave device mode interface. The control module 20 and the function module 30 are electrically connected via the switching unit 14. At this time, the control module 20 is the master device, and the function module 30 is the slave device. The function module 30 provides power supply voltage, and the control module 20 and the function module 30 can exchange data. The function module 30 receives control signals from the control module 20 through the second interface 12 and the first interface 11, and executes the preset functions of the function module 30 according to the control signals, thereby realizing the corresponding overall machine function.
[0032] The transmission interface 13 is an interface for connecting to external terminal devices, such as computers and mobile phones. Through the external terminal devices, the control module 20 connected to the first interface 11 can be used for file access, data communication software download and upgrade, and production debugging, or the functional module 30 connected to the second interface 12 can be used for file access, data communication software download, and production debugging.
[0033] The voltage divider unit 15 is connected between the first interface 11 and the transmission interface 13. When the external terminal device is connected to the transmission interface 13, it divides the power supply voltage output by the external terminal device and transmits it as a control signal to the first interface 11. The first interface 11 automatically switches from a master device mode interface to a slave device mode interface according to the control signal. When the control module 20 receives a control signal from the external terminal device or detects that the first interface 11 has switched to a slave device mode interface, the control module 20 controls the switch unit to connect the first interface 11 and the transmission interface 13, and controls the first interface 11 to disconnect from the second interface 12 through the control switch unit 14. At the same time, it provides power supply voltage. At this time, the transmission interface 13 is a master device mode interface, the external terminal device connected to the transmission interface 13 is the master device, and the control module 20 is the slave device. The external terminal device and the control module 20 establish data interaction. The external terminal device can output control commands to the control module 20 so that the control module 20 can execute preset functions.
[0034] Specifically, when the control module 20 needs to be upgraded, debugged, and automated tested, an external terminal device is connected to the transmission interface 13. The external terminal device provides a 5V power supply voltage, which is divided by the voltage divider unit 15 and transmitted as a control signal to the first interface 11. The first interface 11 switches from a master device mode interface to a slave device mode interface according to the control signal. When the control module 20 detects that the first interface 11 has switched to a slave device mode interface, the control module 20 controls the switch unit 14 to connect the first interface 11 to the transmission interface 13 and disconnect the first interface 11 from the second interface 12. At the same time, a power supply voltage is provided. At this time, the external terminal device connected to the transmission interface 13 is the master device, and the control module 20 is the slave device. At this time, the external terminal device can communicate with the control module 20.
[0035] When firmware upgrades, debugging, and automated testing of functional module 30 are required, after data communication is established between the external terminal device and control module 20, control commands are sent from the external terminal device to control module 20. Control module 20 controls switch unit 14 to disconnect the first interface 11 from the transmission interface according to the control commands, and controls the second interface 12 to be electrically connected to the transmission interface 13, that is, to control the external terminal device to be electrically connected to functional module 30. At the same time, functional module 30 provides power supply voltage, and external terminal device establishes data communication with functional module 30. At this time, transmission interface 13 is the master device mode interface, and second interface 12 is the slave device mode interface. That is, external terminal device is master device, and functional module is slave device. External terminal device can perform firmware upgrades, debugging, and automated testing on functional module 30.
[0036] Please refer to the following: Figure 3 , Figure 3 for Figure 1 Equivalent circuit diagram of electronic equipment in China.
[0037] like Figure 3 As shown, the control module 20 is electrically connected to the transmission interface 13 via the first data line D+ and the second data line D-, for external terminal devices to establish data interaction with the control module 20 via the transmission interface 13. At the same time, the function module 30 is electrically connected to the first data line D+ and the second data line D-.
[0038] The switching unit 14 includes a first switch K1, a second switch K2, and a third switch K3. The first switch K1 is located on the first data line D+ and the second data line D- adjacent to the control module 20. The second switch K2 is located on the first data line D+ and the second data line D- adjacent to the functional module 30. The third switch K3 is located on the first data line D+ and the second data line D- adjacent to the transmission interface 13. The first switch K1 and the third switch K3 are connected in series between the control module 20 and the transmission interface 13. The first switch K1 and the second switch K2 are connected in series between the functional module 30 and the control module 20. The second switch and the third switch are connected in series between the functional module and the transmission interface. By electrically connecting any two of the first switch K1, the second switch K2, and the third switch K3, data interaction can be established between the control module 20 and the functional module 30, or between the control module 20 and an external terminal device connected to the transmission interface 13, or between the functional module 30 and an external terminal device connected to the transmission interface 13.
[0039] For example, when the first switch K1 and the second switch K2 are closed and the third switch K3 is open, the first interface 11 and the second interface 12 are electrically connected. At this time, the control module 20 connected to the first interface 11 and the function module 30 connected to the second interface 12 establish data interaction to form the complete function of the whole machine.
[0040] When the first switch K1 and the third switch K3 are closed and the second switch K2 is open, the first interface 11 and the transmission interface 13 are electrically connected. At this time, the control module 20 connected to the first interface 11 establishes data communication with the external terminal device connected to the transmission interface 13.
[0041] When the second switch K2 and the third switch K3 are closed and the first switch K1 is open, the second interface 12 and the transmission interface 13 are electrically connected. At this time, the functional module 30 connected to the second interface establishes data communication with the external terminal device connected to the transmission interface.
[0042] A power line L is provided between the first interface 11 and the transmission interface 13. The power line L is connected between the power port VBUS of the transmission interface 13 and the mode switching port ID of the first interface 11. The voltage divider unit 15 is provided in the power line L and is used to divide the power supply voltage output when the external terminal device is connected to the transmission interface 13.
[0043] The voltage divider unit 15 includes a first resistor R1 and a second resistor R2. The first resistor R1 is disposed on the power line L, and the second resistor R2 is connected between the power line L and the reference ground terminal GND.
[0044] When the transmission interface 13 is not connected to a device, the mode switching port ID of the first interface 11 is connected to the reference ground GND through the second resistor R2, so that the potential of the mode switching port ID is maintained at the first potential. At this time, the first interface 11 is the master device mode interface.
[0045] When the transmission interface 13 is connected to an external terminal device, the external terminal device outputs a 5V power supply voltage to the power line L via the power port VBUS of the transmission interface 13. After being divided by the first resistor R1 and the second resistor R2, the voltage is transmitted as a control signal to the mode switching port ID of the first interface 11. The potential of the mode switching port ID changes from the first potential to the second potential. At this time, the first interface 11 switches from a master device mode interface to a slave device mode interface. The first potential is a low voltage potential, and the second potential is a high voltage potential.
[0046] The first interface 11 also includes a first control port G1, a second control port G2, and a third control port G3. The first control port G1 is connected to the first switch K1, the second control port G2 is connected to the second switch K2, and the third control port G3 is connected to the third switch K3. When the control module 20 is connected to the first interface 11, the control module 20 controls the closing and opening of the first switch K1, the second switch K2, and the third switch K3 through the first control port G1, the second control port G2, and the third control port G3, respectively, thereby controlling the electrical conduction of any two of the external terminal devices, the control module 20, and the functional module 30, and establishing data communication.
[0047] Specifically, when the control module 20 is connected to the first interface 11 and the function module 30 is connected to the second interface 12, the mode switching port ID of the first interface 11 is connected to the reference ground GND via the power line L and the second resistor R2. At this time, the first interface 11 is the master device mode interface. The control module 20 controls the first switch K1 and the second switch K2 to close via the first control port G1 and the second control port G2, so that the control module 20 and the function module 30 are electrically connected. The power port VBUS of the function module 30 provides the power supply voltage. The control module 20 and the function module 30 establish data interaction to form the complete function of the whole machine.
[0048] When an external terminal device is connected to the transmission interface 13, the power port VBUS in the transmission interface 13 outputs a power supply voltage to the power line L. After being divided by the first resistor R1, the voltage is transmitted as a control signal to the mode switching port ID of the first interface. After receiving the control signal, the first interface 11 automatically switches from the master device mode interface to the slave device mode interface. When the control module 20 connected to the first interface 11 detects that the first interface 11 has switched to the slave device mode interface, it controls the second switch K2 to open via the second control port G2 and simultaneously controls the third switch K3 to close via the third control port G3, so that the first interface 11 is electrically connected to the transmission interface 13. That is, it controls the external terminal device to be electrically connected to the control module 20, and establishes data communication via the first data line D+ and the second data line D-, so that the external terminal device can perform firmware upgrades, debugging, and automated testing on the control module 20.
[0049] When firmware upgrades, debugging, and automated testing are required for the functional module 30 connected to the second interface 12, the external terminal device sends a control connection command to the control module 20. The control module 20 controls the first switch K1 to open and the second switch K2 to close according to the control connection command, so that the second interface 12 is electrically connected to the transmission interface 13. That is, it controls the external terminal device connected to the transmission interface 13 to be electrically connected to the functional module 30 connected to the second interface and establishes data communication, so that the external terminal device can perform firmware upgrades, debugging, and automated testing on the functional module 30.
[0050] Connecting an external terminal device to the transmission interface 13 and transmitting the power supply voltage as a control signal to the first interface 11 causes the first interface 11 to switch from a master device mode interface to a slave device mode interface based on the control signal. This allows the external terminal device to directly perform firmware upgrades, debugging, and automated testing on the control module 20. Furthermore, by controlling the external terminal device, it can establish data interaction with the functional module 30, thereby enabling firmware upgrades, debugging, and automated testing on the functional module 30. This single interface allows for debugging of both the control module 20 and the functional module 30, effectively solving the problem of external terminal devices being unable to establish data interaction with the control or functional modules in electronic devices due to the control module interface being occupied by the functional module. This simplifies the device structure and improves the integration effect of the electronic device.
[0051] Please see Figure 4 , Figure 4 A flowchart illustrating a control method for an electronic device provided in the second embodiment of the application. (See attached flowchart.) Figure 4 As shown, the specific steps are as follows:
[0052] S101, when the external terminal device is not connected to the transmission interface, the control function module is electrically connected to the control module and establishes data interaction. The function module receives control signals from the control module to execute preset functions.
[0053] When the transmission interface 13 is not connected to an external terminal device, the control module 20 is electrically connected through the first switch K1 and the second switch K2 in the control switch unit 14 to establish data interaction between the control function module 30 and the control module 20. The function module 30 receives control signals from the control module 20 and executes preset functions to realize the complete functions of the whole machine.
[0054] S102, when the transmission interface is connected to an external terminal device, the external terminal device is electrically connected to the control module or functional module and data interaction is established to control the external terminal device to perform upgrades, debugging and automated testing on the control module or functional module.
[0055] When the transmission interface 13 is connected to an external terminal device, the control first interface 11 is switched from the master device mode interface to the slave device mode interface. At the same time, the control switch unit 14 is used to control the control module to be electrically connected to the external terminal device connected to the transmission interface 13, and to control the control module 20 to be electrically disconnected from the function module 30.
[0056] Specifically, when an external terminal device is connected to the transmission interface 13, the power port VBUS in the transmission interface 13 outputs a power voltage to the power line L. After being divided by the first resistor R1, the voltage is transmitted as a control signal to the mode switching port ID of the first interface. Upon receiving the control signal, the first interface 11 automatically switches from the master device mode interface to the slave device mode interface. When the control module 20 connected to the first interface 11 detects that the first interface 11 has switched to the slave device mode interface, it controls the second switch K2 to open via the second control port G2 and simultaneously controls the third switch K3 to close via the third control port G3, thereby electrically connecting the first interface 11 and the transmission interface 13. This means that the external terminal device is electrically connected to the control module 20, and data communication is established via the first data line D+ and the second data line D-, enabling the external terminal device to perform firmware upgrades, debugging, and automated testing on the control module 20.
[0057] When the control module 20 receives a control command output from an external terminal device, it controls the switch unit 14 according to the control command to control the external terminal device to be electrically connected to the functional module 30, and to control the external terminal device to be electrically disconnected from the control module 20.
[0058] Specifically, when firmware upgrades, debugging, and automated testing are required for the functional module 30 connected to the second interface 12, the external terminal device sends control commands to the control module 20. The control module 20 controls the first switch K1 to open and the second switch K2 to close according to the control commands, so that the second interface 12 is electrically connected to the transmission interface 13. That is, it controls the external terminal device connected to the transmission interface 13 to be electrically connected to the functional module 30 connected to the second interface and establishes data communication, so that the external terminal device can perform firmware upgrades, debugging, and automated testing on the functional module 30.
[0059] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. An electronic device, characterized in that, It includes a serial bus circuit, a control module, and a function module. The control module and the function module are electrically connected to the serial bus circuit, respectively, and are used to establish data interaction based on the serial bus circuit. When the control module and the function module establish data interaction, the control module and the function module execute preset functions. The serial bus circuit also includes a transmission interface for connecting to an external terminal device. When the transmission interface is connected to the external terminal device, the control module controls the external terminal device to establish data interaction with the control module, and the external terminal device performs upgrades, debugging, and automated testing on the control module. or The control module controls the external terminal device to establish data interaction with the functional module, and the external terminal device performs upgrades, debugging, and automated testing on the functional module. The serial bus circuit further includes a switching unit, which is connected to the control module, the functional module, and the transmission interface to control the electrical connection between the control module and the transmission interface, or to control the electrical connection between the control module and the functional module, or to control the electrical connection between the functional module and the transmission interface. The switching unit includes a first switch, a second switch, and a third switch. The first switch and the third switch are connected in series between the control module and the transmission interface. The first switch and the second switch are connected in series between the functional module and the control module. The second switch and the third switch are connected in series between the functional module and the transmission interface. The control module controls the first switch and the second switch to be electrically connected and the third switch to be disconnected, so as to control the control module to establish data interaction with the functional module; the control module controls the first switch and the third switch to be electrically connected and the second switch to be disconnected, so as to control the control module to establish data interaction with the external terminal device connected to the transmission interface; the control module controls the second switch and the third switch to be electrically connected and the first switch to be disconnected, so as to control the functional module to establish data interaction with the external terminal device connected to the transmission interface.
2. The electronic device as claimed in claim 1, characterized in that, The serial bus circuit further includes a first interface and a second interface. The control module is connected to the first switch through the first interface, and the function module is connected to the second switch through the second interface. When the transmission interface is not connected to the external terminal device, the control module controls the first switch and the second switch to be electrically connected, and simultaneously controls the third switch to be disconnected, so as to control the control module and the function module to establish data interaction. The first interface is a master device mode interface, and the second interface is a slave device mode interface. The function module receives control signals from the control module through the second interface and the first interface, and executes preset functions according to the control signals.
3. The electronic device as described in claim 2, characterized in that, The serial bus circuit further includes a voltage divider unit, and the first interface further includes a mode switching port; The power port of the transmission interface is connected to the mode switching port via the voltage divider unit, and the voltage divider unit is used to divide the power supply voltage output by the power port. When the external terminal device is connected to the transmission interface, the transmission interface is the master device mode interface. The external terminal device outputs the power voltage through the power port, and after being divided by the voltage divider unit, it is transmitted to the first interface as the control signal. The first interface switches from the master device mode interface to the slave device mode interface according to the control signal. The control module controls the first switch and the third switch to be electrically turned on, and at the same time controls the second switch to be turned off, so as to control the external terminal device to be electrically connected to the control module, establish data interaction, and perform upgrades, debugging and automated testing on the control module.
4. The electronic device as claimed in claim 3, characterized in that, The external terminal device outputs a control connection command to the control module through the transmission interface. The control module controls the second switch and the third switch to be turned on according to the control connection command, and at the same time controls the first switch to be turned off. The external terminal device is electrically connected to the functional module and establishes data interaction, and performs upgrades, debugging and automated testing on the functional module.
5. The electronic device as described in claim 3 or 4, characterized in that, The voltage divider unit includes a first resistor and a second resistor. The first resistor is connected between the power port and the mode switching port to divide the power supply voltage. The second resistor is connected between the mode switching port and the reference ground to provide a low voltage potential to the mode switching port. When the transmission interface is not connected to the external terminal device, the mode switching port is connected to the reference ground via the second resistor. The first interface is the master device mode interface. When the transmission interface is connected to the external terminal device, the external terminal device provides the control signal to the first interface through the first resistor and the second resistor. The control module adjusts the first interface to the slave device mode interface according to the control signal.
6. A connection control method for an electronic device, characterized in that, The connection control method, applied to the electronic device as described in claim 5, comprises: When the external terminal device is not connected to the transmission interface, the control module is electrically connected to the control module and establishes data interaction. The function module receives the control signal from the control module to execute the preset function. When the transmission interface is connected to the external terminal device, the external terminal device is electrically connected to the control module and a data interaction is established to control the external terminal device to perform upgrades, debugging, and automated testing on the control module; or when the transmission interface is connected to the external terminal device, the external terminal device is electrically connected to the functional module and a data interaction is established to control the external terminal device to perform upgrades, debugging, and automated testing on the functional module.
7. The connection control method as described in claim 6, characterized in that, When the transmission interface is connected to the external terminal device, the external terminal device is electrically connected to the control module and data interaction is established to control the external terminal device to perform upgrades, debugging, and automated testing on the control module, including: The system controls the first interface to switch to the slave device mode interface, and controls the control module to be electrically connected to the external terminal device and electrically disconnected from the functional module, so as to control the external terminal device to establish data interaction with the control module.
8. The connection control method as described in claim 7, characterized in that, When the transmission interface is connected to the external terminal device, controlling the external terminal device to electrically connect with the functional module and establish data interaction, so as to control the external terminal device to perform upgrades, debugging and automated testing on the functional module, further includes: when the external terminal device is electrically connected with the control module and establishes data interaction, controlling the external terminal device to electrically conduct with the functional module through the control module, and simultaneously controlling the external terminal device to electrically disconnect from the control module, so as to control the external terminal device to electrically connect with the functional module and establish data interaction.
Citation Information
Patent Citations
USB (universal serial bus) interface mode switching device and intelligent terminal
CN104932999A
USB (Universal Serial Bus) interface mode switching method and device, and smart terminal
CN106484645A
