WO2022052731A1 - 传输数据的方法和电子设备 - Google Patents
传输数据的方法和电子设备 Download PDFInfo
- Publication number
- WO2022052731A1 WO2022052731A1 PCT/CN2021/112168 CN2021112168W WO2022052731A1 WO 2022052731 A1 WO2022052731 A1 WO 2022052731A1 CN 2021112168 W CN2021112168 W CN 2021112168W WO 2022052731 A1 WO2022052731 A1 WO 2022052731A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- electronic device
- information
- network
- electronic
- electronic devices
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W40/00—Communication routing or communication path finding
- H04W40/24—Connectivity information management, e.g. connectivity discovery or connectivity update
- H04W40/246—Connectivity information discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W40/00—Communication routing or communication path finding
- H04W40/24—Connectivity information management, e.g. connectivity discovery or connectivity update
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W40/00—Communication routing or communication path finding
- H04W40/24—Connectivity information management, e.g. connectivity discovery or connectivity update
- H04W40/28—Connectivity information management, e.g. connectivity discovery or connectivity update for reactive routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/005—Discovery of network devices, e.g. terminals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/02—Terminal devices
- H04W88/04—Terminal devices adapted for relaying to or from another terminal or user
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/02—Terminal devices
- H04W88/06—Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals
Definitions
- the present application relates to the field of communications, and more particularly to methods and electronic devices for transmitting data in the field of communications.
- data can be transmitted between electronic devices through different transmission methods. Different types of electronic devices may appear in a scene. For example, mobile phones, TVs, wristbands, Electronic devices such as speakers and watches.
- the electronic devices can be connected through Bluetooth, wifi, or universal serial bus (USB) and other connection methods.
- the electronic device needs to automatically discover which connection methods exist, select a connection method among these connection methods, and then establish a connection, and use the established connection to transmit data, which will cause a long transmission delay.
- the embodiments of the present application provide a data transmission method and electronic device, which can save transmission delay.
- an electronic device for transmitting data can be executed by a first electronic device, and the first electronic device can be a device, such as a chip system, capable of supporting the electronic device to implement the functions required by the method. It includes: the first electronic device in the plurality of electronic devices determines, according to the network topology relationship, path information for transmitting the first data to the second electronic device in the plurality of electronic devices and two adjacent electronic devices on the transmission path indicated by the path information The network connection mode between the two electronic devices, the path information is used to indicate the electronic devices through which the first electronic device transmits the first data to the second electronic device, and the network topology relationship includes multiple electronic devices and the network connection mode between the multiple electronic devices ;
- the first electronic device transmits the first data to the second electronic device according to the path information and the network connection mode between two adjacent electronic devices on the transmission path indicated by the path information.
- each electronic device can network in advance different network connections supported by each electronic device to form a network topology relationship.
- the network topology relationship may include multiple electronic devices and a network connection between any two electronic devices among the multiple electronic devices.
- the first electronic device and the second electronic device directly transmit the first data according to the network topology relationship.
- the first data is transmitted through the network connection in The delay caused by the establishment of the connection is beneficial to reduce the delay of data transmission.
- the first electronic device is any electronic device among the plurality of electronic devices.
- the first electronic device may predetermine the network topology relationship, or the central node in the multiple electronic devices may determine the network topology relationship and send the network topology relationship to the first electronic device.
- the first electronic device may save the network topology relationship, and the network topology relationship may be updated or not updated.
- any electronic device among the plurality of electronic devices includes a saved network topology relationship, and the saved network topology relationships are all the same.
- information exchanged directly or indirectly between multiple electronic devices may be based.
- the exchanged information may include information for determining network topology relationships or information for determining path information.
- information may be exchanged between a plurality of electronic devices on a regular basis or when the information changes.
- the transmission path indicated by the path information includes more than two electronic devices.
- the transmission path may include only the first electronic device and the second electronic device, or may include in addition to the first electronic device and the second electronic device. electronic equipment.
- the first electronic device in the plurality of electronic devices determines the path information for transmitting the first data to the second electronic device in the plurality of electronic devices by using the network topology relationship and on the transmission path indicated by the path information Before the network connection between the two adjacent electronic devices, the method further includes: the first electronic device acquires basic information of each electronic device in the plurality of electronic devices and network capability information of each electronic device;
- the first electronic device determines the network topology relationship according to the basic information of each electronic device and the network capability information of each electronic device.
- the basic information of each electronic device is used to identify the electronic device.
- the basic information of each electronic device includes an identifier of the electronic device, a name of the electronic device, a network identifier of the electronic device, the type of the electronic device, weight information of the electronic device, role information of the electronic device, and version of the electronic device at least one of the information.
- the network capability information of each electronic device includes: the network capability information of each electronic device includes: the network connection supported by each electronic device, the bandwidth supported by the network connection supported by each electronic device, the bandwidth supported by each electronic device At least one of the connection information of the network connections supported by the device, the connection status of the network connections supported by each electronic device, and the time information of the network connections in the connected state.
- the first electronic device acquires basic information of each electronic device among the plurality of electronic devices and network capability information of each electronic device, including:
- the first electronic device receives the basic information of the third electronic device and the network capability information of the third electronic device sent by the third electronic device through the first network connection, or receives the third electronic device sent by the third electronic device through the first network connection basic information of the third electronic device, network capability information of the third electronic device, basic information of the fourth electronic device among the plurality of electronic devices, and network capability information of the fourth electronic device;
- the first electronic device sends the basic information of the first electronic device and the network capability information of the first electronic device to the third electronic device through the first network connection.
- the first electronic device can exchange its own information with the third electronic device through the connected first network connection, and the third electronic device can exchange its own information with the first electronic device through the established first network connection, and also It is possible to exchange its own information with the information of other electronic devices (information of the fourth electronic device).
- the information exchanged by multiple electronic devices can be exchanged directly or indirectly through an intermediate device.
- the form is not limited.
- the first network connection may be a network connection supported by both the first electronic device and the third electronic device.
- the method before the first electronic device establishes the first network connection with the third electronic device among the plurality of electronic devices, the method further includes:
- the first electronic device periodically sends a message, and the message carries the device identifier of the first electronic device;
- the first electronic device receives a response message sent by the third electronic device, the response message is sent by the third electronic device after receiving the message periodically sent by the first electronic device, and the response message carries the device identifier of the third electronic device;
- the first electronic device determines that the third electronic device is online according to the device identification of the third electronic device.
- the first electronic device before exchanging information with the third electronic device, the first electronic device needs to determine whether they are online with each other, and information is exchanged only when they are online.
- the first electronic device may also obtain information about whether each electronic device is online, and the first electronic device determines whether each electronic device is online and the network topology relationship to transmit information to the second electronic device among the multiple electronic devices.
- the information about whether each electronic device is online may be understood as whether each electronic device can be detected by other electronic devices.
- the method further includes: the first electronic device acquires at least one of processing capability information of each electronic device in the plurality of electronic devices, network quality of each electronic device, and power information of each electronic device;
- the first electronic device in the plurality of electronic devices determines the path information for transmitting the first data to the second electronic device in the plurality of electronic devices according to the network topology relationship, including: the first electronic device according to the processing capability information of each electronic device , network quality of each electronic device, at least one item of power information of each electronic device, and network topology relationship to determine path information for transmitting the first data to the second electronic device.
- the first electronic device can determine the path information of the first electronic device to transmit the first data to the second electronic device according to at least one of the network quality, processing capability information and power information of each electronic device, and can perform a global The planned path is conducive to the accurate transmission of data.
- the processing capability information of each electronic device is used to indicate the processing capability of each electronic device, for example, including power consumption, chip processing capability, and memory of the electronic device.
- the network quality of each electronic device represents the network quality of the environment where each electronic device is currently located, and the network quality of each electronic device is different in different environments, for example, in a tunnel and an open place.
- Network quality includes connection speed and signal strength, etc.
- the power information of each electronic device indicates the current remaining power of each electronic device, or the available time of power of each electronic device, and the like.
- the first electronic device transmits the first data to the second electronic device according to the path information and a network connection method between two adjacent electronic devices on the transmission path indicated by the path information, including:
- the first electronic device sends a first message to a fifth electronic device adjacent to the first electronic device on the transmission path through the second network connection, the message body of the first message includes the first data, and the message of the first message
- the header includes path information and a network connection mode between two adjacent electronic devices on the transmission path indicated by the path information, so that the fifth electronic device determines the next hop node on the transmission path and the network between the next hop node and the next hop node.
- connection mode, the second network connection is the connection mode between the first electronic device and the fifth electronic device on the transmission path indicated by the path information;
- the header of the first packet further includes at least one of a source address, a destination address, a service identifier, and a service type, where the source address is the address of the first electronic device, and the destination address is the address of the second electronic device.
- the service identifier is used to uniquely identify the service corresponding to the first data
- the service type is used to identify the service type corresponding to the first data.
- the first electronic device may carry the path information determined according to the network topology relationship and the network connection mode between two adjacent electronic devices on the transmission path supported by the path information in the packet header of the first packet sent to the fifth electronic device.
- the fifth electronic device can determine the next-hop node and the network connection mode with the next-hop node according to the information carried in the packet header, and establish the network connection with the next-hop node of the fifth electronic device, and similarly. Therefore, the fifth electronic device can still continue to send the information in the packet header received from the first electronic device to the next hop node through the established network connection, so that two adjacent electronic devices on the transmission path can The message carrying the first data is routed to the second electronic device.
- the first electronic device transmits the first data to the second electronic device according to the path information and a network connection method between two adjacent electronic devices on the transmission path indicated by the path information, include:
- the first electronic device sends network connection indication information to a fifth electronic device adjacent to the first electronic device on the transmission path through the second network connection, where the network connection indication information is used to indicate that the first electronic device and the fifth electronic device are not on the transmission path except the first electronic device and the fifth electronic device.
- the network connection mode between two adjacent electronic devices other than the device, so that the fifth electronic device determines the network connection mode with the next hop node, and the fifth electronic device is the first electronic device on the transmission path.
- the second network connection is the connection mode between the first electronic device and the fifth electronic device on the transmission path indicated by the path information;
- the first electronic device sends a second message to the fifth electronic device through the second network connection, the message header of the second message includes the path information, and the message body of the second message includes the first data;
- the header of the second packet further includes at least one of a source address, a destination address, a service identifier and a service type, where the source address is the address of the first electronic device, and the destination address is the address of the second electronic device.
- the first electronic device can indicate the network connection between adjacent electronic devices on the transmission path determined according to the network topology relationship to the fifth electronic device through the network connection indication information, and the fifth electronic device can indicate the network connection according to the network connection.
- the information establishes a network connection with the next hop node in advance. When data arrives, the established network connection is used to transmit the data directly, which is beneficial to improve the transmission delay.
- the first electronic device includes the path information in the packet header of the packet that can carry the first data, so that the fifth electronic device determines the next hop node on the transmission path. In this way, two adjacent electronic devices on the transmission path can route the message carrying the first data to the second electronic device.
- the method also includes:
- the first electronic device determines whether there is an established second network connection with the fifth electronic device, where the second network connection is a network connection between the first electronic device and the fifth electronic device on the transmission path indicated by the path information;
- the first electronic device establishes a second network connection with the fifth electronic device
- the first electronic device sends the first message to the fifth electronic device adjacent to the first electronic device on the transmission path through the second network connection, or the first electronic device sends the first message through the second network connection.
- the network connection sends network connection indication information to a fifth electronic device adjacent to the first electronic device on the transmission path.
- the existing second network connection first packet or network connection indication information can be reused, Avoid the overhead of needing to re-establish network connections.
- the first electronic device in the plurality of electronic devices determines the path information for transmitting the first data to the second electronic device in the plurality of electronic devices by using the network topology relationship and on the transmission path indicated by the path information After the network connection mode between the two adjacent electronic devices, the method further includes:
- the first electronic device acquires motion information of each electronic device
- the first electronic device determines that there is an electronic device that is in accelerated motion according to the motion information of each electronic device, and does not update the network topology relationship.
- the first electronic device can determine whether to update the network topology relationship based on the motion information, so as to avoid information lag caused by not updating the network topology relationship for a long time, thereby causing the first data transmission to fail.
- the motion information of each electronic device represents the motion state of each electronic device, and each electronic device can determine the current geographic location and motion status of the electronic device according to its own sensor, such as speed, acceleration or direction, and so on.
- the first electronic device in the plurality of electronic devices determines, according to the network topology relationship, path information for transmitting the first data to the second electronic device in the plurality of electronic devices and on the transmission path indicated by the path information After the network connection mode between the two adjacent electronic devices, the method further includes:
- the first electronic device acquires basic information of at least one sixth electronic device that is different from the plurality of electronic devices; the first electronic device determines the number of the at least one sixth electronic device to be added according to the basic information of the at least one sixth electronic device; The number of the at least one sixth electronic device is greater than the preset number, and the first electronic device updates the network topology relationship.
- the first electronic device may determine the number of the added sixth electronic devices based on the basic information of at least one sixth electronic device, and if the number of the added sixth electronic devices meets the preset number, update the network topology relationship, This avoids the information lag caused by not updating the network topology relationship for a long time, thereby causing the first data transmission to fail.
- the method further includes: if at least one sixth electronic device is added, the electronic device in the network topology relationship that is directly connected to the added at least one sixth electronic device can send the historical network topology relationship to The added at least one sixth electronic device, so that the added at least one sixth electronic device determines the network topology relationship according to its own information.
- the basic information of at least one sixth electronic device is used to identify at least one sixth electronic device, and the basic information of at least one sixth electronic device includes the identification of the electronic device, the name of the electronic device, the network identification of the electronic device, the electronic device At least one of the type of the device, the weight information of the electronic device, the role information of the electronic device, and the version information of the electronic device.
- the first electronic device may use other information of the at least one sixth electronic device to determine the number of the at least one sixth electronic device added, for example, network capability information of the at least one sixth electronic device.
- the first electronic device in the plurality of electronic devices determines the path information for transmitting the first data to the second electronic device in the plurality of electronic devices by using the network topology relationship and on the transmission path indicated by the path information After the network connection mode between the two adjacent electronic devices, the method further includes:
- the first electronic device obtains the number of offline electronic devices
- the first electronic device deletes the basic information and network capability information of the offline electronic devices in the network topology relationship, eg, the preset number is one or more.
- the first electronic device periodically sends a message, and the message carries the device identifier of the first electronic device; if the first electronic device does not receive a response message sent by an electronic device within a preset time period, it can be determined that The electronic device goes offline.
- offline electronic devices can be understood as undetected electronic devices or reduced electronic devices. If the number of offline electronic devices reaches a preset number (for example, the preset number is N, and N is a positive integer), Then the first electronic device updates the network topology relationship, and updating the network topology relationship is specifically deleting the basic information and network capability information of the offline electronic device, so as to avoid information lag caused by not updating the network topology relationship for a long time, thereby causing the first data transmission. failure situation.
- a preset number for example, the preset number is N, and N is a positive integer
- the first electronic device in the plurality of electronic devices determines, according to the network topology relationship, path information for transmitting the first data to the second electronic device in the plurality of electronic devices and on the transmission path indicated by the path information After the network connection mode between the two adjacent electronic devices, the method further includes:
- the first electronic device acquires the service set identifier SSID sent by at least some of the multiple electronic devices; the first electronic device determines whether the scene of the multiple electronic devices has changed according to the SSID of at least some of the electronic devices; When the scene changes, the first electronic device updates the network topology relationship.
- the first electronic device determines whether there is an electronic device with a scene change among the plurality of electronic devices according to the SSID, and if there is an electronic device with a scene change, the network topology relationship is updated, so as to avoid problems caused by not updating the network topology relationship for a long time.
- the information is delayed, thereby causing a situation in which the first data transmission fails.
- the first electronic device may determine whether to update according to at least two of the motion information of the plurality of electronic devices, the number of the sixth electronic device added, the offline electronic device, and the electronic device whose scene has changed network topology.
- the first electronic device may periodically update the network topology relationship.
- the updating of the network topology relationship by the first electronic device specifically includes: the first electronic device updates the network topology according to the received updated basic information of each electronic device and updated network capability information of each electronic device relation.
- the first electronic device in the plurality of electronic devices determines, according to the network topology relationship, path information for transmitting the first data to the second electronic device in the plurality of electronic devices and on the transmission path indicated by the path information Before the network connection method between the two adjacent electronic devices, the method further includes:
- the first electronic device acquires service information of the second electronic device, where the service information of the second electronic device is used to indicate a service supported by the second electronic device;
- the first electronic device determines to send the first data corresponding to the service information to the second electronic device according to the service information of the second electronic device.
- the first electronic device before the first electronic device transmits the first data to the second electronic device, the first electronic device needs to determine which services the second electronic device supports. An electronic device determines to send the first data to the second electronic device.
- the service information of the second electronic device is used to indicate a service supported by the second electronic device.
- the method further includes: the first electronic device directly or indirectly sending the basic information of the first electronic device and the network capability information of the first electronic device to other electronic devices in the plurality of electronic devices.
- the method further includes: the basic information of the first electronic device changes and/or the network capability information changes, and the first electronic device directly or indirectly sends the change of the first electronic device to other electronic devices in the plurality of electronic devices. basic information and the changed network capability information of the first electronic device.
- the method further includes: the first electronic device directly or indirectly sending the processing capability information, network quality, power information, motion information, service set identifier and service information of the first electronic device to other electronic devices in the plurality of electronic devices. at least one of.
- the method further includes: at least one of the processing capability information, network quality, power information, motion information, service set identifier, and service information of the first electronic device changes, and the first electronic device sends data to the plurality of electronic devices. other electronic devices that directly or indirectly transmit post-change information.
- a method for determining a network topology relationship including: a first electronic device in the plurality of electronic devices obtains basic information of each electronic device and network capability information of each electronic device in the plurality of electronic devices;
- the first electronic device determines the network topology relationship according to the basic information of each electronic device and the network capability information of each electronic device.
- the basic information of each electronic device includes the basic information of each electronic device, including the identification of the electronic device, the name of the electronic device, the network identification of the electronic device, the type of the electronic device, the weight information of the electronic device, and the role of the electronic device. At least one of information and version information of the electronic device.
- the network capability information of each electronic device includes: the network connection supported by each electronic device, the bandwidth supported by the network connection supported by each electronic device, and the connection information of the network connection supported by each electronic device , at least one of the connection state of the network connection supported by each electronic device and the time information of the network connection in the connection state.
- the first electronic device acquires basic information of each electronic device among the plurality of electronic devices and network capability information of each electronic device, including:
- the first electronic device receives the basic information of the third electronic device and the network capability information of the third electronic device sent by the third electronic device through the first network connection, or receives the third electronic device sent by the third electronic device through the first network connection
- the first electronic device sends the basic information of the first electronic device and the network capability information of the first electronic device to the third electronic device through the first network connection.
- the method before the first electronic device establishes the first network connection with the third electronic device among the plurality of electronic devices, the method further includes:
- the first electronic device periodically sends a message, and the message carries the device identifier of the first electronic device;
- the first electronic device carries the device identifier of the third electronic device
- the first electronic device determines that the third electronic device is online according to the device identification of the third electronic device.
- the present application provides an apparatus, which is included in an electronic device, and has a function of implementing the above aspects and the behavior of the electronic device in possible implementations of the above aspects.
- the function can be realized by hardware, or it can be realized by executing corresponding software by hardware.
- the hardware or software includes one or more modules or units corresponding to the above functions. For example, determine a module or unit, transmit a module or unit, and the like.
- the apparatus may be the above-mentioned first electronic device.
- the present application provides an electronic device, comprising: one or more processors; a memory; a plurality of application programs; and one or more computer programs. Wherein, one or more computer programs are stored in the memory, the one or more computer programs comprising instructions. When the instructions are executed by the electronic device, the electronic device is caused to perform the method of transmitting data in any possible implementation of any of the above aspects.
- the electronic device may further include: a touch display screen and/or a camera, wherein the touch display screen includes a touch-sensitive surface and a display;
- the electronic device may be the above-mentioned first electronic device.
- the present application provides an electronic device including one or more processors and one or more memories.
- the one or more memories are coupled to the one or more processors for storing computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform A method for transmitting data in any possible implementation of any one of the above aspects.
- the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, cause the electronic device to execute any of the possible methods for transmitting data in any of the foregoing aspects.
- the present application provides a computer program product that, when the computer program product runs on an electronic device, enables the electronic device to execute any of the possible data transmission methods in any of the above aspects.
- FIG. 1 is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of a software architecture of an electronic device provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of a method for determining a network topology relationship provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of exchanging information provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of a network topology relationship provided by an embodiment of the present application.
- FIG. 6 is a schematic diagram of a network topology relationship at a network layer provided by an embodiment of the present application.
- FIG. 7 is a schematic diagram of a network topology relationship at a link layer provided by an embodiment of the present application.
- FIG. 8 is a schematic diagram of a method for transmitting data provided by an embodiment of the present application.
- FIG. 9 is a schematic diagram of another method for transmitting data provided by an embodiment of the present application.
- FIG. 10 is a schematic diagram of a format of a data packet provided by an embodiment of the present application.
- FIG. 11 is a schematic diagram of the format of another data packet provided by an embodiment of the present application.
- FIG. 12 is a schematic diagram of another method for transmitting data provided by an embodiment of the present application.
- FIG. 13 is a schematic diagram of the format of another data packet provided by an embodiment of the present application.
- FIG. 14 is a schematic diagram of the format of another data packet provided by an embodiment of the present application.
- FIG. 15 is a schematic diagram of updating a network topology relationship provided by an embodiment of the present application.
- FIG. 16 is a schematic diagram of interaction between a mobile phone and a watch provided by an embodiment of the present application.
- first and second are only used for descriptive purposes, and should not be understood as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined with “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the “multiple” The meaning is two or more.
- FIG. 1 shows a schematic structural diagram of an electronic device 100 .
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 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, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. 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
- graphics processor graphics processor
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- the controller may be the nerve center and command center of the electronic device 100 .
- the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
- 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 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 (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
- 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
- USB universal serial bus
- 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 PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
- the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
- the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
- the UART interface is a universal serial data bus used for asynchronous communication.
- the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
- a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
- the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
- the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
- the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
- MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
- the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 .
- the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
- the GPIO interface can be configured by software.
- the GPIO interface can be configured as a control signal or as a data signal.
- the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
- the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
- the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C 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 interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
- the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
- the charging management module 140 is used to receive charging input from the charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
- the charging management module 140 may receive wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142 , the electronic device 100 can also be powered by the power management module 141 .
- the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
- the power management module 141 receives input from the battery 142 and/or the charging management module 140 and supplies power to the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
- the power management module 141 may also be provided in the processor 110 .
- the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
- the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
- at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
- at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
- the modem processor may include a modulator and a demodulator.
- the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
- the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
- the modem processor may be a stand-alone device.
- the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared technology
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), fifth generation wireless communication system ( 5G, the 5th Generation of wireless communication system), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc.
- GSM global system for mobile communications
- GPRS general packet radio service
- CDMA code division multiple access
- WCDMA wideband code division multiple access
- WCDMA wideband code division multiple access
- time division code division multiple access time-division code division multiple access
- TD-SCDMA time-division code
- the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
- global positioning system global positioning system, GPS
- global navigation satellite system global navigation satellite system, GLONASS
- Beidou navigation satellite system beidou navigation satellite system, BDS
- quasi-zenith satellite system quadsi -zenith satellite system, QZSS
- SBAS satellite based augmentation systems
- 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.
- Display screen 194 is used to display images, videos, and the like.
- Display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
- LED diode AMOLED
- flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
- the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
- 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 ISP is used to process the data fed back by the camera 193 .
- the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
- ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera 193 .
- Camera 193 is used to capture still images or video.
- the object is projected through the lens to generate an optical image onto the photosensitive element.
- the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
- the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
- a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
- Video codecs are used to compress or decompress digital video.
- the electronic device 100 may support one or more video codecs.
- the electronic device 100 can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
- MPEG Moving Picture Experts Group
- MPEG2 moving picture experts group
- MPEG3 MPEG4
- MPEG4 Moving Picture Experts Group
- the NPU is a neural-network (NN) computing processor.
- NN neural-network
- Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, 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 processor 110 executes various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 .
- the internal memory 121 may include a storage program area and a storage data area.
- the storage program area can store an operating system, an 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 electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
- the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
- Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
- the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
- the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
- the voice can be answered by placing the receiver 170B close to the human ear.
- the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
- the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
- the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
- the earphone jack 170D is used to connect wired earphones.
- the earphone interface 170D may be the USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
- the pressure sensor 180A may be provided on the display screen 194 .
- the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
- the electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
- the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
- touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
- the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
- the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
- the gyro sensor 180B can be used for image stabilization.
- the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
- the air pressure sensor 180C is used to measure air pressure.
- the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
- the magnetic sensor 180D includes a Hall sensor.
- the electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
- the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
- the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
- the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
- the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
- Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
- the light emitting diodes may be infrared light emitting diodes.
- the electronic device 100 emits infrared light to the outside through the light emitting diode.
- Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
- the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
- the ambient light sensor 180L is used to sense ambient light brightness.
- the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
- the fingerprint sensor 180H is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
- the temperature sensor 180J is used to detect the temperature.
- the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection.
- the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
- the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
- Touch sensor 180K also called “touch panel”.
- the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
- the touch sensor 180K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to touch operations may be provided through display screen 194 .
- the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
- the bone conduction sensor 180M can acquire vibration signals.
- the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
- the bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal.
- the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone.
- the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function.
- the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
- the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
- the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
- Motor 191 can generate vibrating cues.
- the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
- touch operations acting on different applications can correspond to different vibration feedback effects.
- the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
- Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
- the touch vibration feedback effect can also support customization.
- the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
- the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
- the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
- the SIM card interface 195 can also be compatible with different types of SIM cards.
- the SIM card interface 195 is also compatible with external memory cards.
- the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
- the electronic device 100 employs an eSIM, ie: an embedded SIM card.
- the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
- any electronic device mentioned in the embodiments of the present application may include more or less modules in the electronic device 100 .
- 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. 2 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, music, video, short message and so on.
- the application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer.
- API application programming interface
- the application framework layer includes some predefined functions.
- the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
- a window manager is used to manage window programs.
- the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
- Content providers are used to store and retrieve data and make these data accessible to applications.
- the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
- a display interface can consist of one or more views.
- the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
- the phone manager is used to provide the communication function of the electronic device 100 .
- the management of call status including connecting, hanging up, etc.).
- the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
- the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
- Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
- the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
- 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.
- a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
- surface manager surface manager
- media library Media Libraries
- 3D graphics processing library eg: OpenGL ES
- 2D graphics engine eg: SGL
- the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
- 2D graphics engine is a drawing engine for 2D drawing.
- 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 electronic device When the electronic device needs to communicate with the electronic device, it is necessary to first discover which network connection modes the two electronic devices can communicate through, so as to select a network connection among these network connections, and then establish a connection.
- two electronic devices can communicate through network connections such as Bluetooth, WiFi or USB.
- the two electronic devices need to first discover that they can communicate through three network connection methods of Bluetooth, WiFi or USB, and then connect to these three networks.
- select a network connection mode to establish a connection, and use the established connection to transmit data.
- the connection needs to be discovered first, then the connection is selected, and the connection is further established, so that the transmission delay is longer.
- the data transmission methods provided by the embodiments of the present application can network different network connections supported by various electronic devices in advance to form a network topology relationship.
- the network topology relationship may include a network connection between any two electronic devices among multiple electronic devices.
- the two electronic devices transmit data, they directly transmit data according to the network connection in the network topology relationship, avoiding two electronic devices. It is necessary to first discover one or more network connection methods between the two electronic devices, and then select a reasonable network connection among the one or more network connection methods to establish the delay caused by the connection, which is conducive to reducing the transmission data. delay.
- the electronic device can systematically plan the network topology relationship between different electronic devices, so as to make full use of network resources and avoid resource preemption among the electronic devices.
- any electronic device among the plurality of electronic devices can periodically send a broadcast message, and the electronic device that receives the broadcast message replies with a response message to the electronic device that sent the broadcast message. In this way, it can be considered that the two electronic devices discover each other.
- the format of the reply message and the format of the broadcast message may or may not be consistent with each other. If there are multiple electronic devices that have received the broadcast message, and the multiple electronic devices all return response messages to the electronic device that sent the broadcast message, then a single broadcast message can discover multiple electronic devices.
- the broadcast message sent by any electronic device can carry at least one of the device identification address, user account number, device type, keep-alive flags and reply flags of the electronic device itself, as shown in Table 1,
- the electronic device receiving the broadcast message may filter according to the information sent by the electronic device sending the broadcast message. For example, the electronic device that receives the broadcast message determines the discovered electronic device according to the device identification address and/or device type carried in the broadcast message; for another example, the electronic device that receives the broadcast message determines to send the broadcast message according to the user account of the electronic device that sends the broadcast message. Whether the electronic device of the message is a trusted device, the electronic device that receives the broadcast message uses the user account of the electronic device that sends the broadcast message to compare with its own user account.
- the electronic device that sends the broadcast message is The trusted device will reply a response message to the electronic device that sent the broadcast message.
- the response message replied by the electronic device may include at least one of its own device identification address, user account number, device type, various flag bits for keeping alive, and a reply flag, wherein, different values of the reply flag indicate that The broadcast message is still a response message. If the reply flag is 0, it means that the message is a broadcast message, and if the reply flag is 1, it means that the message is a response message of the broadcast message. In this way, the electronic device that sends the broadcast message can identify which devices have received the broadcast message according to the response message, and thus, which devices have been discovered by the electronic device. At the same time, the electronic device that also sends the broadcast message can filter according to the information carried in the reply message.
- any electronic device among the plurality of electronic devices sends a broadcast message
- the electronic device that has not received the broadcast message will not reply to the electronic device that sent the broadcast message with a reply message, so that the two electronic devices will not find each other.
- any electronic device among the multiple electronic devices can send a directional message to the destination electronic device, and if the other electronic device receives the directional message, it will reply a response message to the electronic device that sent the directional message.
- the targeted message may be a Bluetooth broadcast message.
- the directional message includes the Bluetooth address of the target electronic device.
- the directional message sent by any electronic device among multiple electronic devices is a Bluetooth broadcast message, and the Bluetooth broadcast message includes the Bluetooth address of the target electronic device.
- the electronic device receiving the Bluetooth broadcast message A reply message can be sent back to the electronic device that sends the broadcast message, and the reply message includes the device identifier. In this way, the electronic device that sends the broadcast message can determine that the target electronic device has received the Bluetooth broadcast message, and the two electronic devices can discover each other.
- the electronic device that has not received the directional message will not reply with a reply message to the electronic device that sent the directional message, so that the two electronic devices will not discover each other. .
- multiple electronic devices may discover each other in sequence, or may discover each other at the same time, and the embodiment of the present application does not limit the order in which the multiple electronic devices discover each other.
- there may be other discovery methods among multiple electronic devices which are not limited in this embodiment of the present application.
- multiple electronic devices may discover each other by sending and receiving messages through the respective mobile communication modules 150 and/or wireless communication modules 160 shown in FIG. 1 .
- the electronic device that sends the broadcast message can send the broadcast message and receive the reply message through its own mobile communication module 150 and/or the wireless communication module 160, and the electronic device that receives the broadcast message can use its own mobile communication module 150 And/or the wireless communication module 160 receives broadcast messages and sends reply messages.
- the electronic device that sends the directional message sends the directional message and receives the response message through its own mobile communication module 150 and/or the wireless communication module 160, and the electronic device that receives the directional message uses its own mobile communication module 150 and/or the wireless communication module 160 to send the directional message and receive the response message.
- the wireless communication module 160 receives the directional message and sends the reply message.
- the information exchanged between the plurality of electronic devices may include at least one of basic information of the electronic devices and network capability information of the electronic devices.
- the exchanged information may be saved.
- S302 may include: after the multiple electronic devices discover each other, any network connection may be established with each other, and information may be exchanged using the established network connection. For example, if electronic device 1 and electronic device 2 discover each other, then electronic device 1 and electronic device 2 can use any network connection method to establish a network connection first. For example, electronic device 1 and electronic device both support Bluetooth and WiFi transmission. Then you can use Bluetooth or WiFi to establish a network connection, and then use the established network connection to exchange information.
- the established network connection may be disconnected.
- the established network connection can be understood as a physical connection.
- the basic information of the electronic device may include at least one of the following: the identification of the electronic device (device ID), the name of the electronic device (device name), the type of the electronic device (device type), the network identification (Network ID), the weight of the electronic device at least one of information, role information of the electronic device, and version information of the electronic device.
- the identifier of the electronic device is used to uniquely identify an electronic device;
- the name of the electronic device is the name of the electronic device defined by the user or the name defined by the factory of the electronic device;
- the type of the electronic device indicates which type the electronic device belongs to, for example, the type is: Mobile phones, PCs, wearables, headphones, glasses, speakers, car devices, smart screens or car devices, etc.
- the network identifier is a unique networking identifier assigned by the network to the electronic device after the electronic device accesses the network, for example, it may be a unique device identifier (unique device identifier, UDID).
- the version information of the electronic device indicates the version number of the current system of the electronic device.
- the basic information exchanged by the electronic device can include the identification of the electronic device or the network identification of the electronic device, and can also include the identification of the electronic device and the network of the electronic device. logo, this application is not limited.
- the identification and network identification of the electronic device can also be composed of 16 alphanumerics, for example, the identification and network identification of the electronic device can be 4b3d-4534-6b35-f246; or the identification and network identification of the electronic device can also be composed of 32-bit universal unique identifier (universally unique identifier, UUID) composition, e.g., the electronic device may be identified as "A03F94A675FD65C222A22519B628619EC9CAD21D1BEAFEDDF40A7140D8B650FF", the network identification may be "ED45800FF32CA2CE1A5CF812758FA19A213CA0DB2B5D62DE326A604F6685812C".
- UUID universal unique identifier
- the weight information of the electronic device may be determined by the electronic device itself according to the network capability information of the electronic device and the processing capability information of the electronic device. For example, the power consumption of different electronic devices, chip processing capabilities and memory are different, and the power consumption of the electronic device is high. , Electronic devices with good chip processing capability, large memory and strong network capability have a high weight. On the contrary, electronic devices with low power consumption, poor chip processing capability, small memory and weak network capability have a low weight.
- the role information of the electronic device represents the central node, common node or tail node of an electronic device, and the role of the electronic device represents the role that the electronic device can play in the network topology relationship.
- the role can be the central node in a network topology relationship. , normal node or tail node.
- the role of the electronic device may be determined by the electronic device according to the weight, or determined according to the network capability information of the electronic device and the processing capability information of the electronic device for which the weight is determined.
- an electronic device Before exchanging information, an electronic device can determine itself as the central node. After the electronic devices exchange information with each other, it can update its own role information according to the exchanged information. For example, an electronic device can determine itself as the central node for the first time. Processing capability information of another electronic device, the electronic device can determine according to the processing capability information of the other electronic device that the processing capability of the other electronic device is stronger than the processing capability of the electronic device, so the electronic device can update itself as a common node, In this way, each electronic device can update the character information.
- the network capability information includes the network connection (NetworkCapabilities) supported by the electronic device, the maximum bandwidth supported by the network connection supported by the electronic device, the connection information of the network connection supported by the electronic device (such as port number, MAC address and IP address, etc.) and the at least one.
- the network connection supported by the electronic device may include at least one of: WiFi, Bluetooth, near field communication (NFC), USB, and cellular network (such as 4G or 5G, etc.), where WiFi may include WiFi direct connection (WiFi-P2P) and local area network WiFi (WiFi-LAN).
- WiFi may include WiFi direct connection (WiFi-P2P) and local area network WiFi (WiFi-LAN).
- the network capability information of an electronic device includes the following:
- the network capability information exchanged by the electronic device for example, the network connections supported by the electronic device in the above example include ble, WiFi-P2P, WiFi-LAN, which means that the electronic device supports ble, WiFi-P2P, WiFi-LAN LAN for communication.
- the Bluetooth and WiFi functions of the electronic device may both be turned on, or the Bluetooth and WiFi functions of the electronic device may not be turned on for the time being, but when the ble, WiFi-P2P, and WiFi-LAN functions need to be used, the electronic device It can turn on its own Bluetooth and WiFi functions.
- an electronic device may first send its own basic information and network capability information to another electronic device, and may also receive basic information and network capability information sent by other electronic devices.
- one electronic device receives the basic information and network capability information of the other electronic device, it can also send the received basic information and network capability information of the other electronic device to another electronic device.
- the electronic device may send its own information first, and then send the detected information of other electronic devices.
- one electronic device can also send its own basic information, its own network capability information, the basic information of other electronic devices and the network capability information of other electronic devices to another electronic device at the same time.
- the information exchanged between the multiple electronic devices may also exchange the processing capability information of the electronic device, the network quality of the electronic device, and the power of the electronic device.
- SSID service set identifier
- the processing capability information of the electronic device represents the processing capability of the electronic device, and includes, for example, the power consumption of the electronic device, the processing capability of the chip, and the memory.
- the network quality of the electronic device represents the network quality of the environment where the electronic device is currently located.
- the network quality of the electronic device is different in different environments, for example, the network quality is different in a tunnel and an open place.
- Network quality includes connection speed and signal strength, etc.
- the power information of the electronic device indicates the current remaining power of the electronic device, or the available time of the power of the electronic device, and the like.
- the motion information of the electronic device represents the motion state of the electronic device, and each electronic device can determine the current geographic location and motion status of the current electronic device according to its own sensors, such as speed, acceleration, and direction.
- the service information of the electronic device indicates the services supported by a certain electronic device, for example, the screen mirroring service and/or the voice calling service.
- the service set identifier (SSID) of the electronic device is used to identify the different networks to which the electronic device is connected.
- the topology information of the electronic device is used to represent the network topology relationship saved by the electronic device itself.
- the topology information can be the connection relationship between the network topology relationships determined in history.
- the electronic device in the network topology relationship The device can send the network topology relationship it has saved to the new electronic device, so that the new electronic device can determine the new network topology relationship according to the network topology relationship sent by other electronic devices and its own information, and the new electronic device can send its own network topology relationship.
- the information is exchanged to other electronic devices, and the other electronic devices update the network topology relationship according to the information of the new electronic device.
- device A, device B, and device F can start the smart connection networking through user switches, voice, gestures, etc., for example, device A first detects that device B is online, and device A and device B After mutual discovery, any network connection between device A and device B is established between device A and device B, and information is exchanged using the established network connection. Specifically, exchanging information includes: device A sends its own information to device B, and device B sends its own information to device A. If the device B and the device F discover each other, the device B and the device F establish a network connection, and use the established network connection to exchange information.
- the exchange of information includes that device F sends its own information to device B, and device B sends its own information and the information of device A to device F, so that device F can obtain the information of device A and device B, and device F can It can also be known that device A is also online.
- device B sends the acquired information of device F to device A, so that device A can also know that device F is online.
- the exchange of information can be completed among the three devices, the device A, the device B, and the device F.
- the exchanged information is saved.
- the device A, device B and device F in FIG. 4 may be the devices in FIG. 6 and FIG. 7 .
- device A and device B may disconnect the network connection after exchanging information
- device B and device F may disconnect the network connection after exchanging information
- the network connection used for the exchange of information can be disconnected.
- a new network connection can be established. New network connection interaction information.
- the two electronic devices exchange information of all electronic devices that can be detected, the network connection is disconnected.
- the two electronic devices may use the information of different electronic devices to interact through a network connection established once, or may use the information of different electronic devices to communicate through the network connection established multiple times.
- the established network connection can be disconnected.
- device B obtains the information of device F
- a new network connection can be established, and the device can be connected to the device by using the new network connection. B's information is sent to device A.
- the network connection established by device A and device B is not disconnected first, and then disconnected after device B and device A have exchanged information about device F.
- the embodiments of the present application are not limited.
- any two of the multiple electronic devices can establish a network connection and exchange information after discovering each other.
- which of the multiple electronic devices discover each other first can exchange information.
- S301 and S302 are for the convenience of description.
- mutual discovery of some electronic devices in S301 may be performed after, before or at the same time as some electronic devices in S302 exchange information, which is not limited in this embodiment of the present application.
- the condition for performing S302 or S301 is that multiple electronic devices are all trusted devices, and multiple electronic devices may determine that the electronic device is a trusted device according to the trust information obtained by exchanging, for example, between multiple electronic devices.
- the same account is logged in, that is, the AccountID is the same, or the user has bound and authenticated multiple electronic devices, such as binding through pin code or QR code.
- the plurality of electronic devices determine the network topology relationship between the plurality of electronic devices according to the exchanged information.
- the plurality of electronic devices determine the network topology relationship between the plurality of electronic devices according to the basic information of the electronic devices and the network capability information of the electronic devices obtained through exchange.
- the network topology relationship may include network connection manners between multiple electronic devices.
- the plurality of electronic devices may determine the network topology relationship according to the network capability information of each electronic device and the basic information of each electronic device obtained through exchange.
- one electronic device (such as an electronic device serving as a central node) among the plurality of electronic devices can determine the network topology relationship, and then synchronize the network topology relationship to other electronic devices, or each electronic device itself according to the information exchanged Determine the network topology.
- the form in which the electronic device stores the network topology relationship is not limited. For example, if device A, device B, device C, device D, device E, device F, and device G in FIG. 7 exchange information, the exchanged information can be saved. And the network topology relationship can be determined according to the information exchanged.
- the device A can save the following content, where the information (info) of each device can include at least part of the above-mentioned information, examples are as follows:
- the network connection method between two electronic devices in ConnectAbilityTable indicates that the two electronic devices can communicate with each other through this network connection method.
- the connection capabilities between DevId-A and DevId-B include Bluetooth, WiFi-p2p and WiFi-lan, which means that DevId-A and DevId-B can communicate through Bluetooth, WiFi-p2p or WiFi-lan.
- the content saved by the electronic device can also be in the form shown in Table 2, and the multiple electronic devices can be mobile phones, PADs, PCs, large screens, speakers, headphones, mobile phones, bracelets, and glasses.
- the network relationship is shown in Table 2.
- a mobile phone can determine the names of each electronic device as PAD, PC, large screen, Speakers, headphones, mobile phones, bracelets and glasses, etc.
- These electronic devices determine the network connections supported by other electronic devices according to the obtained network capability information of other electronic devices, and these electronic devices determine the supported networks between two electronic devices according to the network connections supported by other electronic devices and the network connections supported by themselves.
- connection method For example, in Table 1, there is no connection (no-connection, NC) between the mobile phone and the PAD; the mobile phone and the personal computer (PC) can be connected via basic rate (BR) Bluetooth or WiFi, BR Bluetooth is also known as classic Bluetooth. In other words, both the mobile phone and the PC support BR Bluetooth connection and WiFi connection; the mobile phone and the large screen can be connected through Bluetooth (bluetooth, BT) or WiFi, in other words, both the mobile phone and the PC support BT and WiFi connection.
- each of the multiple electronic devices may store the network topology relationship shown in Table 2, and Table 2 stored by each electronic device may be consistent.
- multiple electronic devices may also determine routing information of any two electronic devices according to the saved network topology relationship.
- the mobile phone to the bracelet can be connected by BT
- the mobile phone to the watch can be connected by WiFi
- the routing information from the mobile phone to the speaker can be: mobile phone-large screen via BT/WiF routing, large screen to speaker via WiFi routing .
- any two electronic devices exchange information, it can be considered that the two electronic devices are online, in other words, the electronic devices can be detected.
- One electronic device (such as the electronic device serving as the central node) among the multiple electronic devices can determine whether each electronic device is online, and synchronize the information of whether each electronic device is online to other electronic devices, or each electronic device obtains according to the exchange.
- Information on other electronic devices determines whether other electronic devices are online.
- Each electronic device can store information about whether other electronic devices are online, and the storage form is not limited in any way.
- device A and device B exchange information, and device B can send the detected information of device F to device A
- device A can not only determine that device B is online, but also can It is determined that device F is online, and device B can also determine that device A and device F are online, and device F can also determine that device A and device B are online.
- the electronic devices can determine which electronic devices are online or not online after exchanging information.
- Table 3 corresponding to Table 2 shows information about whether each electronic device is online, and each electronic device can store the table shown in Table 2. "O" in Table 3 indicates that the electronic device is online, and "X" indicates that the electronic device is not online. If the line corresponding to an electronic device is all X, the electronic device is considered offline.
- each electronic device in the plurality of electronic devices can store whether each electronic device is online. For example, as shown in Table 3, whether each electronic device can be stored online can be consistent. In other words, if an electronic device is online, and some electronic devices can detect that the electronic device is online, multiple electronic devices can determine that the electronic device is online because the electronic devices exchange information.
- an electronic device when an electronic device is online, it can be understood that an electronic device can be searched, or it can be understood that the electronic device is in a communicable area or can be found, etc.
- An electronic device online does not mean that the electronic device must have Establish a good network connection. If an electronic device has an established network connection, the electronic device can be considered online, or even if the electronic device does not have an established network connection, as long as it can be searched or detected by other electronic devices, the electronic device can be considered online. . In other words, online means that the electronic device can be discovered, it does not mean that there is already a data channel.
- the electronic device does not need to store the information of whether each electronic device is online, and only needs to store the network topology relationship between the various electronic devices.
- the plurality of electronic devices may determine the network topology relationship between the plurality of electronic devices according to the exchanged information through the respective processors 110 as shown in FIG. 1 .
- a plurality of electronic devices may save the network topology relationship through their respective internal memories 121 as shown in FIG. 1 .
- the plurality of electronic devices may determine whether the plurality of electronic devices are online through the respective processors 110 as shown in FIG. 1 .
- a plurality of electronic devices may store information on whether each electronic device is online through respective internal memories 121 as shown in FIG. 1 .
- the multiple electronic devices in the method 300 may be a combination of electronic devices of different types and/or different scenarios, for example, the multiple electronic devices may be mobile phones, car phones, smart speakers, smart headphones, and other different types of devices, or these Different types of electronic devices are in different scenarios.
- multiple electronic devices may include mobile phones at work and tablets at home.
- the network topology relationship obtained by the method 300 can be applied to different types of electronic devices to transmit data, and can also be applied to different types of electronic devices in different scenarios to transmit data, which can improve the applicability. planning.
- the physical shape of the network topology relationship in the method 300 may be a mesh topology, a star topology, a ring topology, and other shapes of topology.
- the network topology relationship in the method 300 is described below with reference to FIG. 5 .
- the user can realize the communication between two devices at the application layer.
- Communication between different electronic devices can be done through the link layer electronic
- the actual network connection between devices communicates, and at the network layer electronic devices can communicate through different paths.
- the network topology relationship is represented at the link layer as the network connection mode supported between various electronic devices, and at the network layer as the data transmission paths existing between the various electronic devices.
- the watch and the speaker are logically direct, and can directly realize data interaction.
- the watch and the speaker can communicate directly at the application layer because the network layer and the link layer are mixed.
- the watch and the mobile phone can transmit data through the Bluetooth network at the link layer, and the mobile phone and the speaker can transmit data through the WiFi network at the link layer.
- the network connection for data transmission between the watch and the speaker is In the network layer, there is a network connection from the watch to the mobile phone and a network connection from the mobile phone to the speaker.
- the solid line of the network layer in Figure 5 represents the actual network connection in the process of data transmission
- the dashed line represents the supported network connection but no data is transmitted
- the solid line of the link layer also represents the actual network connection of the two electronic devices in the process of data transmission.
- the bluetooth network and the WiFi network are used, and the dotted line indicates the bluetooth network and the WiFi network supported by the two electronic devices, but the bluetooth network and the WiFi network are not used to transmit data.
- the network topology relationship between various electronic devices at the network layer is shown in FIG. 6 , device A, device B, device C, and routers are connected through the network, and device A, device B, device C, and device G are connected through the network. The two are connected through the network.
- Device B is connected to device D, device E, and device F through the network respectively.
- the device G may be a remote device.
- FIG. 7 The network topology relationship between various electronic devices in the link layer corresponding to FIG. 6 is shown in FIG. 7 .
- device A, device B, device C and the router are connected through wifi; device A, device B, and device C have end-to-end connections through ble, wifi, and wifip2p;
- a ble end-to-end connection is maintained between devices;
- a USB end-to-end connection is maintained between device B and device F; there are lan or p2p end-to-end connections between device A, device B, device C, and device G.
- the solid lines in FIG. 6 and FIG. 7 indicate that network connections have been established, and the dotted lines indicate that these network connections may exist between the two devices, but have not been established.
- method 800 includes:
- the first electronic device in the plurality of electronic devices uses the network topology relationship to determine the path information for transmitting the first data to the second electronic device in the plurality of electronic devices and two adjacent two on the transmission path indicated by the path information A network connection method between electronic devices.
- the path information is used to indicate the electronic device through which the first data transmitted by the first electronic device to the second electronic device passes.
- the first electronic device may be a service initiator.
- the central node in the network topology relationship can determine the path information and the network connection mode between two adjacent electronic devices on the transmission path indicated by the path information, and send the information to the first electronic device.
- S810 includes: the first electronic device selects the transmission paths that can reach the second electronic device and the network connection mode between the electronic devices on these transmission paths according to the network topology.
- the WiFi connection between the five electronic devices sends the first data to the fifth electronic device
- the fifth electronic device sends the first data to the second electronic device through the Bluetooth transmission method between the fifth electronic device and the second electronic device
- the transmission path determined by the first electronic device according to the network topology relationship is the first electronic device-the fifth electronic device-the second electronic device
- the transmission path between the first electronic device and the fifth electronic device is
- the connection method is WiFi connection
- the connection method between the fifth electronic device and the second electronic device is Bluetooth connection.
- S810 further includes: the first electronic device selects a transmission path that can reach the second electronic device and a network connection mode between the electronic devices on these transmission paths according to the network topology relationship and the information of other electronic devices exchanged in S302 , for example, according to at least one of the network topology relationship and the processing capability information of the electronic device, the network quality of the electronic device, the power information of the electronic device, the motion information of the electronic device, the weight information of the electronic device and the role information of the electronic device.
- the electronic device through which the first data passes.
- S810 further includes that the first electronic device determines transmission paths that can reach the second electronic device and network connection modes between the electronic devices on these transmission paths according to the network topology relationship and whether each electronic device is reachable for communication.
- the first electronic device determines which network connection mode to use by at least one of the following methods.
- the first electronic device can determine which network connection mode the electronic device adjacent to the first electronic device on the transmission path adopts according to the network connection that it has currently established, and the first electronic device and the fifth electronic device on the transmission path are connected. Neighbor, if a certain network connection between the first electronic device and the fifth electronic device is being connected but not disconnected, the network connection mode that is being connected can be reused. For example, in the network topology relationship, the first electronic device and the fifth electronic device can be transmitted through WiFi or Bluetooth, wherein the first electronic device and the fifth electronic device have established a Bluetooth connection, then it can be determined that Bluetooth is the first electronic device and the fifth electronic device. A network connection method between fifth electronic devices. If there is no established network connection between the first electronic device and the fifth electronic device, the first electronic device determines the network connection between the first electronic device and the fifth electronic device according to the feature of the first data.
- the first electronic device may determine network connections between other adjacent electronic devices on the transmission path in combination with the characteristics of the first data. For example, if the first electronic device determines that the two electronic devices on the transmission path can be transmitted through WiFi or Bluetooth, since the delay of WiFi transmission is lower than that of Bluetooth transmission, and the first data is data with high delay requirements, then The first electronic device may determine WiFi as a network connection method between the two electronic devices. If the first data is data with low latency requirement, since Bluetooth saves power consumption, the first electronic device can determine that Bluetooth is the network connection method between the two electronic devices.
- the first electronic device may determine which network connection mode the electronic device adjacent to the first electronic device adopts on the transmission path according to the network connection that it has currently established and the characteristics of the first data. For example, in the network topology relationship, the first electronic device and the fifth electronic device can be transmitted through WiFi or Bluetooth, the first data is data with high latency requirements, and the WiFi between the two electronic devices is in a connected state, then The electronic device may determine WiFi as a network connection manner with the fifth electronic device.
- the first electronic device and the fifth electronic device can be transmitted through WiFi or Bluetooth, the first data is data with low latency requirements, and the Bluetooth of the two electronic devices is in a connected state, then the first data The electronic device may determine that Bluetooth is a network connection method with the fifth electronic device.
- the first electronic device and the fifth electronic device can be transmitted through WiFi or Bluetooth, the first data is data with high latency requirements, and the Bluetooth of the two electronic devices is connected, and the WiFi is disconnected. In the open state, since the Bluetooth in the connected state cannot meet the time delay requirement of the first data, the first electronic device may determine that WiFi is the network connection method with the fifth electronic device.
- the first electronic device and the fifth electronic device can be transmitted through WiFi or Bluetooth, the first data is data with low latency requirements, and the WiFi of the two electronic devices is connected, and the Bluetooth is disconnected.
- the first electronic device can determine that WiFi is the network connection method with the fifth electronic device, or the first electronic device or the fifth electronic device If the power consumption requirement of the device is relatively high, the first electronic device may determine that Bluetooth is the network connection method with the fifth electronic device.
- the first electronic device may select a network connection manner from multiple network connection manners in combination with the characteristics of the first data. For example, if the two electronic devices on the transmission path can transmit through WiFi or Bluetooth, since the delay of WiFi transmission is lower than that of Bluetooth transmission, and the first data is data with high delay requirements, the first electronic device can determine WiFi is a network connection method between these two electronic devices. If the first data is data with low latency requirements, the first electronic device may determine that Bluetooth is the network connection method between the two electronic devices.
- the first electronic device may arbitrarily select a network connection manner among multiple network connection manners of the two electronic devices.
- the first data may be data required for high delay or data required for low delay, and the feature of the first data is the feature of delay.
- the data volume of the first data may be large or small, and the feature of the first data may be the data volume.
- the first data may be data with a high transmission rate requirement or data with a low transmission rate requirement, and the feature of the first data may be the transmission rate requirement.
- the first electronic device may also determine a network connection manner among multiple network connection manners of the two electronic devices by other manners, which is not limited in this embodiment of the present application.
- the mobile phone needs to transmit data to the glasses, there is no network connection between the mobile phone and the glasses, but there is a WiFi connection between the glasses and the PAD, and there is no network between the PAD and the mobile phone.
- the mobile phone can determine that the path to transmit data to the glasses is: mobile phone-PC-PAD-glasses.
- the mobile phone can determine the transmission path by combining at least one of the above four methods: the network connection method between any two electronic devices on the path of mobile phone-PC-PAD-glasses.
- the mobile phone needs to transmit data to the glasses, there is no network connection between the mobile phone and the glasses, but there is a WiFi connection between the glasses and the PAD, and there is no network connection between the PAD and the mobile phone, but There is a BR or WiFi connection between the PAD and the PC, and a BR or WiFi connection between the PC and the mobile phone. Therefore, the mobile phone needs to determine whether these devices are online. If the online information is shown in Table 3, the mobile phone can determine that the PC, PAD and glasses are all online, and the mobile phone can determine that the path to transmit data to the glasses is: mobile phone-PC-PAD-glasses. The mobile phone can determine this transmission path by combining at least one of the above four methods: the network connection method between any two electronic devices of mobile phone-PC-PAD-glasses.
- the first electronic device determines that there are multiple transmission paths for transmitting the first data.
- the first electronic device may combine the power of the electronic device, the service type of the first data, and the delay of the first data.
- a transmission path is selected among the plurality of transmission paths according to at least one of requirements, processing capability information of the electronic device, and network quality, and a network topology relationship. Specifically, the first electronic device first selects multiple transmission paths that can reach the second electronic device according to the network topology relationship, and can also determine the network connection mode between the electronic devices on these transmission paths.
- the first electronic device needs to select a transmission path among the multiple paths by combining at least one item of the power of the electronic equipment on the multiple paths, the service type of the first data, the delay requirement of the first data, and the network bandwidth, and use the transmission path for transmission. data.
- the first electronic device may determine to send the first data corresponding to the service supported by the second electronic device to the second electronic device according to the service supported by the second electronic device. .
- the first electronic device needs to project the first data to the second electronic device, and the first electronic device needs to determine that the second electronic device supports the screen-casting service before transmitting the first data corresponding to the screen-casting service.
- the first electronic device transmits the first data to the second electronic device according to the path information and a network connection mode between two adjacent electronic devices on the transmission path indicated by the path information.
- S820 includes that the first electronic device establishes a corresponding network connection with the fifth electronic device indicated by the path information, and transmits the first data by using the established network connection mode, and the fifth electronic device establishes a network connection mode with the second electronic device. , and use the established network connection to transmit the first data.
- the first electronic device determines that the transmission is via WiFi between the fifth electronic device and the second electronic device on the transmission path.
- the fifth electronic device and the second electronic device can continue to use the WiFi channel in the connected state to transmit data; when the fifth electronic device and the second electronic device are connected If the WiFi between the electronic devices is not in a connected state, the fifth electronic device and the second electronic device may establish a WiFi connection to transmit data. In this way, the first data can reach the second electronic device.
- the transmission path indicated by the path information may include other electronic devices other than the fifth electronic device or may not include the fifth electronic device.
- the first data can also be directly transmitted between the first electronic device and the second electronic device.
- the path information determined by the first electronic device may only have the first electronic device and the second electronic device, and no other information. electronic equipment.
- the method 800 further includes: after the first electronic device determines the transmission path and the network connection mode between two adjacent electronic devices on the transmission path, the first electronic device may send the network connection indication information (using The network connection between two adjacent electronic devices on the transmission path is directly or indirectly sent to each electronic device on the transmission path, and a corresponding network connection is established between the two adjacent electronic devices according to the network connection instruction information.
- the transmission path is the first electronic device-the fifth electronic device-the second electronic device
- the first electronic device determines that the network connection between the first electronic device and the fifth electronic device is ble
- the fifth electronic device and the The network connection between the two electronic devices is WiFi-p2p.
- the first electronic device establishes a ble connection with the fifth electronic device, the first electronic device sends network connection indication information to the fifth electronic device through the established ble connection, and the network connection indication information is used to indicate the connection between the fifth electronic device and the second electronic device.
- the network connection between them is WiFi-p2p connection.
- the fifth electronic device establishes a WiFi-p2p connection with the second electronic device.
- the method 800 may establish a network connection on the transmission path before transmitting data, or if some network connection itself is in a connected state, data can be directly transmitted directly without establishing a network.
- the header of the packet carrying the first data may carry the path information and the current network connection mode between two adjacent electronic devices on the transmission path indicated by the path information. In this way, any one of the transmission paths After receiving the first data, the electronic device can determine the next hop node according to the path information.
- the source address in the header of the message carrying the first data is the address of the first electronic device
- the destination address is the address of the second electronic device
- the source address of the first data is the ID of the first electronic device
- the destination address is the ID of the second electronic device, so that the first data can be guaranteed to reach the second electronic device during the entire routing process, and the second electronic device can also know that the first data comes from the first electronic device according to the source address.
- the premise of the embodiment shown in FIG. 9 is that no WiFi-p2p connection is established between device A and device B, and no ble connection is established between device B and device E.
- the process of data transmission is described below with reference to FIG. 9 .
- Figure 9 including:
- the device A determines that a communication request needs to be initiated to the device E.
- the device A determines according to S810 that the transmission path from the device A to the device E is to first reach the device B and then to the device E, and the device A can determine that the WiFi-p2p transmission is used between the device A and the device B.
- the routing information is device A-device B-device E
- WiFi-p2p transmission is used between device A and device B
- ble transmission is used between device B and device E.
- the device A establishes a WiFi-p2p connection with the device B.
- the device A sends network connection indication information through the established WiFi-p2p connection, indicating that the device B and the device E are connected by ble.
- device B establishes a ble connection with device E.
- device B may know that the ble connection with device E is established before data transmission, and establish the ble in advance.
- the device A sends a packet carrying the first data to the device B through the WiFi-p2p connection.
- the format of the message is shown in Figure 10.
- the service identifier is used to uniquely identify the current service.
- the message type indicates that the type of the current message is a file type.
- the connection mode indicates that the connection between device A and device B is a WiFi-p2p connection.
- the source address is the ID of device A
- the destination address is the ID of device E
- the next hop list of device A is device B-device E
- the data part in Figure 10 can be the first data.
- S906 is after S903, but the order of S906 and any one of S904-S905 is not limited.
- the device B sends a message carrying the first data to the device E through the ble connection.
- the format of the message sent to the device E is shown in Figure 11.
- the difference from Figure 10 is that the connection mode in Figure 11 is ble.
- the previous linked list in 11 is device A, and the next linked list is device E.
- the device E After receiving the packet, the device E returns a response packet through the original path in the same manner, and the response packet is used to indicate that the device E has received the first data.
- device A and device B after device A and device B have finished transmitting the message, they can disconnect the WiFi-p2p connection, and after device B and device E have finished transmitting the message, they can disconnect the ble connection.
- the packet header of the packet carrying the first data may carry the path information and the network connection mode between any two adjacent electronic devices on the transmission path indicated by the path information.
- any one of the electronic devices can determine the next-hop node and the network connection mode with the next-hop node according to the path information and the network connection mode between the electronic devices on the transmission path indicated by the path information .
- the device A determines to initiate a communication request to the device E.
- the device A determines according to S810 that the transmission path from the device A to the device E is to go to the device B first, and then to the device E, and the device A can determine that the WiFi-p2p transmission is used between the device A and the device B.
- the routing information is device A-device B-device E
- WiFi-p2p transmission is used between device A and device B
- ble transmission is used between device B and device E.
- device A establishes a WiFi-p2p connection with device B.
- device A sends a packet carrying the first data to device B.
- the format of the packet carrying the first data is shown in Figure 13.
- the connection mode field indicates that the connection between device A and device B is WiFi-p2p, and device B It is a ble connection with device E, and the definitions of other fields are the same as in Figure 10.
- the device B determines that the connection with the device E is a ble connection according to the connection mode in FIG. 13 , and establishes a ble connection with the device E.
- the device B may learn that the connection with the device E is a ble connection according to the message carrying the first data.
- Device B sends a message carrying the first data to Device E.
- the format of the message carrying the first data is shown in Figure 14.
- the connection mode field in 14 indicates that the connection between Device B and Device E is a ble connection, and other The definitions of the fields are the same as in Figure 10.
- connection mode field in FIG. 14 may also be the connection mode field in FIG. 13 .
- device E After receiving the packet, device E returns a response packet through the original path in the same way.
- device A and device B after device A and device B have finished transmitting the message, they can disconnect the WiFi-p2p connection, and after device B and device E have finished transmitting the message, they can disconnect the ble connection.
- the source address of the first data is the address of the first electronic device
- the destination address is the address of the second electronic device.
- the source address of the first data is the ID of the first electronic device
- the destination address is the address of the first electronic device. is the ID of the second electronic device.
- the next node After receiving the first data, the next node determines what is the next node where the first data reaches the second electronic device by combining the network topology relationship and local policies. transmitted to the second electronic device. In this way, the data packet of the first data does not need to carry the path information and the network connection mode between the electronic devices on the transmission path indicated by the path information.
- each electronic device receives the first data, it determines the next hop node and the connection with the next hop by itself. The network connection method between hop nodes.
- the local policy mentioned above may be that the electronic device itself formulates a local policy according to the information of each electronic device obtained by exchanging, and the local policy formulated by each electronic device may be the same or different, which is not limited in this embodiment of the present application.
- the determined network topology relationship in method 300 is updated according to whether it is regularly updated or if a certain trigger condition is met. The following describes in conjunction with the description of FIG. 15 to update the method 300 after the trigger condition is met. network topology.
- the continuous exchange of information among the plurality of electronic devices in S1503 may be to exchange information periodically, or to exchange information after some information changes on the original basis. For example, if an electronic device detects that its network connection with another device changes from a connected state to a disconnected state, the changed information can be exchanged.
- the first electronic device determines whether the scene of one or more electronic devices has changed according to the exchange information. If the scene changes, execute S1505, otherwise go back to S1502.
- the first electronic device stores the network topology relationship obtained by the method 300. If any information in S302 of any electronic device in the network topology relationship changes, the electronic device directly or indirectly changes the information after the change. It is sent to the first electronic device, and the first electronic device determines whether the scene of the electronic device changes according to the changed information.
- the changed information includes: SSID, and the first electronic device determines whether the scene of a certain electronic device changes according to the SSID.
- the SSID of a certain electronic device is changed from the SSID of the home network to the SSID of the in-vehicle network.
- the SSID identifies that the scene of the electronic device has changed.
- the first electronic device may further determine whether the scene of a certain electronic device changes according to at least one of network capability information, network quality and motion information, and the SSID.
- the first electronic device may be any electronic device among multiple electronic devices.
- the first electronic device may be a central node among multiple electronic devices, and in this case, the information exchanged by the multiple electronic devices includes role information.
- the first electronic device may be a node with a higher weight among the plurality of electronic devices, and at this time, the information exchanged by the plurality of electronic devices includes weight information.
- the first electronic device determines, according to the exchange information, whether there is an electronic device in the plurality of electronic devices that is in accelerated motion.
- the information exchanged by the electronic devices includes motion information of the electronic devices, so that the first electronic device can determine the motion states of the plurality of electronic devices according to the motion information.
- the first electronic device determines that an electronic device among the plurality of electronic devices is accelerating, it returns to S1502; when the first electronic device determines that the movement speed of the electronic device among the plurality of electronic devices is relatively small, it executes S1506.
- the first electronic device may determine the speed change amount according to the motion speed indicated by the motion information of a certain electronic device and the historical motion speed of the electronic device. If the speed change amount is greater than the speed threshold, the electronic device is considered to be Accelerated motion, otherwise not accelerated motion. Alternatively, the first electronic device may determine the acceleration of the electronic device indicated by the motion information of a certain electronic device, and if the acceleration is greater than the speed threshold, the electronic device is considered to be in accelerated motion, otherwise it is not accelerated motion.
- the first electronic device determines whether the number of electronic devices added is greater than a first number threshold or whether the number of electronic devices decreased is greater than a second data threshold.
- the first electronic device determines the number of electronic devices to be added according to the exchange information.
- the first electronic device determines the reduced number of electronic devices according to the offline electronic devices. If the number of electronic devices added is greater than the first number threshold or the number of electronic devices decreased is greater than the second data threshold, perform S1507. If the number of electronic devices added is less than or equal to the first number threshold or the number of electronic devices decreased is less than or equal to the second data threshold, go back to S1502.
- the first electronic device may determine whether the ad hoc network needs to be triggered according to the increased number of electronic devices or the decreased number of electronic devices. For example, in the method 300, 10 electronic devices form a network topology relationship. As the devices continue to discover and exchange information with each other, for example, after 3 electronic devices are added to perform S1502-S1503, the first electronic device will receive 3 additional electronic devices. information exchanged by the electronic devices, so the first electronic device can determine the number of electronic devices added.
- the first electronic device can determine that the electronic device is not online, which will cause a certain row corresponding to the electronic device in Table 2. Both are "X", and electronic devices that are not online can also be called reduced electronic devices.
- the first quantity threshold and the second data threshold may be specified by a protocol, or may be determined by one electronic device and sent to other electronic devices.
- the first electronic device triggers connection to the ad hoc network.
- the triggering of the first electronic device to connect to the self-organized network may be that the first electronic device sends a networking instruction to other electronic devices in the network topology.
- the networking instruction sent by the first electronic device to other electronic devices may be sequentially sent to each electronic device through multi-hop transmission through the electronic devices in the network topology relationship.
- the first electronic device starts an ad hoc network and can send a networking instruction to the fourth electronic device.
- the fourth electronic device starts ad hoc networking and sends the networking instruction to the second electronic device.
- the second electronic device starts the ad hoc networking.
- a networking instruction can be sent through the established network connection, and if the two electronic devices have not established a network connection, a network connection can be established between the two electronic devices, The established network connection is then used to transmit the networking instruction.
- the format of the networking instruction may be specified by the protocol, and multiple electronic devices may parse the networking instruction according to the specified protocol.
- the first electronic device can enable the intelligent connection networking to trigger the connection to the ad hoc network. For example, a certain control of the first electronic device can be turned on to perform the connection networking or a certain control of the first electronic device can trigger the display interface to display to remind the user whether Self-organized networking needs to be enabled.
- the above method in Figure 15 describes that the ad hoc network is triggered only when the scene of the electronic device changes, the number of electronic devices that change meets the threshold, and the movement of the electronic device is not an accelerated motion.
- the order of this change is not limited, in other words In other words, the sequence of the three steps S1504-S1506 is not limited, you can first determine the number of electronic devices that have changed, then determine whether the electronic devices are accelerating, and finally determine whether the scene has changed.
- the above method 1500 may include any one of the conditions in S1504-S1506 to trigger the ad hoc network, or may include two conditions in the S1504-S1506 to trigger the ad-hoc network, which is not limited in this embodiment of the present application.
- the method 1500 only describes the conditions that need to be met to trigger the ad hoc network, and other conditions can also be derived from the ad hoc network. In other words, the embodiment of the present application does not have any restrictions on the conditions for triggering the ad hoc network. .
- each electronic device when each electronic device enables intelligent connection networking, it can be understood that each electronic device updates its own saved network topology relationship.
- the data transmitted in the method 800 may be the transmission data using the network topology relationship obtained by the method 300 or the data transmitted by using the network topology relationship obtained after updating by the method 1500 .
- FIG. 16 a mobile phone and a watch are taken as examples.
- the mobile phone periodically sends a message in the background, and the message carries the device ID of the mobile phone.
- the watch can receive messages sent by the phone via bluetooth or wifi.
- the message in S1601 can also carry an account number and various flag bits.
- the watch after the watch receives the message sent by the mobile phone, it replies a response message to the mobile phone, and the response message includes the device ID of the watch.
- the response message may further include the account number and various flags of the watch.
- the response message replied by the watch in S1602 carries the device ID of the watch; if the message sent by the mobile phone in S1601 carries the device ID, account number and various flags of the mobile phone, then S1602 The corresponding message replied by the watch can carry the device ID, account number and various flags of the watch.
- the mobile phone determines that the watch is a newly online device according to the device ID of the watch carried in the response message replied by the watch, and the mobile phone has not established a network connection with the watch before.
- the user before S1601, the user binds the mobile phone and the watch, for example, through a pin code or a QR code, so that the mobile phone determines that the watch is a trusted device before S1601.
- the mobile phone determines whether the account of the watch is the same as its own account, and if so, the mobile phone can determine that the watch is a trusted device.
- the mobile phone sends a connection establishment request to the watch, and the connection establishment request carries the Mac address of the watch.
- the phone can know the watch's Mac address.
- the mobile phone and the watch establish a network connection, such as a Bluetooth connection, and authenticate each other.
- a network connection such as a Bluetooth connection
- the mobile phone sends its own basic information, network capability information and processing capability information to the watch through the established network connection.
- the watch stores this information from the phone.
- the basic information sent by the mobile phone to the watch may be:
- the processing capability information sent by the mobile phone to the watch is used to indicate the processing capability of the mobile phone.
- the watch compares the processing capability indicated by the processing capability information sent by the mobile phone with its own processing capability, and finds that the processing capability of the mobile phone is stronger than its own processing capability, then the watch can determine its own role (Role) as an ordinary node.
- the mobile phone can also send the topology information to the watch in S1606 is empty. Alternatively, topology information may not be sent.
- the watch sends its own basic information, network capability information and processing capability information to the mobile phone through the established Bluetooth connection.
- the phone stores this information for the watch.
- the basic information sent by the watch to the mobile phone may be:
- DeviceName kk's watch//The watch whose device name is kk
- DeviceType 06D// The device type is a watch
- Weight 40//The weight value of the current device, calculated by the node network capability and type
- the network capability information sent by the watch to the mobile phone may be:
- S1607 is after S1606, that is, the watch has determined itself as an ordinary node according to the processing capability information sent by the mobile phone, then in S1607, the role information (Role) sent by the watch is an ordinary node.
- S1607 and S1606 are performed simultaneously, that is, the watch does not know the processing capability information of the mobile phone.
- the role information (Role) sent by the watch is the central node.
- the mobile phone After the mobile phone receives the processing capability information of the watch in S1607, it compares the processing capability indicated by the processing capability information of the watch with its own processing capability. The mobile phone determines that its own processing capability is higher than that of the watch, and the mobile phone determines itself as the center. node.
- the Bluetooth connection for exchanging information can be disconnected, and of course the Bluetooth connection can also not be disconnected.
- the mobile phone may determine the network topology relationship according to the exchanged information.
- the watch can determine the network topology relationship according to the exchanged information.
- the mobile phone after the mobile phone finishes executing S1608, it can send the determined network topology relationship to the watch. For example, if the Bluetooth between the mobile phone and the watch is in a connected state, the network is sent through the Bluetooth between the mobile phone and the watch. topological relationship. If there is no network connection in the connected state between the mobile phone and the watch, any network connection supported by the mobile phone and the watch can be established, and the mobile phone uses the established network connection to send the network topology relationship to the watch.
- the network topology relationship determined by the mobile phone and the watch is:
- the mobile phone periodically sends a message, and the message carries the device ID of the mobile phone.
- the content included in the message periodically sent by the mobile phone in S1610 may also be the same as the content carried in the message in S1601, which is not limited in this embodiment of the present application.
- the watch after the watch receives the message sent by the mobile phone, it replies with a response message, and the response message carries the device ID of the watch.
- the mobile phone can periodically or periodically send broadcast messages, and the watch and the mobile phone can confirm that they are online with each other.
- the mobile phone may continue to periodically send broadcast messages to determine whether the watch is online.
- the watch can only send the response message that the device is online without sending its own basic information and network capability information.
- its own basic information and/or network capability information changes, it will send its changed basic information to the opposite end.
- information and/or network capability information Specifically, when the basic information and/or network capability information of the watch changes, the watch can establish any network connection supported by both the mobile phone and the watch with the mobile phone, and send the changed basic information and/or network capability information.
- the mobile phone determines that the watch is not online, the information about the watch in the network topology relationship can be deleted, and the "O" in Table 3 is changed to "X"; or the mobile phone sends messages multiple times If no response message is received from the watch, and the number of times is greater than the preset value, the mobile phone deletes the information about the watch in the network topology relationship.
- the information about the watch in the network topology relationship may not be deleted and continue to be saved.
- the watch goes online next time only the changed information needs to be exchanged, and no change is required. Information.
- the mobile phone continues to execute S1610.
- the watch executes S1611a.
- the watch determines that its own basic information, network capability information, or processing information has changed. In the case that the watch performs S1611a, the watch may perform S1612.
- the watch sends a connection establishment request message, and the connection establishment request message carries the Mac address of the mobile phone.
- the watch and the mobile phone establish a network connection, such as a Bluetooth connection, and authenticate each other.
- a network connection such as a Bluetooth connection
- the watch transmits the changed information through the established Bluetooth connection.
- the watch can use the established network connection to transmit its own basic information, network capability information and processing information.
- the mobile phone updates the network topology relationship determined in S1608 according to the changed information.
- the watch also updates the network topology relationship determined in S1609 according to its own changed information.
- the mobile phone may also update the network topology relationship after receiving the change information of the multiple devices, and is not limited to updating only after receiving the change information of the watch.
- the mobile phone saves the network topology relationship between the mobile phone and the watch.
- the information sent by the desk lamp to the mobile phone is basically the same as the information sent by the watch to the mobile phone.
- the mobile phone updates the network topology relationship according to the information sent by the desk lamp. The difference is:
- the mobile phone can send the network topology relationship between the mobile phone and the watch saved by itself to the desk lamp, so that the desk lamp can determine a new network topology relationship according to its own information and the network topology relationship sent by the mobile phone.
- the mobile phone and the watch determine the network topology relationship.
- the mobile phone determines that the mobile phone to the watch is transmitted through Bluetooth according to the determined network topology relationship.
- the mobile phone determines that the Bluetooth between the watch and the watch is connecting
- the mobile phone transmits data to the watch through the connected Bluetooth.
- the Bluetooth is not connected, the mobile phone establishes a Bluetooth connection with the watch and transmits data through the established Bluetooth connection.
- the information exchanged by each electronic device may include one or more pieces of information, and the specific information to be exchanged is designed according to needs, and the information exchanged by each electronic device may be exchanged once or multiple times. For example, information that is basically unchanged can be exchanged at one time, and information that changes frequently can be exchanged after changing, which is not limited in this application.
- the network topology relationship saved by each electronic device in the plurality of electronic devices is consistent.
- the network topology relationship saved by each electronic device in the plurality of electronic devices may also be inconsistent. In this way, each electronic device can determine the next hop node for data transmission by using the network topology relationship saved by itself, without the need for the first node to perform global planning.
- the networking in this embodiment of the present application is defined as: there are multiple electronic devices with a trust relationship within the range that can be detected by signals such as Bluetooth and WiFi, and one device will maintain a logical connection with other devices. When the system is running The status and information of these electronic devices can be synchronized. These trusted electronic devices form a network. Based on the networking, the service can realize the non-inductive discovery connection. When the service is requested, the service can be directly initiated without waiting for the authentication process of the discovery connection.
- different connected networks can be networked at the network layer to form a network topology relationship.
- any two devices in the network topology relationship can communicate based on the network topology relationship.
- the network topology relationship can include the network connection between any two electronic devices among multiple electronic devices.
- the two devices directly determine the transmission path according to the network topology relationship when transmitting data, avoiding the need to firstly connect the two electronic devices.
- Discovering one or more network connection methods between two electronic devices, and then selecting a reasonable network connection among the one or more network connection methods to establish the connection delay is conducive to reducing the delay of data transmission, And can systematically plan the connection relationship between devices.
- the network topology relationship can be updated in real time according to the information of the electronic devices in the network, so that the real-time performance can be guaranteed.
- each electronic device includes corresponding hardware and/or software modules for executing each function.
- the present application can be implemented in hardware or in the form of a combination of hardware and computer software in conjunction with the algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functionality for each particular application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.
- the electronic device can be divided into functional modules according to the above method examples.
- each functional module can be divided corresponding to each function, such as a determination unit, a transmission unit, etc., or two or more functions can be integrated into one in the processing module.
- the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
- the electronic device provided in this embodiment is used to execute the above method for transmitting data, so it can achieve the same effect as the above implementation method.
- each electronic device may also include a processing module, a storage module, and a communication module.
- the processing module may be used to control and manage the actions of the electronic device.
- the storage module may be used to support the electronic device to execute stored program codes and data, and the like.
- the communication module can be used to support the communication between the electronic device and other devices.
- the processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
- the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and the like.
- the storage module may be a memory.
- the communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
- the electronic device involved in this embodiment may be a device having the structure shown in FIG. 1 .
- This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned relevant method steps to realize the data transmission method in the above-mentioned embodiment. .
- This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the data transmission method in the above-mentioned embodiment.
- the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the method for transmitting data in the foregoing method embodiments.
- the electronic device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference can be made to the corresponding provided above. The beneficial effects in the method will not be repeated here.
- the disclosed apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium.
- a readable storage medium including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请提供了一种传输数据的方法和电子设备。该方法包括:各个电子设备可以预先形成一个网络拓扑关系,这样,网络拓扑关系中的第一电子设备和第二电子设备进行通信时,可以基于该网络拓扑关系确定实现两个电子设备之间通信的路径信息。网络拓扑关系可以包括多个电子设备以及多个电子设备之间中相邻两个电子设备间支持的网络连接,这样,第一电子设备和第二电子设备在传输第一数据时,可直接根据网络拓扑关系确定的路径信息传输第一数据,避免两个电子设备之间需要先发现两个电子设备之间的一个或多个网络连接方式,再在一个或多个网络连接方式中选择一个合理的网络连接建立连接所带来的时延,有利于降低传输数据的时延。
Description
本申请要求于2020年09月10日提交国家知识产权局、申请号为202010949676.0、申请名称为“传输数据的方法和装置”,以及,要求于2020年12月08日提交国家知识产权局、申请号为202011423212.2、申请名称为“传输数据的方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信领域,并且更具体地涉及通信领域中的传输数据方法和电子设备。
随着网络的发展以及电子设备的发展,电子设备之间可以通过不同的传输方式进行传输数据,一个场景中可能会出现不同类型的电子设备,例如家庭网络中会出现手机、电视、手环、音箱和手表等电子设备。电子设备之间需要传输数据时,需要先发现电子设备之间有哪些连接方式,例如,电子设备之间可以通过蓝牙、wifi或者通用串行总线(universal serial bus,USB)等连接方式。电子设备需要先自动发现有哪些连接方式,在这些连接方式中选择一个连接方式,然后再建立连接,并利用建立好的连接传输数据,这样会导致传输时延较长。
发明内容
本申请实施例提供了一种传输数据的方法和电子设备,能够节省传输时延。
第一方面,提供了一种传输数据的电子设备,方法可由第一电子设备执行,第一电子设备可以是能够支持电子设备实现该方法所需的功能的装置,例如芯片系统。包括:多个电子设备中的第一电子设备根据网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式,路径信息用于指示第一电子设备向第二电子设备传输第一数据所经过的电子设备,网络拓扑关系包括多个电子设备以及多个电子设备之间的网络连接方式;
第一电子设备根据路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式向第二电子设备传输第一数据。
在上述方案中,各个电子设备可以预先将各个电子设备支持的不同的网络连接进行组网,形成一个网络拓扑关系,这样,网络拓扑关系中的第一电子设备和第二电子设备进行通信时,都可以基于该网络拓扑关系实现两个电子设备之间的通信。网络拓扑关系可以包括多个电子设备以及多个电子设备之间中任意两个电子设备之间的网络连接,这样,第一电子设备和第二电子设备在传输第一数据时直接根据网络拓扑关系中的网络连接传输第一数据,避免两个电子设备之间需要先发现两个电子设备之间的一个或多个网络连接方式,再在一个或多个网络连接方式中选择一个合理的网络连接建立连接所带来的时延,有利于降低传输数据的时延。
可选地,第一电子设备为多个电子设备中的任一电子设备。
可选地,第一电子设备可以预先确定网络拓扑关系,或者多个电子设备中的中心节点可以确定网络拓扑关系并发送给第一电子设备。
可选地,第一电子设备可以保存网络拓扑关系,且该网络拓扑关系可是更新过的或者是未更新过的。
可选地,多个电子设备中任一电子设备都包括保存网络拓扑关系,且保存的网络拓扑关系都相同。
可选地,多个电子设备之间可以基于直接或者间接交换的信息。交换的信息可以包括用于确定网络拓扑关系的信息或者用于确定路径信息的信息。
可选地,多个电子设备之间可以定期交换信息或者信息有变化时交换信息。
可选地,路径信息指示的传输路径上包括两个以上的电子设备,例如传输路径可以只包括第一电子设备和第二电子设备,还可以包括除了第一电子设备和第二电子设备之外的电子设备。
在一些可能的实现方式中,在多个电子设备中的第一电子设备利用网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之前,方法还包括:第一电子设备获取多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息;
第一电子设备根据各个电子设备的基本信息和各个电子设备的网络能力信息确定网络拓扑关系。
可选地,各个电子设备的基本信息用于标识电子设备。
在一些可能的实现方式中,各个电子的基本信息包括电子设备的标识、电子设备的名称、电子设备的网络标识、电子设备的类型、电子设备的权重信息、电子设备角色信息和电子设备的版本信息中的至少一项。
在一些可能的实现方式中,各个电子设备的网络能力信息包括:各个电子设备的网络能力信息包括:各个电子设备的支持的网络连接、各个电子设备的支持的网络连接所支持的带宽、各个电子设备的支持的网络连接的连接信息、各个电子设备支持的网络连接的连接状态和处于连接状态的网络连接的时间信息中的至少一项。
在一些可能的实现方式中,第一电子设备获取多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息,包括:
第一电子设备与多个电子设备中的第三电子设备建立第一网络连接;
第一电子设备通过第一网络连接接收第三电子设备发送的第三电子设备的基本信息和第三电子设备的网络能力信息,或者通过第一网络连接接收第三电子设备发送的第三电子设备的基本信息、第三电子设备的网络能力信息、多个电子设备中第四电子设备的基本信息和第四电子设备的网络能力信息;
第一电子设备通过第一网络连接向第三电子设备发送第一电子设备的基本信息和第一电子设备的网络能力信息。
在上述方案中,第一电子设备可以通过连接的第一网络连接向第三电子设备交换自身的信息,第三电子设备可以通过建立的第一网络连接向第一电子设备交换自身的信息,也可以交换自身的信息和其他电子设备的信息(第四电子设备的信息),换句 话说,多个电子设备交换的信息可以是直接交换或者间接通过中间设备交换,本申请实施例对交换信息的形式不作限定。
其中,第一网络连接可以是第一电子设备和第三电子设备都支持的一种网络连接。
在一些可能的实现方式中,在第一电子设备与多个电子设备中的第三电子设备建立第一网络连接之前,方法还包括:
第一电子设备定期发送消息,消息携带第一电子设备的设备标识;
第一电子设备接收第三电子设备发送的响应消息,响应消息是第三电子设备接收到第一电子设备定期发送的消息后发送的,响应消息携带第三电子设备的设备标识;
第一电子设备根据第三电子设备的设备标识确定第三电子设备在线。
在上述方案中,第一电子设备在与第三电子设备交换信息之前,需要先确定互相是否在线,只有在线的情况下,才交换信息。
在一些可能的实现方式中,第一电子设备还可以获取各个电子设备是否在线的信息,第一电子设备根据各个电子设备是否在线以及网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式。
可选地,各个电子设备是否在线的信息可以理解为各个电子设备是否能够被其他的电子设备检测到。
在一些可能的实现方式中,方法还包括:第一电子设备获取多个电子设备中的各个电子设备的处理能力信息、各个电子设备的网络质量和各个电子设备的电量信息中的至少一项;
其中,多个电子设备中的第一电子设备根据网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息,包括:第一电子设备根据各个电子设备的处理能力信息、各个电子设备的网络质量、各个电子设备的电量信息中的至少一项以及网络拓扑关系确定向第二电子设备传输第一数据的路径信息。
在上述方案中,第一电子设备可以根据各个电子设备的网络质量、处理能力信息以及电量信息中的至少一种确定第一电子设备向第二电子设备传输第一数据的路径信息,可以进行全局的规划路径,有利于数据的准确的传输。
可选地,各个电子设备的处理能力信息用于指示各个电子设备的处理能力,例如,包括电子设备的功耗、芯片处理能力以及内存。
可选地,各个电子设备的网络质量表示各个电子设备当前所处的环境的网络质量,在不同环境下各个电子设备的网络质量不同,例如在隧道和空旷的地方网络质量不同。网络质量包括连接速率和信号强度等。
可选地,各个电子设备的电量信息表示各个电子设备当前的剩余电量,或者各个电子设备的电量可用时长等。
在一些可能的实现方式中,第一电子设备根据路径信息以及路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式向第二电子设备传输第一数据,包括:
第一电子设备通过第二网络连接向传输路径上与第一电子设备相邻的第五电子设备发送第一报文,第一报文的报文体包括第一数据,第一报文的报文头包括路径信息以及路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式,以便第五 电子设备确定传输路径上的下一跳节点以及与下一跳节点之间的网络连接方式,第二网络连接为路径信息指示的传输路径上第一电子设备与第五电子设备之间的连接方式;
其中,第一报文的报文头还包括源地址、目的地址、业务标识和业务类型中的至少一项,源地址为第一电子设备的地址,目的地址为第二电子设备的地址。业务标识用于唯一标识第一数据对应的业务,业务类型用于标识第一数据对应的业务类型。
在上述方案中,第一电子设备可以将根据网络拓扑关系确定的路径信息以及路径信息支持的传输路径上相邻的两个电子设备之间的网络连接方式携带在第一报文的报文头中发送给第五电子设备。第五电子设备可以根据报文头中携带的这些信息确定下一跳节点,以及与下一跳节点之间的网络连接方式,并与第五电子设备的下一跳节点建立该网络连接,同样地,第五电子设备仍然可以将从第一电子设备接收到的报文头中的这些信息通过建立的网络连接继续发送给下一跳节点,这样,传输路径上的相邻两个电子设备可以将携带第一数据的报文路由到第二电子设备。
在一些可能的实现方式中,其特征在于,第一电子设备根据路径信息以及路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式向第二电子设备传输第一数据,包括:
第一电子设备通过第二网络连接向传输路径上与第一电子设备相邻的第五电子设备发送网络连接指示信息,网络连接指示信息用于指示传输路径上除了第一电子设备和第五电子设备之外的其他相邻的两个电子设备之间的网络连接方式,以便第五电子设备确定与下一跳节点之间的网络连接方式,第五电子设备为传输路径上与第一电子设备相邻的下一跳节点,第二网络连接为路径信息指示的传输路径上第一电子设备与第五电子设备之间的连接方式;
第一电子设备通过第二网络连接向第五电子设备发送第二报文,第二报文的报文头包括路径信息,第二报文的报文体包括第一数据;
其中,第二报文的报文头还包括源地址、目的地址、业务标识和业务类型中的至少一项,源地址为第一电子设备的地址,目的地址为第二电子设备的地址。
在上述方案中,第一电子设备可以将根据网络拓扑关系确定的传输路径上的相邻电子设备之间的网络连接通过网络连接指示信息指示第五电子设备,第五电子设备可以根据网络连接指示信息提前建立与下一跳节点之间的网络连接,当数据到来时,直接利用建立的网络连接传输数据,有利于提高传输时延。此外,第一电子设备将路径信息可以携带第一数据的报文的报文头中,以便第五电子设备确定传输路径上的下一跳节点。这样,传输路径上的相邻两个电子设备可以将携带第一数据的报文路由到第二电子设备。
在一些可能的实现方式中,方法还包括:
第一电子设备确定与第五电子设备之间是否存在已经建立的第二网络连接,第二网络连接为路径信息指示的传输路径上第一电子设备与第五电子设备之间的网络连接;
若不存在第二网络连接,第一电子设备与第五电子设备建立第二网络连接;
若存在已经建立的第二网络连接,则第一电子设备通过第二网络连接向传输路径上与第一电子设备相邻的第五电子设备发送第一报文,或者第一电子设备通过第二网络连接向传输路径上与第一电子设备相邻的第五电子设备发送网络连接指示信息。
换句话说,在上述方案中,第一电子设备与第五电子设备之间存在已经建立的第二网络连接,则可以复用已经存在的第二网络连接第一报文或者网络连接指示信息,避免需要重新建立网络连接所带来的开销。
在一些可能的实现方式中,在多个电子设备中的第一电子设备利用网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,方法还包括:
第一电子设备获取各个电子设备的运动信息;
第一电子设备根据各个电子设备的运动信息确定存在加速运动的电子设备,则不更新网络拓扑关系。
在上述方案中,第一电子设备可以基于运动信息确定是否更新网络拓扑关系,避免长时间不更新网络拓扑关系所导致的信息滞后,从而造成第一数据传输失败的情况。
可选地,各个电子设备的运动信息表示各个电子设备的运动状态,各个电子设备可以根据自身的传感器来判定电子设备的当前的地理位置以及运动的情况,如速度、加速度或方向等等。
在一些可能的实现方式中,在多个电子设备中的第一电子设备根据网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,方法还包括:
第一电子设备获取不同于多个电子设备的至少一个第六电子设备的基本信息;第一电子设备根据至少一个第六电子设备的基本信息确定增加的至少一个第六电子设备的数量;若增加的至少一个第六电子设备的数量大于预设数量,第一电子设备更新网络拓扑关系。
在上述方案中,第一电子设备可以基于至少一个第六电子设备的基本信息确定增加的第六电子设备的数量,若增加的第六电子设备的数量满足预设数量,则更新网络拓扑关系,避免长时间不更新网络拓扑关系所导致的信息滞后,从而造成第一数据传输失败的情形。
在一些可能的实现方式中,方法还包括:若增加了至少一个第六电子设备,则网络拓扑关系中与增加的至少一个第六电子设备中直接连接的电子设备可以将历史网络拓扑关系发送给增加的至少一个第六电子设备,以便增加的至少一个第六电子设备根据自身的信息确定网络拓扑关系。
可选地,至少一个第六电子设备的基本信息用于标识至少一个第六电子设备,至少一个第六电子设备的基本信息包括电子设备的标识、电子设备的名称、电子设备的网络标识、电子设备的类型、电子设备的权重信息、电子设备角色信息和电子设备的版本信息中的至少一项。
可选地,第一电子设备可以至少一个第六电子设备的其他信息,利用其他的信息确定增加的至少一个第六电子设备的数量,如,至少一个第六电子设备的网络能力信息。
在一些可能的实现方式中,在多个电子设备中的第一电子设备利用网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,方法还包括:
第一电子设备获取下线的电子设备的数量;
若下线的电子设备的数量满足预设数量,第一电子设备删除网络拓扑关系中下线的电子设备的基本信息和网络能力信息,如预设数量为一个或多个。
在一些可能的实现方式中,第一电子设备定期发送消息,消息携带第一电子设备的设备标识;第一电子设备在预设时间段内未接收到一个电子设备发送的响应消息,则可以确定该电子设备下线。
在上述方案中,下线的电子设备可以理解为未检测到的电子设备或者减少的电子设备,若下线的电子设备数量达到预设数量(如预设数量为N,N为正整数),则第一电子设备更新网络拓扑关系,更新网络拓扑关系具体为删除下线的电子设备的基本信息和网络能力信息,避免长时间不更新网络拓扑关系所导致的信息滞后,从而造成第一数据传输失败的情形。
在一些可能的实现方式中,在多个电子设备中的第一电子设备根据网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,方法还包括:
第一电子设备获取多个电子设备中的至少部分电子设备发送的服务集标识SSID;第一电子设备根据至少部分电子设备的SSID确定多个电子设备的场景是否发生变化;若多个电子设备的场景发生变化,第一电子设备更新网络拓扑关系。
在上述方案中,第一电子设备根据SSID确定是否多个电子设备中是否存在场景变化的电子设备,若存在场景变化的电子设备则更新网络拓扑关系,避免长时间不更新网络拓扑关系所导致的信息滞后,从而造成第一数据传输失败的情形。
在一些可能的实现方式中,第一电子设备可以根据多个电子设备的运动信息、增加的第六电子设备的数量、下线电子设备和场景发生变化的电子设备中的至少两项确定是否更新网络拓扑关系。
在一些可能的实现方式中,第一电子设备可以定期更新网络拓扑关系。
在一些可能的实现方式中,第一电子设备更新网络拓扑关系具体包括:第一电子设备根据接收到的各个电子设备的更新后的基本信息和各个电子设备的更新后的网络能力信息更新网络拓扑关系。
在一些可能的实现方式中,在多个电子设备中的第一电子设备根据网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之前,方法还包括:
第一电子设备获取第二电子设备的服务信息,第二电子设备的服务信息用于指示第二电子设备支持的服务;
第一电子设备根据第二电子设备的服务信息确定向第二电子设备发送服务信息对应的第一数据。
在上述方案中,第一电子设备在向第二电子设备传输第一数据之前,第一电子设备需要确定第二电子设备支持哪些服务,若第二电子设备支持第一数据对应的服务,则第一电子设备确定向第二电子设备发送第一数据。
可选地,第二电子设备的服务信息用于指示第二电子设备支持的服务。
可选地,方法还包括:第一电子设备向多个电子设备中的其他电子设备直接或者 间接发送第一电子设备的基本信息和第一电子设备的网络能力信息。
可选地,方法还包括:第一电子设备的基本信息发生变化和/或网络能力信息发生变化,第一电子设备向多个电子设备中的其他电子设备直接或者间接发送第一电子设备的变化后的基本信息和第一电子设备的变化后的网络能力信息。
可选地,方法还包括:第一电子设备向多个电子设备中的其他电子设备直接或者间接发送第一电子设备的处理能力信息、网络质量、电量信息、运动信息、服务集标识和服务信息中的至少一项。
可选地,方法还包括:第一电子设备的处理能力信息、网络质量、电量信息、运动信息、服务集标识和服务信息中的至少一项发生变化,第一电子设备向多个电子设备中的其他电子设备直接或者间接发送变化后信息。
第二方面,提供了一种确定网络拓扑关系的方法,包括:多个电子设备中的第一电子设备获取多个电子设备中各个电子设备的基本信息和各个电子设备的网络能力信息;
第一电子设备根据各个电子设备的基本信息和各个电子设备的网络能力信息确定网络拓扑关系。
在一些可能的实现方式中,各个电子的基本信息包括各个电子的基本信息包括电子设备的标识、电子设备的名称、电子设备的网络标识、电子设备的类型、电子设备的权重信息、电子设备角色信息和电子设备的版本信息中的至少一项。
在一些可能的实现方式中,各个电子设备的网络能力信息包括:各个电子设备的支持的网络连接、各个电子设备的支持的网络连接所支持的带宽、各个电子设备的支持的网络连接的连接信息、各个电子设备支持的网络连接的连接状态和处于连接状态的网络连接的时间信息中的至少一项。
在一些可能的实现方式中,第一电子设备获取多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息,包括:
第一电子设备与多个电子设备中的第三电子设备建立第一网络连接;
第一电子设备通过第一网络连接接收第三电子设备发送的第三电子设备的基本信息和第三电子设备的网络能力信息,或者通过第一网络连接接收第三电子设备发送的第三电子设备的基本信息、第三电子设备的网络能力信息、多个电子设备中第四电子设备的基本信息和第四电子设备的网络能力信息;
第一电子设备通过第一网络连接向第三电子设备发送第一电子设备的基本信息和第一电子设备的网络能力信息。
在一些可能的实现方式中,在第一电子设备与多个电子设备中的第三电子设备建立第一网络连接之前,方法还包括:
第一电子设备定期发送消息,消息携带第一电子设备的设备标识;
第一电子设备根据第三电子设备发送的响应消息,响应消息携带第三电子设备的设备标识;
第一电子设备根据第三电子设备的设备标识确定第三电子设备在线。
第三方面,本申请提供了一种装置,该装置包含在电子设备中,该装置具有实现上述各方面及上述各方面的可能实现方式中电子设备行为的功能。功能可以通过硬件 实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,确定模块或单元、传输模块或单元等。
可选地,该装置可以是上述的第一电子设备。
第四方面,本申请提供了一种电子设备,包括:一个或多个处理器;存储器;多个应用程序;以及一个或多个计算机程序。其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令。当指令被电子设备执行时,使得电子设备执行上述任一方面任一项可能的实现中的传输数据的方法。
可选地,该电子设备还可以包括:触摸显示屏和/或摄像头,其中,触摸显示屏包括触敏表面和显示器;
可选地,该电子设备可以是上述的第一电子设备。
第五方面,本申请提供了一种电子设备,包括一个或多个处理器和一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述任一方面任一项可能的实现中的传输数据的方法。
第六方面,本申请提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的传输数据的方法。
第七方面,本申请提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的传输数据的方法。
图1是本申请实施例提供的电子设备的结构示意性框图。
图2是本申请实施例提供的电子设备的软件架构示意性。
图3是本申请实施例提供的确定网络拓扑关系的方法示意图。
图4是本申请实施例提供的交换信息的示意图。
图5是本申请实施例提供的一种网络拓扑关系的示意图。
图6是本申请实施例提供的网络拓扑关系在网络层的示意图。
图7是本申请实施例提供的网络拓扑关系在链路层的示意图。
图8是本申请实施例提供的传输数据的方法的示意图。
图9是本申请实施例提供的另一传输数据的方法的示意图。
图10是本申请实施例提供的数据的报文的格式示意图。
图11是本申请实施例提供的另一数据的报文的格式示意图。
图12是本申请实施例提供的又一传输数据的方法的示意图。
图13是本申请实施例提供的又一数据的报文的格式示意图。
图14是本申请实施例提供的又一数据的报文的格式示意图。
图15是本申请实施例提供的更新网络拓扑关系示意图。
图16是本申申请实施例提供的手机与手表之间的交互示意图。
下面将结合附图对本申请实施例中的技术方案进行清除、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
示例性的,图1示出了电子设备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)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器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)接口,和/或通用串行总线(universal serial bus,USB)接口等。
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传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通 过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications, GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代无线通信系统(5G,the 5th Generation of wireless communication system),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU 可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的 触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用 于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
需要说明的是,本申请实施例提到的任一电子设备可以包括电子设备100中更多或者更少的模块。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
电子设备与电子设备之间需要进行通信时,需要先发现两个电子设备可以通过哪些网络连接方式进行通信,从而在这些网络连接中选择一个网络连接,然后建立连接。举例来说,两个电子设备可以通过蓝牙、WiFi或者USB这些网络连接进行通信,两个电子设备需要先发现可以通过蓝牙、WiFi或者USB这三种网络连接方式进行通信,然后在这三种 网络连接方式中选择一种网络连接方式建立连接,并利用建立好的连接传输数据,这个过程需要先发现连接,再选择连接,并进一步建立连接,从而使得传输时延较长。
在本申请实施例中,本申请实施例提供的传输数据的方法,可以预先将各个电子设备支持的不同的网络连接进行组网,形成一个网络拓扑关系,这样,网络拓扑关系中的任何两个电子设备进行通信时,都可以基于该网络拓扑关系实现两个电子设备之间的通信。网络拓扑关系可以包括多个电子设备之间中任意两个电子设备之间的网络连接,这样,两个电子设备在传输数据时直接根据网络拓扑关系中的网络连接传输数据,避免两个电子设备之间需要先发现两个电子设备之间的一个或多个网络连接方式,再在一个或多个网络连接方式中选择一个合理的网络连接建立连接所带来的时延,有利于降低传输数据的时延。并且电子设备可以系统的规划不同电子设备之间的网络拓扑关系,从而可以充分利用网络资源,避免电子设备之间抢占资源。
下面结合图3描述如何确定网络拓扑关系。
S301,多个电子设备之间互相发现。
其中,S301中,多个电子设备之间通过以下两种方式中的任一种方式进行互相发现。
方式一,多个电子设备中的任一电子设备可以周期性的发送广播消息,接收到该广播消息的电子设备给发送广播消息的电子设备回复应答消息,这样,可以认为两个电子设备互相发现了对方,应答消息的格式与广播消息的格式可以一致也可以不一致。若接收到该广播消息的电子设备为多个,该多个电子设备均向发送广播消息的电子设备回复应答消息,则一次广播消息可以发现多个电子设备。
可选地,任一电子设备发送的广播消息可以携带电子设备自身的设备识别地址、用户账号、设备类型、保活的各类标志位和回复标志中的至少一项,如表1所示,接收广播消息的电子设备可以根据发送广播消息的电子设备的发送的这些信息进行过滤。例如,接收广播消息的电子设备根据广播消息中携带的设备识别地址和/或设备类型确定发现的电子设备;又例如,接收广播消息的电子设备根据发送广播消息的电子设备的用户账号确定发送广播消息的电子设备是否是信任设备,接收广播消息的电子设备利用发送广播消息的电子设备的用户账号与自身的用户账号进行对比,若与自身用户账号相同,则可以确定发送广播消的电子设备为信任设备,则给发送广播消息的电子设备回复应答消息。可选地,电子设备回复的应答消息可以包括自身的设备识别地址、用户账号、设备类型、保活的各种标志位和回复标志中的至少一项,其中,回复标志的取值不同表示是广播消息还是应答消息,如回复标志取0表示该消息为广播消息,如回复标志取1表示该消息为广播消息的应答消息。这样,发送广播消息的电子设备可以根据应答消息识别出哪些设备接收到了广播消息,这样,也即电子设备发现了哪些设备。同时也送广播消息的电子设备可以根据应答消息中携带的信息进行过滤。
表1
此外,若多个电子设备中的任一电子设备发送广播消息,没有接收到广播消息的电子设备也不会给发送广播消息的电子设备回复应答消息,这样,两个电子设备也不会发现对 方。
方式二,多个电子设备中的任一电子设备可以向目的电子设备发送定向消息,另外一个电子设备若接收到定向消息,则向发送定向消息的电子设备回复应答消息,这样,可以认为两个电子设备互相发现了对方。例如,定向消息可以是蓝牙广播消息。定向消息中包括目的电子设备的蓝牙地址,例如,多个电子设备中的任一电子设备发送的定向消息为蓝牙广播消息,蓝牙广播消息包括目的电子设备的蓝牙地址,接收蓝牙广播消息的电子设备可以向发送广播消息的电子设备回复应答消息,应答消息包括:设备标识,这样,发送广播消息的电子设备可以确定目的电子设备接收到了蓝牙广播消息,两个电子设备就可以互相发现。
此外,若多个电子设备中的任一电子设备发送定向消息,没有接收到定向消息的电子设备也不会给发送定向消息的电子设备回复应答消息,这样,两个电子设备也不会发现对方。
需要说明的是,多个电子设备之间可以依次互相发现,也可以同时互相发现,本申请实施例对多个电子设备互相发现的顺序并不作任何限定。此外,多个电子设备之间可以有其他的发现方式,本申请实施例对此不作限定。
也需要说明的是,多个电子设备之间可以分别通过各自的图1所示的移动通信模块150和/或无线通信模块160发送消息和接收消息进行互相发现。例如,在方式一中,发送广播消息的电子设备可以通过自身的移动通信模块150和/或无线通信模块160发送广播消息并接收应答消息,接收广播消息的电子设备可以通过自身的移动通信模块150和/或无线通信模块160接收广播消息并发送应答消息。又例如,在方式二中,发送定向消息的电子设备通过自身的移动通信模块150和/或无线通信模块160发送定向消息并接收应答消息,接收定向消息的电子设备通过自身的移动通信模块150和/或无线通信模块160接收定向消息并发送应答消息。
S302,多个电子设备之间交换信息。多个电子设备之间交换的信息可以包括:电子设备的基本信息和电子设备的网络能力信息中的至少一项。
其中,多个电子设备交换信息时,不仅可以交换自身的信息也可以交换获取到的其他的电子设备的信息。
可选地,多个电子设备之间交换信息之后,可以保存交换得到的信息。
具体地,S302可以包括:多个电子设备在互相发现之后可以互相建立任意一种网络连接,利用建立的网络连接交换信息。例如,电子设备1和电子设备2发现了对方,则电子设备1和电子设备2之间可以采用任意一种网络连接方式先建立网络连接,如电子设备1和电子设备都支持蓝牙和WiFi传输,则可以利用蓝牙或者WiFi建立网络连接,再利用建立好的网络连接交换信息。
可选地,多个电子设备通过建立的网络连接交换完信息之后,可以断开已建立的网络连接。
可以理解的是,可以将建立的网络连接理解为物理连接。
电子设备的基本信息可以包括以下至少一项:电子设备的标识(device ID)、电子设备的名称(device name)、电子设备的类型(device type)、网络标识(Network ID)、电子设备的权重信息、电子设备的角色信息和电子设备的版本信息中的至少一项。其中,电子设 备的标识用于唯一标识一个电子设备;电子设备的名称为用户定义的电子设备的名称或者电子设备出厂定义的名称;电子设备的类型表示电子设备所属哪一类型,例如类型为:手机、PC、穿戴、耳机、眼镜、音箱、车机、智慧屏或者车机等。网络标识为电子设备接入网络之后,网络为电子设备分配的唯一组网标识,例如可以为唯一设备识别符(unique device identifier,UDID)。电子设备的版本信息表示电子设备当前的系统的版本号。
上述电子设备的标识和网络标识都可以唯一标识一个电子设备,因此,电子设备交换的基本信息可以包括电子设备的标识或者电子设备的网络标识,当然也可以包括电子设备的标识和电子设备的网络标识,本申请不予限制。其中,电子设备的标识和网络标识也可以由16位字母数字组合而成,例如电子设备的标识和网络标识都可以为4b3d-4534-6b35-f246;或者电子设备的标识和网络标识也可以由32位的通用唯一识别码(universally unique identifier,UUID)组成,例如,电子设备的标识可以为“A03F94A675FD65C222A22519B628619EC9CAD21D1BEAFEDDF40A7140D8B650FF”,网络标识可以“ED45800FF32CA2CE1A5CF812758FA19A213CA0DB2B5D62DE326A604F6685812C”。
电子设备的权重信息可以是电子设备自身根据电子设备的网络能力信息和电子设备的处理能力信息确定的,例如,不同的电子设备的功耗、芯片处理能力以及内存不同,电子设备的功耗高、芯片处理能力好、内存大并且网络能力强的电子设备权重高,相反地,电子设备的功耗低、芯片的处理能力差、内存小并且网络能力弱的电子设备权重低。
电子设备的角色信息表示某个电子设备中心节点、普通节点或者尾节点,电子设备的角色表示电子设备可以在网络拓扑关系中能够扮演的角色,例如,角色可以是一个网络拓扑关系中的中心节点、普通节点还是尾节点。电子设备的角色可以是电子设备根据权重确定,或者是根据确定权重的电子设备的网络能力信息和电子设备的处理能力信息确定。例如,电子设备的权重越高,则电子设备更有可能是中心节点,电子设备的权重越低,则电子设备更有可能是尾节点,如手机和电脑可能是中心节点,手表和手环可能是尾节点,音箱和电视可能是中间节点。
电子设备在交换信息之前可以先确定自身为中心节点,当电子设备在互相交换信息之后,根据交换的信息可以更新自身的角色信息,例如,一个电子设备首次可以确定自身为中心节点,当接收到另一个电子设备的处理能力信息,该电子设备可以根据另一个电子设备的处理能力信息确定另一个电子设备的处理能力强于该电子设备的处理能力,因此该电子设备可以更新自身为普通节点,这样,每个电子设备可以更新角色信息。
网络能力信息包括电子设备支持的网络连接(NetworkCapabilities)、电子设备支持的网络连接所支持的最大带宽、电子设备支持的网络连接的连接信息(如端口号,MAC地址和IP地址等)和中的至少一项。
例如,电子设备支持的网络连接可以包括:WiFi、蓝牙、近场通信(near field communication,NFC)、USB和蜂窝网(如4G或者5G等)等至少一种,其中,WiFi可以包括WiFi直连(WiFi-P2P)和局域网WiFi(WiFi-LAN)。
下面举例来说,一个电子设备的网络能力信息包括以下内容:
需要说明的是,电子设备交换的网络能力信息,如上述示例中的电子设备支持的网络连接有ble、WiFi-P2P、WiFi-LAN,是指该电子设备支持通过ble、WiFi-P2P、WiFi-LAN进行通信。该电子设备的蓝牙和WiFi功能可都处于开启状态,也可以是该电子设备的蓝牙和WiFi功能暂未处于开启状态,但是在需要使用ble、WiFi-P2P、WiFi-LAN功能时,该电子设备可开启自身的蓝牙和WiFi功能。
需要说明的是,一个电子设备可以将自身的基本信息和网络能力信息先发给另一个电子设备,也可以接收其他电子设备发送的基本信息和网络能力信息。当一个电子设备再接收到其他电子设备的基本信息和网络能力信息时,也可以将接收到的其他电子设备的基本信息和网络能力信息发送给另一个电子设备。换句话说,电子设备在交换信息的过程中,可以先发送自身的信息,再发送检测到的其他电子设备的信息。或者一个电子设备也可以将自身的基本信息、自身的网络能力信息、其他的电子设备的基本信息和其他电子设备的网络能力信息同时发送给另外一个电子设备。
可选地,多个电子设备之间交换的信息除了包括电子设备的基本信息和电子设备的网络能力信息之外,还可以交换电子设备的处理能力信息、电子设备的网络质量、电子设备的电量信息、电子设备的运动信息、电子设备的服务信息、电子设备的服务集标识(service set identifier,SSID)和拓扑信息中的至少一项。
电子设备的处理能力信息表示电子设备的处理能力,例如包括电子设备的功耗、芯片处理能力以及内存。
电子设备的网络质量表示电子设备当前所处的环境的网络质量,在不同环境下电子设备的网络质量不同,例如在隧道和空旷的地方网络质量不同。网络质量包括连接速率和信号强度等。
电子设备的电量信息表示电子设备当前的剩余电量,或者电子设备的电量可用时长等。
电子设备的运动信息表示电子设备的运动状态,各个电子设备可以根据自身的传感器来判定当前电子设备的当前的地理位置以及运动的情况,如速度、加速度、方向。
电子设备的服务信息表示某个电子设备支持的服务,例如支持投屏服务和/或语音通话服务。
电子设备的服务集标识(service set identifier,SSID),用于标识电子设备所连接的不同的网络。
电子设备的拓扑信息用于表示电子设备自身保存的网络拓扑关系,拓扑信息可以是历史确定的网络拓扑关系之间的连接关系,当有新电子设备加入网络拓扑关系时,网络拓扑关系中的电子设备可以将自身已经保存的网络拓扑关系发送给新电子设备,这样,新电子设备可以根据其他电子设备发送的网络拓扑关系以及自身的信息确定新的网络拓扑关系,该新电子设备可以将自身的信息交换给其他的电子设备,其他的电子设备根据新电子设备的信息更新网络拓扑关系。
示例性的,如图4所示,设备A、设备B和设备F可以通过用户开关、语音、手势等方式启动智能连接组网,例如,设备A先检测到设备B在线,设备A与设备B互相发现之后,设备A和设备B之间建立设备A与设备B之间的任意一种网络连接,利用建立的网络连接交换信息。具体地,交换信息包括:设备A将自身的信息发送给设备B,设备B将自身的信息发送给设备A。若设备B与设备F互相发现,则设备B与设备F建立网络连接,利用建立的网络连接交换信息。具体地,交换信息包括设备F将自身信息发送给设备B,设备B将自身信息以及设备A的信息发送给设备F,这样,设备F就可以获取到设备A和设备B的信息,并且设备F也可以获知设备A也在线。此外,设备B将获取的设备F的信息发送给设备A,这样设备A也可以获知设备F在线。这样,设备A、设备B和设备F三个设备之间可以完成信息的交换。设备A、设备B和设备F之间交换完信息之后,将交换得到信息进行保存。其中,图4中的设备A、设备B和设备F可以为图6和图7中的设备。
此外,在图4所示的例子中,设备A与设备B在交互完信息之后可以断开网络连接,设备B与设备F在交互完信息之后可以断开网络连接。
需要说明的是,若两个电子设备之间交互过信息之后,可以将用于交互信息的网络连接断开,当某个电子设备再检测新的电子设备时,可以建立新的网络连接,利用新的网络连接交互信息。或者,两个电子设备交互能够检测到的所有电子设备的信息之后,再断开网络连接。换句话说,本申请实施例中,两个电子设备可以利用一次建立的网络连接交互的不同的电子设备的信息,或者可以利用多次建立的网络连接交互的不同的电子设备的信息。如图4所示,设备A与设备B在交互信息之后可以将建立的网络连接断开,当设备B 获取到设备F的信息之后,可以建立新的网络连接,并利用新的网络连接将设备B的信息发送到设备A。或者设备A与设备B建立的网络连接先不断开,在设备B与设备A交互完设备F的信息之后在断开。本申请实施例不予限制。
需要说明的是,多个电子设备中的任意两个电子设备在互相发现之后就可以建立网络连接并交换信息,换句话说,多个电子设备中哪些电子设备先互相发现了就可以交换信息,与其他电子设备是否发现没有任何顺序限制。也就是说,S301和S302是为了描述方便,实际上,S301中的部分电子设备互相发现可以在S302中的部分电子设备交换信息之后或者之前或者同时进行,本申请实施例不予限制。
也需要说明的是,多个电子设备之间可以分别通过各自的图1所示的移动通信模块150和/或无线通信模块160进行交换信息。
可选地,S302或者S301执行的条件的是多个电子设备之间都是可信设备,多个电子设备可以根据交换得到的信任信息确定电子设备为可信设备,例如多个电子设备之间登录了相同的账号即AccountID相同,或者用户对多个电子设备进行了绑定和认证过程,例如通过pin码或者QR码等绑定。
S303,多个电子设备根据交换的信息确定多个电子设备之间的网络拓扑关系。
进一步地,多个电子设备根据交换得到的电子设备的基本信息和电子设备的网络能力信息确定多个电子设备之间的网络拓扑关系。网络拓扑关系可以包括多个电子设备之间的网络连接方式。
具体地,多个电子设备可以根据交换得到的各个电子设备的网络能力信息以及各个电子设备的基本信息确定网络拓扑关系。具体包括,多个电子设备中的一个电子设备(如作为中心节点的电子设备)可以确定网络拓扑关系,再将网络拓扑关系同步给其他的电子设备,或者每个电子设备自身根据交换得到的信息确定网络拓扑关系。电子设备存储网络拓扑关系的形式不作任何限定,例如若图7中的设备A、设备B、设备C、设备D、设备E、设备F和设备G之间交换信息之后,可以保存交换得到的信息且可以根据交换得到的信息确定网络拓扑关系,例如,设备A可以保存如下内容,其中每个设备的信息(info)可以包括上述至少部分信息,示例如下:
需要说明的是,ConnectAbilityTable中两个电子设备之间的网络连接方式,表示两个 电子设备之间可通过该种网络连接方式通信可达。例如DevId-A与DevId-B之间的连接能力包括蓝牙,WiFi-p2p和WiFi-lan,则表示DevId-A与DevId-B可通过蓝牙,WiFi-p2p或者WiFi-lan进行通信。
例如,电子设备保存的内容还可以为如表2所示的形式,多个电子设备可以为手机、PAD、PC、大屏、音箱、耳机、手机、手环和眼镜,这些设备之间的组网关系如表2所示。这些电子设备在互相发现之后,可以根据交换得到的其他电子设备的基本信息确定其他电子设备的名称以及其他电子设备的标识,例如手机可以确定各个电子设备的名称分别为PAD、PC、大屏、音箱、耳机、手机、手环和眼镜等。这些电子设备根据得到的其他电子设备的网络能力信息确定其他电子设备支持的网络连接,这些电子设备根据其他电子设备支持的网络连接以及自己自身支持的网络连接确定两个电子设备之间支持的网络连接方式。举例来说,表1中手机与PAD之间没有连接(no-connection,NC);手机与个人计算机(personal computer,PC)之间可以通过基础速率(basic rate,BR)蓝牙或者WiFi连接,BR蓝牙也称为经典蓝牙,换句话说,手机与PC都支持BR蓝牙连接和WiFi连接;手机与大屏之间可以通过蓝牙(bluetooth,BT)或者WiFi连接,换句话说,手机与PC都支持BT和WiFi连接。
表2
| 手机 | PAD | PC | 大屏 | 音箱 | 耳机 | 手表 | 手环 | 眼镜 | |
| 手机 | NC | BR/WiFi | BT/WiFi | NC | BT | WiFi | BT | NC | |
| PAD | BR/WiFi | BT/WiFi | WiFi | NC | NC | NC | WiFi | ||
| PC | BR/WiFi | NC | NC | NC | NC | NC | |||
| 大屏 | WiFi | NC | NC | NC | NC | ||||
| 音箱 | NC | NC | NC | NC | |||||
| 耳机 | NC | NC | NC | ||||||
| 手表 | NC | NC | |||||||
| 手环 | NC | ||||||||
| 眼镜 |
可以理解的是,多个电子设备中每个电子设备可以保存如表2所示的网络拓扑关系,且各个电子设备保存的表2可以是一致的。
可选地,多个电子设备也可以根据保存的网络拓扑关系确定任意两个电子设备的路由信息。例如,结合表2所示,手机到手环可以是BT连接,手机到手表可以是WiFi连接,手机到音箱的路由信息可以为:手机-大屏通过BT/WiF路由,大屏到音箱通过WiFi路由。
可以理解的是,如果任何两个电子设备之间交互了信息,则可以认为这两个电子设备在线,换句话说,电子设备能被检测到。多个电子设备中的一个电子设备(如作为中心节点的电子设备)可以确定各个电子设备是否在线,并将各个电子设备是否在线的信息同步给其他的电子设备,或者各个电子设备根据交换得到的其他电子设备的信息确定其他电子设备是否在线。各个电子设备可以存储其他电子设备是否在线的信息,且对于存储的形式不作任何限定。
例如图4中设备A和设备B互相发现之后,设备A与设备B交互信息,且设备B可以将检测到的设备F的信息发送给设备A,则设备A不仅可以确定设备B在线,也可以确 定设备F在线,同时设备B也可以确定设备A与设备F在线,设备F也可以确定设备A与设备B在线。这样,电子设备在交换信息之后就可以确定哪些电子设备在线或者不在线。示例性的,与表2对应的表3中示出了各个电子设备是否在线的信息,各个电子设备可以保存如表2所示的表格。表3的“O”表示电子设备在线,“X”表示电子设备不在线。如果某电子设备对应的一行均为X,才认为该电子设备下线。
表3
| 手机 | PAD | PC | 大屏 | 音箱 | 耳机 | 手表 | 手环 | 眼镜 | |
| 手机 | X | O | O | X | O | O | O | X | |
| PAD | X | O | O | O | X | X | X | O | |
| PC | O | O | O | X | X | X | X | X | |
| 大屏 | O | O | O | O | X | X | X | X | |
| 音箱 | X | O | X | O | X | X | X | X | |
| 耳机 | O | X | X | X | X | X | X | X | |
| 手表 | O | X | X | X | X | X | X | X | |
| 手环 | O | X | X | X | X | X | X | X | |
| 眼镜 | X | O | X | X | X | X | X | X |
可以理解的是,多个电子设备中每个电子设备可以保存各个电子设备是否在线,例如,如表3所示,每个电子设备可以保存的各个电子设备是否在线可以是一致的。换句话说,如果一个电子设备在线,并且有的电子设备可以检测到该电子设备在线,由于电子设备交互信息,则多个电子设备都可以确定该电子设备在线。
需要说明的是,一个电子设备在线可以理解为一个电子设备可以被搜索到,或者可以理解为电子设备在可通信的区域内或者可以被发现等,一个电子设备在线不是说该电子设备一定有已经建立好的网络连接。如果一个电子设备有已经建立好的网络连接可以认为该电子设备在线,或者即使该电子设备没有已经建立好的网络连接,只要能够被其他电子设备搜索到或者检测到,则可以认为该电子设备在线。换句话说,在线指的是电子设备可以被发现,不代表已经有数据通道了。
也需要说明的是,电子设备也可以不保存各个电子设备是否在线的信息,只需要保存各个电子设备之间的网络拓扑关系即可。
可选地,多个电子设备可以通过如图1所示的各自的处理器110根据交换的信息确定多个电子设备之间的网络拓扑关系。多个电子设备可以通过如图1所示的各自的内部存储器121保存网络拓扑关系。
可选地,多个电子设备可以通过如图1所示的各自的处理器110确定多个电子设备是否在线。多个电子设备可以通过如图1所示的各自的内部存储器121保存各个电子设备是否在线的信息。
方法300中的多个电子设备可以是不同类型和/或不同场景中的电子设备的组合,例如多个电子设备可以是手机、车机、智能音箱、智能耳机以及其它不同类型的设备,或者这些不同类型的电子设备处于不同的场景,例如多个电子设备可以包括工作地的手机和居住地的平板。这样,方法300得到的网络拓扑关系可以适用于不同类型的电子设备进行传输数据,也可以适用于不同场景中不同类型的电子设备传输数据,能够提高适用性,也可以 将多个电子设备进行系统的规划。此外,方法300中的网络拓扑关系在物理上的形状可以是网状拓扑、星型拓扑、环形拓扑以及其他形状的拓扑结构。
为了更好的理解方法300的网络拓扑关系,下面结合图5描述方法300中的网络拓扑关系。如图5所示,用户在应用层能够实现两个设备之间的通信,实际上是链路层存在不同网络连接组成的物理子网络,不同的电子设备之间的通信可以通过链路层电子设备之间的实际的网络连接进行通信,在网络层电子设备之间可以通过不同的路径进行通信。网络拓扑关系在链路层表征为各个电子设备之间支持的网络连接方式,在网络层表征为各个电子设备之间存在的传输数据的路径。在应用层,不同电子设备之间进行传输数据时,用户不感知网络层和链路层的网络关系,只能感知到在应用层两个电子设备之间完成了数据交互。例如,如图5中,在应用层,手表与音箱在逻辑上是可以直达的,能够直接实现数据的交互,手表与音箱能够在应用层直接通信是因为在网络层和链路层进行了混合连接组网,手表与手机之间可以在链路层通过蓝牙网络传输数据,手机与音箱之间在链路层可以通过WiFi网络传输数据,这样,手表与音箱之间的传输数据的网络连接在网络层存在手表到手机的网络连接以及手机到音箱的网络连接。在图5中的网络层的实线表示传输数据的过程中的实际的网络连接,虚线表示支持的网络连接但未传输数据,同样链路层的实线表示传输数据过程中两个电子设备实际采用的蓝牙网络和WiFi网络,虚线表示两个电子设备支持的蓝牙网络和WiFi网络,但是未采用蓝牙网络和WiFi网络传输数据。
示例性的,在网络层的各个电子设备的之间的网络拓扑关系如图6所示,设备A、设备B、设备C和路由器通过网络连接,设备A、设备B、设备C和设备G之间两两之间通过网络连接。设备B与设备D、设备E、设备F分别通过网络连接。其中,设备G可以为远端设备。
与图6对应的链路层的各个电子设备之间的网络拓扑关系如图7所示。图7中,设备A、设备B、设备C和路由器通过wifi连接;设备A、设备B、设备C之间通过ble、wifi、wifip2p都有端到端连接;设备B和设备D、设备E之间保持ble端到端连接;设备B和设备F之间保持USB端到端连接;设备A、设备B、设备C和设备G之间都有lan或者p2p的端到端连接。图6和图7中实线表示网络连接已经建立好,虚线表示两个设备之间可以存在这些网络连接,但是还没有建立好。
下面具体结合图8描述电子设备之间如何利用方法300中已经建立好的网络拓扑关系传输数据。图8中仅仅描述两个电子设备之间传输数据,其他电子设备之间传输数据的方式与图8所示的传输方式一致,本申请实施例不详细描述。如图8所示,方法800包括:
S810,多个电子设备中的第一电子设备利用网络拓扑关系确定向多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式。
其中,路径信息用于指示第一电子设备向第二电子设备传输的第一数据所经过的电子设备。
可选地,第一电子设备可以是业务发起方。或者网络拓扑关系中的中心节点可以确定路径信息以及路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方 式,并将这些信息发送给第一电子设备。
具体地,S810,包括:第一电子设备根据网络拓扑关系选择能到达第二电子设备的传输路径以及这些传输路径上的电子设备之间的网络连接方式,例如,第一电子设备首先通过与第五电子设备之间的WiFi连接将第一数据发送到第五电子设备,第五电子设备再通过第五电子设备与第二电子设备之间的蓝牙传输方式将第一数据发送到第二电子设备,在这个例子中,第一电子设备可以根据网络拓扑关系确定的传输路径是第一电子设备-第五电子设备-第二电子设备,传输路径上第一电子设备与第五电子设备之间的连接方式是WiFi连接,第五电子设备与第二电子设备之间的连接方式是蓝牙连接。
可选地,S810还包括:第一电子设备根据网络拓扑关系以及S302交换得到的其他电子设备的信息选择能到达第二电子设备的传输路径以及这些传输路径上的电子设备之间的网络连接方式,例如根据网络拓扑关系以及电子设备的处理能力信息、电子设备的网络质量、电子设备的电量信息、电子设备的运动信息、电子设备的权重信息和电子设备的角色信息中的至少一种信息确定第一数据所经过的电子设备。
可选地,S810还包括,第一电子设备根据网络拓扑关系以及各个电子设备是否通信可达确定能够到达第二电子设备的传输路径以及这些传输路径上的电子设备之间的网络连接方式。
此外,若第一电子设备确定传输路径上的两个电子设备之间有多种网络连接方式,第一电子设备通过以下至少一种方式确定采用哪种网络连接方式。
方式一,第一电子设备可以根据自身当前已经建立的网络连接确定传输路径上与第一电子设备相邻的电子设备采用哪种网络连接方式,传输路径上第一电子设备与第五电子设备相邻,若第一电子设备与第五电子设备的某一网络连接正在连接没有断开,则可以复用正在连接的这种网络连接方式。例如,网络拓扑关系中第一电子设备与第五电子设备可以通过WiFi传输或者蓝牙传输,其中第一电子设备和第五电子设备已经建立了蓝牙连接,则可以确定蓝牙为这第一电子设备和第五电子设备之间的网络连接方式。若第一电子设备与第五电子设备之间不存在已经建立的网络连接,则第一电子设备根据第一数据的特征确定第一电子设备与第五电子设备之间网络连接。
此外,第一电子设备可以结合第一数据的特征确定传输路径上的其他相邻电子设备之间的网络连接。例如,若第一电子设备确定传输路径上的两个电子设备可以通过WiFi传输或者蓝牙传输,由于WiFi传输的时延低于蓝牙传输的时延,第一数据为时延要求高的数据,则第一电子设备可以确定WiFi为这两个电子设备之间的网络连接方式。若第一数据为时延要求低的数据,由于蓝牙比较节省功耗,则第一电子设备可以确定蓝牙为这两个电子设备之间的网络连接方式。
方式二,第一电子设备可以根据自身当前已经建立的网络连接以及第一数据的特征确定传输路径上与第一电子设备相邻的电子设备采用哪种网络连接方式。例如网络拓扑关系中第一电子设备与第五电子设备可以通过WiFi传输或者蓝牙传输,第一数据为时延要求高的数据,且这两个电子设备之间的WiFi处于连接状态,则第一电子设备可以确定WiFi为与第五电子设备之间的网络连接方式。又例如,网络拓扑关系中第一电子设备与第五电子设备可以通过WiFi传输或者蓝牙传输,第一数据为时延要求低的 数据,且这两个电子设备的蓝牙处于连接状态,则第一电子设备可以确定蓝牙为与第五电子设备之间的网络连接方式。再例如,网络拓扑关系中第一电子设备与第五电子设备可以通过WiFi传输或者蓝牙传输,第一数据为时延要求高的数据,且这两个电子设备的蓝牙处于连接状态,WiFi处于断开状态,由于处于连接状态的蓝牙满足不了第一数据的时延要求,则第一电子设备可以确定WiFi为与第五电子设备之间的网络连接方式。再例如,网络拓扑关系中第一电子设备与第五电子设备可以通过WiFi传输或者蓝牙传输,第一数据为时延要求低的数据,且这两个电子设备的WiFi处于连接状态,蓝牙处于断开状态,由于处于连接状态的WiFi满足可以满足第一数据的时延要求,则第一电子设备可以确定WiFi为与第五电子设备之间的网络连接方式,或者第一电子设备或第五电子设备对功耗要求比较高,则第一电子设备可以确定蓝牙为与第五电子设备之间的网络连接方式。
方式三,第一电子设备可以结合第一数据的特征在多种网络连接方式选择一种网络连接方式等。例如若传输路径上的两个电子设备可以通过WiFi传输或者蓝牙传输,由于WiFi传输的时延低于蓝牙传输的时延,第一数据为时延要求高的数据,则第一电子设备可以确定WiFi为这两个电子设备之间的网络连接方式。若第一数据为时延要求低的数据,则第一电子设备可以确定蓝牙为这两个电子设备之间的网络连接方式。
方式四,第一电子设备可以在两个电子设备的多种网络连接方式中任意选择一种网络连接方式。
在上述几种方式中,第一数据可能是高时延要求的数据或者低时延要求的数据,第一数据的特征为时延特征。可选地,第一数据的数据量可能大也可能小,第一数据的特征可以为数据量。可选地,第一数据可能是传输速率要求高的数据也可能是传输速率要求低的数据,第一数据的特征可以为传输速率要求。
可以理解的是,第一电子设备还可以通过其他的方式在两个电子设备的多种网络连接方式中确定一种网络连接方式,本申请实施例不予限制。
结合表2举例来说,若网络拓扑关系如表2所示,手机需要给眼镜传输数据,手机与眼镜之间没有网络连接,但是眼镜与PAD之间有WiFi连接,PAD与手机之间没有网络连接,但是PAD与PC之间有BR或者WiFi连接,PC与手机之间有BR或者WiFi连接。因此,手机可以确定向眼镜传输数据的路径为:手机-PC-PAD-眼镜。手机可以结合上述四种方式的至少一种方式确定这条传输路径:手机-PC-PAD-眼镜这条路径上任意两个电子设备之间的网络连接方式。
举例来说,若网络拓扑关系如表2所示,手机需要给眼镜传输数据,手机与眼镜之间没有网络连接,但是眼镜与PAD之间有WiFi连接,PAD与手机之间没有网络连接,但是PAD与PC之间有BR或者WiFi连接,PC与手机之间有BR或者WiFi连接。因此,手机需要确定这些设备是否在线,若在线信息为表3所示,手机可以确定PC、PAD和眼镜都在线,手机可以确定向眼镜传输数据的路径为:手机-PC-PAD-眼镜。手机可以结合上述四种方式的至少一种方式确定这条传输路径:手机-PC-PAD-眼镜任意两个电子设备之间的网络连接方式。
此外,若第一电子设备确定有多条传输第一数据的传输路径。可选地,若电子设备之间还交换了电量信息、网络质量和电子设备的处理能力信息,则第一电子设备可 以结合电子设备的电量、第一数据的业务类型、第一数据的时延要求、电子设备的处理能力信息和网络质量中的至少一项以及网络拓扑关系在多条传输路径中选择一条传输路径。具体地,第一电子设备首先根据网络拓扑关系选择能到达第二电子设备的多条传输路径,并且也能确定这些传输路径上电子设备之间的网络连接方式。第一电子设备需要结合多条路径上的电子设备的电量、第一数据的业务类型、第一数据的时延要求和网络带宽至少一项在多条路径中选择一条传输路径,利用传输路径传输数据。
可选地,若S302交换的信息包括各个电子设备的服务信息,第一电子设备可以根据第二电子设备的支持的服务确定向第二电子设备发送第二电子设备支持的服务对应的第一数据。例如第一电子设备需要将第一数据投屏到第二电子设备,第一电子设备需要确定第二电子设备是支持投屏服务的,才可以传输投屏服务对应的第一数据。
S820,第一电子设备根据路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式向第二电子设备传输第一数据。
例如,S820,包括,第一电子设备与路径信息指示的第五电子设备建立相应的网络连接,并采用建立的网络连接方式传输第一数据,第五电子设备与第二电子设备建立网络连接方式,并采用建立的网络连接传输第一数据。当路径信息指示的两电子设备间的网络连接已经处于连接状态,则无需重新建立,示例性的,第一电子设备确定传输路径上的第五电子设备和第二电子设备之间通过WiFi传输,当第五电子设备和第二电子设备之间的WiFi处于连接状态,则第五电子设备和第二电子设备,可继续使用处于已连接状态的WiFi通道传输数据;当第五电子设备和第二电子设备之间的WiFi未处于连接状态,则第五电子设备和第二电子设备可建立WiFi连接,以传输数据。这样,第一数据可以到达第二电子设备。当然路径信息指示的传输路径上可以包括除了第五电子设备之外的其他的电子设备或者也可以不包括第五电子设备。
需要说明的是,第一电子设备与第二电子设备之间也可以直接传输第一数据,换句话说第一电子设备确定的路径信息上可以只有第一电子设备和第二电子设备,没有其他的电子设备。
需要说明的是,若路径信息指示的传输路径上的相邻两个电子设备之间本身存在网络连接,则不需要再重新建立网络连接,只需要利用存在的网络连接传输第一数据即可。若路径信息指示的传输路径上的相邻两个电子设备之间不存在网络连接则建立相应的网络连接,利用建立的网络连接传输第一数据。下面描述建立网络连接的方式:
方式一:在S820之前,方法800还包括:第一电子设备确定传输路径以及传输路径上的相邻两个电子设备之间的网络连接方式之后,第一电子设备可以将网络连接指示信息(用于指示传输路径上相邻两个电子设备之间的网络连接)直接或者间接发送给传输路径上的各个电子设备,相邻两个电子设备之间根据网络连接指示信息建立相应的网络连接。举例来说,传输路径为第一电子设备-第五电子设备-第二电子设备,第一电子设备确定第一电子设备与第五电子设备之间的网络连接为ble,第五电子设备与第二电子设备之间的网络连接为WiFi-p2p。第一电子设备与第五电子设备建立ble连接,第一电子设备通过建立的ble连接向第五电子设备发送网络连接指示信息,网络连接指示信息用于指示第五电子设备与第二电子设备之间的网络连接为WiFi-p2p连接。第五电子设备与第二电子设备建立WiFi-p2p连接。换句话说,方法800在传输数据之前可以 将传输路径上的网络连接建立好,或者是有的网络连接本身是连接状态,则无需建立网络间接直接传输数据即可。
在方式一下,携带第一数据的报文的报文头可以携带路径信息以及路径信息指示的传输路径上的当前相邻两个电子设备之间的网络连接方式,这样,传输路径上的任何一个电子设备接收到第一数据之后可以根据这些路径信息确定下一跳节点。
此外,携带第一数据的报文的报文头中的源地址为第一电子设备的地址,目的地址为第二电子设备的地址,例如第一数据的源地址为第一电子设备的ID,目的地址为第二电子设备的ID,这样,在整个路由的过程中可以保证第一数据能够到达第二电子设备,且第二电子设备也能够根据源地址获知第一数据来源于第一电子设备。
为了更好的理解方式一,图9所示的实施例的前提是设备A与设备B之间没有建立WiFi-p2p连接,设备B与设备E之间也没有建立ble连接,若电子设备保存了如图7的网络拓扑关系,下面结合图9描述传输数据的过程。如图9所示,包括:
S901,设备A确定需要向设备E发起通信请求。
S902,设备A根据S810确定设备A到设备E的传输路径是先到设备B,再到设备E,设备A可以确定设备A与设备B之间利用WiFi-p2p传输。这样路由信息是设备A-设备B-设备E,设备A与设备B之间采用WiFi-p2p传输,设备B与设备E之间采用ble传输。
S903,设备A与设备B建立WiFi-p2p连接。
S904,设备A通过建立的WiFi-p2p连接发送网络连接指示信息,指示设备B与设备E之间为ble连接。
S905,设备B与设备E建立ble连接。
换句话说,设备B可以是传输数据之前获知与设备E之间为ble连接,并将ble提前建立好。
S906,设备A通过WiFi-p2p连接向设备B发送携带第一数据的报文。报文的格式如图10所示,业务标识用于唯一标识当前业务,报文类型表示当前报文的类型为文件类型,连接方式表示设备A与设备B之间是WiFi-p2p连接,源地址为设备A的ID,目的地址为设备E的ID,设备A的下一跳链表为设备B-设备E,因为设备A为首节点,设备A的上一跳节点链表为空,图10中数据部分可以为第一数据。
需要理解的是,S906在S903之后,但是S906与S904-S905的任一项顺序没有限制。
S907,设备B通过ble连接向设备E发送携带第一数据的报文,发送给设备E的报文格式如图11所示,其中与图10不同的是,图11中连接方式为ble,图11中的上一跳链表为设备A,下一条链表为设备E。
设备E接收到报文之后通过原路径以同样的方式返回应答报文,应答报文用于表示设备E收到第一数据。
此外,设备A与设备B传输完报文之后,可以断开WiFi-p2p连接,设备B与设备E传输完报文之后,可以断开ble连接。
方式二,S820中,携带第一数据的报文的报文头可以携带路径信息以及路径信息指示的传输路径上的任意相邻的两个电子设备之间的网络连接方式,这样,传输路径上的任何一个电子设备接收到第一数据之后可以根据这些路径信息以及路径信息指示的传输路径上的电子设备之间的网络连接方式确定下一跳节点以及与下一跳节点之间 的网络连接方式。
为了更好的理解方式二,若电子设备保存了如图7的网络拓扑关系,图12所示的实施例的前提是设备A与设备B之间没有建立WiFi-p2p连接,设备B与设备E之间也没有建立ble连接,下面结合图12描述传输数据的过程。如图12所示,包括:
S1201,设备A确定向设备E发起通信请求。
S1202,设备A根据S810确定设备A到设备E的传输路径是先到设备B,再到设备E,设备A可以确定设备A与设备B之间利用WiFi-p2p传输。这样路由信息是设备A-设备B-设备E,设备A与设备B之间采用WiFi-p2p传输,设备B与设备E之间采用ble传输。
S1203,设备A建立与设备B之间的WiFi-p2p连接。
S1204,设备A向设备B发送携带第一数据的报文,携带第一数据的报文的格式如图13所示,连接方式字段表示设备A与设备B之间是WiFi-p2p连接,设备B与设备E之间为ble连接,其他字段的定义与图10相同。
S1205,设备B根据图13中的连接方式确定与设备E之间的连接为ble连接,并与设备E建立ble连接。
换句话说,S1205中,设备B可以根据携带第一数据的报文中获知与设备E之间的连接为ble连接。
S1206,设备B向设备E发送携带第一数据的报文,携带第一数据的报文的格式如图14所示,14中的连接方式字段表示设备B与设备E之间为ble连接,其他字段的定义与图10相同。
当然,图14中的连接方式字段也可以为图13中的连接方式字段。
设备E接收到报文之后通过原路径以同样的方式返回应答报文。
此外,设备A与设备B传输完报文之后,可以断开WiFi-p2p连接,设备B与设备E传输完报文之后,可以断开ble连接。
作为S810和S820可替换的方式,第一数据的源地址为第一电子设备的地址,目的地址为第二电子设备的地址,例如第一数据的源地址为第一电子设备的ID,目的地址为第二电子设备的ID。网络拓扑关系中的任何一个电子设备都可以根据网络拓扑关系以及本地的策略确定第一数据的下一个节点,具体地,第一电子设备只需要根据网络拓扑关系以及本地的策略确定第一数据到达第二电子设备的下一个节点是什么,下一个节点接收到第一数据之后结合网络拓扑关系以及本地的策略确定第一数据到达第二电子设备的下一个节点是什么,依次可以将第一数据传输到第二电子设备。这样,第一数据的数据包无需携带路径信息以及路径信息指示的传输路径上的电子设备之间的网络连接方式,每个电子设备接收到第一数据时自身确定下一跳节点以及与下一跳节点之间的网络连接方式。
上述提到的本地策略可以是电子设备自身根据交换得到各个电子设备的信息制定本地策略,每个电子设备制定的本地策略可以相同也可以不相同,本申请实施例不予限制。
可选地,方法300中,可能不断地有电子设备之间能够互相发现,则会导致网络拓扑关系不停的变化,使得多个电子设备需要不断地交换信息,不断地更新网络拓扑关系,这样会导致开销比较大,功耗也比较大,因此方法300中的确定的网络拓扑关系根据是定时 更新或者是满足一定的触发条件再更新,下面结合图15的描述满足触发条件之后更新方法300中的网络拓扑关系。
S1501,开始。
S1502,多个电子设备之间持续自发现。
S1503,多个电子设备之间持续交换信息。
可选地,在S1503中多个电子设备之间持续交换信息可以是定期交换信息,或者是在有信息在原来基础上发生变化之后再交换信息。举例来说,若一个电子设备的检测到自身与另一个设备的网络连接从连接状态变为断开状态,则可以将变化的信息进行交换。
具体地,电子设备交换的信息参见S302的描述。
S1504,第一电子设备根据交换信息确定一个或多个电子设备的场景是否发生变化。若场景发生变化,则执行S1505,否则回到S1502。
可选地,第一电子设备保存有方法300得到的网络拓扑关系,若网络拓扑关系中的任一电子设备的S302中的任何一种信息发生变化,该电子设备将变化后的信息直接或者间接发送给第一电子设备,第一电子设备根据变化后的信息确定电子设备的场景是否发生变化。例如,变化后的信息包括:SSID,第一电子设备根据SSID确定某一电子设备的场景是否发生变化。举例来说,某一电子设备的SSID从家庭网络的SSID变成车载网络的SSID,该电子设备将变化后的SSID直接或者间接发送给第一电子设备,第一电子设备根据变化后的车载网络的SSID确定该电子设备的场景发生变化。
可选地,第一电子设备还可以根据网络能力信息、网络质量和运动信息中的至少一项以及SSID确定某一电子设备的场景是否发生变化。
在一些可能的实现方式中,第一电子设备可以是多个电子设备中任一电子设备。
在一些可能的实现方式中,第一电子设备可以是多个电子设备中的中心节点,此时,多个电子设备交换的信息包括角色信息。或者第一电子设备可以是多个电子设备中权重较高的节点,此时多个电子设备交换的信息包括权重信息。
S1505,第一电子设备根据交换信息确定多个电子设备中是否存在电子设备为加速运动。
具体地,S302中,电子设备交换的信息包括电子设备的运动信息,这样,第一电子设备可以根据运动信息确定多个电子设备的运动状态。当第一电子设备确定多个电子设备中的某个电子设备正在加速运动时,则回到S1502;当第一电子设备确定多个电子设备中的电子设备运动速度比较小时,则执行S1506。
在S1505中,第一电子设备可以根据某个电子设备的运动信息指示的运动速度以及该电子设备历史的运动速度确定速度的变化量,若速度的变化量大于速度阈值,则认为该电子设备为加速运动,否则不是加速运动。或者第一电子设备可确定某个电子设备运动信息指示的该电子设备的加速度,若加速度大于速度阈值,则认为该电子设备为加速运动,否则不是加速运动。
S1506,第一电子设备确定增加的电子设备的数量是否大于第一数量阈值或者减少的电子设备的数量是否大于第二数据阈值。
具体地,第一电子设备根据交换信息确定增加的电子设备的数量。第一电子设备根据下线的电子设备确定减少的电子设备的数量。若增加的电子设备的数量大于第一数量阈值 或者减少的电子设备的数量大于第二数据阈值,则执行S1507。若增加的电子设备的数量小于或等于第一数量阈值或者减少的电子设备的数量小于或等于第二数据阈值,则回到S1502。
具体地,随着网络中电子设备的增加或者减少,第一电子设备可以根据增加的电子设备的数量或者减少的电子设备的数量确定是否需要触发自组网。例如,方法300中,10个电子设备组成了网络拓扑关系,随着设备的持续互相发现以及交换信息,例如增加了3个电子设备执行S1502-S1503之后,第一电子设备会接收到增加的3个电子设备交换的信息,因此第一电子设备可以确定增加的电子设备的数量。又例如,第一电子设备定期接收不到电子设备的信息,即检测不到电子设备的信息,则第一电子设备可以确定该电子设备不在线,这样会使得表2中电子设备对应的某一行都为“X”,不在线的电子设备也可以称为减少的电子设备。
可选地,第一数量阈值和第二数据阈值可以是协议规定的,或者可以是一个电子设备确定的发送给其他的电子设备的。
S1507,第一电子设备触发连接自组网。
具体地,第一电子设备触发连接自组网可以是第一电子设备向网络拓扑关系中的其他电子设备发送组网指令,其他电子设备接收到组网指令之后,根据组网指令更新自身保存的网络拓扑关系示意图。具体地,第一电子设备向其他电子设备发送组网指令可以通过网络拓扑关系中的电子设备通过多跳传输依次发送到各个电子设备。例如,第一电子设备启动自组网,并可以向第四电子设备发送组网指令,第四电子设备接收到组网指令后启动自组网并将组网指令发送到第二电子设备,第二电子设备接收到组网指令之后,启动自组网。
可选地,若两个电子设备之间已经建立网络连接,则可以通过建立的网络连接发送组网指令,若两个电子设备没有建立网络连接,则两个电子设备之间可以建立网络连接,再利用建立的网络连接传输组网指令。
可以理解的是,组网指令的格式可以是协议规定的,多个电子设备可以按照协议规定的解析组网指令。
第一电子设备可以开启智能连接组网以触发连接自组网,例如,第一电子设备的某个控件可以开启执行连接组网或者第一电子设备的某个控件可以触发显示界面显示提醒用户是否需要开启自组网。
在第一电子设备触发连接自组网之后回到S1501。
上述方法图15描述的是,当电子设备的场景发生变化、变化的电子设备的数量满足阈值并且电子设备的运动不是加速运动时才触发自组网,这个变化的顺序不做任何限定,换句话说,S1504-S1506这三个步骤的顺序不做任何限制,可以先判断变化的电子设备的数量,再判断电子设备是否加速运动,最后判断场景是否发生变化。或者上述方法1500可以包括S1504-S1506中的任意一个条件可以触发自组网,或者可以包括S1504-S1506中的两个条件可以触发自组网,本申请实施例不予限制。
可以理解的是,方法1500中只是举例描述触发自组网需要满足的条件,还可以是其他的条件出发自组网,换句话说,本申请实施例对触发自组网的条件并没有任何限制。
需要说明的是,每个电子设备开启智能连接组网可以理解为每个电子设备更新自身的保存的网络拓扑关系。
也需要说明的是,方法800中传输数据可以是利用方法300得到的网络拓扑关系传输数据也可以是利用方法1500更新后得到的网络拓扑关系传输数据。
为了更好的说明本申请实施例提供的方法,下面结合具体的例子举例说明,如图16所示,以手机和手表为例。
S1601,手机在后台定期发送消息,消息中携带手机的设备ID。手表能够通过蓝牙或wifi接收到手机发送的消息。
当然S1601中的消息还可以携带账号和各类标志位。
S1602,手表接收到手机发送的消息后,回复响应消息给手机,响应消息中包括手表的设备ID。
或者S1602中,响应消息还可以包括手表的账号和各类标志位。
如果S1601中手机发送的消息携带手机的设备ID,则S1602中手表回复的响应消息中携带手表的设备ID;如果S1601中手机发送的消息携带手机的设备ID、账号和各类标志位,则S1602中手表回复的相应消息中可携带手表的设备ID、账号和各类标志位。
S1603,手机根据手表回复的响应消息中携带的手表的设备ID确定手表是新上线的设备,且之前手机未与手表建立过网络连接。
在一种可能的实现方式中,在S1601之前,用户对手机与手表之间进行了绑定,例如,通过pin码或者QR码等绑定,这样,在S1601之前手机确定手表为可信设备。
在另一种可能的实现方式中,当S1602中的响应信息包括手表的账号时,手机确定手表的账号与自身的账号是否相同,若相同,则手机可以确定手表为可信设备。
S1604,手机向手表发送建立连接请求,建立连接请求中携带手表的Mac地址。
由于手表是信任设备,因此手机可以获知手表的Mac地址。
S1605,手机与手表建立网络连接,如蓝牙连接,并互相认证。
S1606,手机通过建立的网络连接向手表发送自身的基本信息、网络能力信息和处理能力信息。手表存储手机的这些信息。
示例性的,手机向手表发送自身的基本信息可以为:
其中,手机向手表发送的处理能力信息用于指示手机的处理能力。手表根据手机发送的处理能力信息指示的处理能力与自身的处理能力进行比较,发现手机的处理能力强于自身的处理能力,则手表可以确定自身的角色(Role)为普通节点。
在一种可能的实现方式中,若手机也未接收到其他的设备发送的基本信息和网络能力信息,即此时的拓扑信息为空,手机还可以在S1606中向手表发送的拓扑信息为空或者可以不发送拓扑信息。
S1607,手表通过建立的蓝牙连接向手机发送自身的基本信息、网络能力信息和处理能力信息。手机存储手表的这些信息。
示例性的,手表向手机发送自身的基本信息可以为:
{NetworkId:4d3b-4535-6c37-f243//标识唯一组网设备
DeviceId:4d3b-4535-6c37-f243//设备标识
DeviceName:kk’s watch//设备名称为kk的手表
DeviceType:06D//设备类型为手表
Weight:40//当前设备的权重值,通过节点网络能力和类型计算
Role:中心节点//设备角色
SwVersion:v1.1//系统版本号
}
示例性的,手表向手机发送自身的网络能力信息可以为:
在一种可能的实现方式中,S1607在S1606之后,即此时手表根据手机发送的处理能力信息已经确定自身为普通节点,则S1607中,手表发送的角色信息(Role)为普通节点。
在另一种可能的实现方式中,S1607与S1606同时进行了,即手表不知道手机的处理能力信息,在S1607中,手表发送的角色信息(Role)为中心节点。
手机在S1607接收到手表的处理能力信息之后,将手表的处理能力信息所指示的处理能力与自身的处理能力进行比较,手机确定自身的处理能力高与手表的处理能力,手机将自身确定为中心节点。
经过S1606和S1607就完成了手机与手表的基本信息、网络能力信息和处理信息的交换。
其中,手机与手表执行完S1606和S1607之后,可以断开用于交换信息的蓝牙连接,当然也可以不断开蓝牙连接。
S1608,手机可以根据交换的信息确定网络拓扑关系。
S1609,手表可以根据交换的信息确定网络拓扑关系。
作为S1609可替换的方式,手机执行完S1608之后,可以将确定的网络拓扑关系发送给手表,例如,如果手机与手表之间的蓝牙正在处于连接状态,则通过手机与手表之间的蓝牙发送网络拓扑关系。如果手机与手表之间不存在处于连接状态的网络连接,则可以建立任意一种手机和手表都支持的网络连接,手机利用建立的网络连接向手表发送网络拓扑关系。
例如结合S1606和S1607中的例子,手机和手表确定的网络拓扑关系为:
S1610,手机周期性发送消息,消息中携带手机的设备ID。
其中,S1610中手机周期性发送的消息包括的内容与S1601中消息携带的内容也可以相同,本申请实施例不予限制。
S1611a,手表接收到手机发送的消息之后,回复响应消息,响应消息中携带手表的设备ID。
经过S1610与S1611,手机可周期性或定期发送广播消息,手表与手机可确认互相在线。
其中,手机和手表在第一次交换信息后,手机可继续周期性发送广播消息,以确定手表是否在线。手表可只发送设备在线的响应消息,而无需再发送自己的基本信息和网络能力信息,而当自身的基本信息和/或网络能力信息发生变化时,才会向对端发送自己变化后的基本信息和/或网络能力信息。具体的,当手表的基本信息和/或网络能力信息发生变化时,手表可以与手机建立任意一种手机和手表都支持的网络连接,并发送变化后的基本信息和/或网络能力信息。
S1611b,若手表接收不到手机发送的消息,也不会回复响应消息,手机定期(如5min)接收不到手表发现的响应消息,则可以确定手表不在线。
在一种可能的实现方式中,当手机确定手表不在线时,可以将网络拓扑关系中关于手表的信息删除,并且将表3中的“O”改为“X”;或者手机多次发送消息都没有收到手表的响应消息,且次数大于预设值,手机删除网络拓扑关系中关于手表的信息。
在另一种可能的实现方式中,当手机确定手表不在线时,可以不删除网络拓扑关系中关于手表的信息,继续保存,当下次手表上线时,只需要交换变化的信息,不交换没变化的信息。
手机继续执行S1610。当手表能再次接收到手机发送的消息时,手表执行S1611a。
S1612,手表确定自身的基本信息、网络能力信息或者处理信息发生变化,在手表执行S1611a的情况下,手表可以执行S1612。
S1613,手表发送建立连接请求消息,建立连接请求消息中携带手机的Mac地址。
S1614,手表与手机建立网络连接,如蓝牙连接,并互相认证。
S1615,手表通过建立的蓝牙连接传输变化后的信息。
当然,根据具体实现设计,若手机确定手表不在线之后,手机删除了关于手表的信息,则S1615中,手表可以利用建立的网络连接传输自身的基本信息、网络能力信息和处理信息。
S1616,手机根据变化后的信息更新S1608中确定的网络拓扑关系。
当然,手表也根据自身变化后的信息更新S1609中确定的网络拓扑关系。
其中,S1616中,手机可以也接收到多个设备的变化的信息之后更新网络拓扑关系,不限于只接收到手表变化的信息就更新。
手机保存有手机与手表之间的网络拓扑关系,当新上线台灯之后,台灯向手机发送的信息与手表向手机发送的信息基本一致,手机根据台灯发送的信息更新网络拓扑关系,不同的是,手机可以将自身保存的手机与手表之间的网络拓扑关系发送给台灯,这样,台灯就可以根据自身的信息以及手机发送的网络拓扑关系确定新的网络拓扑关系。
经过S1601-S1616,手机和手表确定了网络拓扑关系,当手机需要向手表传输数据时,手机根据确定的网络拓扑关系,确定手机到手表通过蓝牙传输,当手机确定与手表之间的蓝牙正在连接时,手机通过正在连接的蓝牙向手表传输数据,当蓝牙未连接时,手机建立与手表之间的蓝牙连接,并通过建立的蓝牙连接传输数据。
需要说明的是,本申请实施例中,各个电子设备交换的信息可以包括一个或多个信息,根据需要进行设计具体交换哪些信息,且各个电子设备交换的信息可以通过一次交换或者通过多次交换,例如针对基本不变的信息可以一次交换,经常变化的信息可以变化后在交换,本申请不予任何限制。
也需要说明的是,本申请实施例中前述描述的是,多个电子设备中每个电子设备保存的网络拓扑关系一致,当然多个电子设备中每个电子设备保存的网络拓扑关系也可以不一致,这样,每个电子设备可以利用自身保存的网络拓扑关系确定数据传输的下一跳节点,无需首节点进行全局规划。
本申请实施例中的组网定义为:在蓝牙、WiFi等信号可检测到的范围内存在有信任关系的多个电子设备,一个设备会和其他设备维持一个逻辑上的连接,在系统运行时可同步这些电子设备的状态和信息。这些可信的电子设备就形成了一个组网。基于组网,业务可以实现无感发现连接,在业务请求时,无需等待发现连接认证过程即可直接发起业务。
因此,本申请实施例方法,可以在网络层将不同连接的网络进行组网,形成一个网络拓扑关系,这样,网络拓扑关系中的任何两个设备进行通信时,都可以基于该网络拓扑关系实现两个电子设备之间的通信。网络拓扑关系可以包括多个电子设备之间中任意两个电子设备之间的网络连接,这样,两个设备在传输数据时直接根据网络拓扑关系确定传输路径,避免两个电子设备之间需要先发现两个电子设备之间的一个或多个网络连接方式,再在一个或多个网络连接方式中选择一个合理的网络连接建立连接所带来的时延,有利于降 低传输数据的时延,并且可以系统的规划设备之间的连接关系。此外,网络拓扑关系可以根据网络中的电子设备的信息进行实时的更新,从而可以保证实时性。
可以理解的是,各个电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,例如确定单元、传输单元等,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本实施例提供的电子设备,用于执行上述传输数据的方法,因此可以达到与上述实现方法相同的效果。
在采用集成的单元的情况下,各个电子设备还可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理。存储模块可以用于支持电子设备执行存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图1所示结构的设备。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的传输数据的方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的传输数据的方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的传输数据的方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
Claims (22)
- 一种传输数据的方法,其特征在于,包括:多个电子设备中的第一电子设备根据网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式,所述路径信息用于指示所述第一电子设备向所述第二电子设备传输所述第一数据所经过的电子设备,所述网络拓扑关系包括所述多个电子设备以及所述多个电子设备之间的网络连接方式;所述第一电子设备根据所述路径信息以及所述路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式向所述第二电子设备传输第一数据。
- 根据权利要求1所述的方法,其特征在于,在所述多个电子设备中的第一电子设备根据网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之前,所述方法还包括:所述第一电子设备获取所述多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息;所述第一电子设备根据所述各个电子设备的基本信息和所述各个电子设备的网络能力信息确定所述网络拓扑关系。
- 根据权利要求2所述的方法,其特征在于,所述各个电子的基本信息包括电子设备的标识、电子设备的名称、电子设备的网络标识、电子设备的类型、电子设备的权重信息、电子设备角色信息和电子设备的版本信息中的至少一项。
- 根据权利要求2或3所述的方法,其特征在于,所述各个电子设备的网络能力信息包括:各个电子设备的支持的网络连接、所述各个电子设备的支持的网络连接所支持的带宽、所述各个电子设备的支持的网络连接的连接信息、所述各个电子设备支持的网络连接的连接状态和处于连接状态的网络连接的时间信息中的至少一项。
- 根据权利要求2至4中任一项所述的方法,其特征在于,所述第一电子设备获取所述多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息,包括:所述第一电子设备与所述多个电子设备中的第三电子设备建立第一网络连接;所述第一电子设备通过所述第一网络连接接收所述第三电子设备发送的所述第三电子设备的基本信息和所述第三电子设备的网络能力信息,或者通过所述第一网络连接接收所述第三电子设备发送的所述第三电子设备的基本信息、所述第三电子设备的网络能力信息、所述多个电子设备中第四电子设备的基本信息和所述第四电子设备的网络能力信息;所述第一电子设备通过所述第一网络连接向所述第三电子设备发送所述第一电子设备的基本信息和所述第一电子设备的网络能力信息。
- 根据权利要求5所述的方法,其特征在于,在所述第一电子设备与所述多个电子设备中的第三电子设备建立第一网络连接之前,所述方法还包括:所述第一电子设备定期发送消息,所述消息携带所述第一电子设备的设备标识;所述第一电子设备接收所述第三电子设备发送的响应消息,所述响应消息是所述 第三电子设备接收到所述第一电子设备定期发送的消息后发送的,所述响应消息携带所述第三电子设备的设备标识;所述第一电子设备根据所述第三电子设备的设备标识确定所述第三电子设备在线。
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法还包括:所述第一电子设备获取所述多个电子设备中的各个电子设备的处理能力信息、各个电子设备的网络质量和各个电子设备的电量信息中的至少一项;其中,所述多个电子设备中的第一电子设备根据网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息,包括:所述第一电子设备根据所述各个电子设备的处理能力信息、所述各个电子设备的网络质量、所述各个电子设备的电量信息中的至少一项以及所述网络拓扑关系确定向所述第二电子设备传输所述第一数据的路径信息。
- 根据权利要求1至7中任一项所述的方法,其特征在于,所述第一电子设备根据所述路径信息以及所述路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式向所述第二电子设备传输第一数据,包括:所述第一电子设备通过第二网络连接向所述传输路径上与所述第一电子设备相邻的第五电子设备发送第一报文,所述第一报文的报文体包括所述第一数据,所述第一报文的报文头包括所述路径信息以及所述路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式,以便所述第五电子设备确定所述传输路径上的下一跳节点以及与下一跳节点之间的网络连接方式;其中,所述第一报文的报文头还包括源地址、目的地址、业务标识和业务类型中的至少一项,所述源地址为所述第一电子设备的地址,所述目的地址为所述第二电子设备的地址。
- 根据权利要求1至7中任一项所述的方法,其特征在于,所述第一电子设备根据所述路径信息以及所述路径信息指示的传输路径上相邻的两个电子设备之间的网络连接方式向所述第二电子设备传输第一数据,包括:所述第一电子设备通过第二网络连接向所述传输路径上与所述第一电子设备相邻的第五电子设备发送网络连接指示信息,所述网络连接指示信息用于指示所述传输路径上除了所述第一电子设备之外的其他相邻的两个电子设备之间的网络连接方式,以便所述第五电子设备确定与下一跳节点之间的网络连接方式,所述第五电子设备为所述传输路径上与所述第一电子设备相邻的下一跳节点;所述第一电子设备通过所述第二网络连接向所述第五电子设备发送第二报文,所述第二报文的报文头包括所述路径信息,所述第二报文的报文体包括所述第一数据;其中,所述第二报文的报文头还包括源地址、目的地址、业务标识和业务类型中的至少一项,所述源地址为所述第一电子设备的地址,所述目的地址为所述第二电子设备的地址。
- 根据权利要求8或9所述的方法,其特征在于,所述方法还包括:所述第一电子设备确定与所述第五电子设备之间是否存在已经建立的所述第二网络连接;若不存在所述第二网络连接,所述第一电子设备与所述第五电子设备建立所述第 二网络连接;若存在已经建立的所述第二网络连接,则所述第一电子设备通过所述第二网络连接向所述传输路径上与所述第一电子设备相邻的所述第五电子设备发送所述第一报文,或者所述第一电子设备通过所述第二网络连接向所述传输路径上与所述第一电子设备相邻的所述第五电子设备发送所述网络连接指示信息。
- 根据权利要求1至10中任一项所述的方法,其特征在于,在所述多个电子设备中的第一电子设备利用网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,所述方法还包括:所述第一电子设备获取所述各个电子设备的运动信息;所述第一电子设备根据所述各个电子设备的运动信息确定存在加速运动的电子设备,则不更新所述网络拓扑关系。
- 根据权利要求1至11中任一项所述的方法,其特征在于,在所述多个电子设备中的第一电子设备根据网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,所述方法还包括:所述第一电子设备获取不同于所述多个电子设备的至少一个第六电子设备的基本信息;所述第一电子设备根据至少一个第六电子设备的基本信息确定增加的所述至少一个第六电子设备的数量;若增加的所述至少一个第六电子设备的数量大于预设数量,所述第一电子设备更新所述网络拓扑关系。
- 根据权利要求1至12中任一项所述的方法,其特征在于,在所述多个电子设备中的第一电子设备利用网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,所述方法还包括:所述第一电子设备获取所述多个电子设备中的至少部分电子设备发送的服务集标识SSID;所述第一电子设备根据所述至少部分电子设备的SSID确定所述多个电子设备中是否存在场景发生变化的电子设备;若存在场景发生变化的电子设备,所述第一电子设备更新所述网络拓扑关系。
- 根据权利要求1至13中任一项所述的方法,其特征在于,在所述多个电子设备中的第一电子设备利用网络拓扑关系确定向所述多个电子设备中的第二电子设备传输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之后,所述方法还包括:所述第一电子设备获取下线的电子设备的数量;若下线的电子设备的数量满足预设数量,所述第一电子设备删除网络拓扑关系中下线的电子设备的基本信息和网络能力信息。
- 根据权利要求1至14中任一项所述的方法,其特征在于,在所述多个电子设备中的第一电子设备根据网络拓扑关系确定向所述多个电子设备中的第二电子设备传 输第一数据的路径信息以及所述路径信息指示的传输路径上的相邻两个电子设备之间的网络连接方式之前,所述方法还包括:所述第一电子设备获取所述第二电子设备的服务信息,所述第二电子设备的服务信息用于指示所述第二电子设备支持的服务;所述第一电子设备根据所述第二电子设备的服务信息确定向所述第二电子设备发送所述服务信息对应的第一数据。
- 一种确定网络拓扑关系的方法,其特征在于,所述方法包括:多个电子设备中的第一电子设备获取所述多个电子设备中各个电子设备的基本信息和各个电子设备的网络能力信息;所述第一电子设备根据所述各个电子设备的基本信息和各个电子设备的网络能力信息确定所述网络拓扑关系。
- 根据权利要求16所述的方法,其特征在于,所述各个电子的基本信息包括电子设备的标识、电子设备的名称、电子设备的网络标识、电子设备的类型、电子设备的权重信息、电子设备角色信息和电子设备的版本信息中的至少一项。
- 根据权利要求16或17所述的方法,其特征在于,所述各个电子设备的网络能力信息包括:各个电子设备的支持的网络连接、所述各个电子设备的支持的网络连接所支持的带宽、所述各个电子设备的支持的网络连接的连接信息、所述各个电子设备支持的网络连接的连接状态和处于连接状态的网络连接的时间信息中的至少一项。
- 根据权利要求16至18中任一项所述的方法,其特征在于,所述第一电子设备获取所述多个电子设备中的各个电子设备的基本信息和各个电子设备的网络能力信息,包括:所述第一电子设备与所述多个电子设备中的第三电子设备建立第一网络连接;所述第一电子设备通过所述第一网络连接接收所述第三电子设备发送的所述第三电子设备的基本信息和所述第三电子设备的网络能力信息,或者通过所述第一网络连接接收所述第三电子设备发送的所述第三电子设备的基本信息、所述第三电子设备的网络能力信息、所述多个电子设备中第四电子设备的基本信息和所述第四电子设备的网络能力信息;所述第一电子设备通过所述第一网络连接向所述第三电子设备发送所述第一电子设备的基本信息和所述第一电子设备的网络能力信息。
- 根据权利要求19所述的方法,其特征在于,在所述第一电子设备与所述多个电子设备中的第三电子设备建立第一网络连接之前,所述方法还包括:所述第一电子设备定期发送消息,所述消息携带所述第一电子设备的设备标识;所述第一电子设备接收所述第三电子设备发送的响应消息,所述响应消息是所述第三电子设备接收到所述第一电子设备定期发送的消息后发送的,所述响应消息携带所述第三电子设备的设备标识;所述第一电子设备根据所述第三电子设备的设备标识确定所述第三电子设备在线。
- 一种电子设备,其特征在于,包括:一个或多个处理器;存储器;安装有多个应用程序的模块;以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行如权利 要求1至15中任一项所述的方法或者如权利要求16至20中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至15中任一项所述的方法或者如权利要求16至20中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP21865787.2A EP4199562A4 (en) | 2020-09-10 | 2021-08-12 | DATA TRANSMISSION METHOD AND ELECTRONIC DEVICE |
| US18/179,433 US20230209438A1 (en) | 2020-09-10 | 2023-03-07 | Data Transmission Method and Electronic Device |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010949676 | 2020-09-10 | ||
| CN202010949676.0 | 2020-09-10 | ||
| CN202011423212.2 | 2020-12-08 | ||
| CN202011423212.2A CN114173317B (zh) | 2020-09-10 | 2020-12-08 | 传输数据的方法和电子设备 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US18/179,433 Continuation US20230209438A1 (en) | 2020-09-10 | 2023-03-07 | Data Transmission Method and Electronic Device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022052731A1 true WO2022052731A1 (zh) | 2022-03-17 |
Family
ID=78995636
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/112168 Ceased WO2022052731A1 (zh) | 2020-09-10 | 2021-08-12 | 传输数据的方法和电子设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20230209438A1 (zh) |
| EP (1) | EP4199562A4 (zh) |
| CN (1) | CN113873678A (zh) |
| WO (1) | WO2022052731A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114786058A (zh) * | 2022-04-27 | 2022-07-22 | 南京欧珀软件科技有限公司 | 多媒体数据展示方法、装置、终端及存储介质 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114268936B (zh) * | 2022-03-01 | 2022-07-12 | 荣耀终端有限公司 | 数据传输方法及装置 |
| CN117295183A (zh) * | 2022-06-16 | 2023-12-26 | 华为技术有限公司 | 一种组网方法、系统及相关装置 |
| CN117858114A (zh) * | 2022-09-30 | 2024-04-09 | 华为技术有限公司 | 通信方法及通信装置 |
| CN115665713A (zh) * | 2022-10-26 | 2023-01-31 | 歌尔科技有限公司 | 多设备的通信方法、装置、设备及存储介质 |
| CN116781765A (zh) * | 2023-05-10 | 2023-09-19 | 深圳开鸿数字产业发展有限公司 | 分布式网络的连接方法、装置、计算机设备及存储介质 |
| CN117082122B (zh) * | 2023-08-21 | 2025-10-14 | 深圳市兆珑科技有限公司 | 通信方法、中心设备以及计算机可读存储介质 |
| CN120676000A (zh) * | 2024-03-18 | 2025-09-19 | 华为技术有限公司 | 传输数据的方法、电子设备和系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103501236A (zh) * | 2013-08-26 | 2014-01-08 | 武汉烽火网络有限责任公司 | 网络控制平面逻辑拓扑生成方法及装置 |
| US20150358235A1 (en) * | 2014-06-05 | 2015-12-10 | Futurewei Technologies, Inc. | Service Chain Topology Map Construction |
| CN107517157A (zh) * | 2016-06-16 | 2017-12-26 | 华为技术有限公司 | 一种路径确定方法、装置和系统 |
| CN110677341A (zh) * | 2019-09-09 | 2020-01-10 | 锐捷网络股份有限公司 | 一种数据转发方法、装置、电子设备及存储介质 |
| CN110784349A (zh) * | 2019-10-24 | 2020-02-11 | 深圳供电局有限公司 | 一种电力通信设备与网络割接方案自动生成方法及装置 |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102790950B (zh) * | 2011-05-18 | 2016-06-01 | 中兴通讯股份有限公司 | 多接口终端邻居拓扑发现、协作通信方法和多接口终端 |
| US9608902B2 (en) * | 2011-06-16 | 2017-03-28 | Qualcomm Incorporated | Communication mechanism in a network of nodes with multiple interfaces |
| US9495326B2 (en) * | 2011-09-12 | 2016-11-15 | Qualcomm Incorporated | Providing communication path information in a hybrid communication network |
| US8995280B2 (en) * | 2011-11-11 | 2015-03-31 | Stmicroelectronics, Inc. | System and method for an energy efficient network adapter |
| US9112728B2 (en) * | 2012-05-31 | 2015-08-18 | Broadcom Corporation | Implementing control planes for hybrid networks |
| WO2016003868A1 (en) * | 2014-07-01 | 2016-01-07 | Trinity Mobile Networks, Inc. | Methods, devices, and systems for implementing centralized hybrid wireless self-organizing networks |
| US20170195218A1 (en) * | 2015-12-30 | 2017-07-06 | Qualcomm Incorporated | Routing in a hybrid network |
-
2020
- 2020-12-08 CN CN202111071489.8A patent/CN113873678A/zh active Pending
-
2021
- 2021-08-12 EP EP21865787.2A patent/EP4199562A4/en active Pending
- 2021-08-12 WO PCT/CN2021/112168 patent/WO2022052731A1/zh not_active Ceased
-
2023
- 2023-03-07 US US18/179,433 patent/US20230209438A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103501236A (zh) * | 2013-08-26 | 2014-01-08 | 武汉烽火网络有限责任公司 | 网络控制平面逻辑拓扑生成方法及装置 |
| US20150358235A1 (en) * | 2014-06-05 | 2015-12-10 | Futurewei Technologies, Inc. | Service Chain Topology Map Construction |
| CN107517157A (zh) * | 2016-06-16 | 2017-12-26 | 华为技术有限公司 | 一种路径确定方法、装置和系统 |
| CN110677341A (zh) * | 2019-09-09 | 2020-01-10 | 锐捷网络股份有限公司 | 一种数据转发方法、装置、电子设备及存储介质 |
| CN110784349A (zh) * | 2019-10-24 | 2020-02-11 | 深圳供电局有限公司 | 一种电力通信设备与网络割接方案自动生成方法及装置 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4199562A4 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114786058A (zh) * | 2022-04-27 | 2022-07-22 | 南京欧珀软件科技有限公司 | 多媒体数据展示方法、装置、终端及存储介质 |
| CN114786058B (zh) * | 2022-04-27 | 2024-02-06 | 南京欧珀软件科技有限公司 | 多媒体数据展示方法、装置、终端及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113873678A (zh) | 2021-12-31 |
| EP4199562A4 (en) | 2024-02-21 |
| EP4199562A1 (en) | 2023-06-21 |
| US20230209438A1 (en) | 2023-06-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP4084486B1 (en) | Cross-device content projection method, and electronic device | |
| CN111866950B (zh) | Mec中数据传输的方法和通信装置 | |
| WO2022052731A1 (zh) | 传输数据的方法和电子设备 | |
| CN110191442B (zh) | 一种蓝牙连接方法、设备及系统 | |
| CN111405681B (zh) | Wi-Fi Aware的建链方法、系统、电子设备和存储介质 | |
| WO2021082829A1 (zh) | 蓝牙连接方法及相关装置 | |
| WO2021175300A1 (zh) | 数据传输方法、装置、电子设备和可读存储介质 | |
| WO2022257977A1 (zh) | 电子设备的投屏方法和电子设备 | |
| CN113923230A (zh) | 数据同步方法、电子设备和计算机可读存储介质 | |
| WO2021175268A1 (zh) | 移动网络热点的共享方法、装置和热点共享设备 | |
| WO2021043198A1 (zh) | 一种蓝牙配对方法及相关装置 | |
| WO2023000969A1 (zh) | 蜂窝通信功能的使用方法、相关装置及系统 | |
| WO2022068513A1 (zh) | 无线通信方法和终端设备 | |
| WO2021043250A1 (zh) | 一种蓝牙通信方法及相关装置 | |
| WO2021218544A1 (zh) | 一种提供无线上网的系统、方法及电子设备 | |
| WO2020134868A1 (zh) | 一种连接建立方法及终端设备 | |
| WO2021052204A1 (zh) | 基于通讯录的设备发现方法、音视频通信方法及电子设备 | |
| WO2021027623A1 (zh) | 一种设备能力发现方法及p2p设备 | |
| CN113243126B (zh) | 一种用于终端的网络管理方法和终端 | |
| WO2021197071A1 (zh) | 无线通信系统及方法 | |
| CN115460445A (zh) | 电子设备的投屏方法和电子设备 | |
| WO2022199491A1 (zh) | 一种立体声组网方法、系统及相关装置 | |
| CN115087134A (zh) | 一种蓝牙连接的方法和电子设备 | |
| WO2024260185A1 (zh) | 一种数据传输的方法、终端及系统 | |
| CN114173317B (zh) | 传输数据的方法和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| ENP | Entry into the national phase |
Ref document number: 2021865787 Country of ref document: EP Effective date: 20230316 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |












