Data transmission method, apparatus and device

By disconnecting the USB data path after the electronic device receives a lock screen or power-off command, and then reconnecting it when unlocking, the data security problem caused by the USB data path is solved, and data protection is achieved in the locked screen or power-off state.

CN119512991BActive Publication Date: 2026-05-29VIVO MOBILE COMM CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2024-11-06
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The USB data path of electronic devices is usually activated after leaving the factory, resulting in poor data security, as other users can obtain data from the device through this path.

Method used

By disconnecting the USB data path upon receiving a lock screen or power-off command and then reconnecting it after unlocking, the security of the USB data path during data transmission is ensured.

Benefits of technology

It improves the data security of electronic devices and prevents data leakage through the USB data path when the screen is locked or the device is powered off.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512991B_ABST
    Figure CN119512991B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method, device and equipment, and belongs to the technical field of electronic equipment. The data transmission method comprises the following steps: receiving a first instruction, wherein the first instruction comprises a lock screen instruction or a shutdown instruction; in response to the first instruction, disconnecting a USB data channel of the electronic equipment; receiving a second instruction, wherein the second instruction comprises an unlocking instruction; and in response to the second instruction, unlocking the electronic equipment and turning on the USB data channel to transmit data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronic equipment technology, specifically relating to a data transmission method, apparatus, and device. Background Technology

[0002] The Universal Serial Bus (USB) pathway for electronic devices includes a data pathway, an audio pathway, and a charging protocol pathway. The data pathway is used for data transmission, the audio pathway is used for transmitting audio signals, and the charging protocol pathway is used for charging electronic devices.

[0003] Normally, the USB data path is enabled after an electronic device leaves the factory. This means that if another user gets hold of the electronic device, they can access the data on the device through the USB data path, resulting in poor data security. Summary of the Invention

[0004] The purpose of this application is to provide a data transmission method, apparatus, and device that can solve the problem of poor data security.

[0005] In a first aspect, embodiments of this application provide a data transmission method, including:

[0006] Receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction;

[0007] In response to the first command, disconnect the USB data path of the electronic device;

[0008] Receive a second instruction, wherein the second instruction includes an unlock instruction;

[0009] In response to the second command, the electronic device is unlocked and the USB data path is activated to transfer data.

[0010] Secondly, embodiments of this application provide a data transmission apparatus, including:

[0011] The first receiving module is used to receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction;

[0012] Disconnect module, used to disconnect the USB data path of electronic device in response to a first command;

[0013] The second receiving module is used to receive a second instruction, wherein the second instruction includes an unlocking instruction;

[0014] The activation module is used to unlock the electronic device and activate the USB data path in response to a second command, so as to transmit data.

[0015] Thirdly, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores programs or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the steps of the data transmission method provided in embodiments of this application.

[0016] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the data transmission method provided in embodiments of this application are implemented.

[0017] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the data transmission method provided in embodiments of this application.

[0018] Sixthly, embodiments of this application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the steps of the data transmission method provided in embodiments of this application.

[0019] In this embodiment, by receiving a first instruction, which includes a screen lock instruction or a power off instruction; in response to the first instruction, disconnecting the USB data path of the electronic device; receiving a second instruction, which includes an unlock instruction; and in response to the second instruction, unlocking the electronic device and reconnecting the USB data path to transmit data. Thus, by disconnecting the USB data path of the electronic device when the screen is locked or the device is powered off, and reconnecting the USB data path only after the device is unlocked, the security of the data in the electronic device can be improved, preventing other users from accessing the data in the electronic device through the USB data path when the screen is locked or the device is powered off. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the data transmission method provided in an embodiment of this application;

[0021] Figure 2 This is a schematic diagram of the first hardware architecture provided in the embodiments of this application;

[0022] Figure 3 This is a schematic diagram of the second hardware architecture provided in the embodiments of this application;

[0023] Figure 4 This is a schematic diagram of the third hardware architecture provided in the embodiments of this application;

[0024] Figure 5 This is a schematic diagram of the structure of the data transmission device provided in the embodiments of this application;

[0025] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0026] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements the embodiments of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0029] The data transmission method, apparatus, and device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0030] Figure 1 This is a flowchart illustrating the data transmission method provided in an embodiment of this application. The data transmission method may include:

[0031] Step 101: Receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction;

[0032] In some possible implementations of the embodiments of this application, the first instruction in the embodiments of this application may be sent when triggered by the user, or it may be sent automatically.

[0033] For screen lock commands, the screen lock command is triggered when the user briefly presses the power button of the electronic device, or the user sets up automatic screen lock, which is automatically triggered when the electronic device has not been operated for a long time.

[0034] For shutdown commands, when a user presses and holds the power button on the electronic device, a screen lock command is triggered. Alternatively, if the user sets an automatic shutdown, a screen lock command is automatically triggered when the corresponding automatic shutdown time is reached.

[0035] Step 102: In response to the first instruction, disconnect the USB data path of the electronic device.

[0036] In some possible implementations of this application's embodiments, the USB data path of the electronic device is disconnected after receiving a screen lock command or a power-off command. Once the USB data path of the electronic device is disconnected, data cannot be obtained from the electronic device via the USB data path.

[0037] Step 103: Receive a second instruction, wherein the second instruction includes an unlock instruction;

[0038] In some possible implementations of the embodiments of this application, the unlocking command in the embodiments of this application includes an unlocking command to unlock the screen when the screen is locked, and may also include an unlocking command when the electronic device is powered on.

[0039] Step 104: In response to the unlock command, unlock the electronic device and enable the USB data path to transfer data.

[0040] This application does not limit the method used to unlock the electronic device; any available unlocking method can be applied to this application, such as fingerprint unlocking, face unlocking, pattern unlocking, character unlocking, etc. Once the electronic device is unlocked, the USB data path is activated, allowing data transmission.

[0041] In this embodiment, by receiving a first instruction, which includes a screen lock instruction or a power off instruction; in response to the first instruction, disconnecting the USB data path of the electronic device; receiving a second instruction, which includes an unlock instruction; and in response to the second instruction, unlocking the electronic device and reconnecting the USB data path to transmit data. Thus, by disconnecting the USB data path of the electronic device when the screen is locked or the device is powered off, and reconnecting the USB data path only after the device is unlocked, the security of the data in the electronic device can be improved, preventing other users from accessing the data in the electronic device through the USB data path when the screen is locked or the device is powered off.

[0042] In some possible implementations of the embodiments of this application, in step 102, the USB data path of the electronic device can be disconnected if the electronic device has a lock screen password.

[0043] In this embodiment, because a lock screen password is set, even if other users obtain the electronic device, they will not be able to unlock the electronic device and access the data inside it.

[0044] In some possible implementations of the embodiments of this application, the USB data path of the electronic device includes a USB data path inside the processor of the electronic device and a USB data path outside the processor. When disconnecting the USB data path of the electronic device, the USB data path inside the processor and / or the USB data path outside the processor can be disconnected. That is, only the USB data path inside the processor can be disconnected, only the USB data path outside the processor can be disconnected, or both the USB data path inside the processor and the USB data path outside the processor can be disconnected.

[0045] In some possible implementations of the embodiments of this application, the electronic device includes a USB logic switch, which is used to switch between a USB data path, an audio path, and a charging protocol path outside the processor; accordingly, step 102 may include: switching the USB logic switch to the audio path or the charging protocol path, and disconnecting the USB data path outside the processor.

[0046] In some possible implementations of the embodiments of this application, the USB logic switch in the embodiments of this application may be a single-pole triple-throw switch or two single-pole double-throw switches.

[0047] For example, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the first hardware architecture provided in the embodiments of this application. Figure 2 In this circuit, the USB logic switch is a single-pole triple-throw switch 201, which is connected to the USB data path 2021, the audio path 2022, and the charging protocol path 2023 respectively. The common terminal of the single-pole triple-throw switch 201 is connected to the USB interface 203 of the electronic device. The USB data path 2021 is connected to the processor 204 of the electronic device, and the processor 204 is also connected to the single-pole triple-throw switch 201 via a control line 205.

[0048] When the electronic device receives a screen lock command or a power off command, the processor 204 switches the single-pole triple-throw switch 201 to the audio path 2022 or the charging protocol path 2023 via the control line 205, and disconnects the external USB data path 2021 of the processor 204.

[0049] For example, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the second hardware architecture provided in an embodiment of this application. Figure 3In this design, the USB logic switch uses two single-pole double-throw switches. The first single-pole double-throw switch 301 is connected to the USB data path 2021 and the charging protocol path 2023 respectively. The second single-pole double-throw switch 302 is connected to the common terminal of the first single-pole double-throw switch 301 and the audio path 2022 respectively. The common terminal of the second single-pole double-throw switch 302 is connected to the USB interface 203 of the electronic device. The USB data path 2021 is connected to the processor 204 of the electronic device. The processor 204 is also connected to the first single-pole double-throw switch 301 through the first control line 303 and to the second single-pole double-throw switch 302 through the second control line 304.

[0050] When the electronic device receives a screen lock command or a power off command, the processor 204 switches the first single-pole double-throw switch 301 to the charging protocol path 2023 via the first control line 303, or switches the second single-pole double-throw switch 302 to the audio path 2022 via the second control line 304.

[0051] In some possible implementations of the embodiments of this application, preferably, the USB logic switch can be switched to the charging protocol path. In this case, regardless of whether the electronic device is connected to a computer or a charger via the USB interface, it will be identified as non-standard charging. This ensures that the electronic device cannot be cracked, leaked, or flashed, regardless of who has it, thus improving data security. At the same time, it can still charge the electronic device, and the electronic device can be tracked while powered on, increasing the probability of the owner recovering the electronic device.

[0052] In some possible implementations of the embodiments of this application, when the first instruction includes a power-off instruction, step 102 may include: disconnecting the USB data path after a first duration following the receipt of the first instruction. That is, upon receiving the first instruction, the USB data path is not immediately disconnected, but rather disconnected after a period of time.

[0053] In some possible implementations of the embodiments of this application, the first duration can be set according to actual needs.

[0054] In some possible implementations of the embodiments of this application, by delaying the disconnection of the USB data path when the electronic device is powered off, it can be ensured that the normal flashing operation of the owner of the electronic device is not affected when the electronic device is powered off, while at the same time, it can prevent the electronic device from being illegally flashed by others when it is lost.

[0055] In some possible implementations of the embodiments of this application, step 104 may include: switching the USB logic switch to the USB data path outside the processor, thereby enabling the USB data path outside the processor.

[0056] For example, when electronic devices adopt Figure 2In the architecture shown, after the electronic device receives the unlock command, the processor 204 switches the single-pole triple-throw switch 201 to the USB data path 2021 via the control line 205, thus enabling the USB data path 2021 outside the processor 204.

[0057] When electronic devices adopt Figure 3 In the architecture shown, after the electronic device receives the unlock command, the processor 204 switches the first single-pole double-throw switch 301 to the USB data path 2021 via the first control line 303, and switches the second single-pole double-throw switch 302 to the common terminal of the first single-pole double-throw switch 301 via the second control line 304, thereby connecting the USB data path 2021 outside the processor 204.

[0058] In some possible implementations of this application's embodiments, the electronic device may include a power management integrated circuit (PMIC), which is connected to a switch for controlling the on / off state of the USB data path within the processor. Step 102 may include: when the power management chip detects that a USB device is connected to the electronic device via the USB battery charging protocol and the USB bus voltage is greater than a first threshold, turning on the switch, disconnecting the USB data path within the processor, and disabling the USB battery charging protocol.

[0059] In some possible implementations of this application's embodiments, the USB battery charging protocol defines a detection, control, and reporting mechanism for device charging via a USB interface. When an electronic device is connected to a computer via a USB interface, the USB battery charging protocol identifies the computer as a Standard Downstream Port device, allowing the electronic device to perform data transmission and charging. When the electronic device is connected to a charger via a USB interface, the USB battery charging protocol identifies the computer as a Dedicated Charging Port (DCP) device, allowing the electronic device to only charge. The first threshold can be set according to actual needs, for example, 4.5 volts (V).

[0060] For example, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the third hardware architecture provided in the embodiments of this application.

[0061] exist Figure 4 In the processor 403, the power management chip 401 is connected to the external USB data path 402. The power management chip 401 is also connected to the switch 4031 in the processor 403 via the control line 404. The other end of the external USB data path 402 is connected to the USB interface 203.

[0062] When the electronic device is locked or powered off, the power management chip 401 detects USB device access via the USB battery charging protocol. When a USB device is detected connected to the electronic device and the USB bus voltage exceeds a first threshold, the USB battery charging protocol is disabled. The chip then controls the switch 4031 in the processor 403 to open via control line 404, disconnecting the USB data path within the processor 403. Because the USB data path within the processor 403 is disabled, even if a USB device is connected to the electronic device, it cannot access the data within the electronic device, thus improving data security. After the USB battery charging protocol is disabled, the USB device can only communicate with the charging protocol path. Once the USB device is recognized as a DCP device, it can charge the electronic device.

[0063] In some possible implementations of the embodiments of this application, step 104 may include: when the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the second threshold through the USB battery charging protocol, closing the switch, conducting the USB data path inside the processor, and opening the USB battery charging protocol.

[0064] In some possible implementations of the embodiments of this application, when the electronic device adopts Figure 4 In the architecture shown, after the electronic device receives the unlock command, the power management chip 401 detects the USB device access through the USB battery charging protocol. When a USB device is detected to be connected to the electronic device and the USB bus voltage is greater than the second threshold, the USB battery charging protocol is turned on, and the switch 4031 in the processor 403 is closed through the control line 404, so that the USB data path inside the processor 403 is turned on.

[0065] In some possible implementations of this application's embodiments, after the electronic device is unlocked, the USB data path is turned on, and the USB battery charging protocol is enabled, the USB data path is connected to the power management chip. The USB device access is detected through the USB battery charging protocol. When the accessed USB device is identified as a USB audio device (e.g., USB headphones or USB microphone), the processor controls the USB logic switch to switch to the audio path to transmit audio signals with the audio codec in the electronic device. When the accessed USB device is identified as an SDP device, the USB logic switch is switched to the data path to transmit data with the SDP device. When the accessed USB device is identified as a DCP device (e.g., a charger), the USB logic switch is switched to the charging protocol path to charge the electronic device.

[0066] The data transmission method provided in this application can be executed by a data transmission device. This application uses a data transmission device executing the data transmission method as an example to illustrate the data transmission device provided in this application.

[0067] Figure 5 This is a schematic diagram of the structure of the data transmission device provided in an embodiment of this application. The data transmission device 500 may include:

[0068] The first receiving module 501 is used to receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction;

[0069] Disconnect module 502 is used to disconnect the USB data path of the electronic device in response to the first instruction;

[0070] The second receiving module 503 is used to receive a second instruction, wherein the second instruction includes an unlocking instruction;

[0071] The conduction module 504 is used to unlock the electronic device and conduct the USB data path in response to the second command to transmit data.

[0072] In this embodiment, by receiving a first instruction, which includes a screen lock instruction or a power off instruction; in response to the first instruction, disconnecting the USB data path of the electronic device; receiving a second instruction, which includes an unlock instruction; and in response to the second instruction, unlocking the electronic device and reconnecting the USB data path to transmit data. Thus, when the electronic device is locked or powered off, the USB data path is disconnected, and only reconnected after the electronic device is unlocked. This prevents other users from accessing data on the electronic device via the USB data path when the device is locked or powered off, thereby improving the security of data on the electronic device.

[0073] In some possible implementations of embodiments of this application, the electronic device includes a power management chip, which is connected to a switch for controlling the on or off state of a USB data path inside the processor.

[0074] The disconnect module 502 is specifically used for:

[0075] When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the first threshold through the USB battery charging protocol, it turns on the switch, disconnects the USB data path inside the processor, and shuts down the USB battery charging protocol.

[0076] In some possible implementations of the embodiments of this application, the conduction module 504 is specifically used for:

[0077] When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the second threshold through the USB battery charging protocol, it closes the switch, conducts the USB data path inside the processor, and opens the USB battery charging protocol.

[0078] In some possible implementations of the embodiments of this application, the electronic device includes a USB logic switch, which is used for switching between USB data path, audio path and charging protocol path outside the processor;

[0079] The disconnect module 502 is specifically used for:

[0080] Switch the USB logic switch to the audio path or charging protocol path, and disconnect the USB data path outside the processor.

[0081] In some possible implementations of the embodiments of this application, the conduction module 504 is specifically used for:

[0082] Switch the USB logic switch to the external USB data path, thus enabling the external USB data path.

[0083] The data transmission device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.

[0084] The data transmission device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0085] The data transmission device provided in this application embodiment can achieve... Figures 1 to 4 The various processes implemented in the data transmission method embodiment will not be described again here to avoid repetition.

[0086] Optionally, such as Figure 6 As shown, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described data transmission method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0087] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements the embodiments of this application.

[0088] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.

[0089] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0090] The processor 710 is configured to: receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction; in response to the first instruction, disconnect the USB data path of the electronic device; receive a second instruction, wherein the second instruction includes an unlock instruction; and in response to the second instruction, unlock the electronic device and reconnect the USB data path to transmit data.

[0091] In this embodiment, by receiving a first instruction, which includes a screen lock instruction or a power off instruction; in response to the first instruction, disconnecting the USB data path of the electronic device; receiving a second instruction, which includes an unlock instruction; and in response to the second instruction, unlocking the electronic device and reconnecting the USB data path to transmit data. Thus, when the electronic device is locked or powered off, the USB data path is disconnected, and only reconnected after the electronic device is unlocked. This prevents other users from accessing data on the electronic device via the USB data path when the device is locked or powered off, thereby improving the security of data on the electronic device.

[0092] In some possible implementations of embodiments of this application, the electronic device includes a power management chip, which is connected to a switch for controlling the on or off state of a USB data path inside the processor.

[0093] The processor 710 is specifically used for:

[0094] When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the first threshold through the USB battery charging protocol, it turns on the switch, disconnects the USB data path inside the processor, and shuts down the USB battery charging protocol.

[0095] In some possible implementations of the embodiments of this application, the processor 710 is specifically used for:

[0096] When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the second threshold through the USB battery charging protocol, it closes the switch, conducts the USB data path inside the processor, and opens the USB battery charging protocol.

[0097] In some possible implementations of this application's embodiments, the electronic device includes a USB logic switch, which is used for switching between a USB data path, an audio path, and a charging protocol path external to the processor. Accordingly, the processor 710 is specifically used for:

[0098] Switch the USB logic switch to the audio path or charging protocol path, and disconnect the USB data path outside the processor.

[0099] In some possible implementations of the embodiments of this application, the processor 710 is specifically used for:

[0100] Switch the USB logic switch to the external USB data path, thus enabling the external USB data path.

[0101] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0102] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0103] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.

[0104] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described data transmission method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0105] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium, examples of which include non-transitory computer-readable media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the data transmission method provided in this application and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0107] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0108] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the data transmission method embodiment provided in this application, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0109] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0111] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A data transmission method, characterized in that, The method includes: Receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction; In response to the first instruction, the USB data path of the electronic device is disconnected; Receive a second instruction, wherein the second instruction includes an unlock instruction; In response to the second instruction, the electronic device is unlocked and the USB data path is activated to transmit data; The electronic device includes a USB logic switch, which is used for switching between the USB data path, audio path and charging protocol path outside the processor of the electronic device. Disconnecting the USB data path of the electronic device includes: Switch the USB logic switch to the audio path or the charging protocol path, and disconnect the USB data path outside the processor; Switching the USB logic switch to the audio path or the charging protocol path includes: USB device access detection is performed using the USB battery charging protocol. When the connected USB device is identified as a USB audio device, the USB logic switch is switched to the audio path; When the connected USB device is identified as a DCP device, the USB logic switch is switched to the charging protocol path; The electronic device includes a power management chip, which is connected to a switch for controlling the on or off of a USB data path inside the processor of the electronic device. Disconnecting the USB data path of the electronic device includes: When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than a first threshold via the USB battery charging protocol, it turns on the switch, disconnects the USB data path inside the processor, and shuts down the USB battery charging protocol.

2. The method according to claim 1, characterized in that, Enabling the USB data path includes: When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the second threshold through the USB battery charging protocol, it closes the switch, conducts the USB data path inside the processor, and opens the USB battery charging protocol.

3. A data transmission device, characterized in that, The device includes: The first receiving module is configured to receive a first instruction, wherein the first instruction includes a screen lock instruction or a power off instruction; Disconnect module, used to disconnect the USB data path of the electronic device in response to the first instruction; The second receiving module is used to receive a second instruction, wherein the second instruction includes an unlocking instruction; A conduction module is used to unlock the electronic device and conduct the USB data path in response to the second instruction, so as to transmit data; The electronic device includes a USB logic switch, which is used for switching between the USB data path, audio path and charging protocol path outside the processor of the electronic device. The disconnect module is specifically used for: Switch the USB logic switch to the audio path or the charging protocol path, and disconnect the USB data path outside the processor; The disconnect module is specifically used for: USB device access detection is performed using the USB battery charging protocol. When the connected USB device is identified as a USB audio device, the USB logic switch is switched to the audio path; When the connected USB device is identified as a DCP device, the USB logic switch is switched to the charging protocol path; The electronic device includes a power management chip, which is connected to a switch for controlling the on or off of a USB data path inside the processor of the electronic device. The disconnect module is specifically used for: When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than a first threshold via the USB battery charging protocol, it turns on the switch, disconnects the USB data path inside the processor, and shuts down the USB battery charging protocol.

4. The apparatus according to claim 3, characterized in that, The conduction module is specifically used for: When the power management chip detects that a USB device is connected to the electronic device and the USB bus voltage is greater than the second threshold through the USB battery charging protocol, it closes the switch, conducts the USB data path inside the processor, and opens the USB battery charging protocol.

5. The apparatus according to claim 3, characterized in that, The conduction module is specifically used for: Switch the USB logic switch to the USB data path outside the processor, thereby enabling the USB data path outside the processor.

6. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the data transmission method as described in any one of claims 1-2.