Method for transmitting data, and electronic device and system

By determining the data transmission method based on the collaborative synchronization scenario between multiple electronic devices, the problem of low data transmission efficiency in the prior art is solved, and data synchronization with low latency and low power consumption is achieved, and user experience is improved.

WO2025066640A1PCT designated stage expired Publication Date: 2025-04-03HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/112271
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-27
Filing Date
2024-08-15
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently transmit data between multiple electronic devices, affecting the user's experience of processing tasks through electronic devices.

Method used

In the collaborative synchronization scenario, the specific data transmission method, including end-end and end-cloud methods, is determined based on the number of electronic devices and network status, so as to achieve efficient data synchronization.

Benefits of technology

In the collaborative synchronization scenario, the delay of data synchronization is reduced, power consumption is reduced, data transmission efficiency is improved, and user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024112271_03042025_PF_FP_ABST
    Figure CN2024112271_03042025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a method for transmitting data, and an electronic device and a system. The method is applied to a first electronic device. The method comprises: in response to opening a collaborative application, receiving second synchronization information, wherein the second synchronization information is synchronization information of a second electronic device; on the basis of the second synchronization information, determining whether a first electronic device performs collaborative synchronization with at least one second electronic device; when the first electronic device performs collaborative synchronization with the second electronic device, determining a first data transmission mode on the basis of the number of second electronic devices and / or network states of the first electronic device and the second electronic devices; and transmitting data to be synchronized with the second electronic device by means of the first data transmission mode. By means of the method for transmitting data, and the electronic device and the system in the present application, it is possible to automatically identify whether the current scenario is a collaborative synchronization scenario, and determine a specific data transmission mode on the basis of the number and / or network states of electronic devices in the collaborative synchronization scenario, thereby improving the usage experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method, electronic device and system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on September 27, 2023, with application number 202311261294.9, and invention name “Method, electronic device and system for transmitting data”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of electronic devices, and in particular to a method, electronic device, and system for transmitting data. Background Art

[0003] With the development of science and technology, users can complete work or study tasks through multiple electronic devices, and task processing of multiple electronic devices requires data transmission. Among them, factors such as the efficiency and method of data transmission affect the user's experience of processing tasks through electronic devices.

[0004] Therefore, how to provide an efficient way to transmit data to improve user experience is an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The present application provides a method, electronic device, and system for transmitting data, which can provide an efficient data transmission method in a collaborative synchronization scenario and improve the user experience.

[0007] In a first aspect, a method for transmitting data is provided, which is applied to a first electronic device, and the method includes: in response to opening a collaborative application, receiving at least one second synchronization information, the at least one second synchronization information is synchronization information of at least one second electronic device, and the at least one second synchronization information corresponds one-to-one with the at least one second electronic device; determining whether the first electronic device and the at least one second electronic device are collaboratively synchronized based on the at least one second synchronization information; when the first electronic device and the at least one second electronic device are collaboratively synchronized, determining a first data transmission method based on the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device; and transmitting the data to be synchronized with the at least one second electronic device through the first data transmission method.

[0008] For example, collaborative applications may be drawing applications, file applications, and other applications that support collaborative synchronization functions. The data ID may be used to represent information such as pages, pictures, and text currently displayed (or opened) by the electronic device.

[0009] It should be noted that, in response to a user opening a collaborative application, the first electronic device may send a first synchronization message to at least one second electronic device, or send the first synchronization message to a cloud server, wherein the first synchronization message is synchronization information of the first electronic device. At the same time, the first electronic device may receive at least one second synchronization message from at least one second electronic device, or may receive at least one second synchronization message from a cloud server.

[0010] It should be noted that when a collaborative application is open, it can trigger the upload and download of synchronization information; or, to save power, updated synchronization information can be transmitted when the data changes. For example, if a first electronic device displays an image from a drawing application and a user modifies the image through the device, the first electronic device can upload the modified data ID to the cloud server, where the modified data ID can represent the modified image.

[0011] Based on the above scheme, it is possible to determine whether multiple electronic devices are in a collaborative synchronization scenario, and in the collaborative synchronization scenario, determine the specific data transmission method (transmission strategy) based on the number of electronic devices and / or network status, so that the data synchronization delay in the collaborative synchronization scenario is low, the power consumption is low, and the efficiency is high, ensuring a good user experience.

[0012] In combination with the first aspect, in some implementations of the first aspect, the synchronization information includes an electronic device identification ID, an ID of the collaborative application, and a data ID, where the data ID is used to represent data displayed by the electronic device.

[0013] In combination with the first aspect, in certain implementations of the first aspect, before determining the first method of transmitting data based on the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device, the method also includes: determining the number of the second electronic devices based on the at least one second synchronization information, and determining the network status of the first electronic device and the second electronic device based on the at least one second synchronization information.

[0014] It is understandable that when the first electronic device receives one second synchronization message, the first electronic device can determine that the number of second electronic devices is 1; when the first electronic device receives two second synchronization messages, the first electronic device can determine that the number of second electronic devices is 2. In other words, the first electronic device can determine the number of second electronic devices based on the number of received second synchronization messages, and because the synchronization message includes the electronic device ID, the first electronic device can also determine the second electronic device ID corresponding to the second synchronization message based on the electronic device ID in the second synchronization message.

[0015] It should be noted that network states include near-field communication, far-field communication, or both. Simply put, near-field and far-field can be relative concepts in terms of communication distance. When two electronic devices are close to each other, they may be in a near-field network state; when two electronic devices are far apart, they may be in a far-field network state. When a first electronic device is synchronized with at least two second electronic devices, both near-field and far-field network states may exist.

[0016] In combination with the first aspect, in certain implementations of the first aspect, before determining the number of the second electronic devices based on at least one second synchronization information, the method also includes: determining that the first electronic device is collaboratively synchronized with the at least one second electronic device based on the ID of the collaborative application in the first synchronization information being consistent with the ID of the collaborative application in the at least one second synchronization information, and the data ID in the first synchronization information being consistent with the data ID in the at least one second synchronization information, wherein the first synchronization information is the synchronization information of the first electronic device.

[0017] It should be noted that when the first electronic device and the second electronic device display the same collaborative application and the same data on their front ends, the first electronic device and the second electronic device can be considered to be in a collaborative synchronization scenario. In a collaborative synchronization scenario, the first electronic device and the second electronic device synchronize data and share resources. At the same time, multiple electronic devices in collaborative synchronization can also complete the tasks of two electronic devices on one electronic device through a peripheral device (for example, a mouse or keyboard).

[0018] It is understandable that the content displayed on the collaboratively synchronized first electronic device is consistent with the content displayed on the second electronic device. When the content displayed on one electronic device changes, the content displayed on the other electronic device will also change accordingly.

[0019] In combination with the first aspect, in certain implementations of the first aspect, when the number of second electronic devices is 1 and the network status of the first electronic device and the second electronic device is a near-field network state, the data to be synchronized is transmitted with the at least one second electronic device through the first data transmission method, including: sending the data to be synchronized to a third electronic device, which is one of the at least one second electronic device.

[0020] It should be noted that when the number of second electronic devices is one, the number of collaborative devices is two, including the first electronic device and the third electronic device. Furthermore, when the first electronic device and the third electronic device are in a near-field network state, data can be directly transmitted end-to-end. In other words, the first electronic device directly sends the data to be synchronized to the third electronic device.

[0021] For example, two cooperating devices in a near-field network state may preferably perform data transmission via a distributed soft bus.

[0022] In comparison, if two collaborative devices in a near-field network state choose to transmit data through server forwarding, the number of hops required for the first electronic device to complete data synchronization is 2. That is, the first electronic device needs to first send the data to be synchronized to the server, and the server then forwards the data to be synchronized to the third electronic device. It can be seen that when the two collaborative devices are in a near-field network state, it is obvious that the number of hops required to transmit data through a distributed soft bus is smaller. The fewer the hops, the fewer resources required to transmit data, and the lower the latency. Therefore, in certain scenarios, a data transmission method with fewer hops is preferred.

[0023] Based on the above solution, two collaborative devices in a near-field network state can improve the efficiency of data transmission in an end-to-end manner, thereby enhancing the user experience of collaboratively processing work tasks through electronic devices.

[0024] In combination with the first aspect, in certain implementations of the first aspect, when the number of second electronic devices is 1 and the network status of the first electronic device and the second electronic device is a far-field network state, the data to be synchronized is transmitted with the at least one second electronic device through the first data transmission method, including: sending the data to be synchronized to a third electronic device through a server, and the third electronic device is one of the at least one second electronic device.

[0025] It should be noted that when the number of second electronic devices is 1, the number of collaborative devices is 2, including the first electronic device and the third electronic device. Moreover, when the first electronic device and the third electronic device are in a far-field network state, data cannot be transmitted between them in an end-to-end manner, and data can be transmitted in an end-to-cloud manner. That is, the first electronic device forwards the data to be synchronized to the third electronic device through the server. When the two collaborative devices are in a far-field network state, the number of hops for the first electronic device to complete data synchronization is 2. It can be seen that even if the number of collaborative devices is the same, different methods of transmitting data may be used. (For example, two collaborative devices in a near-field network state use distributed soft bus technology to transmit data; two collaborative devices in a far-field network state transmit data through a cloud server).

[0026] Based on the above solution, two collaborative devices in a far-field network state can improve the efficiency of data transmission through an end-cloud approach, thereby enhancing the user experience of collaboratively processing work tasks through electronic devices.

[0027] In combination with the first aspect, in certain implementations of the first aspect, when the number of second electronic devices is 3, the data to be synchronized is transmitted with the at least one second electronic device through the first data transmission method, including: sending the data to be synchronized to a third electronic device, a fourth electronic device and a fifth electronic device through a server, wherein the third electronic device, the fourth electronic device and the fifth electronic device belong to the at least one second electronic device.

[0028] It should be noted that when the number of second electronic devices is 3, the number of collaborative devices is 4, including the first electronic device, the third electronic device, the fourth electronic device, and the fifth electronic device. For the scenario of collaborative synchronization of four collaborative devices, whether in near-field network state or far-field network state, data can be transmitted in an end-to-cloud manner. In other words, the first electronic device forwards the data to be synchronized to the third electronic device, the fourth electronic device, and the fifth electronic device through the server.

[0029] It should be noted that the end-cloud approach is applicable to both near-field and far-field network states. When the number of cooperating devices is four or more, data transmission can be carried out using the end-cloud approach in both near-field and far-field network states. This ensures that the number of data forwarding times (fewer hops) is reduced during the data transmission process, thus reducing transmission latency and power consumption.

[0030] Based on the above solution, four or more collaborative devices can improve the efficiency of data transmission through the end-cloud method, and enhance the user experience of collaboratively processing work tasks through electronic devices.

[0031] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the first electronic device is normally synchronized with the at least one second electronic device, transmitting the data to be synchronized with the at least one second electronic device through a second data transmission method; wherein the delay of the first data transmission method is lower than the delay of the second data transmission method.

[0032] It should be noted that normal synchronization can be a screen projection connection, or USB flash drive synchronization and other synchronization methods that have lower requirements for data consistency.

[0033] It is understandable that the first data transmission method has higher data consistency requirements than the second data transmission method. The higher the data consistency requirement, the shorter the data synchronization delay. The higher the data consistency requirement, the shorter the data synchronization delay.

[0034] For example, the data consistency of the first data transmission mode is strong eventual consistency, and the data synchronization delay is in the millisecond level. The data consistency of the second data transmission mode is eventual consistency, and the data synchronization delay is in the x-second level.

[0035] That is to say, when electronic devices are in a collaborative synchronization scenario, transmitting data in a manner with higher data consistency helps to improve the user experience of the data synchronization process.

[0036] According to a second aspect, an electronic device is provided, which is a first electronic device and includes: one or more processors; one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the following steps: in response to opening a collaborative application, receive at least one second synchronization information, the at least one second synchronization information is synchronization information of at least one second electronic device, and the at least one second synchronization information corresponds one-to-one with the at least one second electronic device; determine whether the first electronic device and the at least one second electronic device are collaboratively synchronized based on the at least one second synchronization information; when the first electronic device and the at least one second electronic device are collaboratively synchronized, determine a first data transmission method based on the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device; and transmit the data to be synchronized with the at least one second electronic device through the first data transmission method.

[0037] In combination with the second aspect, in some implementations of the second aspect, the synchronization information includes an electronic device identification ID, an ID of the collaborative application, and a data ID, where the data ID is used to represent data displayed by the electronic device.

[0038] In combination with the second aspect, in certain implementations of the second aspect, when the instruction is executed by the one or more processors, the electronic device performs the following steps: before determining the first method of transmitting data based on the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device, determine the number of the second electronic devices based on the at least one second synchronization information, and determine the network status of the first electronic device and the second electronic device based on the at least one second synchronization information.

[0039] In combination with the second aspect, in certain implementations of the second aspect, when the instruction is executed by the one or more processors, the electronic device performs the following steps: before determining the number of the second electronic devices based on at least one second synchronization information, determine that the first electronic device is collaboratively synchronized with the at least one second electronic device based on the ID of the collaborative application in the first synchronization information being consistent with the ID of the collaborative application in the at least one second synchronization information, and the data ID in the first synchronization information being consistent with the data ID in the at least one second synchronization information, wherein the first synchronization information is the synchronization information of the first electronic device.

[0040] In combination with the second aspect, in certain implementations of the second aspect, when the number of second electronic devices is 1 and the network status of the first electronic device and the second electronic device is a near-field network state, the data to be synchronized is transmitted to the at least one second electronic device through the first data transmission method. When the instruction is executed by the one or more processors, the electronic device performs the following steps: sending the data to be synchronized to a third electronic device, which is one of the at least one second electronic device.

[0041] In combination with the second aspect, in certain implementations of the second aspect, when the number of second electronic devices is 1 and the network status of the first electronic device and the second electronic device is a far-field network status, the data to be synchronized is transmitted to the at least one second electronic device through the first data transmission method. When the instruction is executed by the one or more processors, the electronic device performs the following steps: sending the data to be synchronized to a third electronic device through the server, and the third electronic device is one of the at least one second electronic device.

[0042] In combination with the second aspect, in certain implementations of the second aspect, when the number of second electronic devices is 3, the data to be synchronized is transmitted to the at least one second electronic device through the first data transmission method. When the instruction is executed by the one or more processors, the electronic device performs the following steps: sending the data to be synchronized to the third electronic device, the fourth electronic device and the fifth electronic device through the server, wherein the third electronic device, the fourth electronic device and the fifth electronic device belong to the at least one second electronic device.

[0043] In combination with the second aspect, in certain implementations of the second aspect, when the instruction is executed by the one or more processors, the electronic device performs the following steps: when the first electronic device is normally synchronized with the at least one second electronic device, the data to be synchronized is transmitted to the at least one second electronic device through the second data transmission method; wherein the latency of the first data transmission method is lower than the latency of the second data transmission method.

[0044] In a third aspect, a system for transmitting data is provided, the system comprising a first electronic device and a second electronic device as in the first aspect and any possible implementation thereof.

[0045] In a fourth aspect, a device for transmitting data is provided, a processor coupled to a memory, the memory being used to store a computer program, and the processor being used to run the computer program, so that the device for transmitting data executes the method as in the first aspect and any possible implementation thereof.

[0046] In combination with the fourth aspect, in certain implementations of the fourth aspect, one or more of the memory and the transceiver are further included, and the transceiver is used to receive signals and / or send signals.

[0047] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer implements the method in the first aspect and any possible implementation thereof.

[0048] In a sixth aspect, a computer program product comprising instructions is provided, which, when run on a computer, enables the computer to execute the method in the first aspect and any possible implementation thereof.

[0049] In a seventh aspect, a chip is provided, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to execute the method in the first aspect and any possible implementation thereof.

[0050] In combination with the seventh aspect, in a possible implementation, the processor is coupled to the memory through an interface.

[0051] In combination with the seventh aspect, in a possible implementation, the chip system also includes a memory, in which a computer program or computer instructions are stored. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] FIG1 is a schematic structural diagram of an electronic device.

[0053] FIG2 is a software structure block diagram of an electronic device.

[0054] FIG3 is a schematic diagram of a scenario provided in an embodiment of the present application.

[0055] FIG4 is a schematic diagram of a data synchronization method provided in an embodiment of the present application.

[0056] FIG5 is a schematic diagram of a network scenario provided in an embodiment of the present application.

[0057] FIG6 is a schematic diagram of a transmission method provided in an embodiment of the present application.

[0058] FIG7 is a schematic flowchart of a method for transmitting data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solution in this application will be described below with reference to the accompanying drawings.

[0060] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0061] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0062] The following describes an electronic device, a user interface for such an electronic device, and embodiments for using such an electronic device. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication functions (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to devices equipped with Or other portable electronic devices with operating systems. The portable electronic device may also be other portable electronic devices, such as a laptop computer. It should also be understood that in some other embodiments, the electronic device may not be a portable electronic device, but may be a desktop computer, smart screen, smart host, smart speaker, smart refrigerator, or other smart home device.

[0063] For example, FIG1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an internal memory 121, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a microphone 170C, a sensor module 180, a camera 193, and a display screen 194. The sensor module 180 may include an acceleration sensor 180E, a touch sensor 180K, and the like.

[0064] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0065] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0066] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0067] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0068] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0070] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0071] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process 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 convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0072] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a microphone 170C, etc.) or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0073] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate 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, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0074] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0075] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects 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 modify display information.

[0076] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0077] The ISP is used to process data fed back by the camera 193. In some embodiments, the ISP can be set in the camera 193.

[0078] Camera 193 is used to capture still images or videos. The lens generates an optical image of an object and projects it onto a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or other format. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than one.

[0079] The 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.

[0080] Video codecs are used to compress or decompress digital videos. Electronic device 100 may support one or more video codecs. In this way, electronic device 100 can play or record videos in multiple encoding formats.

[0081] The NPU is a neural network (NN) computing processor that rapidly processes input information and can continuously self-learn by drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain. The NPU can be used to implement applications such as intelligent cognition in electronic device 100.

[0082] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function), etc. The data storage area may store data (such as audio data) created during the use of the electronic device 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, etc.

[0083] The electronic device 100 can implement audio functions, such as music playback, through the audio module 170, the speaker 170A, the microphone 170C, and the application processor.

[0084] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0085] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0086] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0087] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. 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 touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0088] Figure 2 is a software structure diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer, from top to bottom. The application layer can include a series of application packages.

[0089] As shown in FIG2 , the application layer may include a camera, a user interface (UI), third-party applications, etc. Among them, the third-party applications may include a gallery, a calendar, a map, etc.

[0090] The application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The application framework layer may include some predefined functions.

[0091] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0092] The window manager manages windowed applications. It can determine the display size, determine whether a status bar is present, lock the screen, and take screenshots. Content providers store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books.

[0093] The view system includes visual controls, such as controls for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views.

[0094] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0095] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0096] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0097] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

[0098] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.

[0099] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats.

[0100] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0101] A 2D graphics engine is a drawing engine for 2D drawings.

[0102] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0103] The hardware layer may include various sensors, such as the various sensors described in FIG1 .

[0104] With the development of science and technology, users usually have multiple electronic devices. For example, as shown in Figure 3, a diagram of a scenario in which a method for transmitting data provided by an embodiment of the present application is applicable is shown. Multiple electronic devices may include mobile phone terminals, personal computers, and tablet computers, etc. In order to facilitate the work and study of users, multiple electronic devices can be connected to each other to achieve data synchronization, so that users can flexibly use different electronic devices to process data. However, there are many ways to synchronize data, and different synchronization methods have different requirements for data consistency. Therefore, an embodiment of the present application provides a method for transmitting data, which can provide appropriate data consistency for different synchronization methods, and determine the appropriate method for transmitting data in combination with the number of electronic devices and the network status, thereby improving the user experience of the data synchronization process.

[0105] For example, several common data synchronization methods are introduced below in conjunction with Figure 4. One data synchronization method is the ordinary synchronization method. Generally speaking, the ordinary synchronization method has low data consistency requirements. Another data synchronization method is the collaborative synchronization method. Generally speaking, the collaborative synchronization method has high data consistency requirements. In the data transmission scenario provided in the embodiment of the present application, data consistency can mean that the data maintains the same content and status on multiple interconnected electronic devices. Among them, low data consistency requirements (eventual consistency) can be understood as the data synchronization delay is at the x-second level. High data consistency requirements (strong eventual consistency) can be understood as the data synchronization delay is at the hundreds of milliseconds level.

[0106] As shown in (a) in Figure 4, a common synchronization method is shown, in which the mobile phone terminal is connected to the smart screen for screen projection. Specifically, if both the mobile phone terminal and the smart screen support high definition multimedia interface (HDMI), the mobile phone terminal can be connected to the smart screen for screen projection via HDMI. Alternatively, if both the mobile phone terminal and the smart screen support wireless screen projection, the mobile phone terminal and the smart screen can be connected for screen projection via wireless screen projection. For example, the mobile phone terminal and the smart screen are connected in the same local area network, and screen mirroring is achieved through system-level distributed soft bus technology, so that the picture displayed by the mobile phone terminal as shown in (a) in Figure 4 can be mirrored and displayed on the smart screen in real time. For another example, the mobile phone terminal uses an application that can support the screen projection function (for example, a video player, a conference application, etc.) to transfer the projection content through the cloud server, and the mobile phone terminal sends the projected picture to the smart screen, and the smart screen can display the picture.

[0107] As shown in (b) of Figure 4, another common synchronization method is shown. The mobile terminal and the smart screen can synchronize data via a USB flash drive. This method requires manual operation by the user. For example, the user inserts a USB flash drive or other mobile storage device into the mobile terminal, copies the files in the folder to be synchronized (for example, File 1, File 2, and File 3) to the mobile storage device, removes the mobile storage device from the mobile terminal, inserts it into the smart screen device, and moves the files from the mobile storage device to the smart screen to complete data synchronization.

[0108] It should be noted that Figures 4(a) and 4(b) above illustrate two common synchronization methods. These methods can display data from one electronic device to another, and users can process the synchronized data on one or more electronic devices. For example, when using the screen projection connection shown in Figure 4(a), the smart screen can synchronously display the image shared by the mobile terminal. When the user zooms in or out on the mobile terminal, the image displayed on the smart screen will also zoom in or out synchronously. When using the USB flash drive copy method shown in Figure 4(b) to synchronize data, the smart screen displays the shared file from the mobile terminal. Since both the mobile terminal and the smart screen have the file, the user can open the shared file on the mobile terminal or the electronic device to process it. After the user processes file 1 on the mobile terminal, the processed file 1 can be synchronized to the smart screen via a mobile storage device, so that the smart screen obtains the processed file 1; alternatively, after the user processes file 2 on the smart screen, the processed file 2 can be synchronized to the mobile terminal via a mobile storage device, so that the mobile terminal obtains the processed file 2. It can be seen that real-time data synchronization cannot be achieved through mobile storage devices. The above two data synchronization scenarios do not require high data consistency.

[0109] As shown in Figure 4 (c), a collaborative synchronization method is shown. The mobile terminal and the smart screen are collaboratively connected, and the smart screen displays the main interface of the mobile terminal. The user can control the mobile terminal interface on the smart screen. For example, content can be freely dragged and dropped between the mobile terminal and the smart screen, thus realizing dual-screen operation.

[0110] It's important to note that collaborative synchronization is a distributed technology that enables cross-system and cross-device collaboration. When multiple electronic devices are connected, data synchronization and resource sharing are possible. Furthermore, multiple electronic devices can perform the tasks of two other devices simultaneously, using a single peripheral device.

[0111] For example, as shown in (d) in FIG4 , a collaborative synchronization method is shown, in which a tablet computer and a personal computer are collaboratively connected. A painting application is opened on both the front end of the personal computer and the tablet computer, and the same picture content is displayed. After the tablet computer and the personal computer are collaboratively connected, the tablet computer can be used as an extended screen of the personal computer to expand the operating space and method of the personal computer. The tablet computer and the personal computer can share the mouse and keyboard of the personal computer, and the tablet computer can control the synchronized data through the touch screen (finger or stylus). The mouse of the personal computer can drag and drop data between the personal computer and the tablet computer, making data transmission more convenient.

[0112] It should be noted that through the collaborative synchronization method shown in Figure 4 (c) and Figure 4 (d) above, electronic devices can synchronize data with collaboratively connected devices in real time. It can be seen that in the collaborative synchronization scenario, multiple electronic devices need to open the same application on the front end and process the synchronized data in real time, which requires high data consistency to meet the user's experience in the collaborative synchronization scenario.

[0113] That is, in the scenario of normal synchronization, in order to save power, it is not necessary to use high data consistency for data synchronization; however, in the scenario of collaborative synchronization, in order to improve the user experience, it is necessary to use high data consistency for data synchronization. Therefore, in the data transmission method provided in the embodiment of the present application, the corresponding data consistency can be used for data synchronization processing according to the specific data synchronization scenario.

[0114] It should be noted that when determining whether the current synchronization scene is a collaborative synchronization scene as shown in (c) in Figure 4 or (d) in Figure 4, synchronization information is required, wherein the synchronization information includes device identification (ID), application ID, data ID and other information. The data ID can be used to represent the page, picture, text and other information currently displayed (or opened) by the device. Each device in the collaborative scene can determine that the current synchronization scene is a collaborative scene based on the synchronization information. And, further, after determining that the current synchronization scene is a collaborative synchronization scene, it is necessary to determine the number and / or network status of the current collaborative devices. The collaborative synchronization scene requires at least two electronic devices to collaborate; the network status includes near-field communication and / or far-field communication. The above specific methods for determining the collaborative synchronization scene, the number of collaborative devices and the network status will be specifically described in conjunction with Figure 5 below.

[0115] Figure 5 shows a schematic diagram of a network scenario in which device A and device B are in the same local area network and can determine the collaboration scenario, the number of collaborative devices, and the network status of the collaborative devices through the local area network.

[0116] It should be noted that a local area network (LAN) is a regional network formed in a local area. The area that a LAN can cover is limited, but compared to other networks, it has faster transmission speeds, more stable performance, and a simpler framework. LANs include wired LANs and wireless LANs (WLANs). Among them, there are many implementation protocols for wireless LANs, and the most widely used one is Wi-Fi. Multiple wireless devices can be combined into a wireless LAN through a router. For example, in a home scenario, a router is usually all that is needed to set up a small wireless LAN. Wired LANs can use a variety of different transmission technologies. Generally, various devices in a wired LAN can communicate and interact using copper wires, optical fibers, etc. as transmission media.

[0117] For example, as shown in Figure 5 , device A and device B are on the same local area network. Device A and device B can report their synchronization information to the server on the local area network. For example, device A reports its ID, the ID of the application open on device A (e.g., the drawing application shown in Figure 4 (d)), and the data ID (e.g., the specific image shown in Figure 4 (d)). Similarly, device B also reports its device ID, application ID, and data ID to the server on the local area network.

[0118] Device A and device B can also download synchronization information of other devices from the server of the local area network. For example, device A downloads the device ID, application ID and data ID of device B from the server of the local area network, and device B downloads the device ID, application ID and data ID of device A from the server of the local area network. When the application ID of device B is consistent with the application ID of device A, it can indicate that the front-ends of device A and device B have the same application open or displayed; when the data ID of device B is consistent with the data ID of device A, it can indicate that the front-ends of device B and device A have the same data (for example, pages, pictures or text, etc.) open or displayed. In other words, when device A and device B are connected to the same local area network via wired or wireless means, they can exchange synchronization information with each other through the server of the local area network. This method of exchanging synchronization information through the server can also be understood as an end-cloud method.

[0119] Device A can determine whether to synchronize with device B, the number of devices synchronized with device A, and the network status based on the synchronization information. For example, device A learns from the downloaded synchronization information of device B that the same application is opened or displayed on the front end of device B and device A, and that the same data is opened or displayed on the front end of device B and device A, and then device A determines to synchronize with device B. Device A only learns from the LAN server that device B synchronizes with itself, and can determine that the number of devices synchronized with itself is 2 (including device A and device B), and determines the device ID of device B synchronized with device A. In addition, since device A and device B are both connected to the same LAN server, the LAN server stores the device IDs of device A and device B, and the LAN server can determine that device A and device B are in a near-field network state. Similarly, device B can also determine whether to synchronize with device A, the number of devices synchronized with device B, and the network status based on the synchronization information.

[0120] In addition, as shown in Figure 5, in addition to device A and device B in the same local area network, device C and device D outside the local area network are also included. Among them, device C can communicate and interact with device A and device B in the local area network through the cloud server. Device C can report its own synchronization information to the cloud server, and device A and device B can also report their own synchronization information to the cloud server. Each device downloads the synchronization information of other devices from the cloud server respectively, and determines whether it is a collaborative synchronization scenario, the number of collaborative synchronization devices and the network status based on the synchronization information. For example, device C downloads the synchronization information of device A and device B from the cloud server, and determines that device C and device A and B have the same application and data opened or displayed on the front end. Therefore, it is determined that the current synchronization scenario is a collaborative synchronization scenario, and the number of collaborative devices is 3 (including device A, device B and device C). Since device C realizes the interaction of synchronization information with device A and device C through the cloud server, device C and device A or device B are in a far-field network state, while for device A, device B and device C, device A and device B are in a near-field network state. It can be seen that the network states of device A, device B and device C include near-field and far-field. This method of exchanging synchronization information through a cloud server can also be understood as an end-to-end method. For another example, device D can exchange its own synchronization information with device C through an end-to-end (device to device, D2D) communication method, and device D can also determine the synchronization scenario, the number of collaborative devices and the network status based on the synchronization information. This method of directly exchanging synchronization information between devices can be understood as an end-to-end method.

[0121] It should be noted that each of the above-mentioned devices can send its own synchronization information to the server or to other devices. It is understandable that when a device opens a collaborative application (for example, a painting application, etc.), it can trigger the device to send its own synchronization information. Alternatively, in order to save power consumption, the device can send updated synchronization information when the data changes. For example, a picture of a drawing application is displayed on the device. When the user modifies the picture through the device, the device can upload the modified data ID to the cloud server, where the modified data ID can represent the modified picture.

[0122] It should be noted that in the collaborative synchronization scenario, there are at least two collaborative devices. By querying the device ID in the near-field network (for example, a local area network), the number of collaborative devices and the network status of the collaborative devices (including near field, far field, or near field and far field) are determined. For example, as shown in Figure 5, device A and device B are in a local area network, and device A and device B are relatively in a near-field network state. Device C is not in the local area network, and device C and device A or device B are relatively in a far-field network state. Among them, near field and far field can be relative concepts in communication distance. Simply put, if the distance between two devices is close, it may be a near-field network state; if the distance between two devices is far, it may be a far-field network state.

[0123] Furthermore, in a collaborative synchronization scenario, a preferred data transmission method can be determined based on the number of collaborative devices and the network status. The following describes a method for determining a preferred transmission strategy in conjunction with FIG6 .

[0124] As shown in Figure 6 (a), a method for transmitting data between two collaborative devices is shown. When device A and device B are in a near-field network state, data transmission can be carried out in an end-to-end manner. In other words, device A and device B communicate directly with each other, and device A can directly transmit data to device B. In a scenario where two collaborative devices are in a near-field network state, the number of hops required for device A to complete data synchronization is 1. Simply put, it takes one hop for device A to transmit data to device B to complete the data synchronization process.

[0125] For example, this end-to-end approach can specifically adopt a distributed soft bus. The distributed soft bus can provide a unified distributed communication capability for seamless interconnection between devices, can quickly discover and connect to each other, and thus can efficiently transmit tasks and data. HarmonyOS connects different devices through distributed soft bus technology, which can realize multiple communication methods, and multiple devices can communicate with each other efficiently and conveniently, just like using "one device". The distributed soft bus can include four parts in the logical architecture: discovery, connection, networking and transmission. These four parts can divide the work and cooperate in the business logic, and achieve the goal of distributed soft bus communication by building a distributed communication framework. The following is a brief introduction to the four parts of the distributed soft bus:

[0126] 1. Discovery

[0127] Through the discovery technology of the distributed soft bus, any device can discover the existence of distributed devices around it. Any device can be an active discoverer, a passive discoverer, or both.

[0128] Specifically, the discovery technology of the distributed soft bus supports device discovery through different media such as Bluetooth, Ethernet, and Wi-Fi; supports the selection of appropriate discovery media based on the capabilities of different devices; and supports the provision of appropriate discovery strategies such as discovery frequency and scanning cycle based on the characteristics of the device and business needs.

[0129] 2. Connect

[0130] Using distributed soft bus technology, any device can connect to other distributed devices nearby. The distributed soft bus selects the appropriate communication medium and connection technology based on the capabilities and service requirements of the distributed devices. This establishes communication links between devices, facilitating subsequent networking and transmission.

[0131] 3. Networking

[0132] Through distributed networking technology, any device can combine distributed devices with different communication capabilities into a network. This networking extends the reach of distributed device networks beyond single or one-to-one communication connections. Distributed networking can form a dynamic network of devices across a specific scenario (e.g., home or industrial manufacturing).

[0133] In a dynamic network, the communication and service capabilities of each device can be effectively managed. When any device in the network has a service need, it can provide the required device information at any time through the distributed soft bus network to support the establishment of a service channel.

[0134] 4. Transmission

[0135] Distributed soft bus transmission technology provides service data transmission capabilities for any device in the current scenario. This technology abstracts service data and quality of service (QoS) and provides appropriate transmission services based on network load and device capabilities. This technology ensures the transmission quality of multiple services across the entire distributed network while ensuring the communication needs of a single service.

[0136] It can be understood that the two collaborative devices shown in (a) in Figure 6 are in a near-field network state, and data transmission can preferably be carried out through a distributed soft bus. If the transmission is carried out through the cloud server, the number of hops for device A to complete data synchronization is 2. Simply put, device A needs to send the data to the cloud server first, and then the cloud server sends the data to device B to complete the data transmission. It can be seen that when the two collaborative devices are in a near-field network state, it is obvious that the number of hops required to transmit data through a distributed soft bus is relatively small. The fewer the hops, the fewer resources required to transmit data, and the lower the latency. Therefore, in certain scenarios, a data transmission method with fewer hops is preferred.

[0137] When device A and device B are in a far-field network state, the distributed soft bus technology may not be able to meet the current data transmission needs. Based on this, data transmission needs to be carried out through a cloud server. That is, device A sends data to the cloud server, and the cloud server forwards the data to device B. In this scenario, the number of hops required for device A to complete data synchronization is 2. It can be seen that even if the number of collaborative devices is the same, different data transmission methods may be used (for example, two collaborative devices in a near-field network state use distributed soft bus technology to transmit data; two collaborative devices in a far-field network state transmit data through a cloud server).

[0138] As shown in (b) of Figure 6, a data transmission method for three collaborative devices is shown. When device A, device B, and device C are in a near-field network state, data transmission can be carried out in an end-to-end manner. That is to say, device A, device B, and device C can communicate and interact directly with each other, and device A can transmit data directly to device B, or directly to device C. In a scenario where there are three collaborative devices and they are in a near-field network state, the number of hops required for device A to synchronize data to the other two collaborative devices is 2. Simply put, the process of device A transmitting data to device B is 1 hop, and the process of device A transmitting data to device C is 1 hop. The process of device A completing data synchronization requires a total of 2 hops.

[0139] As shown in (c) of Figure 6, a method of transmitting data among three collaborative devices is shown. Unlike the scenario shown in (b) of Figure 6, the three collaborative devices shown in (c) of Figure 6 are in a far-field network state. Based on this, the end-to-end method (for example, a distributed soft bus) is not suitable for scenarios where the three collaborative devices are in a far-field network state. Therefore, the process of transmitting data can be completed through the forwarding function of the cloud server. For example, device A sends data to the cloud server, and the cloud server can send the data down to device B and device C. It can be seen that the above process of uploading data to the cloud server requires 1 hop, and the process of the cloud server sending data down to the collaborative device requires 1 hop. The process of device A completing data synchronization requires a total of 2 hops.

[0140] As shown in (d) in Figure 6, a data transmission method for four collaborative devices is shown. When device A, device B, device C, and device D are in a near-field network, data transmission can be carried out in an end-to-end manner. That is, device A, device B, device C, and device D can communicate and interact directly with each other, and device A can transmit data to device B, device C, and device D respectively. When the four collaborative devices use an end-to-end method for data transmission, the number of hops required for device A to synchronize data to the other three collaborative devices is 3. Simply put, the process of device A transmitting data to device B is 1 hop, the process of device A transmitting data to device C is 1 hop, and the process of device A transmitting data to device D is 1 hop. The process of device A completing data synchronization requires a total of 3 hops.

[0141] As shown in (e) of Figure 6, a data transmission method for four collaborative devices is shown. Unlike the data transmission method described in (d) of Figure 6, Figure 6 (e) shows an end-to-cloud data transmission method, that is, data synchronization is achieved through forwarding via a cloud server. When four collaborative devices use an end-to-cloud method for data transmission, the number of hops required for device A to synchronize data to the other three collaborative devices is 2. Simply put, the process of device A sending data to the cloud server is 1 hop, and the process of the cloud server sending data to the collaborative devices (devices B, C, and D) requires 1 hop. The process of device A completing data synchronization requires a total of 2 hops.

[0142] It should be noted that when data is transmitted in an end-to-end manner, the more collaborative devices there are, the more hops are required to complete the data transmission, that is, the more data forwarding times are required. Therefore, for the near-field network state, it cannot be simply assumed that data can be transmitted in an end-to-end manner, but the number of collaborative devices must also be considered. For example, in the above introduction to (e) in Figure 6, for four collaborative devices in a near-field network state, the number of hops required for data transmission in an end-to-cloud manner (2 hops) is obviously less than the number of hops required for data transmission in an end-to-end manner (3 hops). In other words, when determining the preferred data transmission method (data transmission strategy), it is necessary to determine the number of data forwarding times (number of hops) in the data transmission process based on the number of collaborative devices and the network state. Selecting a data transmission method with fewer data forwarding times as the preferred method can reduce the delay in the data transmission process and save power consumption.

[0143] It should be noted that in a collaborative synchronization scenario, the number of collaborative devices and the network status may change dynamically. Therefore, the method of transmitting data may also change with the changes in the number of collaborative devices and / or the network status, so that the method of transmitting data can be most suitable for the current collaborative synchronization scenario.

[0144] As shown in FIG7 , a method for transmitting data provided in an embodiment of the present application is shown. This method can be applied to the scenario shown in FIG3 . The method is described in detail below.

[0145] S701: In response to opening a collaborative application, receiving at least one second synchronization information.

[0146] It should be noted that at least one second synchronization information is synchronization information of at least one second electronic device, and the second electronic device is an electronic device other than the first electronic device, and at least one second synchronization information corresponds one-to-one with at least one second electronic device. Among them, the synchronization information includes the electronic device ID, the ID of the collaborative application, and the data ID. The data ID is used to represent the data displayed by the electronic device.

[0147] For example, collaborative applications may be drawing applications, file applications, and other applications that support collaborative synchronization functions. The data ID may be used to represent information such as pages, pictures, and text currently displayed (or opened) by the electronic device.

[0148] It should be noted that, in response to the user opening the collaborative application, the first electronic device may send the first synchronization information to at least one second electronic device, or send the first synchronization information to the cloud server. At the same time, the first electronic device may receive at least one second synchronization information from at least one second electronic device, or may receive at least one second synchronization information from the cloud server. The first synchronization information is the synchronization information of the first electronic device.

[0149] It is understandable that whether the device that interacts with the first electronic device with the first synchronization information and the second synchronization information is a cloud server or other electronic devices may depend on the current network status.

[0150] For example, when a first electronic device and a second electronic device correspond to device A and device B, respectively, as shown in Figure 5, and are within the same local area network, when a user opens a collaborative application on the first electronic device, the first electronic device reports first synchronization information to the local area network server, and the second electronic device reports second synchronization information to the local area network server. Simultaneously, the first electronic device downloads the second synchronization information from the local area network server, and the second electronic device downloads the first synchronization information from the local area network server. For another example, when the first electronic device and the second electronic device correspond to device A and device C, respectively, as shown in Figure 5, and are not within the same local area network, device C communicates with device A via a cloud server. When a user opens a collaborative application on the first electronic device, the first electronic device reports first synchronization information to the cloud server, and the second electronic device reports second synchronization information to the cloud server. Simultaneously, the first electronic device downloads the second synchronization information from the cloud server, and the second electronic device downloads the first synchronization information from the cloud server. For another example, when the first electronic device and the second electronic device correspond to device C and device D, respectively, as shown in Figure 5, the first and second electronic devices communicate and interact in an end-to-end manner. When a user opens a collaborative application on the first electronic device, the first and second electronic devices exchange synchronization information with each other.

[0151] It should be noted that when a collaborative application is open, it can trigger the upload and download of synchronization information; or, to save power, updated synchronization information can be transmitted when the data changes. For example, if a first electronic device displays an image from a drawing application and a user zooms out on the image, the first electronic device can upload the modified data ID to the cloud server, where the modified data ID can represent the zoomed-out image.

[0152] S702: Determine whether the first electronic device and at least one second electronic device are synchronized in a coordinated manner according to at least one second synchronization information.

[0153] Exemplarily, the first electronic device may be synchronized with at least one second electronic device in a coordinated or common manner.

[0154] S703: When the first electronic device is synchronized with at least one second electronic device, determine a first data transmission method according to the number of second electronic devices and / or the network status of the first electronic device and the second electronic device.

[0155] It should be noted that before determining the first method of transmitting data based on the number of second electronic devices and / or the network status of the first electronic device and the second electronic device, the first electronic device can determine the number of second electronic devices based on at least one second synchronization information, and determine the network status of the first electronic device and the second electronic device based on at least one second synchronization information.

[0156] It should be noted that when the first electronic device receives one second synchronization message, the first electronic device can determine that the number of second electronic devices is 1; when the first electronic device receives two second synchronization messages, the first electronic device can determine that the number of second electronic devices is 2. In other words, the first electronic device can determine the number of second electronic devices based on the number of received second synchronization messages, and because the synchronization message includes the electronic device ID, the first electronic device can also determine the second electronic device ID corresponding to the second synchronization message based on the electronic device ID in the second synchronization message.

[0157] It should be noted that the network status includes near-field communication, far-field communication, or near-field communication and far-field communication. Simply put, near field and far field can be relative concepts in terms of communication distance. When the distance between two electronic devices is close, it may be a near-field network state; when the distance between two electronic devices is far, it may be a far-field network state. When a first electronic device is synchronized with at least two second electronic devices, both near-field and far-field network states may exist. For example, as shown in Figure 5, the first electronic device corresponds to device C, one of the second electronic devices corresponds to device D, and the other second electronic device corresponds to device A. It can be seen that device C and device D are in a near-field network state, and device A and device C or device D are in a far-field network state. The network status of device A, device C, and device D includes a near-field network state and a far-field network state.

[0158] Optionally, before determining the number of second electronic devices based on at least one second synchronization information, the first electronic device determines that the first electronic device is collaboratively synchronized with at least one second electronic device based on the fact that the ID of the collaborative application in the first synchronization information is consistent with the ID of the collaborative application in at least one second synchronization information, and the data ID in the first synchronization information is consistent with the data ID in at least one second synchronization information.

[0159] That is to say, when the first electronic device and the second electronic device display the same collaborative application and the same data on their front ends, it can be considered that the first electronic device and the second electronic device are in a collaborative synchronization scenario. In the collaborative synchronization scenario, the first electronic device and the second electronic device synchronize data and share resources. At the same time, the multiple electronic devices in collaborative synchronization can also complete the tasks of two electronic devices on one electronic device through a peripheral device (for example, a mouse, a keyboard).

[0160] It is understandable that the content displayed on the collaboratively synchronized first electronic device is consistent with the content displayed on the second electronic device. When the content displayed on one electronic device changes, the content displayed on the other electronic device will also change accordingly.

[0161] S704: Transmit the data to be synchronized with at least one second electronic device using a first data transmission method.

[0162] It should be noted that before transmitting data to be synchronized between the first electronic device and the second electronic device, a data transmission method must be determined. The basis for determining the data transmission method includes at least one of the following: the number of second electronic devices and the network status. The data transmission method can be understood as a data transmission strategy, which can include an end-to-end method and an end-to-cloud method.

[0163] Exemplarily, when the number of the second electronic device is 1 and the network status of the first electronic device and the second electronic device is a near field network status, the data to be synchronized is sent to a third electronic device, which is one of the at least one second electronic device.

[0164] It should be noted that when the number of second electronic devices is one, the number of collaborative devices is two, including the first electronic device and the third electronic device. Furthermore, when the first electronic device and the third electronic device are in a near-field network state, data can be directly transmitted end-to-end. In other words, the first electronic device directly sends the data to be synchronized to the third electronic device.

[0165] For example, as shown in Figure 6 (a), the first electronic device corresponds to device A, and the third electronic device corresponds to device B. Devices A and B communicate directly with each other. In other words, in a scenario where two devices are collaborating and in a near-field network state, the number of hops required for device A to complete data synchronization is 1. Of course, for device B, the number of hops required for device B to complete data synchronization is also 1.

[0166] For example, two cooperating devices in a near-field network state may preferably perform data transmission via a distributed soft bus.

[0167] In comparison, if two collaborative devices in a near-field network state choose to transmit data through server forwarding, the number of hops required for the first electronic device to complete data synchronization is 2. That is, the first electronic device needs to first send the data to be synchronized to the server, and the server then forwards the data to be synchronized to the third electronic device. It can be seen that when the two collaborative devices are in a near-field network state, it is obvious that the number of hops required to transmit data through a distributed soft bus is smaller. The fewer the hops, the fewer resources required to transmit data, and the lower the latency. Therefore, in certain scenarios, a data transmission method with fewer hops is preferred.

[0168] Exemplarily, when the number of second electronic devices is 1 and the network status of the first electronic device and the second electronic device is a far-field network status, the data to be synchronized is sent to a third electronic device through the server, and the third electronic device is one of the at least one second electronic device.

[0169] It should be noted that when the number of second electronic devices is 1, the number of collaborative devices is 2, including the first electronic device and the third electronic device. Moreover, when the first electronic device and the third electronic device are in a far-field network state, data cannot be transmitted between them in an end-to-end manner, and data can be transmitted in an end-to-cloud manner. That is, the first electronic device forwards the data to be synchronized to the third electronic device through the server. When the two collaborative devices are in a far-field network state, the number of hops for the first electronic device to complete data synchronization is 2. It can be seen that even if the number of collaborative devices is the same, different methods of transmitting data may be used. (For example, two collaborative devices in a near-field network state use distributed soft bus technology to transmit data; two collaborative devices in a far-field network state transmit data through a cloud server).

[0170] Exemplarily, when the number of second electronic devices is 2 and the network status of the first electronic device and the second electronic device is a near field network status, the data to be synchronized is sent to the third electronic device and the fourth electronic device, and the third electronic device and the fourth electronic device belong to at least one second electronic device.

[0171] It should be noted that when the number of second electronic devices is two, the number of collaborative devices is three, including the first electronic device, the third electronic device, and the fourth electronic device. Furthermore, when the first electronic device, the third electronic device, and the fourth electronic device are in a near-field network state, data can be directly transmitted end-to-end. In other words, the first electronic device directly sends the data to be synchronized to the third electronic device and the fourth electronic device.

[0172] For example, as shown in Figure 6(b), the first electronic device corresponds to device A, the third electronic device corresponds to device B, and the fourth electronic device corresponds to device C. Devices A, B, and C communicate directly with each other. In other words, in a scenario with three cooperating devices in a near-field network state, the number of hops required for device A to complete data synchronization is two. Of course, the number of hops required for devices B and C to complete data synchronization is also two.

[0173] Exemplarily, when the number of second electronic devices is 2 and the network status of the first electronic device and the second electronic device is a far-field network state, the data to be synchronized is sent to the third electronic device and the fourth electronic device through the cloud server, and the third electronic device and the fourth electronic device belong to at least one second electronic device.

[0174] It should be noted that when the number of second electronic devices is 2, the number of collaborative devices is 3, including the first electronic device, the third electronic device, and the fourth electronic device. Furthermore, when the first electronic device, the third electronic device, and the fourth electronic device are in a far-field network state, data can be transmitted in an end-to-cloud manner. In other words, the first electronic device forwards the data to be synchronized to the third electronic device and the fourth electronic device through the server.

[0175] For example, as shown in Figure 6 (c), the first electronic device corresponds to device A, the third electronic device corresponds to device B, and the fourth electronic device corresponds to device C. Devices A, B, and C communicate with each other through the server. In other words, in a scenario with three cooperating devices in a far-field network state, the number of hops required for device A to complete data synchronization is 2. Of course, the number of hops required for devices B and C to complete data synchronization is also 2.

[0176] It can be seen that for the three collaborative devices, regardless of the near-field network state or the far-field network state, the end-to-end data transmission method and the end-to-cloud data transmission method respectively adopted require 2 hops.

[0177] Exemplarily, when the number of second electronic devices is 3, the data to be synchronized is sent to the third electronic device, the fourth electronic device and the fifth electronic device through the server, wherein the third electronic device, the fourth electronic device and the fifth electronic device belong to at least one second electronic device.

[0178] It should be noted that when the number of second electronic devices is 3, the number of collaborative devices is 4, including the first electronic device, the third electronic device, the fourth electronic device, and the fifth electronic device. For the scenario of collaborative synchronization of four collaborative devices, whether in near-field network state or far-field network state, data can be transmitted in an end-to-cloud manner. In other words, the first electronic device forwards the data to be synchronized to the third electronic device, the fourth electronic device, and the fifth electronic device through the server.

[0179] For example, as shown in (d) of Figure 6, the first electronic device corresponds to device A, the third electronic device corresponds to device B, the fourth electronic device corresponds to device C, and the fifth electronic device corresponds to device D. In the case of four collaborative devices and a near-field network scenario, data is transmitted in an end-to-end manner, and the number of hops required for device A to complete data synchronization is 3. Of course, for devices B, C, and D, the number of hops required to complete data synchronization is also 3. As shown in (e) of Figure 6, the first electronic device corresponds to device A, the third electronic device corresponds to device B, the fourth electronic device corresponds to device C, and the fifth electronic device corresponds to device D. In the case of four collaborative devices and regardless of whether the scenario is a near-field network or a far-field network, data is transmitted in an end-to-cloud manner, and the number of hops required for device A to complete data synchronization is 2. Of course, for devices B, C, and D, the number of hops required to complete data synchronization is also 2.

[0180] It should be noted that the end-cloud approach is applicable to both near-field and far-field network states. When the number of cooperating devices is four or more, data transmission can be carried out using the end-cloud approach in both near-field and far-field network states. This ensures that the number of data forwarding times (fewer hops) is reduced during the data transmission process, thus reducing transmission latency and power consumption.

[0181] In addition, when the first electronic device is normally synchronized with at least one second electronic device, the data to be synchronized is transmitted to the at least one second electronic device via a second data transmission method; wherein the delay of the first data transmission method is lower than the delay of the second data transmission method.

[0182] It should be noted that normal synchronization can be a screen projection connection, or USB flash drive synchronization and other synchronization methods that have lower requirements for data consistency.

[0183] It is understandable that the first data transmission method has higher data consistency requirements than the second data transmission method. The higher the data consistency requirement, the shorter the data synchronization delay. The higher the data consistency requirement, the shorter the data synchronization delay.

[0184] For example, the data consistency of the first data transmission mode is strong eventual consistency, and the data synchronization delay is in the millisecond level. The data consistency of the second data transmission mode is eventual consistency, and the data synchronization delay is in the x-second level.

[0185] That is to say, when electronic devices are in a collaborative synchronization scenario, transmitting data in a manner with higher data consistency helps to improve the user experience of the data synchronization process.

[0186] It should be noted that based on the first data transmission method determined in the above steps, data synchronization with strong eventual consistency between electronic devices can be achieved in a collaborative synchronization scenario. Of course, based on the second data transmission method determined in the above steps, data synchronization with eventual consistency between electronic devices can also be achieved in a normal synchronization scenario.

[0187] The embodiments provided in the present application can determine whether multiple electronic devices are in a collaborative synchronization scenario, and in the collaborative synchronization scenario, determine the specific data transmission method (transmission strategy) based on the number of electronic devices and / or network status. In addition, the data transmission method in the collaborative synchronization scenario has high data consistency, so that the data synchronization in the collaborative synchronization scenario has low latency, low power consumption, and high efficiency, ensuring a good user experience.

[0188] The present application provides a computer program product that, when executed on a device, causes the device to execute the technical solution in the above embodiment. Its implementation principle and technical effects are similar to those of the above method-related embodiments and will not be further described here.

[0189] The present embodiment provides a readable storage medium containing instructions that, when executed on a device, cause the device to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar and will not be further described here.

[0190] The present application provides a chip for executing instructions. When the chip is running, it executes the technical solution in the above embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.

[0191] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.

[0192] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units (modules) can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0193] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the unit is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0194] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0195] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0196] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0197] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for transmitting data, characterized in that: The method is applied to a first electronic device, and the method includes: In response to opening the collaborative application, receiving at least one second synchronization information, the at least one second synchronization information being synchronization information of at least one second electronic device, the at least one second synchronization information corresponding to the at least one second electronic device in a one-to-one manner; Determining whether the first electronic device and the at least one second electronic device are synchronized in coordination according to the at least one second synchronization information; When the first electronic device is synchronized with the at least one second electronic device, determining a first data transmission mode according to the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device; The data to be synchronized is transmitted to the at least one second electronic device by using the first data transmission method.

2. The method according to claim 1, characterized in that The synchronization information includes an electronic device identification ID, an ID of the collaborative application, and a data ID, where the data ID is used to represent data displayed by the electronic device.

3. The method according to claim 1 or 2, characterized in that: Before determining the first data transmission mode according to the number of the second electronic devices and / or the network status of the first electronic device and the second electronic device, the method further includes: determining the number of the second electronic devices according to the at least one second synchronization information, and The network status of the first electronic device and the second electronic device is determined according to the at least one second synchronization information.

4. The method according to claim 3, characterized in that: Before determining the number of the second electronic devices according to at least one second synchronization information, the method further includes: Based on the fact that the ID of the collaborative application in the first synchronization information is consistent with the ID of the collaborative application in the at least one second synchronization information, and the data ID in the first synchronization information is consistent with the data ID in the at least one second synchronization information, it is determined that the first electronic device is collaboratively synchronized with the at least one second electronic device, wherein the first synchronization information is the synchronization information of the first electronic device.

5. The method according to claim 3 or 4, characterized in that: When the number of the second electronic device is 1, and the network state between the first electronic device and the second electronic device is a near field network state, The transmitting the data to be synchronized with the at least one second electronic device by using the first data transmission method includes: The data to be synchronized is sent to a third electronic device, where the third electronic device is one of the at least one second electronic device.

6. The method according to claim 3 or 4, characterized in that: When the number of the second electronic device is 1, and the network state between the first electronic device and the second electronic device is a far-field network state, The transmitting the data to be synchronized with the at least one second electronic device by using the first data transmission method includes: The data to be synchronized is sent to a third electronic device through a server, where the third electronic device is one of the at least one second electronic device.

7. The method according to claim 3 or 4, characterized in that: When the number of the second electronic devices is 3, The transmitting the data to be synchronized with the at least one second electronic device by using the first data transmission method includes: The data to be synchronized is sent to a third electronic device, a fourth electronic device and a fifth electronic device through a server, wherein the third electronic device, the fourth electronic device and the fifth electronic device belong to the at least one second electronic device.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: When the first electronic device is normally synchronized with the at least one second electronic device, transmitting the data to be synchronized with the at least one second electronic device in a second data transmission manner; The delay of the first data transmission method is lower than the delay of the second data transmission method.

9. An electronic device, characterized in that: The electronic device is a first electronic device, comprising: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the electronic device performs the method according to any one of claims 1 to 8.

10. A device for transmitting data, characterized in that: A processor coupled to a memory, wherein the memory is used to store a computer program, and the processor is used to run the computer program so that the device for transmitting data performs the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the computer is caused to implement the method according to any one of claims 1 to 8.

12. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method, electronic device and system for transmitting data

    CN119728708B

  • Data synchronization method and electronic device

    CN105681393A

  • Screen broadcasting method, device, system, electronic equipment and storage medium

    CN110752999A

  • Method for realizing remote cooperation of multiple whiteboards

    CN114879924A

  • Method and device for cooperative work of applications between devices

    CN115147056A