WO2017185694A1 - 电子设备以及向直连的另一电子设备提供数据的方法 - Google Patents
电子设备以及向直连的另一电子设备提供数据的方法 Download PDFInfo
- Publication number
- WO2017185694A1 WO2017185694A1 PCT/CN2016/103396 CN2016103396W WO2017185694A1 WO 2017185694 A1 WO2017185694 A1 WO 2017185694A1 CN 2016103396 W CN2016103396 W CN 2016103396W WO 2017185694 A1 WO2017185694 A1 WO 2017185694A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- electronic device
- otg
- mode
- user data
- computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0634—Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0664—Virtualisation aspects at device level, e.g. emulation of a storage device or system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Definitions
- the present application relates to the field of smart device technologies, for example, to a method for a first electronic device to provide data to a directly connected second electronic device and a first electronic device.
- USB Universal Serial Bus
- the host is Host and the slave is Device. USB data exchange can only occur between the host and the device.
- the host (Host) ) and the host (Host), and the device (Device) and device (Device) can not be interconnected, all data transmission is initiated by the host (Host), and the device (Device) is only passive responsible for answering, for example, reading
- the host (Host) issues a read command first, and the device (Device) returns the data after receiving the command.
- the computer is the host and the other USB peripherals are the devices.
- the USB OTG (On-The-Go) standard is fully compatible with the USB 2.0 standard, and the OTG standard can be used to transfer data between other USB peripherals without a computer. If the two connected USB peripherals are both OTG dual-function devices (DRD), you can switch between Host/Device. If you connect the two with OTG data cable, you can read the SD of the other device. The data in the card, but the user data partition (USER DATA) of the other device is still not recognized, and the data cannot be read from the user data partition (USER DATA) of the other device.
- DDD OTG dual-function devices
- the present application provides a method of providing data to a directly connected electronic device, and associated electronic devices, such that the electronic device is capable of reading a user data partition (USER DATA) of another directly connected electronic device.
- a user data partition (USER DATA) of another directly connected electronic device.
- a method for a first electronic device to provide data to a directly connected second electronic device is provided.
- the user data partition of the first electronic device is enumerated as a USB flash drive for the second electronic device to directly read user data from the enumerated USB flash drive.
- the first electronic device is a smart phone.
- the setting the first electronic device to the OTG device mode comprises: controlling data of the related register by using a hardware control circuit to set the first electronic device to an OTG device mode.
- a first electronic device includes: a mode control module, a request receiving module, and an enumeration module;
- the mode control module is configured to receive a command set to the OTG device mode, and set the first electronic device to an OTG device mode, so that the second electronic device connected to the first electronic device through the OTG data line Set itself to OTG host mode;
- the request receiving module is configured to receive a request from the second electronic device to read a user data partition of the first electronic device
- the enumeration module is configured to enumerate the user data partition of the first electronic device into a U disk, so that the second electronic device directly reads the user data from the enumerated U disk.
- the first electronic device is a smart phone.
- the mode control module sets the first electronic device to an OTG device mode, including: controlling, by a hardware control circuit, data of a related register to set the first electronic device to an OTG device mode.
- a first electronic device comprising at least one processor; and a memory communicatively coupled to the at least one processor, wherein the memory is stored with the at least An instruction executed by a processor for controlling the processor to operate to perform the method of any of the methods.
- non-transitory computer readable storage medium stores computer instructions for causing the computer Performing the method of any of the above.
- a computer program product comprising a computing program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, wherein the program instructions are When executed, the computer is caused to perform the method of any of the above.
- the embodiment of the present application utilizes the OTG function of the electronic device, and sets the first electronic device to the OTG device mode. If the second electronic device directly connected to the first electronic device receives the request for reading the user data partition, the first The user data partition of an electronic device itself is enumerated as a U disk, so that the second electronic device can read user data from the enumerated U disk, which is convenient for the user to use.
- FIG. 1 is a flowchart of a method for providing data by a first electronic device to a directly connected second electronic device according to an embodiment of the present application
- FIG. 2 is a block diagram of a first electronic device provided by an embodiment of the present application.
- FIG. 3 is a block diagram showing a hardware configuration of a first electronic device provided by an embodiment of the present application.
- the biometric information in the embodiment of the present application may refer to a personalized physiological characteristic of a human, such as a fingerprint, an iris, a sound, etc., and these physiological features are personalized, and thus the biometrics can be utilized. Information to identify users.
- a first embodiment of the present application provides a method for a first electronic device to provide data to a directly connected second electronic device.
- the direct connection between the first electronic device and the second electronic device may mean that the first electronic device and the second electronic device are not transferred between the third electronic device (eg, a computer), but the first electronic device and the second electronic device pass through The OTG data line is directly connected.
- the third electronic device eg, a computer
- the method includes steps 110-step 130.
- the first electronic device receives a command sent by the user to set the OTG device mode, and sets the first electronic device to the OTG device mode.
- the first electronic device can be made to pass the OTG data.
- the second electronic device connected to the line is set to the OTG host mode.
- step 120 a request to read a user data partition (USER DATA) of the first electronic device from the second electronic device is received.
- USER DATA user data partition
- step 130 after receiving the request, the user data partition (USER DATA) of the first electronic device is enumerated as a U disk, so that the second electronic device directly reads the user from the enumerated U disk. data.
- USR DATA user data partition
- the data of the relevant register may be controlled by a hardware control circuit to set the first electronic device to the OTG device mode.
- the application may also set the first electronic device to the OTG device mode in another manner.
- the embodiment of the present application utilizes the OTG function of the electronic device, and sets the first electronic device to the OTG device mode. If the second electronic device directly connected to the first electronic device receives the request for reading the user data partition, the first The user data partition of an electronic device itself is enumerated as a U disk, so that the second electronic device can read user data from the enumerated U disk, which is convenient for the user to use.
- the first electronic device and the second electronic device may be smart phones, and the smart phone supports the OTG host/device mode, and the user data area in the old smart phone can be easily read into the new smart phone by using the method. Increases the ease with which users can replace new smartphones.
- First electronic device 10 Directly connected to the second electronic device may mean that the first electronic device 10 and the second electronic device are not transferred by the third electronic device (for example, a computer), but the first electronic device 10 and the second electronic device pass the OTG data.
- the line is directly connected.
- the first electronic device 10 includes a mode control module 11, a request receiving module 12, and an enumeration module 13.
- the mode control module 11 is configured to receive a command set to the OTG device mode, and set the first electronic device 10 to the OTG device mode.
- the USB OTG negotiation mechanism may cause the first electronic device 10 to be connected through the OTG data line.
- the two electronic devices are set to the OTG host mode.
- the first electronic device and the second electronic device conform to the master-slave structure of the USB OTG, wherein the first electronic device is a Device and the second electronic device is a Host.
- the request receiving module 12 is configured to receive a request from the second electronic device to read the user data partition of the first electronic device 10.
- the enumeration module 13 is configured to, after the request receiving module 12 receives the request, enumerate the user data partition of the first electronic device 10 into a U disk, so that the second electronic device directly extracts the U disk from the enumeration The user data of the first electronic device 10 is read.
- the mode control module 11 may control the data of the relevant register through the hardware control circuit to set the first electronic device 10 to the OTG device mode.
- the first electronic device 10 can also be set to the OTG device mode in another manner.
- the embodiment of the present application utilizes the OTG function of the electronic device, and sets the first electronic device to the OTG device mode. If the second electronic device directly connected to the first electronic device receives the request for reading the user data partition, the first The user data partition of an electronic device itself is enumerated as a U disk, so that the second electronic device can read user data from the enumerated U disk, which is convenient for the user to use.
- the first electronic device and the second electronic device may be smart phones, and the smart phone supports the OTG host/device mode, and the user data area in the old smart phone can be easily read into the new smart phone by using the method. It improves the user's ease of replacing a new smartphone and drives users to purchase a smartphone.
- an embodiment of the present application provides a first electronic device 30, which may include at least one processor 3010 and a memory 3020 for communicating with the at least one processor, wherein the memory 3020 is configured to store instructions.
- the instructions are used to control the processor 3010 to operate to perform the method of the first embodiment.
- the first electronic device 30 may also include an interface device 3030, a communication device 3040, a display device 3050, an input device 3060, a speaker 3070, a microphone 3080, and the like.
- the processor 3010 can be, for example, a central processing unit CPU, a microprocessor MCU, or the like.
- the memory 3020 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a nonvolatile memory such as a hard disk, and the like.
- the interface device 3030 includes, for example, a USB interface, an OTG interface, a headphone interface, and the like.
- the communication device 3040 can, for example, be capable of wired or wireless communication, and the communication device 3040 should include a WIFI communication module and a mobile data communication module (eg, a SIM card).
- the display device 3050 is, for example, a liquid crystal display, a touch display, or the like.
- Input device 3060 can include, for example, a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 3070 and the microphone 3080.
- FIG. 3 is merely illustrative and is in no way intended to limit the application or use of the present application, as well as embodiments of the present application. It will be understood by those skilled in the art that although a plurality of devices are illustrated in FIG. 3, embodiments of the present application may relate only to some of the devices therein.
- the application can be a system, method and/or computer program product.
- the computer program product can include a non-transitory computer readable storage medium having computer readable program instructions for causing a processor to implement an embodiment of the present application.
- the computer readable storage medium can be a tangible device that can hold and store the instructions used by the instruction execution device.
- the computer readable storage medium can be, for example, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- the computer readable storage medium may include: a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), a static random access memory ( SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, a punch card or a concave structure in a groove on which an instruction is stored, And any suitable combination of the above.
- RAM random access memory
- ROM read only memory
- EPROM or flash memory erasable programmable read only memory
- SRAM static random access memory
- CD-ROM compact disk read only memory
- DVD digital versatile disk
- memory stick floppy disk
- mechanical encoding device for example, a punch card or a concave structure in a groove on which an instruction is stored, And any suitable combination of the above.
- a computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
- the computer readable program instructions described herein can be downloaded to a plurality of computing/processing devices from a computer readable storage medium or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
- the network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
- a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards
- the computer readable program instructions are for storage in a computer readable storage medium in each computing/processing device.
- Computer program instructions for performing the operations of the present application can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
- the computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. carried out.
- the remote computer can be connected to the user's computer via any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider to access the Internet) connection).
- the customized electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by utilizing state information of computer readable program instructions.
- Computer readable program instructions are executed to implement various aspects of the present invention.
- the computer readable program instructions can be provided to a general purpose computer, a special purpose computer, or a processor of other programmable data processing apparatus to produce a machine such that when executed by a processor of a computer or other programmable data processing apparatus Means for implementing the functions/acts specified in one or more of the blocks of the flowcharts and/or block diagrams.
- the computer readable program instructions can also be stored in a computer readable storage medium that causes the computer, programmable data processing device, and/or other device to operate in a particular manner, such that the computer readable medium storing the instructions includes An article of manufacture that includes instructions for implementing various aspects of the functions/acts recited in one or more of the flowcharts.
- the computer readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device to perform a series of operational steps on a computer, other programmable data processing device or other device to produce a computer-implemented process.
- instructions executed on a computer, other programmable data processing apparatus, or other device implement the functions/acts recited in one or more of the flowcharts and/or block diagrams.
- each block in the flowchart or block diagram can represent a module, a program segment, or a portion of an instruction that includes one or more components for implementing the specified logical functions.
- Executable instructions can also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
- the embodiment of the present application provides a method for a first electronic device to provide data to a directly connected second electronic device and a first electronic device capable of reading a user data partition of the directly connected electronic device.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
- Telephone Function (AREA)
Abstract
一种第一电子设备向直连的第二电子设备提供数据的方法和第一电子设备。包括:接收设置为OTG device模式的命令,将所述第一电子设备设置为OTG device模式,以使得与所述第一电子设备通过OTG数据线连接的第二电子设备将自身设置为OTG host模式;接收从所述第二电子设备发来的读取所述第一电子设备的用户数据分区的请求;将所述第一电子设备的用户数据分区枚举为一个U盘,以供所述第二电子设备直接从枚举出的U盘中读取用户数据。
Description
本申请要求在2016年4月29日提交中国专利局、申请号为201610285308.4、发明名称为“电子设备、向直连的另一电子设备提供数据的方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及智能设备技术领域,例如涉及第一电子设备向直连的第二电子设备提供数据的方法和第一电子设备。
通用串行总线(Universal Serial Bus,USB)是一种主从结构,主机为Host,从机为Device,USB的数据交换只能发生在主机(Host)和设备(Device)之间,主机(Host)和主机(Host)、以及设备(Device)和设备(Device)之间不能互连,所有的数据传输都由主机(Host)主动发起,而设备(Device)只是被动的负责应答,例如,在读数据时,主机(Host)先发出读命令,设备(Device)收到该命令后,才返回数据。通常情况下,电脑为主机(Host),其它USB外设为设备(Device)。
USB OTG(On-The-Go)标准完全兼容USB2.0标准,可以利用OTG标准在没有电脑的情况下,实现其它USB外设之间的数据传送。如果相连的两个USB外设都是OTG双功能设备(Dual-Role Device,DRD),都可以在Host/Device之间切换,将两者用OTG数据线连接,就可以读取对方设备的SD卡中的数据,但仍然无法识别到对方设备的用户数据分区(USER DATA),也不能从对方设备的用户数据分区(USER DATA)中读取数据。
发明内容
本申请提供向直连的电子设备提供数据的方法、以及相关电子设备,使得电子设备能够读取直连的另一电子设备的用户数据分区(USER DATA)。
根据本申请实施例的第一方面,提供了一种第一电子设备向直连的第二电子设备提供数据的方法,应用于第一电子设备中,包括:
接收设置为OTG device模式的命令,将所述第一电子设备设置为OTG device
模式,以使得与所述第一电子设备通过OTG数据线连接的第二电子设备将自身设置为OTG host模式;
接收从所述第二电子设备发来的读取所述第一电子设备的用户数据分区的请求;以及
将所述第一电子设备的用户数据分区枚举为一个U盘,以供所述第二电子设备直接从枚举出的U盘中读取用户数据。
可选地,所述第一电子设备为智能手机。
可选地,所述将第一电子设备设置为OTG device模式,包括:通过硬件控制电路控制相关寄存器的数据,以将所述第一电子设备设置为OTG device模式。
根据本申请实施例的第二方面,提供了一种第一电子设备,包括:模式控制模块、请求接收模块、以及枚举模块;
所述模式控制模块,设置为接收设置为OTG device模式的命令,将所述第一电子设备设置为OTG device模式,以使得与所述第一电子设备通过OTG数据线连接的第二电子设备将自身设置为OTG host模式;
所述请求接收模块,设置为接收从所述第二电子设备发来的读取所述第一电子设备的用户数据分区的请求;以及
所述枚举模块,设置为将所述第一电子设备的用户数据分区枚举为一个U盘,以供所述第二电子设备直接从枚举出的U盘中读取用户数据。
可选地,所述第一电子设备为智能手机。
可选地,所述模式控制模块将所述第一电子设备设置为OTG device模式,包括:通过硬件控制电路控制相关寄存器的数据,以将所述第一电子设备设置为OTG device模式。
根据本申请实施例的第三方面,提供了一种第一电子设备,包括至少一个处理器;以及与所述至少一个处理器通信连接的存储器,其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令用于控制所述处理器进行操作以执行任一项所述的方法。
根据本申请实施例的第四方面,还提供了一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行上述的任一项所述的方法。
根据本申请实施例的第五方面,还提供了一种计算机程序产品,包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任一项所述的方法。
本申请实施例利用了电子设备的OTG功能,将第一电子设备设置为OTG device模式,如果接收到与该第一电子设备直连的第二电子设备读取用户数据分区的请求,就将第一电子设备自身的用户数据分区枚举为一个U盘,这样第二电子设备就可以从枚举出的U盘中读取用户数据,方便了用户的使用。
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1示出了本申请实施例提供的第一电子设备向直连的第二电子设备提供数据的方法的流程图;
图2示出了本申请实施例提供的第一电子设备的框图;以及
图3示出了本申请实施例提供的第一电子设备的硬件配置的框图。
为使本发明的目的、技术方案和优点更加清楚,以下将参照本申请实施例中的附图,通过实施方式清楚、完整地描述本申请的技术方案,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。在不冲突的情况下,以下实施例和实施例中的特征可以相互组合。
参照附图来详细描述本申请示例性实施例。应注意到:除非另外说明,在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本申请的范围。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本申请及其应用或使用的任何限制。
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中可以不对相似的标号和字母进行相关讨论。
本申请实施例中的生物识别信息,可以是指人类的个性化生理特征,例如指纹、虹膜、声音等,这些生理特征是个性化的,因此可以利用这些生物识别
信息来识别用户。
<实施例一>
参考图1所示,本申请实施例一提供了一种第一电子设备向直连的第二电子设备提供数据的方法。
第一电子设备和第二电子设备直连,可以是指第一电子设备和第二电子设备之间不经过第三电子设备(例如电脑)中转,而是第一电子设备和第二电子设备通过OTG数据线直接连接。
该方法包括步骤110-步骤130。
在步骤110中,第一电子设备接收用户发来的设置成OTG device模式的命令,将第一电子设备设置为OTG device模式,由于USB OTG的协商机制,可以使得与第一电子设备通过OTG数据线连接的第二电子设备设置为OTG host模式。在步骤110完成后,第一电子设备和第二电子设备符合USB OTG的主从结构,其中第一电子设备为Device,第二电子设备为Host。
在步骤120中,接收从第二电子设备发来的读取第一电子设备的用户数据分区(USER DATA)的请求。
在步骤130中,接收到所述请求后,将第一电子设备的用户数据分区(USER DATA)枚举为一个U盘,以供第二电子设备直接从枚举出的U盘中读取用户数据。
可选地,在步骤110中,可以通过硬件控制电路控制相关寄存器的数据,从而将第一电子设备设置为OTG device模式。本申请还可以采用别的方式将第一电子设备设置为OTG device模式。
本申请实施例利用了电子设备的OTG功能,将第一电子设备设置为OTG device模式,如果接收到与该第一电子设备直连的第二电子设备读取用户数据分区的请求,就将第一电子设备自身的用户数据分区枚举为一个U盘,这样第二电子设备就可以从枚举出的U盘中读取用户数据,方便了用户的使用。
可选地,第一电子设备和第二电子设备可以为智能手机,智能手机多支持OTG host/device模式,可以利用本方法将旧智能手机中的用户数据区轻易地读取到新智能手机中,提升了用户更换新智能手机的容易性。
<实施例二>
参考图2所示,本申请实施例二提供了第一电子设备10。第一电子设备10
和第二电子设备直连,可以是指第一电子设备10和第二电子设备之间不经过第三电子设备(例如电脑)中转,而是第一电子设备10和第二电子设备通过OTG数据线直接连接。
第一电子设备10包括模式控制模块11、请求接收模块12、以及枚举模块13。
模式控制模块11,设置为接收设置为OTG device模式的命令,将第一电子设备10设置为OTG device模式,由于USB OTG的协商机制,会使得与第一电子设备10通过OTG数据线连接的第二电子设备设置为OTG host模式。这一过程完成后,第一电子设备和第二电子设备符合USB OTG的主从结构,其中第一电子设备为Device,第二电子设备为Host。
请求接收模块12,设置为接收从第二电子设备发来的读取第一电子设备10的用户数据分区的请求。
枚举模块13,设置为在请求接收模块12接收到所述请求后,将第一电子设备10的用户数据分区枚举为一个U盘,以供第二电子设备直接从枚举出的U盘中读取第一电子设备10的用户数据。
可选地,模式控制模块11可以通过硬件控制电路控制相关寄存器的数据,从而将第一电子设备10设置为OTG device模式。本申请实施例还可以采用别的方式将第一电子设备10设置为OTG device模式。
本申请实施例利用了电子设备的OTG功能,将第一电子设备设置为OTG device模式,如果接收到与该第一电子设备直连的第二电子设备读取用户数据分区的请求,可以将第一电子设备自身的用户数据分区枚举为一个U盘,这样第二电子设备就可以从枚举出的U盘中读取用户数据,方便了用户的使用。
可选地,第一电子设备和第二电子设备可以为智能手机,智能手机多支持OTG host/device模式,可以利用本方法将旧智能手机中的用户数据区轻易地读取到新智能手机中,提升了用户更换新智能手机的容易性,驱动用户购买智能手机。
<实施例三>
参考图3所示,本申请实施例提供了一种第一电子设备30,可以包括至少一个处理器3010和用于与该至少一个处理器通信连接的存储器3020,其中,存储器3020用于存储指令,所述指令用于控制处理器3010进行操作以执行实施例一中的方法。
第一电子设备30还可以包括接口装置3030、通信装置3040、显示装置3050、输入装置3060、扬声器3070、麦克风3080,等等。
处理器3010例如可以是中央处理器CPU、微处理器MCU等。存储器3020例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接口装置3030例如包括USB接口、OTG接口、耳机接口等。通信装置3040例如能够进行有线或无线通信,通信装置3040应当包括WIFI通信模块和移动数据通信模块(例如SIM卡)。显示装置3050例如是液晶显示屏、触摸显示屏等。输入装置3060例如可以包括触摸屏、键盘等。用户可以通过扬声器3070和麦克风3080输入/输出语音信息。
图3所示的电子设备仅是解释性的,并且决不是为了要限制本申请、以及本申请实施例的应用或用途。本领域技术人员应当理解,尽管在图3中示出了多个装置,但是,本申请实施例可以仅涉及其中的部分装置。
本申请可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括非暂态计算机可读存储介质,该非暂态计算机可读存储介质上载有用于使处理器实现本申请实施例的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的可以包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到多个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发
该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本申请操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言-诸如Smalltalk、C++等,以及常规的过程式编程语言-诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络-包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。
这里参照根据本申请实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请实施例的多个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本申请的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。
以上已经描述了本申请可选实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的每个实施例。
本申请实施例提供了一种第一电子设备向直连的第二电子设备提供数据的方法和第一电子设备,能够读取直连的电子设备的用户数据分区。
Claims (9)
- 一种第一电子设备向直连的第二电子设备提供数据的方法,应用于第一电子设备,包括:接收设置为OTG设备device模式的命令,将所述第一电子设备设置为OTG device模式,以使得与所述第一电子设备通过OTG数据线连接的第二电子设备将自身设置为OTG主机host模式;接收从所述第二电子设备发来的读取所述第一电子设备的用户数据分区的请求;以及将所述第一电子设备的用户数据分区枚举为一个U盘,以供所述第二电子设备直接从枚举出的U盘中读取用户数据。
- 根据权利要求1所述的方法,其中,所述第一电子设备为智能手机。
- 根据权利要求1所述的方法,其中,所述将第一电子设备设置为OTG device模式,包括:通过硬件控制电路控制相关寄存器的数据,以将所述第一电子设备设置为OTG device模式。
- 一种第一电子设备,包括模式控制模块、请求接收模块、以及枚举模块;所述模式控制模块,设置为接收设置为OTG device模式的命令,将所述第一电子设备设置为OTG device模式,以使得与所述第一电子设备通过OTG数据线连接的第二电子设备将自身设置为OTG host模式;所述请求接收模块,设置为接收从所述第二电子设备发来的读取所述第一电子设备的用户数据分区的请求;以及所述枚举模块,设置为将所述第一电子设备的用户数据分区枚举为一个U盘,以供所述第二电子设备直接从枚举出的U盘中读取用户数据。
- 根据权利要求4所述的第一电子设备,其中,所述第一电子设备为智能手机。
- 根据权利要求4所述的第一电子设备,其中,所述模式控制模块将所述第一电子设备设置为OTG device模式,包括:通过硬件控制电路控制相关寄存器的数据,以将所述第一电子设备设置为 OTG device模式。
- 一种第一电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器,其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令用于控制所述处理器进行操作以执行根据权利要求1-3任一项所述的方法。
- 一种非暂态计算机可读存储介质,其中,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-3任一项所述的方法。
- 一种计算机程序产品,包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-3任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610285308.4 | 2016-04-29 | ||
| CN201610285308.4A CN105955666A (zh) | 2016-04-29 | 2016-04-29 | 电子设备、向直连的另一电子设备提供数据的方法 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017185694A1 true WO2017185694A1 (zh) | 2017-11-02 |
Family
ID=56913487
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/103396 Ceased WO2017185694A1 (zh) | 2016-04-29 | 2016-10-26 | 电子设备以及向直连的另一电子设备提供数据的方法 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105955666A (zh) |
| WO (1) | WO2017185694A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105955666A (zh) * | 2016-04-29 | 2016-09-21 | 乐视控股(北京)有限公司 | 电子设备、向直连的另一电子设备提供数据的方法 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201084144Y (zh) * | 2007-04-27 | 2008-07-09 | 桂林海威科技有限公司 | Usb自由通道 |
| CN102662897A (zh) * | 2012-03-31 | 2012-09-12 | 北京壹人壹本信息科技有限公司 | 一种移动终端以及移动终端之间数据交互的方法 |
| CN103019981A (zh) * | 2012-11-16 | 2013-04-03 | 深圳市文鼎创数据科技有限公司 | 信号转接控制方法及信号转接装置 |
| CN103294625A (zh) * | 2012-09-24 | 2013-09-11 | 天津思博科科技发展有限公司 | 一种用于移动电话或掌上电脑的采集终端usb接口模块的实现 |
| CN104572564A (zh) * | 2015-01-13 | 2015-04-29 | 上海动联信息技术股份有限公司 | 一种实现android移动设备与USB OTG主机通讯的方法 |
| CN105955666A (zh) * | 2016-04-29 | 2016-09-21 | 乐视控股(北京)有限公司 | 电子设备、向直连的另一电子设备提供数据的方法 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7214089B1 (en) * | 2006-01-13 | 2007-05-08 | I/O Interconnect Inc. | Universal serial bus On-The-Go apparatus |
| CN101500325A (zh) * | 2008-02-01 | 2009-08-05 | 上海晨兴电子科技有限公司 | 使用usb电缆实现手机互连共享信息的方法 |
| CN101764877A (zh) * | 2009-12-18 | 2010-06-30 | 康佳集团股份有限公司 | 一种两部手机互传数据的方法 |
| CN102325223A (zh) * | 2011-09-13 | 2012-01-18 | 深圳桑菲消费通信有限公司 | 手机间进行数据传输的方法 |
-
2016
- 2016-04-29 CN CN201610285308.4A patent/CN105955666A/zh active Pending
- 2016-10-26 WO PCT/CN2016/103396 patent/WO2017185694A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201084144Y (zh) * | 2007-04-27 | 2008-07-09 | 桂林海威科技有限公司 | Usb自由通道 |
| CN102662897A (zh) * | 2012-03-31 | 2012-09-12 | 北京壹人壹本信息科技有限公司 | 一种移动终端以及移动终端之间数据交互的方法 |
| CN103294625A (zh) * | 2012-09-24 | 2013-09-11 | 天津思博科科技发展有限公司 | 一种用于移动电话或掌上电脑的采集终端usb接口模块的实现 |
| CN103019981A (zh) * | 2012-11-16 | 2013-04-03 | 深圳市文鼎创数据科技有限公司 | 信号转接控制方法及信号转接装置 |
| CN104572564A (zh) * | 2015-01-13 | 2015-04-29 | 上海动联信息技术股份有限公司 | 一种实现android移动设备与USB OTG主机通讯的方法 |
| CN105955666A (zh) * | 2016-04-29 | 2016-09-21 | 乐视控股(北京)有限公司 | 电子设备、向直连的另一电子设备提供数据的方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105955666A (zh) | 2016-09-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106257410B (zh) | 用于声音辅助输入的多模式消岐的方法、电子装置和设备 | |
| CN107077464B (zh) | 电子设备和用于其口头交互的方法 | |
| US9743226B2 (en) | Method for short-range wireless communication and electronic device using the same | |
| US10827067B2 (en) | Text-to-speech apparatus and method, browser, and user terminal | |
| KR102248474B1 (ko) | 음성 명령 제공 방법 및 장치 | |
| EP3040985B1 (en) | Electronic device and method for voice recognition | |
| US10261683B2 (en) | Electronic apparatus and screen display method thereof | |
| US20190228217A1 (en) | Method, apparatus and device for waking up voice interaction function based on gesture, and computer readable medium | |
| US9888061B2 (en) | Method for organizing home screen and electronic device implementing the same | |
| CN104699236A (zh) | 利用境况解释自然语言语音识别命令 | |
| EP3444811B1 (en) | Speech recognition method and device | |
| CN107870899A (zh) | 信息处理方法、信息处理设备及程序产品 | |
| CN106020434B (zh) | 人机接口设备输入融合的方法、设备及产品 | |
| CN104700834A (zh) | 信息处理方法及信息处理装置 | |
| US9959598B2 (en) | Method of processing image and electronic device thereof | |
| CN107133245A (zh) | 状态信息管理系统、方法及电子设备 | |
| US20150280933A1 (en) | Electronic device and connection method thereof | |
| WO2017185694A1 (zh) | 电子设备以及向直连的另一电子设备提供数据的方法 | |
| WO2017185693A1 (zh) | 电子设备以及从直连的另一电子设备中复制数据的方法 | |
| US10430046B2 (en) | Electronic device and method for processing an input reflecting a user's intention | |
| CN110991431A (zh) | 人脸识别方法、装置、设备及存储介质 | |
| CN106446110B (zh) | 一种终端搬家连接安全性的实现方法及装置 | |
| CN106507268B (zh) | 一种手机搬家中动态验证的方法及装置 | |
| US20160048498A1 (en) | Method for providing alternative service and electronic device thereof | |
| CN106503511A (zh) | 一种提高手机搬家密码校验安全性的方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16900202 Country of ref document: EP Kind code of ref document: A1 |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16900202 Country of ref document: EP Kind code of ref document: A1 |