WO2022083507A1 - 设备间联通方法、电子设备、及计算机可读存储介质 - Google Patents

设备间联通方法、电子设备、及计算机可读存储介质 Download PDF

Info

Publication number
WO2022083507A1
WO2022083507A1 PCT/CN2021/124006 CN2021124006W WO2022083507A1 WO 2022083507 A1 WO2022083507 A1 WO 2022083507A1 CN 2021124006 W CN2021124006 W CN 2021124006W WO 2022083507 A1 WO2022083507 A1 WO 2022083507A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
usb
mode
module
communication
Prior art date
Application number
PCT/CN2021/124006
Other languages
English (en)
French (fr)
Inventor
梁勇
毛宇锋
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21881925.8A priority Critical patent/EP4213532A4/en
Priority to US18/249,466 priority patent/US20230370420A1/en
Publication of WO2022083507A1 publication Critical patent/WO2022083507A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a method for communicating between devices, an electronic device, and a computer-readable storage medium.
  • Multi-screen collaboration is a distributed technology. The purpose is to achieve cross-system and cross-device collaboration, connect mobile phones with computers and tablets, and realize resource sharing and collaborative operation. Multi-screen collaboration is not only the mutual transfer of files between tablet/computer and mobile phone, but also utilizes the computing power and professional system capabilities of tablet/computer to realize seamless collaboration between tablet/computer and mobile phone. Design, complete the tasks of two devices on one large-screen device, reply to WeChat, reply to emails, etc., and also use the more professional application ecology of tablet/computer to realize more applications.
  • Methods for realizing multi-screen collaboration between devices include wired methods, such as connecting through a USB cable and communicating based on the USB protocol.
  • this method cannot get through the IP layer, which makes the data transmission speed difficult to meet the requirements.
  • the present application provides a method for communicating between devices, for communicating between a first electronic device and a second electronic device based on a USB module of the first electronic device, by virtualizing the first electronic device into a USB network card , can open up the IP layer between the first electronic device and the second electronic device, make the data transmission between the first electronic device and the second electronic device more rapid, and cut off the movement of the second electronic device using the first electronic device.
  • the communication module such as the cellular module or the WIFI module, provides access to the Internet, which can avoid the problem that the second electronic device uses the network of the first electronic device to surf the Internet and steal traffic.
  • the first electronic device can be any terminal device with a USB interface and a mobile communication module, such as a mobile phone and a tablet computer, and can realize IP layer communication
  • the second electronic device can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, an intelligent Any terminal device with USB interface that can realize IP layer communication, such as TV and large-screen TV.
  • the first electronic device may also belong to one of the second electronic devices, that is to say, the communication method between devices of the present application can be executed, for example, between a mobile phone and a mobile phone, or between a mobile phone and a laptop computer and many more.
  • the present application provides a method for communicating between devices, for communicating between a first electronic device and a second electronic device based on a USB module of the first electronic device, including: the first electronic device starts the first electronic device.
  • a communication mode the first communication mode is used for IP layer communication between the first electronic device and the second electronic device; the first electronic device is the first electronic device and the second electronic device
  • the device assigns an IP address; the first electronic device receives data from the second electronic device, and the first electronic device stops transmitting the data to the mobile communication module of the first electronic device.
  • the first electronic device and the second electronic device are connected by using USB, and the IP address allocation, open up the IP layer between the first electronic device and the second electronic device, realize IP layer communication, and at the same time, stop transmitting the data received from the second electronic device via the USB module to the The mobile communication module of the first electronic device, that is, to stop forwarding the request sent by the second electronic device to enjoy the mobile network of the first electronic device to the mobile communication module of the first electronic device, thereby preventing the second electronic device from using Internet access of the first electronic device.
  • the USB P2P mode is a communication mode in which IP layer communication is realized between the first electronic device and the second electronic device, and at the same time, the network is not shared between the first electronic device and the second electronic device.
  • the first electronic device uses a DHCP function to assign IP addresses to the first electronic device and the second electronic device via the USB module.
  • DHCP Dynamic Host Configuration Protocol
  • Dynamic Host Configuration Protocol is a network protocol of a local area network, which refers to a range of IP addresses controlled by the server. When the client logs in to the server, it can automatically obtain the IP address and subnet mask assigned by the server.
  • DHCP is usually used in large-scale local area network environments. Its main function is to centrally manage and assign IP addresses, so that hosts in the network environment can dynamically obtain IP addresses, Gateway addresses, DNS server addresses and other information, and can improve the use of addresses. Rate.
  • the DHCP protocol adopts a client/server model, and the task of dynamically assigning host addresses is driven by network hosts.
  • the DHCP server When the DHCP server receives the address information from the network host, it will send the relevant address configuration and other information to the network host, so as to realize the dynamic configuration of the address information of the network host.
  • the DHCP protocol uses UDP as the transmission protocol. The host sends a request message to the DHCP server, and the DHCP server responds with a response message to the host.
  • DNSmasq As the software for executing the DHCP protocol, for example, DNSmasq software is included but not limited to.
  • DNSmasq is a small and convenient tool for configuring DNS and DHCP for small networks, it provides DNS functionality and optional DHCP functionality. It serves only locally applicable domain names that do not appear in global DNS servers. DNSmasq puts Internet addresses and address-domain name mappings in the cache, which reduces the burden on the server and improves performance (especially in modem connections). Additionally, DNSmasq can be configured to automatically obtain address information from upstream DNS servers using PPP or DHCP configuration requests, and it will automatically reload this information if the information changes.
  • the method further includes: mirroring and displaying the desktop of the first electronic device on the second electronic device on the same screen, so as to realize the connection between the first electronic device and the second electronic device.
  • Multi-screen collaboration of electronic devices That is to say, the method for communicating between devices in the first aspect of the present application can be used to realize multi-screen collaboration between devices.
  • the first electronic device includes any one of a mobile phone and a tablet computer
  • the second electronic device includes a mobile phone, a tablet computer, a notebook computer, a desktop computer, and a smart TV.
  • the inter-device communication method according to the present application can be used for the communication between a mobile phone and any one of a mobile phone, a tablet computer, a notebook computer, a desktop computer, and a smart TV, and can also be used for a tablet computer and a mobile phone or a notebook computer, etc. Any connection between and so on.
  • the assigning IP addresses to the first electronic device and the second electronic device via the USB module includes: the first electronic device makes the USB module Work in RNDIS mode to virtualize the first electronic device into a USB network card; based on the DHCP function, assign an IP address to the USB module; the USB module assigns the IP address to the first electronic device and the USB module respectively. the second electronic device.
  • the first electronic device is virtualized as a USB network card, and then IP addresses are respectively allocated to the first electronic device and the second electronic device through the USB module through the DHCP function.
  • the IP layer communication is realized between the first electronic device and the second electronic device.
  • virtualizing the first electronic device into a USB network card can be realized based on RNDIS (Remote Network Driver Interface Specification, remote network driver interface specification), and specifically the USB module of the first electronic device can be set to RNDIS mode to realize, which In essence, the first electronic device runs TCP/IP on the first electronic device through the USB module, so that the first electronic device looks like a network card.
  • RNDIS Remote Network Driver Interface Specification, remote network driver interface specification
  • the USB module of the first electronic device can be set to RNDIS mode to realize, which In essence, the first electronic device runs TCP/IP on the first electronic device through the USB module, so that the first electronic device looks like a network card.
  • RNDIS Remote Network Driver Interface Specification, remote network driver interface specification
  • the DHCP function is used to first distribute the IP address to the USB module, and then the USB module assigns the IP address to the first electronic device and the second electronic device respectively. Thereby, the mobile device and the second electronic device can communicate at the IP layer through the USB module based on the assigned IP address.
  • the first electronic device stops transmitting the data to the mobile communication module of the first electronic device by setting a forwarding rule.
  • a forwarding rule Specifically, for example, port mapping can be set on a router, and then it is implemented by adding a service port and selecting an IP address.
  • the first electronic device displays an option to activate the first communication mode, the first electronic device receives an operation on the option; the operation of the option, the first electronic device starts the first communication mode. That is, for example, after the first electronic device detects that the external second electronic device is connected through the USB module, it actively sends out a request to start the first connection mode, for example, jumps out of the USB P2P connection interface, and the user can use the Click OK to start the USB P2P mode.
  • the first electronic device starts the first communication mode according to a request received from at least one application running on the first electronic device. That is to say, in addition to the above-mentioned startup method, the application can also be opened according to the request of one or more applications running on the first electronic device, for example, when the application needs to be run in a multi-screen collaborative situation At the same time, it will trigger the request sent by the application to start the USB P2P mode, according to which the USB P2P mode can be set.
  • the first electronic device when multiple applications request to activate the first communication mode, after the last application is closed, the first electronic device closes the first communication mode. That is to say, when multiple applications need to run in USB P2P mode, when one of the applications is closed, it will not exit the USB P2P mode immediately, but continue to enable the USB P2P mode, so that other applications that are still running continue to be in the USB P2P mode. In the normal operation state, until the last application requesting to start the USB P2P mode is closed, the first electronic device automatically turns off the USB P2P mode.
  • the method includes: recording each application that sends the request.
  • the identifier of the application is established, and a list is established; when the process in which the first application is located ends, the identifier corresponding to the first application is cleared from the list until no identifier exists in the list, and the first electronic device closes the The first connection mode.
  • USB P2P mode For each application that initiates the USB P2P mode, a list is established by recording its identity. When the process of one of the applications ends, the identity of the application is cleared in the general list, so that the needs of the process can be accurately determined.
  • Manage the applications in the USB P2P mode which can effectively avoid the unnecessary impact of turning off the USB P2P mode on the running applications. In this way, it is possible to manage multiple applications at the same time to enable and disable the USB P2P mode. Different applications are independent of each other and do not need to be sensed. When multiple applications require the USB P2P mode to be activated, the first electronic device only needs to be turned on once. There will be no waste of resources. When multiple applications exit the process one by one, as long as one of them does not end the process, the USB P2P mode will not be closed.
  • the method further includes: when the first electronic device receives a request to start the second connection mode, the first electronic device causes the USB module to receive a request from The data of the second electronic device can be transmitted to the mobile communication module of the first electronic device, wherein the second communication mode shares the mobile network of the first electronic device with the second electronic device.
  • the second communication mode is actually a mobile network in which the second electronic device shares the first electronic device, that is, a so-called shared network mode, such as a USB tethering mode.
  • the first electronic device enables the data received by the USB module from the second electronic device to be transmitted to the mobile communication module of the first electronic device, that is, the first electronic device turns on the data from its USB module to transfer the data to the mobile communication module of the first electronic device.
  • the channel through which the received data packet is sent to its mobile communication module.
  • the request for sharing the mobile network sent by the second electronic device to the first electronic device can be forwarded to the mobile communication module of the first electronic device, such as a cellular module or a WIFI module , when the mobile communication module receives the request, it performs related configuration of the shared network, so that the second electronic device can share the network of the first electronic device.
  • the mobile communication module such as a cellular module or a WIFI module
  • the mobile communication module receives the request, it performs related configuration of the shared network, so that the second electronic device can share the network of the first electronic device.
  • the channel for transmitting the data received via the USB module to the mobile communication module of the first electronic device is opened, so that the second electronic device can share the first electronic device mobile network.
  • the first electronic device provides two communication modes at the same time, namely the USB P2P mode and the USB Tethering mode, while for the inside of the first electronic device, the two modes are actually merged at the same time.
  • the request to start the second communication mode can be started through the setting module, or through the application on the first electronic device, etc.
  • the request to start the first communication mode here A detailed description thereof is omitted.
  • the USB module in the case that all applications requesting to start the first communication mode are closed, it is further detected whether the second communication mode is in the activated state.
  • the USB module continues to act as a virtual network card until the second connection mode is turned off. That is to say, even if all applications requesting the USB P2P mode exit the process, if it is detected that an application is enabling the USB Tethering mode, the USB module will not be turned off as a virtual network card, that is to say, the USB Tethering mode will continue until until the USB Tethering mode is turned off.
  • the first electronic device switches between the first communication mode and the second communication mode based on a request of a running application. Because the states of USB P2P and USB Tethering are coupled and conflict occurs, in order to solve the replacement between these two states, it is possible to switch between USB P2P and USB Tethering based on the request of the running application. Avoid state conflicts between USB P2P and USB Tethering, enabling collaboration, conversion, etc. between USB P2P and USB Tethering.
  • the present application provides an electronic device, comprising a touch screen, a memory, one or more processors, and multiple application programs, wherein the electronic device further includes one or more methods for executing inter-device communication A program, wherein the one or more programs for executing the inter-device communication method are stored in the memory, and when the one or more processors are executing the one or more inter-device communication methods When the program is executed, the electronic device is made to implement the inter-device communication method of any one of the possible implementation manners of the first aspect.
  • the present application further provides a computer-readable storage medium, which is characterized by comprising computer instructions, which, when the computer instructions are executed on an electronic device, cause the processor to execute any one of the above-mentioned first aspects A method of communication between devices of possible implementations.
  • the present application further provides an electronic device, the electronic device includes a USB module, a mobile communication module and a communication module, the communication module is used for IP layer communication between the electronic device and other electronic devices, the The communication module includes a connection manager, and the connection manager is used to start the first communication mode, assign IP addresses to the electronic device and all other electronic devices respectively, and make the electronic device stop receiving data via the USB module. Data is transmitted to the mobile communication module.
  • the present application starts the first communication mode by setting the communication module in the application framework layer of the electronic device.
  • the connection module includes a connection manager, and the connection manager performs connection setting of the first connection mode. That is, the connection manager starts the USB P2P mode, performs IP address allocation, and stops the electronic device from transmitting the data received via the USB module to the mobile communication module.
  • the electronic device uses the DHCP function to assign IP addresses to the electronic device and other electronic devices via the USB module.
  • the electronic device further includes a USB management module and a network management module
  • the connection manager is further configured to send a message to the USB management module for setting the USB module to the RNDIS mode request
  • the USB management module is configured to receive the request and set the USB module to the RNDIS mode based on the request, so as to virtualize the electronic device into a USB network card
  • the connection manager is further configured to utilize the DHCP function , assigning an IP address to the USB module and sending it to the network management module, and the network management module assigns the IP address to the electronic device and other electronic devices connected to the electronic device respectively.
  • connection manager connects the USB management module and the network management module respectively, the connection manager enables the USB P2P mode according to the instruction of starting the USB P2P mode, and thereafter, the connection manager instructs the USB management module to set the USB module to the RNDIS mode, and , the connection manager assigns an IP address to the USB module, and assigns it to the electronic device and other electronic devices connected to the electronic device through the network management module.
  • the successful opening of the USB P2P mode is completed.
  • connection manager stops transmitting the data received via the USB module to the mobile communication module of the electronic device by setting a forwarding rule.
  • the communication module further includes: an external monitoring manager, the external monitoring manager is configured to, when it is detected that other electronic devices are connected to the electronic device via the USB module, The display of the electronic device is caused to display an option to activate the first communication mode, and the connection manager activates the first communication mode based on the received operation on the option.
  • the external monitoring module is used to notify the corresponding module when the state of the USB changes. For example, when it is detected that other electronic devices are connected to the electronic device via the USB module, it sends a request to the connection manager to start the USB P2P mode.
  • the external monitoring module can also be used for, for example, managing external users, including setting the setting of the module, managing the interface calls of other applications, and the like.
  • the connection manager is configured to start the first communication mode according to a request received from at least one application running on the electronic device. That is to say, in addition to prompting the user to start the USB P2P mode after detecting that the state of the USB has changed, the USB P2P mode can also be triggered to start the USB P2P mode based on at least one application running on the electronic device.
  • the connection management when multiple applications request to start the first connection mode, is further configured to close the first connection after detecting that the last application is closed model. In this way, it is possible to manage multiple applications at the same time to turn on and off the USB P2P mode. Different applications are independent of each other and do not need to be aware of each other. Causes a waste of resources; in addition, when multiple applications exit the process successively and require to close the USB P2P mode, as long as it is confirmed that there are still applications that have not ended, the USB P2P mode will not be closed, thereby avoiding adverse effects on running applications.
  • the communication module is further configured to start a second communication mode between the electronic device and other electronic devices, and the second communication mode adjusts the movement of the electronic device
  • the network is shared with other electronic devices, and the connection manager is further configured to enable the electronic device to transmit the data received through the USB module to the The mobile communication module of the electronic device starts the second communication mode.
  • the China Unicom module can also be used to start mobile network sharing (ie USB Tethering mode) between the electronic device and other electronic devices.
  • USB Tethering mode ie USB Tethering mode
  • the connection manager detects that an application requests to start the USB Tethering mode, it will be opened via all
  • the data received by the USB module from other electronic devices is transmitted to the channel of the mobile communication module of the electronic device, so that other electronic devices can enjoy the mobile network of the electronic device.
  • the electronic device provides two communication modes at the same time, namely USB P2P mode and USB Tethering mode, while for the internal of the electronic device, it is actually integrated with each other, that is, the electronic device
  • the first communication mode and the second communication mode are simultaneously activated internally, wherein the passage closed by the communication module when the first communication mode is set is opened again by the communication module.
  • the electronic device further includes: a state machine manager, where the state machine manager is configured to switch the electronic device between the first communication mode and the second communication mode. That is to say, the state machine manager manages the conflict handling and transition of states between the USB P2P mode and the USB Tethering mode. In addition, cooperation between states, state query, etc. can also be managed through the state machine manager.
  • the present application further provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute the method for inter-device communication in any of the possible implementations of the first aspect.
  • FIG. 1 is an application scenario diagram of a method for communicating between devices provided according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an electronic device provided according to an embodiment of the present application.
  • FIG. 3 is a block diagram of a software structure of an electronic device provided according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for communicating between devices provided according to an embodiment of the present application.
  • Figure 5(a) is a selection interface of the USB P2P mode of the mobile phone
  • Figure 5(b) is another selection interface of the USB P2P mode of the mobile phone
  • FIG. 6 is a schematic diagram of starting USB P2P triggered by an application according to an embodiment of the present application
  • FIG. 7 is a schematic flowchart of a method for communicating between devices according to Embodiment 1 of the present application.
  • FIG. 8 is a schematic flowchart of a method for communicating between devices according to Embodiment 2 of the present application.
  • FIG. 9 is a schematic flowchart of a method for communicating between devices according to Embodiment 3 of the present application.
  • Fig. 10 is a schematic diagram showing the relationship of each state managed by the state machine manager in the USB P2P module in the mobile phone shown in Fig. 8;
  • Figure 11 is a block diagram of a device according to some embodiments of the present application.
  • SoC 12 is a block diagram of a system on a chip (SoC) according to some embodiments of the present application.
  • the mobile phone 1 is used as an example of the first electronic device
  • the notebook computer 2 is used as an example of the second electronic device for description.
  • the first electronic device is not limited to this, and may also be, for example, a tablet computer, etc.
  • the second electronic device is not limited to a notebook computer, but may also be a tablet computer, a smart TV, a large-screen TV, and the like.
  • FIG. 1 is an exemplary application scenario diagram of a method for communicating between devices according to an embodiment of the present application.
  • FIG. 1 shows a scenario of collaborative work between a mobile phone 1 and a notebook computer 2 .
  • Multi-screen collaboration allows users to directly open the files in the phone on the computer and edit them. After editing, the files will still be saved to the original location on the phone.
  • the reminder information of the mobile phone 1 can be directly displayed on the screen of the notebook computer 2 .
  • users can also call laptops 2 cameras, microphones, speakers and other hardware, and make phone calls or video calls on mobile phones 1, such as WeChat TM , QQ TM , Tencent TM conference, corporate WeChat TM , Huawei WeLink TM , etc.
  • Option 1 Connect via wireless.
  • a tablet computer and a Huawei mobile phone or Honor mobile phone
  • it can search for a connection through Bluetooth or scan a code to connect.
  • Bluetooth search connection as an example, including: slide out the notification panel from the status bar at the top of the phone screen, click the Bluetooth icon to turn on Bluetooth; similarly, slide out the notification panel from the status bar at the top of the tablet screen, click Multi-screen collaboration, and click the Prompt operation; move the phone close to the tablet, and further complete the connection according to the pop-up prompts on the screen of the phone and tablet.
  • the wireless connection method there is a delay problem in the wireless connection method, and the signal is easily interfered with problems such as jamming.
  • a wired connection scheme is also proposed for the delay and freeze problems of wireless connections. That is to say, a USB cable is used, one end is connected to the mobile phone, and the other end is connected to the notebook computer, and based on this, multi-screen collaboration is realized.
  • the devices communicate only through the USB connection and based on the USB protocol, the USB channel is used to transmit data, and the IP layer cannot be opened up, which makes the data transmission speed difficult to meet the requirements.
  • USB Tethering function is a function that allows a notebook computer to connect and access the mobile data network of a mobile phone through a Universal Serial Bus (USB) port.
  • USB Universal Serial Bus
  • the notebook computer wants to use the mobile network of the mobile phone, it is implemented by means of software bridging.
  • the cellular processor in the phone downloads a packet of data from the mobile network and transmits the packet to the application processor.
  • the application processor of the mobile phone does not directly process the data packet, but bridges it to the notebook computer through the USB, and the notebook computer processes it.
  • the notebook computer bridges its request for sharing the network to the mobile phone through the USB, and the mobile phone sends the request to its cellular processor.
  • the cellular processor After receiving the request, the cellular processor performs corresponding configuration through the interface function. In this way, the function of the computer enjoying the mobile Internet network of the mobile phone is realized through the above-mentioned software bridging method.
  • the USB Tethering technology is a technology that uses USB to share the network.
  • the mobile phone when the mobile phone is connected to the computer through a USB cable, the mobile phone is used as a USB network card, so that the computer can access the Internet through the mobile phone USB. That is, the computer shares the phone's network through the phone's USB.
  • the Android mobile phone systems come with this function. This technology opens up the IP layer, which greatly improves the speed of data transmission. However, it has the risk of uncontrollable user traffic on the computer side and stealing the network traffic of the mobile phone.
  • this application proposes a new connection mode (the first connection mode, hereinafter referred to as the USB P2P mode), on the premise that the mobile phone 1 and the notebook computer 2 are connected by a USB cable,
  • the USB device that is, the mobile phone 1
  • the USB device is virtualized into a network card to open up the IP layer between the mobile phone 1 and the laptop computer 2.
  • the USB module of the mobile phone 1 will be closed.
  • FIG. 2 shows a schematic structural diagram of an electronic device 100 including a mobile phone according to some embodiments of the present application.
  • terminal devices such as mobile phones and tablet computers mentioned in the above application scenarios of this application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • the processor 110 may generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 of the mobile phone that executes the USB P2P mode after receiving the instruction to start the USB P2P mode, the mobile phone is first virtualized into a USB network card, and the IP address is allocated through the USB module, and the mobile phone is stopped. The data received by the USB module is transmitted to the mobile communication module of the mobile phone. In this way, the data transmission based on the IP layer is realized without sharing the mobile network.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store the operating system, the application program required for at least one function (such as a sound playback function, an image playback function, etc.) and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • instructions are stored in the internal memory 121, and when the processor 110 reads the instructions stored in the internal memory 121, the method for communicating between devices according to the present application is executed. .
  • the communication method between devices in the following embodiments.
  • the USB interface 130 is a connector conforming to the USB standard specification, which can be used to connect the electronic device 100 and peripheral devices, and specifically can be a standard USB interface (such as a Type C interface), a Mini USB interface, a Micro USB interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices.
  • the processor 110 may support a Universal Serial Bus, and the standard specifications of the Universal Serial Bus may be USB1.x, USB2.0, USB3.x, and USB4.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
  • FIG. 3 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, video, etc.
  • applications such as HoloScreens TM , iQIYI TM , WeChat TM , mail, and gallery can be opened collaboratively with multiple screens so as to utilize the application ecology of the computer for more convenient processing.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer can include window manager, content provider, telephony manager, resource manager, notification manager, view system, connection manager, external listener manager, state machine manager, network Network management module, USB management module, etc.
  • connection manager the external monitoring manager, and the state machine manager are integrated to form a China Unicom module for managing the connection mode between devices, wherein the connection manager is respectively connected to the network management module, the USB management module, the external monitoring manager, and the state machine. manager.
  • the Unicom module is used for IP layer communication between the mobile phone and the notebook computer.
  • the connection manager is used to start the USB P2P mode (as an example of the first connection mode), and use the DHCP function to respectively provide the electronic device and other connected devices via the USB module with the DHCP function.
  • the electronic device ie, the second electronic device
  • the connection manager is also used to start the USB Tethering mode (as an example of the second communication mode), so that other electronic devices can enjoy the mobile network of the electronic device.
  • the external monitoring manager is used to manage external users, including setting the setting of the module, or managing the interface calls of other applications, etc., and notifying the corresponding module when the state of the USB changes. Specifically, for example, when the user turns on the USB P2P mode through the setting module, the external monitoring manager feeds back the information to the connection manager, so as to make corresponding settings to realize the normal operation of the USB P2P mode, or, when the USB P2P mode is detected When the interface is connected to an external device such as a notebook computer through a connecting line, the option of the USB connection mode is jumped out so that the user can select the connection manager to perform corresponding operations.
  • the state machine manager is mainly used for switching between the first communication mode and the second communication mode, and management of state fusion.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • the workflow of the software and hardware of the electronic device 100 is exemplarily described in conjunction with a shopping scenario using a shopping APP.
  • a touch operation that is, an operation of touching the shopping APP icon
  • a corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into raw input events (including touch coordinates, time stamps of the touch operation, etc.), and the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event.
  • the touch operation is a touch click operation
  • the control corresponding to the click operation is the control of the shopping APP icon.
  • the shopping APP application calls the interface of the application framework layer to start the shopping application, and then starts the display driver by calling the kernel layer.
  • the corresponding store information and the like are acquired from the server of the shopping APP through the mobile communication module 150 or the wireless communication module 160 .
  • a method for communicating between a mobile phone and a notebook computer is taken as an example for description. That is, the mobile phone is an example of the first electronic device, and the notebook computer is an example of the second electronic device.
  • the method for communicating between devices includes:
  • step S100 the mobile phone starts the USB P2P mode.
  • USB P2P mode is used to realize IP layer communication between the mobile phone and the notebook computer.
  • the mobile phone when the mobile phone detects that the notebook computer is connected to it via the USB module, it can send a request to start the USB P2P mode. Based on the request, the USB P2P mode can be activated by user confirmation.
  • USB interface may be a standard USB connector (such as a Type A connector, a Type B connector, and a Type C connector), a Mini USB interface, a Micro USB interface, and the like.
  • USB P2P mode is selected by default, and the USB P2P mode is directly activated. mode and enable other modes such as charging mode, etc., you can call up the USB setting options to set accordingly.
  • the mobile phone may also start the USB P2P mode according to a request sent by an application running on the mobile phone. For example, as shown in FIG. 6 , when the mobile phone opens iQIYITM , a service box of iQIYITM pops up, and a reminder box appears in the service box to remind the user to activate the USB P2P mode.
  • step S200 the mobile phone uses the DHCP function to assign IP addresses to the mobile phone and the notebook computer connected to the mobile phone via the USB module of the mobile phone.
  • the DHCP function is used to assign IP addresses to the mobile phone and the notebook computer connected to the mobile phone, thereby opening up the IP layer between the mobile phone and the notebook computer.
  • the USB module can be set to the RNDIS mode, which is essentially to run TCP/IP on the mobile phone through the USB module, so that the mobile phone works as a USB network card.
  • RNDIS essentially to run TCP/IP on the mobile phone through the USB module, so that the mobile phone works as a USB network card.
  • mobile phones, tablet computers, smart watches, and computers can all be virtualized into USB network cards through RNDIS.
  • the IP addresses are respectively assigned to the mobile phone and the notebook computer connected to the mobile phone through a USB cable.
  • step S300 the mobile phone stops transmitting the data received via the USB module to the mobile communication module of the mobile phone.
  • the USB module of the mobile phone receives data from the notebook computer and stops transmitting the data to the mobile communication module of the mobile phone.
  • the notebook computer if it intends to use the mobile network of the mobile phone, it will send a request to use the mobile network to the mobile phone.
  • the request will be first received by the USB module of the mobile phone through the USB interface.
  • the mobile phone needs to send the data (that is, the request) to the mobile communication module of the mobile phone, and receive the corresponding response from the mobile communication module to realize the sharing of the mobile network.
  • the technical solutions of the embodiments of the present application can avoid sharing the mobile network in the USB P2P mode by cutting off the path for transmitting the data received via the USB module to the mobile communication module of the mobile phone.
  • the mobile phone can stop transmitting the data received via the USB module to the mobile communication module of the mobile phone by setting a forwarding rule.
  • a forwarding rule More specifically, for example, port mapping can be set on a router, and then it can be implemented by adding a service port and selecting an IP address.
  • the IP layer can be opened between the mobile phone and the notebook computer, and the data transmission of the IP layer can be realized.
  • the data transmission speed can be greatly improved.
  • the mobile phone and the laptop do not share the mobile network, and each uses their own network to access the Internet, avoiding the problem of the laptop stealing the mobile phone traffic.
  • the mobile phone After the mobile phone and the laptop are connected by a USB cable, the mobile phone realizes the connection in the USB P2P mode through the following steps.
  • Step S101 the mobile phone sends a request to start the USB P2P mode through the application, or as shown in Figure 5(a), Figure 5(b), selects the USB P2P option through the USB connection mode selection box and the sharing setting selection box in the setting module to send out Request to initiate USB P2P mode.
  • Step S102 after receiving the request, the interface layer of the mobile phone instructs the connection manager to check whether the USB P2P mode is enabled.
  • Step S103 when the connection manager detects that the USB P2P mode is not enabled, the connection manager starts the USB P2P mode.
  • Step S201 the connection manager instructs the USB management module to set the USB module to the RNDIS mode.
  • Step S202 after receiving the instruction of the connection manager, the USB management module sets the USB module to set it to the RNDIS mode.
  • the USB module is virtualized into a network card.
  • Step S203 the connection manager instructs the network management module to assign an IP address.
  • Step S204 after the network management module receives the instruction to allocate the IP address, it uses the DHCP function and DNSmasq software to allocate the IP address to the mobile phone and the notebook computer.
  • step S301 the connection manager performs forwarding rule setting to close the channel for transmitting the data packet received by the USB module to the mobile network module.
  • the laptop cannot share the mobile network of the mobile phone.
  • Step S401 the connection manager feeds back to the APP/setting module, and the USB P2P mode is successfully enabled.
  • the IP layer can be opened between the mobile phone and the notebook computer, and the data transmission of the IP layer can be realized, thereby Compared with ordinary USB connection and communication based on USB protocol, the data transmission speed can be greatly improved.
  • the mobile phone and the laptop do not share the mobile network, and each uses their own network to access the Internet, avoiding the problem of the laptop stealing the mobile phone traffic.
  • the mobile phone After the mobile phone and the laptop are connected by a USB cable, the mobile phone realizes the connection in the USB P2P mode through the following steps.
  • Step S111 the mobile phone sends a request to start the USB P2P mode through the application 1.
  • Step S112 after receiving the request, the interface layer of the mobile phone instructs the connection manager to check whether the USB P2P mode is enabled.
  • step S113 when the connection manager detects that the USB P2P mode is not enabled, the connection manager starts the USB P2P mode.
  • Step S211 the connection manager instructs the USB management module to set the USB module to the RNDIS mode.
  • Step S212 after receiving the instruction of the connection manager, the USB management module sets the USB module to set it to the RNDIS mode.
  • the USB module is virtualized into a network card.
  • Step S213 the connection manager instructs the network management module to assign an IP address.
  • Step S214 after the network management module receives the instruction to assign the IP address, it uses the DHCP function and DNSmasq software to assign the IP address to the mobile phone and the notebook computer.
  • Step S311 the connection manager performs forwarding rule setting to close the channel for transmitting the data packet received by the USB module to the mobile network module.
  • the notebook computer cannot enjoy the mobile network of the mobile phone.
  • Step S411 the connection manager feeds back to the APP/setting module, and the USB P2P mode is successfully enabled.
  • Step S511 the application 2 running on the mobile phone sends a request to start the USB P2P mode.
  • Step S512 after receiving the request, the interface layer instructs the connection manager to check whether the USB P2P mode is enabled.
  • Step S513 the connection manager detects and detects that the USB P2P mode has been enabled.
  • Step S514 the connection manager notifies the application 2 that the startup is successful. So far, application 2 can normally use the USB P2P mode for multi-screen collaboration.
  • the interface layer notifies the connection manager to detect whether the USB P2P mode has been turned on, and connect the After receiving the notification, the manager detects and determines that the mode has been enabled, and notifies that the application 2 has been successfully opened. At this time, the application 2 can use the multi-screen collaboration function normally.
  • this embodiment also includes the following steps:
  • Step S611 an application requests to close the USB P2P mode.
  • the application may be any one of multiple running applications.
  • Step S612 after receiving the request, the interface layer notifies the connection manager to turn off the USB P2P mode.
  • Step S613 the connection manager detects, and stops closing when it is determined that other applications are using the USB P2P mode
  • Step S614 when it is determined that no other application is using the USB P2P mode, the USB management module is notified to cancel the setting of the USB RNDIS mode (that is, cancel the virtualization of the USB module into a network card), and the USB management module performs corresponding settings.
  • the USB management module manages the settings of the USB module and closes the USB RNDIS mode. Wait until the next application request to open before starting it.
  • Step S615 the connection manager notifies the setting module of the mobile phone that the shutdown is completed. That is to say, it is no longer displayed in the selection box of the Settings module as being turned on.
  • the connection manager when the above application requests to start the USB P2P mode, the connection manager also records the identification of each request to start the USB P2P mode. For example, a user ID or any identifier that can identify the caller can be used.
  • the identifiers of these multiple applications are recorded to form a list. Thereafter, when an application exits the process (applies to close, or exits abnormally), the connection manager removes the corresponding identifier from the above list.
  • the method for communicating between devices in this embodiment it can be confirmed whether there are any applications using the USB P2P mode only by confirming whether there is an identifier in the list, and the USB P2P mode will be turned off only when there is no identifier in the list. , which can simply and reliably manage applications using the USB P2P mode, avoiding abnormal interruption of applications and data loss due to error exits.
  • steps S111 to S514 are the same as those in the above-mentioned embodiment 2, and are marked with the same step number in FIG. 9, and the detailed description thereof is omitted.
  • the setting module in addition to multiple applications requesting to start the USB P2P mode, the setting module also requests to start the USB Tethering mode, that is, requesting to share the mobile network of the mobile phone with the notebook computer.
  • this embodiment also includes the following steps:
  • Step S711 the setting module applies for enabling the USB Tethering mode.
  • Step S712 the interface layer instructs the connection manager to check whether the USB Tethering mode is enabled.
  • Step S713 the connection manager checks, and when it is checked that the USB Tethering mode is not turned on, the forwarding rules are set so that the data received by the USB module from the notebook computer can be transmitted to the mobile communication module of the mobile phone.
  • Step S714 sending a notification of successful activation to the setting module.
  • this embodiment only provides an example, that is, the case of applying for the Unicom USB Tethering mode after first enabling the USB P2P mode.
  • the connection manager directly sends a notification of the successful turn on to the setting module. It should be noted that in this case, the connection manager no longer sets the forwarding rules, but retains the forwarding rules in the USB Tethering mode, so that the USB Tethering mode can continue to operate normally. For upper-level users, they cannot perceive it. For users, it shows that both the USB P2P mode and the USB Tethering mode are turned on.
  • the difference from the above-mentioned Embodiment 2 is that in the step S614, it is further determined whether No other application uses the USB Tethering mode, only when neither the application uses the USB P2P mode nor the USB Tethering mode, the USB management module is notified to cancel the setting of the RNDIS mode. That is to say, when the application exits the USB P2P mode, the USB module does not really exit the mode of the virtual network card, so that the USB Tethering mode can officially run.
  • the mobile phone when the mobile phone exits the USB Tethering mode, it will not immediately notify the USB management module to cancel the RNDIS mode setting.
  • the USB management module When all the applications of the mobile phone using the USB Tethering mode end the process, first reset the forwarding rules through the connection manager, so as to close the channel through which the data received by the USB module from the notebook computer can be transmitted to the mobile communication module of the mobile phone , but keep the USB management module in RNDIS mode so that the USB P2P mode continues to operate. That is to say, although the setting module shows that the USB Tethering mode is turned off, the bottom layer of the operating system of the mobile phone does not actually turn off the RNDIS mode.
  • the connection manager notifies the USB management module to cancel the setting of the RNDIS mode. That is to say, at this time, the setting module shows that both the USB P2P mode and the USB Tethering mode are turned off, and the USB module has exited the virtual network card mode, and all IP layer communication links are cut off between the mobile phone and the laptop. Data transfer between laptops is only possible based on the USB protocol.
  • the state machine manager can be abstracted in the application framework layer, which is responsible for the state conflict between the USB P2P mode and the USB Tethering mode Processing, collaboration, transformation, status query, etc.
  • Figure 10 shows transitions between several states.
  • IdleState initial state
  • IdleState represents: the initial state of the system, that is, the parent state of all states. That is to say, neither USB P2P nor Tethering is connected.
  • StartingP2pState [Enable USBP2P state] means: try to open the USB P2P state, which means to start the USB P2P mode.
  • USB P2P enabled status means: USB P2P mode has been activated, which means that the mobile phone is already in the IP layer communication with the laptop based on the USB P2P mode and does not share the mobile network.
  • TetherState [shared network status] means: USB Tethering mode has been turned on, that is to say, the mobile network sharing status has been turned on, and there is no business application to use USB P2P.
  • JointState means: in the coordinated state, that is to say, the USB mobile network sharing has been enabled, and other services have applied for the use of USB P2P.
  • StoppingP2pState [Apply to close the USB P2P state] means: try to exit the USB P2P state, indicating that all applications using USB P2P have finished the process, try to exit.
  • the mobile phone when the mobile phone is in the IdleState state, when a service applies for enabling the USB P2P mode, it enters the StartingP2pState state, and the state machine manager records this state.
  • the state machine manager notifies the connection manager that it is currently in the StartingP2pState state, and then the connection manager informs the USB network setting module to set the USB module to RNDIS mode (that is, activate the RNDIS mode), and is managed by the network
  • the device assigns an IP address, and the connection manager sets the forwarding rules accordingly, thereby activating the P2pState state, and the state machine manager further records that the USB of the mobile phone is in the P2pState state at this time.
  • the connection manager sends a request to close the USB P2P mode, thereby entering the StoppingP2pState state.
  • the connection manager informs the USB management module to turn off the RNDIS mode of the USB, thereby returning to the IdleState state.
  • the state machine manager will notify the connection manager of the current state (that is, the P2pState state), and the connection manager can directly set the forwarding rules to realize USB tethering. mode, thus entering the JointState state, that is, entering the state where the USB P2P mode and the USB Tethering mode are activated at the same time.
  • the state machine manager when trying to turn off USB P2P, the state machine manager will inform the connection manager that it is in the JointState state at this time.
  • the connection manager does not tell the USB management module to change the mode of the USB module, and the connection manager does not change the forwarding rules. That is to say, at this time, the bottom layer of the system will not change, but the setting module shows that the USB P2P mode has been turned off, and the mobile phone is currently in the USB Tethering activation state, that is, the TetherState state.
  • the state machine manager when trying to turn off the USB Tethering mode, the state machine manager will inform the connection manager that it is in the JointState state at this time.
  • the connection manager does not notify to turn off the RNDIS mode of the USB module, but directly enters the P2PState state. That is, the connection manager does not tell the USB management module to change the mode of the USB module, but only changes the forwarding rules.
  • the bottom layer of the system only closes the channel for forwarding the received data packets to the mobile communication module by USB, and shows that the USB Tetherting mode has been closed in the setting module, and the mobile phone is currently in the USB P2P activation state, that is, the P2PState state.
  • the application that applies to enable the USB P2P mode is killed, that is, the case of abnormal exit. In this case, it will directly return to the initial state, and the state machine manager will also directly change the state of the USB module. It is recorded as the initial state, and on this basis, the corresponding settings are made according to the new application request or the startup request issued by the setting module.
  • connection manager can avoid erroneously informing the USB management module to turn off the RNDIS mode of the USB module, thereby effectively avoiding the two methods.
  • the conflict between the states makes the bottom layer of the system in a state of fusion, which can further improve the user experience.
  • FIG. 11 shows a block diagram of a device 1200 according to one embodiment of the present application.
  • Device 1200 may include one or more processors 1201 coupled to controller hub 1203 .
  • the controller hub 1203 is connected via a multidrop bus such as a Front Side Bus (FSB), a point-to-point interface such as a Quick Path Interconnect (QPI), or the like 1206 communicates with processor 1201.
  • FOB Front Side Bus
  • QPI Quick Path Interconnect
  • Processor 1201 executes instructions that control general types of data processing operations.
  • the controller hub 1203 includes, but is not limited to, a Graphics Memory Controller Hub (GMCH) (not shown) and an Input/Output Hub (IOH) (which may be on a separate chip) (not shown), where the GMCH includes the memory and graphics controller and is coupled to the IOH.
  • GMCH Graphics Memory Controller Hub
  • IOH Input/Output Hub
  • Device 1200 may also include a coprocessor 1202 and memory 1204 coupled to controller hub 1203 .
  • the memory and GMCH may be integrated within the processor (as described in this application), with the memory 1204 and coprocessor 1202 coupled directly to the processor 1201 and to the controller hub 1203, the controller hub 1203 and IOH in a single chip.
  • the memory 1204 may be, for example, Dynamic Random Access Memory (DRAM), Phase Change Memory (PCM), or a combination of the two.
  • DRAM Dynamic Random Access Memory
  • PCM Phase Change Memory
  • the coprocessor 1202 is a special-purpose processor, such as, for example, a high-throughput MIC processor (Many Integerated Core, MIC), a network or communications processor, a compression engine, a graphics processor, a general graphics processor (General Purpose Computing on GPU, GPGPU), or embedded processor, etc.
  • a high-throughput MIC processor Many Integerated Core, MIC
  • MIC Manufacturing Integerated Core
  • GPGPU General Purpose Computing on GPU
  • embedded processor etc.
  • FIG. 12 Optional properties of the coprocessor 1202 are shown in FIG. 12 with dashed lines.
  • the memory 1204 acts as a computer-readable storage medium and may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions.
  • memory 1204 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as one or more hard-disk drives (HDD(s)), one or more Multiple Compact Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives.
  • HDD hard-disk drives
  • CD Multiple Compact Disc
  • DVD Digital Versatile Disc
  • the device 1200 may further include a Network Interface Controller (NIC) 1206 .
  • Network interface 1206 may include a transceiver for providing a radio interface for device 1200 to communicate with any other suitable device (eg, front-end modules, antennas, etc.).
  • network interface 1206 may be integrated with other components of device 1200 .
  • the network interface 1206 may implement the functions of the communication unit in the above-described embodiments.
  • Device 1200 may further include an input/output (I/O) device 1205 .
  • I/O 1205 may include: a user interface designed to enable a user to interact with device 1200; a peripheral component interface designed to enable peripheral components to also interact with device 1200; and/or sensors designed to determine the environment associated with device 1200 Condition and/or location information.
  • Figure 11 is exemplary only. That is, although FIG. 11 shows that the device 1200 includes multiple devices such as the processor 1201, the controller hub 1203, the memory 1204, etc., in practical applications, the device using each method of the present application may only include the devices of the device 1200 Some of the devices, for example, may contain only the processor 1201 and the NIC 1206. The properties of the optional device in Figure 11 are shown in dashed lines.
  • the memory 1204 serving as a computer-readable storage medium stores an instruction, and when the instruction is executed on the computer, the device 1200 executes the method for communicating between devices according to the above-mentioned embodiments.
  • the device 1200 executes the method for communicating between devices according to the above-mentioned embodiments.
  • the above-mentioned embodiments. method which will not be repeated here.
  • FIG. 12 is a block diagram of a SoC (System on Chip, system on chip) 1300 according to an embodiment of the present application.
  • SoC 1300 includes: interconnect unit 1350 coupled to application processor 1310; system proxy unit 1380; bus controller unit 1390; integrated memory controller unit 1340; one or more coprocessors 1320, which may include integrated graphics logic, image processor, audio processor and video processor; Static Random Access Memory (SRAM) unit 1330; Direct Memory Access (DMA) unit 1360.
  • the coprocessor 1320 includes a special purpose processor such as, for example, a network or communications processor, a compression engine, a GPGPU, a high throughput MIC processor, an embedded processor, or the like.
  • Static random access memory (SRAM) unit 1330 may include one or more computer-readable media for storing data and/or instructions.
  • the computer-readable storage medium may have instructions stored thereon, in particular, temporary and permanent copies of the instructions.
  • the instruction may include: when executed by at least one unit in the processor, causing the Soc 1300 to execute the method according to the above-mentioned embodiment. For details, refer to the method in the above-mentioned embodiment, which will not be repeated here.
  • Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementation methods.
  • Embodiments of the present application may be implemented as a computer program or program code executing on a programmable system including at least one processor, a storage system (including volatile and nonvolatile memory and/or storage elements) , at least one input device, and at least one output device.
  • Program code may be applied to input instructions to perform the functions described herein and to generate output information.
  • the output information can be applied to one or more output devices in a known manner.
  • a processing system includes any processor having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor system.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • the program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system.
  • the program code may also be implemented in assembly or machine language, if desired.
  • the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled language or an interpreted language.
  • the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof.
  • the disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (eg, computer-readable) storage media, which can be executed by one or more processors read and execute.
  • the instructions may be distributed over a network or over other computer-readable media.
  • a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (eg, a computer), including, but not limited to, floppy disks, optical disks, optical disks, Compact Disc Read Only Memory , CD-ROMs), magneto-optical disks, Read Only Memory (ROM), Random Access Memory (RAM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable read-only memory (Electrically Erasable Programmable Read Only Memory, EEPROM), magnetic or optical cards, flash memory, or for the use of the Internet to transmit information by electrical, optical, acoustic or other forms of propagating signals (for example, carrier waves, infrared signals tangible machine-readable storage of digital signals, etc.).
  • machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
  • each unit/module mentioned in each device embodiment of this application is a logical unit/module.
  • a logical unit/module may be a physical unit/module or a physical unit/module.
  • a part of a module can also be implemented by a combination of multiple physical units/modules.
  • the physical implementation of these logical units/modules is not the most important, and the combination of functions implemented by these logical units/modules is the solution to the problem of this application. The crux of the technical question raised.
  • the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems raised in the present application, which does not mean that the above-mentioned device embodiments do not exist. other units/modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

本申请提供一种设备间联通方法、电子设备、及计算机可读存储介质。其中设备间联通方法用于在第一电子设备与第二电子设备之间基于第一电子设备的USB模块进行联通,包括:第一电子设备启动第一联通模式;所述第一电子设备为所述第一电子设备以及所述第二电子设备分配IP地址;所述第一电子设备停止将经由所述USB模块接收的数据传输至所述第一电子设备的移动通信模块。根据本申请实施例的设备间联通方法,在第一电子设备与第二电子设备之间通过USB线连接的前提下,将第一电子设备虚拟成USB网卡,以在第一电子设备与第二电子设备之间打通IP层,同时使得第二电子设备不能共享第一电子设备的移动网络以避免第二电子设备偷跑第一电子设备的流量。

Description

设备间联通方法、电子设备、及计算机可读存储介质
本申请要求于2020年10月20日提交中国专利局、申请号为202011124452.2、申请名称为“设备间联通方法、电子设备、及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,具体涉及一种设备间联通方法、电子设备及计算机可读存储介质。
背景技术
随着全场景设备的普及,多设备之间进行协同工作已经成为趋势。
多屏协同属于分布式技术,目的在于实现跨系统、跨设备协同,将手机与电脑、平板连接,实现资源共享,协同操作。多屏协同,不仅仅是平板/电脑和手机之间文件互传,更是利用平板/电脑的运算能力和专业系统能力,实现平板/电脑和手机的无缝协同,键盘、鼠标成为手机的外设,在一个大屏设备上完成两个设备的任务,回微信、回邮件等,同时也利用平板/电脑更专业的应用生态实现更多的应用。
设备之间实现多屏协同的方法包括有线方法,例如通过一根USB连接线连接并基于USB协议进行通信。然而,该方法无法打通IP层,导致其数据传播速度难以满足要求。
发明内容
有鉴于此,本申请提供一种设备间联通的方法,用于在第一电子设备与第二电子设备之间基于第一电子设备的USB模块进行联通,通过将第一电子设备虚拟成USB网卡,能够打通第一电子设备与第二电子设备之间的IP层,使得第一电子设备与第二电子设备之间的数据传输更为迅速,同时切断第二电子设备利用第一电子设备的移动通信模块例如蜂窝模块或WIFI模块进行上网的通路,能够避免第二电子设备利用第一电子设备的网络上网偷跑流量的问题。
其中,第一电子设备可以为例如手机、平板电脑等任意具有USB接口以及移动通信模块且能够实现IP层通信的终端设备,第二电子设备可以为手机、平板电脑、笔记本电脑、台式电脑、智能电视、大屏电视等任意具有USB接口的可实现IP层通信的终端设备。换言之,第一电子设备也可以属于第二电子设备中的一种,也就是说,本申请的设备间联通方法,例如可以在手机和手机之间执行,也可以在手机和笔记本电脑之间执行等等。
以下从多个方面介绍本申请,以下多个方面的实施方式和有益效果可互相参考。
第一方面,本申请提供一种设备间联通的方法,用于在第一电子设备与第二电子设备之间基于第一电子设备的USB模块进行联通,包括:所述第一电子设备启动第一联通模式,所述第一联通模式用于在所述第一电子设备和第二电子设备之间进行IP层联通;所述第一电子设备为所述第一电子设备以及所述第二电子设备分配IP地址;所述第一电子设备接收来自所述第二电子设备的数据,所述第一电子设备停止将所述数据传输至所述第一电子设备的移动通信模块。
根据本申请的设备间联通方法,在实现第一联通模式(以下将该第一联通模式记作USB P2P模式)时,利用USB将第一电子设备与第二电子设备之间进行连接,并且进行IP地址分配,打通第一电子设备与第二电子设备这两设备之间的IP层,实现IP层通信,同时,停止将经由所述USB模块接收的来自第二电子设备的数据传输至所述第一电子设备的移动通信模块,也就是停止将第二电子设备发来的请求享用第一电子设备的移动网络的请求转发给第一电子设备的移动通信模块,由此避免第二电子设备利用第一电子设备的网络上网。也就是说,USB P2P模式是一种在第一电子设备与第二电子设备之间实现IP层联通,同时,在第一电子设备与第二电子设备之间并不共享网络的一种联通模式。
在上述第一方面的一种可能的实现中,所述第一电子设备利用DHCP功能,经由所述USB模块为所述第一电子设备以及所述第二电子设备分配IP地址。
DHCP(Dynamic Host Configuration Protocol,动态主机配置协议),是一个局域网的网络协议,指的是由服务器控制一段IP地址范围,客户机登录服务器时就可以自动获得服务器分配的IP地址和子网掩码。DHCP通常被应用于大型的局域网络环境中,主要作用是集中地管理、分配IP地址,使网络环境中的主机动态地获得IP地址、Gateway地址、DNS服务器地址等信息,并能够提升地址的使用率。DHCP协议采用客户端/服务器模型,主机地址的动态分配任务由网络主机驱动。当DHCP服务器接收到来自网络主机申请地址的信息时,才会向网络主机发送相关的地址配置等信息,以实现网络主机地址信息的动态配置。DHCP协议采用UDP作为传输协议,主机发送请求消息到DHCP服务器,DHCP服务器回应应答消息给主机。
作为执行DHCP协议的软件,例如包括但不限于DNSmasq软件。DNSmasq是一个小巧且方便地用于配置DNS和DHCP的工具,适用于小型网络,它提供了DNS功能和可选择的DHCP功能。它服务那些只在本地适用的域名,这些域名是不会在全球的DNS服务器中出现的。DNSmasq把因特网地址和地址-域名映射关系放入cache中,减少服务器负担的同时也提升了性能(特别是在modem连接中)。此外,DNSmasq能配置来自动用PPP或DHCP配置请求从上行域名解析服务器中获取地址信息,如果信息发生改变,它会自动重载这些信息。
在上述第一方面的一种可能的实现中,还包括:在所述第二电子设备上镜像同屏显示所述第一电子设备的桌面,以实现所述第一电子设备与所述第二电子设备的多屏协同。也就是说,本申请第一方面的设备间联通方法,可以用于实现设备间的多屏协同。
在上述第一方面的一种可能的实现中,所述第一电子设备包括手机、平板电脑中的任一个,所述第二电子设备包括手机、平板电脑、笔记本电脑、台式电脑、智能电视中的任一个。也就是说,根据本申请的设备间联通方法可以用于手机和手机、平板电脑、笔记本电脑、台式电脑、智能电视中任一个之间的联通,也可以用于平板电脑与手机或笔记本电脑等等之间的任一个联通。
在上述第一方面的一种可能的实现中,所述经由所述USB模块为所述第一电子设备以及所述第二电子设备分配IP地址包括:所述第一电子设备使得所述USB模块以RNDIS模式工作,以将所述第一电子设备虚拟成USB网卡;基于DHCP功能,为所述USB模块分配IP地址;所述USB模块将所述IP地址分别分配给所述第一电子设备与所述第二电子设备。
也就是说,首先,将第一电子设备虚拟成USB网卡,此后通过DHCP功能,经由所述USB模块分别为第一电子设备与第二电子设备分配IP地址。由此,在第一电子设备与第二电子设备之间实现了IP层的连通。
其中,将第一电子设备虚拟成USB网卡,可以基于RNDIS(Remote Network Driver Interface Specification,远程网络驱动接口规范)来实现,具体地可以将第一电子设备的USB模块设置成RNDIS 模式来实现,其实质上就是通过USB模块在第一电子设备上跑TCP/IP,让第一电子设备看上去像一块网卡。目前,手机、平板电脑、智能手表、电脑均能够通过RNDIS实现USB虚拟网卡。
在将第一电子设备虚拟成USB网卡之后,利用DHCP功能,首先将IP地址分发给USB模块,此后由该USB模块将IP地址分别分配给第一电子设备与第二电子设备。由此,移动设备和第二电子设备,基于被分配的IP地址,可以通过USB模块以IP层进行通信。
在上述第一方面的一种可能的实现中,所述第一电子设备通过设置转发规则,停止将所述数据传输至所述第一电子设备的移动通信模块。具体地,例如可以在路由器上设置端口映射,此后通过添加服务端口、选定IP地址来实现。
在上述第一方面的一种可能的实现中,还包括所述第一电子设备显示启动所述第一联通模式的选项,所述第一电子设备接收对所述选项的操作;响应于接收到的对所述选项的操作,所述第一电子设备启动所述第一联通模式。也就是说,例如在第一电子设备检测到通过USB模块连接了外联的第二电子设备之后,主动发出启动所述第一联通模式的请求,例如,跳出启动USB P2P连接界面,用户可以通过点确认键启动USB P2P模式。
在上述第一方面的一种可能的实现中,所述第一电子设备根据接收到的来自所述第一电子设备上运行的至少一个应用的请求,启动所述第一联通模式。也就是说,除了上述的启动方式之外,还可以根据所述第一电子设备上运行的一个或多个应用的请求,例如,当该应用需要在多屏协同情况下运行时,打开该应用的同时,会触发该应用发出的启动USB P2P模式的请求,根据该请求可以进行USB P2P模式设置。
在上述第一方面的一种可能的实现中,在多个应用请求启动所述第一联通模式的情况下,当最后一个应用关闭之后,所述第一电子设备关闭所述第一联通模式。也就是说,当多个应用都需要在USB P2P模式下运行时,当其中一个应用关闭,并不会立刻退出USB P2P模式,而是继续启用USB P2P模式,以便仍在运行的其他应用继续处于正常运行状态,直至最后一个请求启动USB P2P模式的应用关闭之后,第一电子设备自发关闭USB P2P模式。
进一步地,所述在多个应用请求启动所述第一联通模式的情况下,当最后一个应用关闭之后所述第一电子设备关闭所述第一联通模式包括:记录每个发出所述请求的应用的标识,建立清单;当第一应用所在的进程结束,则从所述清单中清除所述第一应用对应的标识,直至所述清单中无标识存在,所述第一电子设备关闭所述第一联通模式。
也就是说,对于每个发出启动USB P2P模式的应用通过记录其标识建立清单,当其中一个应用的进程结束,则总清单中清除该应用的标识,由此能够准确地对于正在进程中的需要USB P2P模式的应用进行管理,从而能够有效避免关闭USB P2P模式对于正在运行中的应用产生不必要的影响。由此,可以实现同时管理多个应用进行USB P2P模式的开启和关闭,不同的应用之间相互独立,不必感知,当多个应用均要求启动USB P2P模式,第一电子设备只需开启一次,不会造成资源浪费,当多个应用逐个退出进程,只要其中还有一个应用没有结束进程,则USB P2P模式就不会关闭。
进一步地,在上述第一方面的一种可能的实现中,还包括:当所述第一电子设备接收到启动第二联通模式的请求,所述第一电子设备使得所述USB模块接收的来自所述第二电子设备的数据能够传输至所述第一电子设备的移动通信模块,其中所述第二联通模式将所述第一电子设备的移动网络共享给所述第二电子设备。
也就是说,该第二联通模式实际上是第二电子设备共享第一电子设备的移动网络,即所谓的共享网络模式,例如USB Tethering模式。所述第一电子设备使得所述USB模块接收的来自所述第二电子设 备的数据能够传输至所述第一电子设备的移动通信模块,也就是说,第一电子设备打开从其USB模块将接收到的数据包发送至其移动通信模块的通路。参考上述说明可知,在打开该通路的情况下即使得由第二电子设备发送给第一电子设备的请求共享移动网络的请求能够被转发至第一电子设备的移动通信模块例如蜂窝模块或WIFI模块,当该移动通信模块接收到该请求,即进行共享网络的相关配置,使得第二电子设备能够共享第一电子设备的网络。换言之,当检测到有应用请求启动USB Tethering模式,打开将经由所述USB模块接收的数据传输至所述第一电子设备的移动通信模块的通路,以使得第二电子设备能够共享第一电子设备的移动网络。即,对于外部用户而言,该第一电子设备此时同时提供两种联通模式,即USB P2P模式和USB Tethering模式,而对于第一电子设备内部而言,其实同时融合了该两种模式。其中,关于启动第二联通模式的请求,可以通过设置模块来启动,也可以通过第一电子设备上的应用来启动等,具体细节可以参考上述对于启动第一联通模式的请求的说明,在此省略其详细说明。
进一步地,在上述第一方面的一种可能的实现中,在请求启动第一联通模式的所有应用关闭的情况下,进一步检测所述第二联通模式是否处于启动状态,当检测到所述第二联通模式处于启动状态时,所述USB模块持续作为虚拟网卡直至所述第二联通模式关闭。也就是说,即便所有的请求USB P2P模式的应用均退出进程,如果还检测到有应用在启用USB Tethering模式,则不会关闭USB模块作为虚拟网卡,也就是说保持USB Tethering模式持续进行,直至USB Tethering模式关闭为止。
在上述第一方面的一种可能的实现中,所述第一电子设备基于所运行的应用的请求,在所述第一联通模式与所述第二联通模式之间切换。因为USB P2P和USB Tethering状态是耦合的,并且会发生冲突,为了解决这两个状态之间的装换,可以基于运行的应用的请求,在USB P2P和USB Tethering之间进行切换,由此能够避免USB P2P和USB Tethering之间状态的冲突,使得USB P2P和USB Tethering之间能够实现协同、转换等。
第二方面,本申请提供一种电子设备,包括触摸屏,存储器,一个或多个处理器,多个应用程序,其特征在于,所述电子设备还包括一个或多个用于执行设备间联通方法的程序,其中所述一个或多个用于执行设备间联通方法程序被存储在所述存储器中,当所述一个或多个处理器在执行所述一个或多个用于执行设备间联通方法程序时,使得所述电子设备实现上述第一方面中任一种可能的实现方式的设备间联通方法。
第三方面,本申请还提供一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述处理器执行上述第一方面中任一种可能的实现方式的设备间联通方法。
第四方面,本申请还提供一种电子设备,该电子设备包括USB模块、移动通信模块以及联通模块,所述联通模块用于在该电子设备与其他电子设备之间进行IP层联通,所述联通模块包括连接管理器,所述连接管理器用于启动第一联通模式,并分别给所述该电子设备以及所其他电子设备分配IP地址,并使该电子设备停止将经由所述USB模块接收的数据传输至所述移动通信模块。
也就是说,本申请通过在该电子设备的应用程序框架层中设置联通模块来启动第一联通模式。具体而言,所述联通模块中包括连接管理器,该连接管理器进行第一联通模式的连接设置。也即该连接管理器启动USB P2P模式,并进行IP地址分配,同时使该电子设备停止将经由所述USB模块接收的数据传输至所述移动通信模块。
在上述第四方面的一种可能的实现中,所述电子设备利用DHCP功能,经由所述USB模块为该电子设备以及其他电子设备分配IP地址。
在上述第四方面的一种可能的实现中,该电子设备还包括USB管理模块以及网络管理模块,所述连接管理器还用于向所述USB管理模块发出设置所述USB模块为RNDIS模式的请求,所述USB管理模块用于接收所述请求,并基于所述请求将所述USB模块设置为RNDIS模式,以将该电子设备虚拟成USB网卡,所述连接管理器还用于利用DHCP功能,给所述USB模块分配IP地址并发送给所述网络管理模块,所述网络管理模块将所述IP地址分别给该电子设备以及与该电子设备连接的其他电子设备分配IP地址。也就是说,连接管理器分别连接USB管理模块与网络管理模块,连接管理器根据启动USB P2P模式的指令开启USB P2P模式,此后,连接管理器指示USB管理模块将USB模块设置为RNDIS模式,并且,连接管理器给USB模块分配IP地址,并通过网络管理模块分配给该电子设备和与该电子设备连接的其他电子设备。至此,完成USB P2P模式的成功开启。
在上述第四方面的一种可能的实现中,所述连接管理器通过设置转发规则,停止将经由所述USB模块接收的数据传输至该电子设备的移动通信模块。
在上述第四方面的一种可能的实现中,所述联通模块还包括:外部监听管理器,所述外部监听管理器用于当检测到其他电子设备经由所述USB模块与该电子设备连接时,使得该电子设备的显示器显示启动所述第一联通模式的选项,所述连接管理器基于接收到的对所述选项的操作启动所述第一联通模式。
也就是说,外部监听模块用于等USB的状态发生变化时通知相应的模块,例如当检测到其他电子设备经由USB模块与该电子设备发生连接时,向连接管理其发出启动USB P2P模式的请求。此外,外部监听模块还可以用于例如管理外部用户,包括设置模块的设置、其他应用程序的接口调用的管理等。
在上述第四方面的一种可能的实现中,所述连接管理器用于根据接收到的来自该电子设备上运行的至少一个应用的请求启动所述第一联通模式。也就是说,除了上述检测到USB的状态发生变化后提示用户启动USB P2P模式之外,也可以基于该电子设备上运行的至少一个应用触发启动USB P2P模式。
在上述第四方面的一种可能的实现中,在多个应用请求启动所述第一联通模式的情况下,所述连接管理其还用于检测到最后一个应用关闭之后关闭所述第一联通模式。由此,可以实现同时管理多个应用进行USB P2P模式的开启和关闭,不同的应用之间相互独立,不必感知,多个应用先后要求开启USB P2P模式的情况下,只需开启一次,不会造成资源浪费;此外,多个应用先后退出进程,要求关闭USB P2P模式时,只要确认到尚有应用未结束,则不会关闭USB P2P模式,从而避免对于正在运行中的应用带来不利影响。
在上述第四方面的一种可能的实现中,所述联通模块还用于在该电子设备与其他电子设备之间启动第二联通模式,所述第二联通模式将所述该电子设备的移动网络共享给其他电子设备,所述连接管理器还用于,在接收到来自所述联通模块的启动第二联通模式的请求时,使该电子设备能够将经由所述USB模块接收的数据传输至该电子设备的移动通信模块以启动所述第二联通模式。
也就是说,联通模块还可以用于在该电子设备与其他电子设备之间启动移动网络共享(即USB Tethering模式),当连接管理器检测到有应用请求启动USB Tethering模式,则打开将经由所述USB模块接收的来自其他电子设备的数据传输至该电子设备的移动通信模块的通路,以使得其他电子设备能够享用该电子设备的移动网络。也就是说,对于外部用户而言,该电子设备此时同时提供两种联通模式,即USB P2P模式和USB Tethering模式,而对于该电子设备内部而言,其实是相互融合的,即该电子设备内部同时激活第一联通模式与第二联通模式,其中在设置第一联通模式时由联通模块关闭的通路再次被联通模块打开。
进一步地,该电子设备还包括:状态机管理器,所述状态机管理器用于使该电子设备在所述第一联通模式与所述第二联通模式之间进行切换。也就是说,通过该状态机管理器来管理决USB P2P模式和 USB Tethering模式之间状态的冲突处理和转换。此外,还可以通过状态机管理器来管理状态之间的协同、状态查询等。
第五方面,本申请还提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面中任一种可能的实现方式的设备间联通方法。
附图说明
图1是根据本申请一个实施例提供的设备间联通方法的应用场景图;
图2是根据本申请一个实施例提供的电子设备的结构示意图;
图3是根据本申请一个实施例提供的电子设备的软件结构框图;
图4是根据本申请一个实施例提供的设备间联通方法的流程示意图;
图5(a)是手机的USB P2P模式的一个选择界面;
图5(b)是手机的USB P2P模式的另一个选择界面;
图6是根据本申请一个实施例中由应用触发启动USB P2P的示意图;
图7是根据本申请实施例1的设备间联通方法的流程示意图;
图8是根据本申请实施例2的设备间联通方法的流程示意图;
图9是根据本申请实施例3的设备间联通方法的流程示意图;
图10是根据图8所示手机中的USB P2P模块中状态机管理器所管理的各状态的关系示意图;
图11是根据本申请一些实施例的一种设备的框图;
图12是根据本申请一些实施例的一种片上系统(SoC)的框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整的描述。
下面,首先参考附图对本申请的实施例进行进一步详细说明。
以下,以手机1作为第一电子设备的实例,笔记本电脑2作为第二电子设备的实例进行说明。当然,第一电子设备不限于此,还可以是例如平板电脑等,同样地第二电子设备并不限于笔记本电脑,还可以是平板电脑、智能电视、大屏电视等。
图1是根据本申请一个实施例的设备间联通方法的示例性应用场景图。
图1示出了手机1与笔记本电脑2之间进行协同工作的一个场景。多屏协同,让用户能够在电脑上直接打开手机里的文件并进行编辑,编辑后文件依然会保存到手机上原来的位置。此外,手机1的提醒信息,可以直接显示到笔记本电脑2屏幕上。另外,用户还可以调用笔记本电脑2摄像头、麦克风、音响等硬件,接打手机1电话或视频通话,例如微信 TM、QQ TM、腾讯 TM会议、企业微信 TM、华为WeLink TM等。
在设备之间实现多屏协同的方法包括如下方案:
方案1:通过无线连接。以平板电脑与华为手机(或荣耀手机)建立多屏协同为例,其可以通过蓝牙查找连接或者进行扫码连接。以蓝牙查找连接为例,包括:从手机屏幕顶部状态栏下滑出通知面板,点击蓝牙图标开启蓝牙;同样地,从平板电脑屏幕顶部状态状态栏下滑出通知面板,点击多屏协同,并根据屏幕提示操作;将手机靠近平板电脑,并进一步根据手机和平板电脑屏幕的弹框提示完成连接即可。然而,无线连接方式存在着延时问题,且信号容易受干扰出现卡顿等问题。
方案2:针对无线连接的延时和卡顿问题,还提出了有线连接方案。也就是使用一根USB连接线,一端连接手机,一端连接笔记本电脑,基于此来实现多屏协同。然而,设备之间如果仅通过USB连线并基于USB协议进行通信,则传递数据使用的是USB通道,无法打通IP层,导致其数据传播速度难以满足要求。
如果能够通过USB连线打通IP层,则能够大大解决数据传播速度的问题。对于此,目前公开了在设备之间通过USB网络共享功能(即USB Tethering功能)来实现基于IP协议的通信方案,例如,手机可以将自己的移动数据网络通过USB共享给笔记本电脑等其他电子设备。USB Tethering功能是一种允许笔记本电脑通过通用串行总线(Universal Serial Bus,USB)端口连接并访问手机移动数据网络的功能。具体地,在笔记本电脑想要使用手机的移动网络时,通过软件桥接的方式来实现。在此过程中,手机中的蜂窝处理器从移动网络下载数据包,并将该数据包传输到应用处理器。手机的应用处理器并不直接对该数据包进行处理,而是通过USB桥接给笔记本电脑,由笔记本电脑进行处理。要实现电脑共享移动网络,在将电脑通过USB连接手机后,由笔记本电脑将其共享网络的请求通过USB桥接给手机,手机将该请求发送给其蜂窝处理器。蜂窝处理器在接受到该请求之后,通过接口函数进行相应配置。如此,通过上述的软件桥接方式实现电脑享用手机的移动互联网络的功能。
也就是说,USB Tethering技术是使用USB来共享网络的技术,在该模式下,当手机通过USB线连接电脑时,手机被当做USB上网卡,使电脑通过手机USB来上网。也就是说,电脑通过手机的USB共享该手机的网络。目前,大部分安卓手机系统都自带实现了该功能。该技术打通了IP层,使得数据传播速度大大提高。但是其存在电脑端的用户流量不可控,偷跑手机的网络流量的风险。
针对上述两种方案的缺点进行改进,本申请提出了一种新的联通方式(第一联通模式,以下简称USB P2P模式),在手机1与笔记本电脑2之间通过USB线连接的前提下,将USB设备也即手机1虚拟成网卡,以在手机1与笔记本电脑2之间打通IP层,同时为了避免笔记本电脑2偷跑手机1的网络流量而关闭手机1的USB模块将接收到的来自笔记本电脑2的数据包发送给手机1的移动通信模块的通路,也就是使得笔记本电脑2不能共享手机1的移动网络,从而能够发挥上述两种方案的优点的同时,避免上述两种方案的缺点。
图2示出了根据本申请一些实施例的包括手机在内的电子设备100的结构示意图。例如,本申请的上述应用场景中所提及的例如手机、平板电脑等终端设备。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接头130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
处理器110可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。例如,作为执行USB P2P模式的手机的处理器110,在接收到启动USB P2P模式的指令后,首先将手机虚拟成USB网卡,并通过USB模块进行IP地址的分配,且使手机停止将经由所述USB模块接收的数据传输至手机的移动通信模块。由此,在不共享移动网络的前提下实现基于IP层的数据传输。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功 能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
根据本申请的一些实施例,内部存储器121内存储有指令(换言之,计算机可读代码),处理器110读取内部存储器121中存储的所述指令时,执行根据本申请的设备间联通的方法。具体可以参考下述实施例的设备间联通方法。
USB接口130是一种符合USB标准规范的连接器,可以用来连接电子设备100和外围设备,具体可以是标准USB接口(例如Type C接口),Mini USB接口,Micro USB接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。在一些实施方案中,处理器110可以支持通用串行总线(Universal Serial Bus),通用串行总线的标准规范可以为USB1.x,USB2.0,USB3.x,USB4。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图3是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图3所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,视频等应用程序。其中例如可以包括HoloScreens TM、爱奇艺 TM、微信 TM、邮件、图库等应用可以使用多屏协同打开以便利用电脑的应用生态进行更便捷的处理。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,电话管理器,资源管理器,通知管理器,视图系统,连接管理器,外部监听管理器,状态机管理器,网络网络管理模块、USB管理模块等。
其中,连接管理器、外部监听管理器、状态机管理器综合构成联通模块用于管理设备间的联通模式,其中连接管理器分别连接网络管理模块、USB管理模块、外部监听管理器、以及状态机管理器。联通模块用于在手机与笔记本电脑之间进行IP层联通。
在本申请的一种可能的实现中,连接管理器用于启动USB P2P模式(作为第一联通模式的示例),并利用DHCP功能,经由所述USB模块分别给所述电子设备以及与其连接的其他电子设备(即第二电子设备)分配IP地址。也就是说,连接管理器根据启动USB P2P模式的请求,通过USB管理模块将USB的模式例如开启为RNDIS模式等,并通过网络管理模块给手机和笔记本电脑分配IP地址。此外,在本申请的另一些可能的实现中,连接管理器还用于启动USB Tethering模式(作为第二联通模式的示例),以便其他电子设备享用该电子设备的移动网络。
外部监听管理器用于管理外部用户,包括设置模块的设置、或者其他应用程序的接口调用的管理等,以及当USB的状态发生变化时通知相应模块。具体而言,例如,当用户通过设置模块打开USB P2P模 式时,外部监听管理器将该信息反馈给连接管理器,以便进行相应的设置来实现USB P2P模式的正常运行,或者,当检测到USB接口通过连接线连接了外部设备例如笔记本电脑时,跳出USB连接方式的选项以便用户选择后由连接管理器进行相应的操作。
状态机管理器,主要用于在第一联通模式与第二联通模式之间进行切换、以及状态的融合的管理。
具体地,可以参考下述结合图6-9对实施例1-3的详细说明。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合使用购物APP进行购物的场景,示例性说明电子设备100软件以及硬件的工作流程。当触摸传感器180K接收到触摸操作,即触摸购物APP图标的操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息),原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为购物APP图标的控件为例,购物APP应用调用应用框架层的接口,启动购物应用,进而通过调用内核层启动显示驱动,通过移动通信模块150或无线通信模块160从该购物APP的服务器获取相应的店铺信息等。
下面,结合图4-图6描述根据本申请实施例的设备间联通方法。
下面,以手机与笔记本电脑之间进行联通的方法为例进行说明。即,手机是第一电子设备的实例,笔记本电脑是第二电子设备的实例。
如图4所示,根据本申请实施例的设备间联通方法,包括:
步骤S100,手机启动USB P2P模式。
如上述说明,该USB P2P模式用于在手机与笔记本电脑之间实现IP层联通。
具体地,例如可以在手机检测到笔记本电脑经由USB模块与其连接时,发出启动USB P2P模式的请求。基于该请求,可以通过用户确认来启动该USB P2P模式。
例如,当手机检测到其自身的USB接口通过USB连接线连接外部设备,比如笔记本电脑时,可以弹出如图5(a)或图5(b)所示的选择框,以供用户选择。图5(a)显示的是在USB的连接方式下设置的选择项。图5(b)显示的是在USB的热点共享处增设的选择项。这两种设置并不存在本质的区别,只是界面所处位置不同。当用户选择USB P2P模式,则手机启动USB P2P模式,进行相应的设置,例如下述的USB模块的模式设置、IP地址的分配、数据包转发规则的设置等。其中,USB接口可以是标准USB接头(例如Type A接头,Type B接头,Type C接头),Mini USB接口,Micro USB接口等。
当然,也可以隐藏该选择框,将手机直接设置为默认该选项,也就是手机通过USB连接线连接外部设备时,默认选中该USB P2P模式,直接启动该USB P2P模式,如果手机想要关闭该模式而启用其他模式例如充电模式等,则可以调出USB的设置选项进行相应设置。
此外,作为启动方式之一,还可以是手机根据其自身所运行的应用发出的请求,启动该USB P2P模式。例如,如图6所示,手机打开爱奇艺 TM,弹出爱奇艺 TM的业务框,在该业务框里出现提醒用户启动该USB P2P模式的提醒框。
步骤S200,手机利用DHCP功能,经由该手机的USB模块,为手机以及与手机相连接的笔记本电脑分配IP地址。
也就是说,手机被虚拟成USB网卡后,利用DHCP功能为手机以及与手机相连接的笔记本电脑分配IP地址,由此来打通手机与笔记本电脑之间的IP层。
具体地,作为将设备虚拟USB网卡的方式,例如可以将USB模块设置为RNDIS模式,实质上就是在通过USB模块在手机上跑TCP/IP,让手机以USB网卡的方式工作。目前,手机、平板电脑、智能手表、电脑均能够通过RNDIS实现将其虚拟成USB网卡。
此后,利用DHCP功能,经由USB模块,分别将IP地址分配给手机和与手机通过USB连接线连接的笔记本电脑。
需要说明的是,不限于DHCP模式进行IP地址的分配只要能够进行IP地址分配的任一方案均可适用于本申请。
步骤S300,手机停止将经由USB模块接收的数据传输至手机的移动通信模块。
也就是说,手机的USB模块接收来自笔记本电脑的数据,并停止将所述数据传输至手机的移动通信模块。
具体而言,笔记本电脑意图享用手机的移动网络,则会向手机发送享用移动网络的请求。该请求将通过USB接口首先由手机的USB模块所接收,手机需要将该数据(即请求)发送至手机的移动通信模块,并收到移动通信模块做出的相应的响应才能实现移动网络的共享。本申请实施例的技术方案通过切断将经由USB模块接收的数据传输至手机的移动通信模块的通路,则能够在该USB P2P模式下避免共享移动网络。
例如,手机可以通过设置转发规则来实现停止将经由USB模块接收的数据传输至手机的移动通信模块。更具体而言,例如可以在路由器上设置端口映射,此后通过添加服务端口、选定IP地址来实现。
根据上述实施例1的设备间联通方法,通过将手机虚拟成USB网卡,并分别给手机和笔记本电脑分配IP地址,能够在手机和笔记本电脑之间打通IP层,实现IP层的数据传输,从而相比于普通的USB连接且基于USB协议进行通信,能够极大提高数据传输速度。此外,通过设置转发规则,使得手机与笔记本电脑之间不共享移动网络,各自用各自的网络进行上网,避免了笔记本电脑偷跑手机流量的问题。
下面,结合附图详细描述根据本申请实施例的设备间联通方法。
实施例1
首先,结合图7详细描述根据本申请实施例1的设备间联通方法。
在手机和笔记本电脑之间通过USB连接线连接之后,手机通过如下步骤实现USB P2P模式的联通。
步骤S101,手机通过应用发出启动USB P2P模式的请求,或者如图5(a)、图5(b)所示通过设置模块中的USB连接方式选择框、共享设置选择框选中USB P2P选项以发出启动USB P2P模式的请求。
步骤S102,手机的接口层收到该请求后,指示连接管理器检查USB P2P模式是否开启。
步骤S103,当连接管理器检测到未开启启动USB P2P模式时,则连接管理器启动USB P2P模式。
步骤S201,连接管理器指示USB管理模块将USB模块设置为RNDIS模式。
步骤S202,USB管理模块接收到连接管理器的指示之后,对USB模块进行设置,以将其设置为RNDIS模式。由此,将USB模块虚拟成网卡。
步骤S203,连接管理器指示网络管理模块分配IP地址。
步骤S204,网络管理模块接收分配IP地址的指示后,利用DHCP功能,利用DNSmasq软件,给手机和笔记本电脑分配IP地址。
步骤S301,连接管理器进行转发规则设置,以关闭将USB模块所接收到的数据包传输至移动网络模块的通路。
也就是说,使得笔记本电脑不能共享手机的移动网络。
步骤S401,连接管理器反馈给APP/设置模块,USB P2P模式开启成功。
根据上述实施例1的设备间联通方法,通过将USB模块虚拟成网卡,并分别给手机和笔记本电脑分配IP地址,能够在手机和笔记本电脑之间打通IP层,实现IP层的数据传输,从而相比于普通的USB连接且基于USB协议进行通信,能够极大提高数据传输速度。此外,通过设置转发规则,使得手机与笔记本电脑之间不共享移动网络,各自用各自的网络进行上网,避免了笔记本电脑偷跑手机流量的问题。
实施例2
接下来,结合图8详细描述根据本申请实施例2的设备间联通方法。
在手机和笔记本电脑之间通过USB连接线连接之后,手机通过如下步骤实现USB P2P模式的联通。
步骤S111,手机通过应用1发出启动USB P2P模式的请求。
步骤S112,手机的接口层收到该请求后,指示连接管理器检查USB P2P模式是否开启。
步骤S113,连接管理器检测到未开启启动USB P2P模式时,则连接管理器启动USB P2P模式。
步骤S211,连接管理器指示USB管理模块将USB模块设置为RNDIS模式。
步骤S212,USB管理模块接收到连接管理器的指示之后,对USB模块进行设置,以将其设置为RNDIS模式。由此,将USB模块虚拟成网卡。
步骤S213,连接管理器指示网络管理模块分配IP地址。
步骤S214,网络管理模块接收分配IP地址的指示后,利用DHCP功能,利用DNSmasq软件,给手机和笔记本电脑分配IP地址。
步骤S311,连接管理器进行转发规则设置,以关闭将USB模块所接收到的数据包传输至移动网络模块的通路。
也就是说,使得笔记本电脑不能享用手机的移动网络。
步骤S411,连接管理器反馈给APP/设置模块,USB P2P模式开启成功。
上述步骤S111至步骤S411,与实施例1的相同。在此不再进行详细说明。与上述实施例1所不同的是,本实施例中,还对应于多个应用要求开启USB P2P的模式进行管理。具体地,在上述步骤的基础之上,还包括如下步骤:
步骤S511,手机上运行的应用2发出启动USB P2P模式的请求。
步骤S512,接口层收到该请求后,指示连接管理器检查USB P2P模式是否开启。
步骤S513,连接管理器进行检测,检测到已经开启USB P2P模式。
步骤S514,连接管理器通知应用2,开启成功。至此,应用2可以正常利用USB P2P模式进 行多屏协同。
也就是说,手机上除了应用1之外,可以同时跑多个需要多屏协同的应用。当通过第一个应用(即应用1)开启了USB P2P模式之后,后续应用(例如应用2)在发出启动USB P2P模式的请求时,接口层通知连接管理器检测是否已经开启USB P2P模式,连接管理器接到该通知后进行检测,确定已经开启该模式之后,通知应用2开启成功,此时应用2可以正常使用多屏协同功能。
更进一步地,在多个应用请求启动USB P2P模式的情况下,还存在USB P2P模式的退出机制的问题。
为此,本实施例还包括如下步骤:
步骤S611,一应用请求关闭USB P2P模式。需要说明的是,该应用可以是多个运行中的应用中的任意一个。
步骤S612,接口层收到该请求后,通知连接管理器关闭USB P2P模式。
步骤S613,连接管理器进行检测,当确定有其他应用正在使用USB P2P模式,则停止关闭;
步骤S614,当确定无其他应用正在使用USB P2P模式,则通知USB管理模块取消设置USB RNDIS模式(即取消将USB模块虚拟成网卡),由USB管理模块进行相应设置。
也就是说,在多个应用申请开启USB P2P模式的情境下,当各应用结束使用并陆续退出的过程中,当最后一个应用退出USB P2P模式时,USB管理模块管理USB模块的设置,关闭USB的RNDIS模式。待到下一个应用请求开启后再启动。
步骤S615,连接管理器通知手机的设置模块,关闭完毕。也就是说,在设置模块的选择框里不再显示其处于开启状态。
另外,上述应用在请求启动USB P2P模式时,连接管理器还记录每个请求开启USB P2P模式的标识,例如可以使用用户ID、或者任意可以标识调用者的标识符,当多个应用请求启动USB P2P模式时,则将这些多个应用的标识记录下来,形成清单。此后,在一应用退出进程(申请关闭,或者异常退出)时,则连接管理器从上述清单中去除相应的标识。
由此,根据本实施例的设备间联通方法,只要通过确认清单中是否还存在标识即可确认是否还有应用正在使用USB P2P模式,只有当清单中不存在任何标识时才会关闭USB P2P模式,能够简单且确实地对于使用USB P2P模式的应用进行管理,避免因错误退出导致应用的非正常中断、数据丢失等。
实施例3
下面,结合图9详细描述根据实施例3的设备间联通方法。
以应用1、应用2为例的USB P2P模式的开启步骤(也就是步骤S111至步骤S514),与上述实施例2相同,在图9中标以相同的步骤编号,省略其详细说明。
与上述实施例2不同的是,除了多个应用请求启动USB P2P模式之外,还通过设置模块请求启动USB Tethering模式,也就是请求将手机的移动网络共享给笔记本电脑。为了实现该USB Tethering模式的运行,本实施例还包括如下步骤:
步骤S711,设置模块申请开启USB Tethering模式。
步骤S712,接口层指示连接管理器检查USB Tethering模式是否开启。
步骤S713,连接管理器进行检查,当检查到USB Tethering模式未开启,则进行转发规则的设置,使得USB模块接收的来自笔记本电脑的数据能够传输至手机的移动通信模块。
步骤S714,向设置模块发送开启成功的通知。
当然,本实施例仅仅给出了一种示例,即先开启USB P2P模式之后申请联通USB Tethering模式的情况。还存在先开启USB Tethering模式之后有应用申请联通USB P2P模式的情况。同样地,此时只要连接管理器检查到USB Tethering模式已经开启,由于在该状态下能够直接进行IP层的通信,则连接管理器直接向设置模块发送开启成功的通知。需要注意的是,在此情况下,连接管理器不再进行转发规则的设置,而是保留USB Tethering模式下的转发规则,以便USB Tethering模式能够持续正常运行。而对于上层的用户而言,则无法感知,对于用户显示的是同时开启了USB P2P模式以及USB Tethering模式。
另外,在所有申请启动USB P2P模式的应用结束进程时,由于此时手机同时开启了USB P2P模式以及USB Tethering模式,与上述实施例2所不同的是,所述步骤S614中,还进一步确定是否无其他应用使用USB Tethering模式,只有当既无应用使用USB P2P模式也无应用使用USB Tethering模式时,通知USB管理模块取消设置RNDIS模式。也就是说,当应用退出USB P2P模式时,USB模块并不真正退出虚拟网卡的模式,以便USB Tethering模式可以正式运行。
同样地,当手机退出USB Tethering模式时,也不会立刻通知USB管理模块取消设置RNDIS模式。当手机的所有使用USB Tethering模式的应用结束进程时,首先通过连接管理器重新设置转发规则,以将所述USB模块接收的来自笔记本电脑的数据能够传输至所述手机的移动通信模块的通路关闭,但保留USB管理模块继续为RNDIS模式,以便USB P2P模式继续运行。也就是说,此时虽然设置模块显示USB Tethering模式关闭,但手机的操作系统底层实际并未关闭RNDIS模式。只有所有使用USB P2P模式的应用的进程也结束时,此时连接管理器才通知USB管理模块取消设置RNDIS模式。也就是说,此时设置模块同时显示USB P2P模式以及USB Tethering模式均已关闭,且USB模块已经退出虚拟网卡模式,手机和笔记本电脑之间切断所有的IP层通信链路,此时在手机和笔记本电脑之间仅可以基于USB协议进行数据传输。
通过上述对实施例3的介绍可知,USB P2P模式和USB Tethering模式的状态是耦合,并且会冲突的。所以,为了解决这两个状态之间的转换问题,如图3所示,可以在应用程序框架层中抽象出状态机管理器,由其负责USB P2P模式和USB Tethering模式之间的状态的冲突处理、协同、转换、已经状态查询等。
图10示出了几种状态之间的转换。
其中,IdleState(初始状态)表示:系统初始状态,也就是所有状态的父状态。也即表明USB P2P与Tethering均未连接。
StartingP2pState【开启USBP2P状态】表示:尝试开启USB P2P状态,也就是表明启动USB P2P模式。
P2pState【USB P2P开启成功状态】表示:USB P2P模式已经处于激活状态,也就是说手机此时已经处于与笔记本电脑之间能够基于USB P2P模式进行IP层通信且不共享移动网络。
TetherState【共享网络状态】表示:USB Tethering模式已经开启,也就是说移动网络共享状态已经开启,且没有业务申请使用USB P2P。
JointState【协同状态】表示:处于协同状态,也就是说USB移动网络共享已开启,且有其他业务申请使用USB P2P。
StoppingP2pState【申请关闭USB P2P状态】表示:尝试退出USB P2P状态,表明所有使用USB P2P的应用已经进程结束,尝试退出。
参考图10可知,在手机处于IdleState状态下,当有业务申请开启USB P2P模式,则进入 StartingP2pState状态,状态机管理器记录该状态。为了最终实现USB P2P模式,状态机管理器将当前处于StartingP2pState状态通知连接管理器,进而由连接管理器通知USB网络设置模块设置USB模块为RNDIS模式(也即是激活RNDIS模式),并由网络管理器分配IP地址,且由连接管理器相应地设置转发规则,由此激活P2pState状态,状态机管理器进一步记录手机的USB此时处于P2pState状态。
在P2pState状态下,当所有申请USB P2P模式的应用均已结束进程,则连接管理器发出关闭USB P2P模式的请求,从而进入StoppingP2pState状态。在此状态下,参考上述说明可知,连接管理器接到状态机管理器告知的当前处于StoppingP2pState状态的通知后,连接管理器告知USB管理模块关闭USB的RNDIS模式,从而回到IdleState状态。由此,实现了从初始状态到开启USB P2P状态,再到激活USB P2P模式,再到申请退出USB P2P模式,并最终回到初始状态的一个过程。
另外,在P2pState状态下,当根据业务需求,需要开启USB Tethering模式,则状态机管理器将现在状态(即P2pState状态)通知连接管理器,连接管理器直接进行转发规则的设置即可实现USB Tethering模式,由此进入JointState状态,也就是进入USB P2P模式和USB Tethering模式同时激活的状态。
另外,由图10可知,在JointState状态下,当尝试关闭USB P2P时,则状态机管理器将此时处于JointState状态告知连接管理器,连接管理器基于该状态信息,在接收到关闭USB P2P的请求时,并不会如上述所述进入StoppingP2pState状态,而是直接进入TetherState状态。实际上,连接管理器并不会告知USB管理模块改变USB模块的模式,且连接管理器也不会改变转发规则。也就是说,此时,系统底层并不会做出改变,只是在设置模块那里显示USB P2P模式已经关闭,手机当前处于USB Tethering激活状态,即TetherState状态。
并且,在JointState状态下,当尝试关闭USB Tethering模式时,则状态机管理器将此时处于JointState状态告知连接管理器,连接管理器基于该状态信息,在接收到关闭USB Tethering模式的请求时,连接管理器并不会通知关闭USB模块的RNDIS模式,而是直接进入P2PState状态。也就是说,连接管理器并不会告知USB管理模块改变USB模块的模式,而仅仅改变转发规则。换言之,此时,系统底层仅仅关闭了USB将接收到的数据包转发至移动通信模块的通路,并在设置模块那里显示USB Tetherting模式已经关闭,手机当前处于USB P2P激活状态,即P2PState状态。
除此之外,还存在申请开启USB P2P模式的应用被杀死的情况,也就是异常退出的情况,在此情况下,都会直接回到初始状态,状态机管理器也直接将USB模块的状态记录为初始状态,在此基础上,根据新的应用请求或设置模块发出的启动请求,进行相应的设置。
由上述说明可知,通过引入状态机管理器,及时将USB的当前状态报告给连接管理器,能够使得连接管理器避免错误地通知USB管理模块关闭USB模块的RNDIS模式,从而能够有效比避免两种状态之间存在的冲突问题,使得系统底层处于融合状态,能够进一步改善用户体验。
下面,参考图11对本申请的一个实施例的设备1200(例如手机)进行说明。图11所示为根据本申请的一个实施例的设备1200的框图。设备1200可以包括耦合到控制器中枢1203的一个或多个处理器1201。对于至少一个实施例,控制器中枢1203经由诸如前端总线(Front Side Bus,FSB)之类的多分支总线、诸如快速通道互连(Quick Path Interconnect,QPI)之类的点对点接口、或者类似的连接1206与处理器1201进行通信。处理器1201执行控制一般类型的数据处理操作的 指令。在一实施例中,控制器中枢1203包括,但不局限于,图形存储器控制器中枢(Graphics Memory Controller Hub,GMCH)(未示出)和输入/输出中枢(Input Output Hub,IOH)(其可以在分开的芯片上)(未示出),其中GMCH包括存储器和图形控制器并与IOH耦合。
设备1200还可包括耦合到控制器中枢1203的协处理器1202和存储器1204。或者,存储器和GMCH中的一个或两者可以被集成在处理器内(如本申请中所描述的),存储器1204和协处理器1202直接耦合到处理器1201以及控制器中枢1203,控制器中枢1203与IOH处于单个芯片中。存储器1204可以是例如动态随机存取存储器(Dynamic Random Access Memory,DRAM)、相变存储器(Phase Change Memory,PCM)或这两者的组合。在一个实施例中,协处理器1202是专用处理器,诸如例如高吞吐量MIC处理器(Many Integerated Core,MIC)、网络或通信处理器、压缩引擎、图形处理器、通用图形处理器(General Purpose Computing on GPU,GPGPU)、或嵌入式处理器等等。协处理器1202的任选性质用虚线表示在图12中。
存储器1204作为计算机可读存储介质,可以包括用于存储数据和/或指令的一个或多个有形的、非暂时性计算机可读介质。例如,存储器1204可以包括闪存等任何合适的非易失性存储器和/或任何合适的非易失性存储设备,例如一个或多个硬盘驱动器(Hard-Disk Drive,HDD(s)),一个或多个光盘(Compact Disc,CD)驱动器,和/或一个或多个数字通用光盘(Digital Versatile Disc,DVD)驱动器。
在一个实施例中,设备1200可以进一步包括网络接口(Network Interface Controller,NIC)1206。网络接口1206可以包括收发器,用于为设备1200提供无线电接口,进而与任何其他合适的设备(如前端模块,天线等)进行通信。在各种实施例中,网络接口1206可以与设备1200的其他组件集成。网络接口1206可以实现上述实施例中的通信单元的功能。
设备1200可以进一步包括输入/输出(Input/Output,I/O)设备1205。I/O 1205可以包括:用户界面,该设计使得用户能够与设备1200进行交互;外围组件接口的设计使得外围组件也能够与设备1200交互;和/或传感器设计用于确定与设备1200相关的环境条件和/或位置信息。
值得注意的是,图11仅是示例性的。即虽然图11中示出了设备1200包括处理器1201、控制器中枢1203、存储器1204等多个器件,但是,在实际的应用中,使用本申请各方法的设备,可以仅包括设备1200各器件中的一部分器件,例如,可以仅包含处理器1201和NIC1206。图11中可选器件的性质用虚线示出。
根据本申请的一些实施例,作为计算机可读存储介质的存储器1204上存储有指令,该指令在计算机上执行时使设备1200执行根据上述实施例中的设备间联通方法,具体可参照上述实施例的方法,在此不再赘述。
图12所示为根据本申请的一实施例的SoC(System on Chip,片上系统)1300的框图。在图12中,相似的部件具有同样的附图标记。另外,虚线框是更先进的SoC的可选特征。在图12中,SoC1300包括:互连单元1350,其被耦合至应用处理器1310;系统代理单元1380;总线控制器单元1390;集成存储器控制器单元1340;一组或一个或多个协处理器1320,其可包括集成图形逻辑、图像处理器、音频处理器和视频处理器;静态随机存取存储器(Static Random Access Memory,SRAM)单元1330;直接存储器存取(DMA)单元1360。在一个实施例中,协处理器1320包括专用处理器,诸如例如网络或通信处理器、压缩引擎、GPGPU、高吞吐量MIC处理器、或嵌入式处理器等。
静态随机存取存储器(SRAM)单元1330中可以包括用于存储数据和/或指令的一个或多个计 算机可读介质。计算机可读存储介质中可以存储有指令,具体而言,存储有该指令的暂时和永久副本。该指令可以包括:由处理器中的至少一个单元执行时使Soc1300执行根据上述实施例中的方法,具体可参照上述实施例的方法,在此不再赘述。
本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。
可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器(Digital Signal Processor,DSP)、微控制器、专用集成电路(Application Specific Integrated Circuit,ASIC)或微处理器之类的处理器的任何系统。
程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。
在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、光盘只读存储器(Compact Disc Read Only Memory,CD-ROMs)、磁光盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read Only Memory,EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明书附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还 包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,上述仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (15)

  1. 一种设备间联通方法,用于第一电子设备与第二电子设备构成的系统,所述第一电子设备和所述第二电子设备通过USB线进行连接,其特征在于,包括:
    所述第一电子设备启动第一联通模式,所述第一联通模式用于在所述第一电子设备和第二电子设备之间进行IP层联通;
    所述第一电子设备为所述第一电子设备以及所述第二电子设备分配IP地址;
    所述第一电子设备的USB模块接收来自所述第二电子设备的数据;
    所述第一电子设备停止将所述数据传输至所述第一电子设备的移动通信模块。
  2. 根据权利要求1所述的方法,其特征在于,所述第一电子设备利用DHCP功能,经由所述USB模块为所述第一电子设备以及所述第二电子设备分配IP地址。
  3. 根据权利要求1所述的方法,其特征在于,还包括:
    在所述第二电子设备上镜像同屏显示所述第一电子设备的桌面,以实现所述第一电子设备与所述第二电子设备的多屏协同。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述第一电子设备包括手机、平板电脑中的任一个,所述第二电子设备包括手机、平板电脑、笔记本电脑、台式电脑、智能电视中的任一个。
  5. 根据权利要求2所述的方法,其特征在于,所述经由所述USB模块为所述第一电子设备以及所述第二电子设备分配IP地址包括:
    所述第一电子设备使得所述USB模块以RNDIS模式工作,以将所述第一电子设备虚拟成网卡;
    基于DHCP功能,为所述USB模块分配IP地址;
    所述USB模块将所述IP地址分别分配给所述第一电子设备与所述第二电子设备。
  6. 根据权利要求1所述的方法,其特征在于,所述第一电子设备通过设置转发规则,停止将所述数据传输至所述第一电子设备的移动通信模块。
  7. 根据权利要求1所述的方法,其特征在于,还包括:
    所述第一电子设备显示启动所述第一联通模式的选项;
    所述第一电子设备接收对所述选项的操作;
    响应于接收到的对所述选项的操作,所述第一电子设备启动所述第一联通模式。
  8. 根据权利要求1所述的方法,其特征在于,所述第一电子设备根据接收到的来自所述第一电子设备上运行的至少一个应用的请求,启动所述第一联通模式。
  9. 根据权利要求8所述的方法,其特征在于,在多个应用请求启动所述第一联通模式的情况下,当最后一个应用关闭之后,所述第一电子设备关闭所述第一联通模式。
  10. 根据权利要求9所述的方法,其特征在于,所述在多个应用请求启动所述第一联通模式的情况下,当最后一个应用关闭之后所述第一电子设备关闭所述第一联通模式包括:
    记录每个发出所述请求的应用的标识,建立清单;
    当第一应用所在的进程结束,则从所述清单中清除所述第一应用对应的标识,直至所述清单中无标识存在,所述第一电子设备关闭所述第一联通模式。
  11. 根据权利要求1所述的方法,其特征在于,还包括:
    当所述第一电子设备接收到启动第二联通模式的请求,所述第一电子设备使得所述USB模块接收的来自所述第二电子设备的数据能够传输至所述第一电子设备的移动通信模块,其中,所述第二联通模式将所述第一电子设备的移动网络共享给所述第二电子设备。
  12. 根据权利要求11所述的方法,其特征在于,在请求启动第一联通模式的所有应用关闭的情况下,进一步检测所述第二联通模式是否处于启动状态,当检测到所述第二联通模式处于启动状态时,所述USB模块持续作为虚拟网卡直至所述第二联通模式关闭。
  13. 根据权利要求11所述的方法,其特征在于,所述第一电子设备基于所运行的应用的请求,在所述第一联通模式与所述第二联通模式之间切换。
  14. 一种电子设备,包括触摸屏,存储器,一个或多个处理器,多个应用程序,其特征在于,所述电子设备还包括一个或多个用于执行设备间联通方法的程序,其中所述一个或多个用于执行设备间联通方法程序被存储在所述存储器中,当所述一个或多个处理器在执行所述一个或多个用于执行设备间联通方法程序时,使得所述电子设备实现如权利要求1至13任一项所述的方法。
  15. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-13中任一项所述的方法。
PCT/CN2021/124006 2020-10-20 2021-10-15 设备间联通方法、电子设备、及计算机可读存储介质 WO2022083507A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21881925.8A EP4213532A4 (en) 2020-10-20 2021-10-15 METHOD FOR COMMUNICATION BETWEEN DEVICES AND ELECTRONIC DEVICE AND COMPUTER-READABLE STORAGE MEDIUM
US18/249,466 US20230370420A1 (en) 2020-10-20 2021-10-15 Method for Connection Between Devices, Electronic Device, and Computer-Readable Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011124452.2A CN114448940B (zh) 2020-10-20 2020-10-20 设备间联通方法、电子设备、及计算机可读存储介质
CN202011124452.2 2020-10-20

Publications (1)

Publication Number Publication Date
WO2022083507A1 true WO2022083507A1 (zh) 2022-04-28

Family

ID=81289671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124006 WO2022083507A1 (zh) 2020-10-20 2021-10-15 设备间联通方法、电子设备、及计算机可读存储介质

Country Status (4)

Country Link
US (1) US20230370420A1 (zh)
EP (1) EP4213532A4 (zh)
CN (2) CN114448940B (zh)
WO (1) WO2022083507A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103298033A (zh) * 2012-02-23 2013-09-11 美国博通公司 受限无线接入点的流量控制
WO2018082044A1 (zh) * 2016-11-04 2018-05-11 华为技术有限公司 一种网络热点控制的方法以及相关设备
CN111328054A (zh) * 2018-12-14 2020-06-23 腾讯科技(深圳)有限公司 数据传输方法和装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7613770B2 (en) * 2006-06-30 2009-11-03 Microsoft Corporation On-demand file transfers for mass P2P file sharing
KR101780021B1 (ko) * 2010-10-18 2017-10-11 삼성전자주식회사 네트워크 인터페이스의 자동 설정에 기초해 인터넷 연결을 공유하는 방법 및 장치
EP2533555B1 (en) * 2011-06-10 2016-03-30 BlackBerry Limited System and method for conducting peer-to-peer (P2P) communications
US9619417B2 (en) * 2011-06-17 2017-04-11 Alcatel Lucent Method and apparatus for remote delivery of managed USB services via a mobile computing device
CN106549998B (zh) * 2015-09-22 2019-08-02 深圳市赛格导航科技股份有限公司 一种obd数据透传的方法及系统
CN107463524A (zh) * 2016-06-06 2017-12-12 华为终端(东莞)有限公司 一种访问数据的方法及相关设备
CN210986103U (zh) * 2020-03-09 2020-07-10 济南慧天云海信息技术有限公司 一种基于rndis的高速数据单向传输装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103298033A (zh) * 2012-02-23 2013-09-11 美国博通公司 受限无线接入点的流量控制
WO2018082044A1 (zh) * 2016-11-04 2018-05-11 华为技术有限公司 一种网络热点控制的方法以及相关设备
CN111328054A (zh) * 2018-12-14 2020-06-23 腾讯科技(深圳)有限公司 数据传输方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4213532A4

Also Published As

Publication number Publication date
CN114448940B (zh) 2023-03-31
CN116319681A (zh) 2023-06-23
EP4213532A1 (en) 2023-07-19
US20230370420A1 (en) 2023-11-16
EP4213532A4 (en) 2024-02-21
CN114448940A (zh) 2022-05-06

Similar Documents

Publication Publication Date Title
US11297453B2 (en) Swapping roles between untethered wirelessly connected devices
US10437631B2 (en) Operating system hot-switching method and apparatus and mobile terminal
CN108605373B (zh) 用于提供网络共享服务的方法和电子装置
EP4261676A1 (en) Distributed application processing method and apparatus
WO2019019954A1 (zh) 基于终端的多安卓系统实现方法、存储介质及终端
WO2024088268A1 (zh) Rdma事件管理方法、设备及存储介质
JP2002268778A (ja) 情報処理装置
CN116028205A (zh) 资源调度方法和电子设备
WO2022083507A1 (zh) 设备间联通方法、电子设备、及计算机可读存储介质
WO2023029983A1 (zh) 一种控件内容的拖拽方法、电子设备及系统
WO2022053062A1 (zh) 一种IoT设备的管理方法及终端
WO2022262529A1 (zh) 控制方法、装置、电子设备及存储介质
CN115278642A (zh) 获取sim卡的信息的方法、电子设备及终端设备
CN117479344B (zh) 一种蓝牙连接方法、电子设备及可读存储介质
CN116737404A (zh) 用于应用接续的方法及终端设备
WO2024022256A1 (zh) 一种设备间连接的管理方法、设备及系统
WO2024067166A1 (zh) 共享文件的方法、电子设备及计算机可读存储介质
CN117479344A (zh) 一种蓝牙连接方法、电子设备及可读存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021881925

Country of ref document: EP

Effective date: 20230414

NENP Non-entry into the national phase

Ref country code: DE