Data transmission method and electronic equipment

Data transmission is carried out through cache transmission, which solves the problem of high power consumption of data transmission in distributed collaborative services, and achieves low power consumption while ensuring picture fluency and clarity.

CN119629707APending Publication Date: 2025-03-14HUAWEI DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311185170.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In distributed collaborative services, the data transmission power consumption of electronic devices is high, resulting in increased power consumption of equipment and affecting the user's viewing experience.

Method used

Data transmission is carried out by buffering and transmission, and the first electronic device decides whether to send the generated first frame data to the second electronic device according to preset conditions, or caches the frame data. The specific method includes generating the first frame data, deciding whether to send based on the cache time and the number of frames, and promptly notifying the playback mode of the receiving device.

Benefits of technology

It effectively reduces data transmission power consumption, while ensuring the smoothness and clarity of the screen display of the receiving device, and does not affect the user's viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629707A_ABST
    Figure CN119629707A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and electronic equipment, and relates to the technical field of terminals. The first electronic equipment transmits data to the second electronic equipment in a cache sending mode, so that the data transmission power consumption is effectively reduced. The method comprises the following steps: a first electronic device generates first frame data; when it is determined that the first caching duration and / or the first caching frame number are / is reached, the first electronic device sends cached multi-frame data to the second electronic device, and the multi-frame data comprise the first frame data. And when it is determined that the first cache duration and / or the first cache frame number are / is not reached, the first electronic device caches the first frame data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a data transmission method and an electronic device. Background Art

[0002] With the development of terminal technology, distributed collaborative services are widely used in users' daily life and office scenes. Among them, distributed collaborative services include multi-screen collaboration, screen projection, super desktop, etc.

[0003] For example, a distributed communication system includes electronic device A and electronic device B. When running a video application, electronic device A sends the played video content to electronic device B for display in response to a user operation. In this way, the user can watch the video content on electronic device B. If the display screen of electronic device B is larger than the display screen of electronic device A, the user can get a better viewing experience.

[0004] During the execution of distributed collaborative services, the sending device needs to encode the content to be synchronized at a certain bit rate and send the encoded content to be synchronized to the receiving device at a certain frame rate. Correspondingly, the receiving device also needs to receive and decode the content to be synchronized at the corresponding frame rate and bit rate to ensure the smoothness and clarity of the displayed image. As a result, the power consumption of electronic devices executing distributed collaborative services is relatively high, which increases the power consumption of the equipment. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a data transmission method and an electronic device. The technical solution provided by the present application is that a first electronic device transmits data to a second electronic device by buffering according to preset conditions, thereby effectively reducing data transmission power consumption.

[0006] In order to achieve the above technical objectives, this application provides the following technical solutions:

[0007] In a first aspect, a data transmission method is provided, which is applied to a first electronic device. The method includes: generating a first frame of data. When it is determined that a first cache duration and / or a first cache frame quantity is reached, sending cached multiple frames of data to a second electronic device, the multiple frames of data including the first frame of data. When it is determined that the first cache duration and / or the first cache frame quantity is not reached, caching the first frame of data.

[0008] In this way, the first electronic device uses the first cache duration and / or the first cache frame number to measure whether to cache and generate the first frame data or send the first frame data to the second electronic device. Thus, while implementing cache transmission, the first cache duration and / or the first cache frame number ensure the smoothness and clarity of the screen display of the second electronic device. While saving power consumption by caching and transmitting frame data, it does not affect the user's viewing experience.

[0009] According to the first aspect, after generating the first frame data, the method also includes: determining that the cache sending conditions are met, the cache sending conditions include one or more of the following: the second electronic device supports cache playback capabilities, the first network communication conditions are currently met, the first electronic device has not detected user operations, the second electronic device has not detected user operations, and the second electronic device is in cache playback mode.

[0010] Optionally, the first network communication condition is, for example, a strong network communication condition.

[0011] In some examples, after generating the first frame data, the first electronic device determines whether a buffer transmission condition is currently met, and performs buffer transmission if the buffer transmission condition is met.

[0012] In this way, the first electronic device performs buffer transmission according to the current transmission situation, thereby saving power consumption and preventing the buffer transmission from affecting the user's viewing experience.

[0013] According to the first aspect, or any implementation of the first aspect above, the sending of the first frame data is cache sending, and the method also includes: detecting a first operation of the user, stopping the cache sending or adjusting the cache sending parameters, and adjusting the cache sending parameters includes shortening the first cache duration to the second cache sending duration and / or reducing the first cache frame number to the second cache frame number.

[0014] In this way, during the buffer transmission process, the first electronic device can also adaptively adjust the transmission timing according to the user operation, thereby avoiding the impact on the touch delay of the transmitting end, or reducing the impact on the touch delay of the transmitting end device.

[0015] According to the first aspect, or any implementation of the first aspect above, the method further includes: sending a cache sending change notification to the second electronic device, the cache sending change notification being used to indicate that the first electronic device has stopped cache sending or has adjusted cache sending parameters.

[0016] In this way, when the transmission mode or buffer transmission parameters of the first electronic device change, the second electronic device is notified in time, and the occurrence of abnormal frame loss is avoided, thereby achieving transmission without frame loss.

[0017] According to the first aspect, or any implementation of the first aspect above, the sending of the first frame data is buffered sending, and the method further includes: receiving a buffered playback change notification sent by the second electronic device, the buffered playback change notification being used to instruct the second electronic device to stop buffered playback in response to the user's reverse control of the first electronic device. In response to the buffered playback change notification, the buffered transmission is stopped.

[0018] In this way, during the cache transmission process, the second electronic device will promptly feedback to the first electronic device after detecting the user operation, and the first electronic device can also adaptively adjust the transmission timing according to the user's reverse control operation, thereby avoiding the impact on the touch delay of the receiving device.

[0019] In addition, when the playback mode of the second electronic device changes, it notifies the first electronic device in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving display without frame loss.

[0020] According to the first aspect, or any implementation of the first aspect above, stopping buffer transmission includes: sending the generated frame data to the second electronic device frame by frame.

[0021] According to the first aspect, or any implementation method of the first aspect above, when it is determined that the first cache duration and / or the first cache frame number has been reached, multiple frames of cached data are sent to the second electronic device, including: in response to the first frame data, determining that the cached data sending cycle has been reached, and sending multiple frames of cached data to the second electronic device, wherein the length of the cached data sending cycle is equal to the first cache duration.

[0022] In some examples, the first electronic device periodically sends multiple frames of data cached in a current period to the second electronic device according to the first cache duration.

[0023] According to the first aspect, or any implementation of the first aspect above, when it is determined that the first cache duration and / or the first cache frame number has been reached, sending cached multi-frame data to the second electronic device includes: in response to the first frame data, determining that the time since the cache data was last cleared has reached the first cache duration. Sending the cached multi-frame data to the second electronic device, the multi-frame data being all the data cached by the first electronic device.

[0024] For example, the first electronic device maintains a data cache list of user cached data. After the data cache list is cleared, the state of the data cache list is empty. Then, after the first electronic device obtains new data at the Tmsth time and stores the data in the data cache list, the state of the data cache list changes from empty to non-empty. Then the Tms+zmsth time point is the cached data sending time point, and the first electronic device clears the data cache list again. Among them, zms is, for example, the first cache duration.

[0025] According to the first aspect, or any implementation of the first aspect above, when it is determined that the first cache duration and / or the first cache frame number is reached, sending cached multi-frame data to the second electronic device includes: determining that the first frame data is the Nth frame of data to be sent, N is equal to the first cache frame number, and N is a positive integer greater than 2. Sending the cached multi-frame data to the second electronic device, the multi-frame data being all the data cached by the first electronic device.

[0026] For example, after the first electronic device clears the data cache list, it receives new data and stores it in the data cache list. Afterwards, after determining that the data stored in the data cache list has reached the first cache frame number, the first electronic device can clear the data cache list again and send the data obtained by clearing the data cache list to the second electronic device.

[0027] According to the first aspect, or any implementation of the first aspect above, when it is determined that the first cache duration and / or the first cache frame number has been reached, sending cached multi-frame data to the second electronic device includes: in response to the first frame data, determining that the time since the cache data was last cleared has reached the first cache duration, or determining that the first frame data is the Nth frame of data to be sent, where N is equal to the first cache frame number. Sending cached multi-frame data to the second electronic device, the multi-frame data being all data cached by the first electronic device.

[0028] For example, take the first cache duration as 100ms and the first cache frame number as 8 frames. When the data cache list is empty, the first electronic device receives new data at Tms. From this time point, it waits for 100ms, or determines that the audio and video frames stored in the data cache list reach 8 frames, clears the audio and video frames in the data cache list, and sends them to the second electronic device. After that, the first electronic device starts again from the time point when the new data is obtained, and repeats the above process.

[0029] In this way, the first electronic device measures whether to send the cached multi-frame data to the second electronic device through the first cache duration and / or the first cache frame number, and while implementing the cache transmission, the first cache duration and / or the first cache frame number ensure the smoothness and clarity of the screen display of the second electronic device. While saving power consumption, it does not affect the user's viewing experience.

[0030] According to the first aspect, or any implementation of the first aspect above, before generating the first frame data, the method further includes: sending first information to the second electronic device, the first information being used to indicate that the first electronic device supports cache transmission capability. Receiving second information sent by the second electronic device, the second information being used to indicate that the second electronic device supports cache playback capability.

[0031] In some embodiments, before generating the first frame data, the first electronic device also negotiates cache capacity with the second electronic device to determine whether the first electronic device and the second electronic device have cache transmission capabilities.

[0032] According to the first aspect, or any implementation of the first aspect above, sending the cached multiple frames of data to the second electronic device includes: sending the packaged multiple frames of data to the second electronic device.

[0033] For example, when the first electronic device determines that it needs to send the cached multi-frame data, it packages the cached multi-frame data and sends it to the second electronic device. Optionally, the packaged multi-frame data also carries the timestamp of each frame of data being sent out, or the packaged multi-frame data also carries the time interval between the two frames of data being sent out.

[0034] In a second aspect, a data transmission method is provided, which is applied to a second electronic device. The method includes: receiving multi-frame data sent by a first electronic device, where the multi-frame data is data sent by the first electronic device when it is determined that a first cache duration and / or a first cache frame quantity has been reached. Cache the multi-frame data. Display the multi-frame data frame by frame according to a frame output time interval of the multi-frame data.

[0035] In some embodiments, after receiving the multi-frame data sent by the first electronic device, the second electronic device caches the multi-frame data so as to subsequently display the multi-frame data in a cached playback mode.

[0036] According to a second aspect, the playback of the multi-frame data is cache playback, and the method further includes: detecting an operation of a user instructing to reversely control the first electronic device. Stopping cache playback. Sending a cache playback change notification to the first electronic device, the cache playback change notification is used to indicate that the second electronic device has stopped cache playback.

[0037] According to the second aspect, or any implementation of the second aspect above, the playback of the multi-frame data is cache playback, and the method includes: receiving a cache transmission change notification sent by a first electronic device. When the cache transmission change notification indicates that the first electronic device has stopped cache transmission, stop the cache playback. When the cache transmission change notification indicates that the first cache duration is shortened to the second cache transmission duration and / or the first cache frame number is reduced to the second cache frame number, adjust the cache threshold.

[0038] According to the second aspect, or any implementation of the second aspect above, the method further includes: determining that the cached data is greater than a cache threshold, adjusting a display time interval of historical data in the cached data that exceeds the cache threshold, or discarding historical data in the cached data that exceeds the cache threshold, wherein the adjusted display time interval of the historical data is less than a frame output time interval of the historical data.

[0039] According to the second aspect, or any implementation of the second aspect, the cache threshold is greater than the first cache duration and / or the first cache frame quantity.

[0040] In some examples, the second electronic device determines that the cached data is greater than the cache threshold. Then, the second electronic device adjusts the display time interval of the historical data in the cached data that exceeds the cache threshold, or discards the historical data in the cached data that exceeds the cache threshold. The adjusted display time interval of the historical data is less than the frame output time interval of the historical data.

[0041] Exemplarily, the cache threshold is the cache interval time, which is greater than the first cache time. For example, the first cache time is 100ms, and the cache interval time is 120ms. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the frame time of the latest audio and video frame in the cache list is frame time 1, and the historical audio and video frames that have not been displayed include some audio and video frames whose time difference between the frame time and the frame time 1 is greater than the cache interval time. Then, the second electronic device determines that these audio and video frames need to be processed faster.

[0042] Another exemplary embodiment is that the cache threshold is the number of cache frames, which is greater than the first number of cache frames. For example, the first number of cache frames is 8 frames, and the number of cache frames is 10 frames. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the number of audio and video frames cached in the current cache list is greater than the number of cache frames, and the excess number is the first number. Then, the second electronic device determines the first number of audio and video frames that precede the frame output as historical audio and video frames that need to be processed faster based on the frame output time of the audio and video frames cached in the cache list. Afterwards, the second electronic device can speed up the processing of the first number of audio and video frames through the above-mentioned fast broadcast method or frame loss method.

[0043] In this way, by setting the cache threshold, when an abnormal situation occurs, the timeliness of the second electronic device sending and displaying can be guaranteed, thereby improving the user experience.

[0044] According to the second aspect, or any implementation of the second aspect above, before receiving the multi-frame data sent by the first electronic device, the method further includes: receiving first information sent by the first electronic device, the first information is used to indicate that the first electronic device supports cache transmission capability. Sending second information to the first electronic device, the second information is used to indicate that the second electronic device supports cache playback capability.

[0045] In a third aspect, a first electronic device is provided. The first electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the first electronic device executes: generating a first frame of data. When it is determined that the first cache duration and / or the first cache frame quantity is reached, multiple frames of cached data are sent to the second electronic device, and the multiple frames of data include the first frame of data. When it is determined that the first cache duration and / or the first cache frame quantity is not reached, the first frame of data is cached.

[0046] According to the third aspect, after generating the first frame data, when the processor reads computer instructions from the memory, it also enables the first electronic device to execute: determining that the cache sending conditions are met, the cache sending conditions include one or more of the following: the second electronic device supports cache playback capabilities, the first network communication conditions are currently met, the first electronic device has not detected user operations, the second electronic device has not detected user operations, and the second electronic device is in cache playback mode.

[0047] According to the third aspect, or any implementation method of the third aspect above, the first frame data is sent as cache sending, and when the processor reads the computer instructions from the memory, it also enables the first electronic device to execute: detecting the user's first operation, stopping the cache sending or adjusting the cache sending parameters, and adjusting the cache sending parameters includes shortening the first cache duration to the second cache sending duration and / or reducing the first cache frame number to the second cache frame number.

[0048] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from the memory, it also enables the first electronic device to execute: sending a cache sending change notification to the second electronic device, and the cache sending change notification is used to indicate that the first electronic device has stopped cache sending or has adjusted cache sending parameters.

[0049] According to the third aspect, or any implementation of the third aspect above, the sending of the first frame data is cache sending, and when the processor reads the computer instruction from the memory, it also causes the first electronic device to execute: receiving a cache playback change notification sent by the second electronic device, the cache playback change notification is used to instruct the second electronic device to stop cache playback in response to the user's reverse control of the first electronic device. In response to the cache playback change notification, stop cache transmission.

[0050] According to the third aspect, or any implementation of the third aspect, stopping buffer transmission includes: sending the generated frame data to the second electronic device frame by frame.

[0051] According to the third aspect, or any implementation method of the third aspect above, when it is determined that the first cache duration and / or the first cache frame number is reached, multiple frames of cached data are sent to the second electronic device, including: in response to the first frame data, determining that the cache data sending cycle is currently reached, and sending multiple frames of cached data to the second electronic device, and the length of the cache data sending cycle is equal to the first cache duration.

[0052] According to the third aspect, or any implementation of the third aspect above, when it is determined that the first cache duration and / or the first cache frame number has been reached, sending cached multi-frame data to the second electronic device includes: in response to the first frame data, determining that the time since the cache data was last cleared has reached the first cache duration. Sending the cached multi-frame data to the second electronic device, the multi-frame data being all the data cached by the first electronic device.

[0053] According to the third aspect, or any implementation of the third aspect above, when it is determined that the first cache duration and / or the first cache frame number is reached, sending cached multi-frame data to the second electronic device includes: determining that the first frame data is the Nth frame of data to be sent, N is equal to the first cache frame number, and N is a positive integer greater than 2. Sending the cached multi-frame data to the second electronic device, the multi-frame data being all the data cached by the first electronic device.

[0054] According to the third aspect, or any implementation of the third aspect above, when it is determined that the first cache duration and / or the first cache frame number has been reached, sending cached multi-frame data to the second electronic device includes: in response to the first frame data, determining that the time since the cache data was last cleared has reached the first cache duration, or determining that the first frame data is the Nth frame of data to be sent, where N is equal to the first cache frame number. Sending cached multi-frame data to the second electronic device, the multi-frame data being all data cached by the first electronic device.

[0055] According to the third aspect, or any implementation of the third aspect above, when the processor reads the computer instruction from the memory, the first electronic device is also caused to execute: sending first information to the second electronic device, the first information is used to indicate that the first electronic device supports the cache transmission capability. Receive second information sent by the second electronic device, the second information is used to indicate that the second electronic device supports the cache playback capability.

[0056] According to the third aspect, or any implementation of the third aspect, sending the cached multiple frames of data to the second electronic device includes: sending the packaged multiple frames of data to the second electronic device.

[0057] In a fourth aspect, a second electronic device is provided. The second electronic device includes: a processor, a memory and a display screen, the memory and the display screen are coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the second electronic device executes: receiving multi-frame data sent by the first electronic device, the multi-frame data is the data sent by the first electronic device when it is determined that the first cache duration and / or the first cache frame number has been reached. Cache the multi-frame data. Display the multi-frame data frame by frame according to the frame output time interval of the multi-frame data.

[0058] According to a fourth aspect, the playback of the multi-frame data is cache playback, and when the processor reads the computer instruction from the memory, the second electronic device is also caused to execute: detecting the operation of the user instructing to reversely control the first electronic device. Stop cache playback. Send a cache playback change notification to the first electronic device, and the cache playback change notification is used to indicate that the second electronic device has stopped cache playback.

[0059] According to the fourth aspect, or any implementation of the fourth aspect above, the playback of the multi-frame data is cache playback, and when the processor reads the computer instruction from the memory, the second electronic device is also caused to execute: receiving a cache transmission change notification sent by the first electronic device. When the cache transmission change notification indicates that the first electronic device has stopped cache transmission, the cache playback is stopped. When the cache transmission change notification indicates that the first cache duration is shortened to the second cache transmission duration and / or the first cache frame number is reduced to the second cache frame number, the cache threshold is adjusted.

[0060] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads the computer instruction from the memory, the second electronic device is also caused to execute: determining that the cached data is greater than the cache threshold. Adjusting the display time interval of the historical data in the cached data that exceeds the cache threshold, or discarding the historical data in the cached data that exceeds the cache threshold, wherein the adjusted display time interval of the historical data is less than the frame output time interval of the historical data.

[0061] According to the fourth aspect, or any implementation of the fourth aspect, the cache threshold is greater than the first cache duration and / or the first cache frame quantity.

[0062] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads the computer instruction from the memory, the second electronic device is also caused to execute: receiving first information sent by the first electronic device, the first information is used to indicate that the first electronic device supports cache transmission capability. Sending second information to the first electronic device, the second information is used to indicate that the second electronic device supports cache playback capability.

[0063] In a fifth aspect, an electronic device is provided, which has the function of implementing the data transmission method described in the first aspect and any possible implementation thereof; or, the electronic device has the function of implementing the data transmission method described in the second aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0064] In a sixth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by an electronic device, the electronic device executes the method of the first aspect or any one of the implementations of the first aspect; or the electronic device executes the method of the second aspect or any one of the implementations of the second aspect.

[0065] In the seventh aspect, a computer program product is provided. When the computer program product runs on an electronic device, it enables the electronic device to execute the method of the first aspect or any one of the embodiments of the first aspect; or, it enables the electronic device to execute the method of the second aspect or any one of the embodiments of the second aspect.

[0066] In an eighth aspect, a circuit system is provided, the circuit system comprising a processing circuit, the processing circuit being configured to execute the method of the first aspect or any one of the embodiments of the first aspect; or, the processing circuit being configured to execute the method of the second aspect or any one of the embodiments of the second aspect.

[0067] In the ninth aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the method in the first aspect or any one of the embodiments of the first aspect; and the at least one processor executes the method in the second aspect or any one of the embodiments of the second aspect.

[0068] The technical effects of the aforementioned aspects can be referenced to each other and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A schematic diagram of a multi-screen collaboration scenario provided in an embodiment of the present application;

[0070] Figure 2 A schematic diagram of a super desktop scene provided in an embodiment of the present application;

[0071] Figure 3 A schematic diagram of a screen projection scenario provided in an embodiment of the present application;

[0072] Figure 4A schematic diagram of module interaction during data transmission provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of a communication system to which the data transmission method provided in an embodiment of the present application is applied;

[0074] Figure 6 A schematic diagram of the hardware structure of a first electronic device provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of a software structure block diagram of a first electronic device provided in an embodiment of the present application;

[0076] Figure 8 Schematic diagram of the data transmission method provided in the embodiment of the present application Figure 1 ;

[0077] Fig. 9 A schematic diagram of module interaction during cache transmission provided in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of the cache transmission effect provided in an embodiment of the present application;

[0079] Fig.11 Schematic diagram of the data transmission method provided in the embodiment of the present application Figure 2 ;

[0080] Fig.12 Schematic diagram of the data transmission method provided in the embodiment of the present application Figure 3 ;

[0081] Fig.13 Schematic diagram of the data transmission method provided in the embodiment of the present application Figure 4 ;

[0082] Fig.14 Schematic diagram of the data transmission method provided in the embodiment of the present application Figure 5 ;

[0083] Fig.15 A schematic diagram of the structure of a first electronic device provided in an embodiment of the present application;

[0084] Fig.16 A schematic diagram of the structure of a second electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0085] The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary 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 or more (including two).

[0086] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0087] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0088] In some embodiments, the distributed collaborative service includes multi-screen collaboration, screen projection, super desktop, Hicar, etc. Through the distributed collaborative service, different electronic devices can achieve collaboration, thereby helping users to obtain better device usage effects.

[0089] For example, Figure 1In the multi-screen collaboration scenario shown, a multi-screen collaboration connection is established between the laptop computer 101 and the mobile phone 102, and a window 11 is displayed in the mobile phone 101, which is used to display the interface of the mobile phone 102. In this way, the user can operate the content in the mobile phone 102 on the laptop computer 101 with a larger display screen. For example, in response to the user's editing operation in the window 101, the laptop 101 can send the edited content to the mobile phone 102, thereby ensuring the consistency of the data of the multi-terminal devices, and the user can view the latest edited content on the mobile phone 102 side later.

[0090] As another example, Figure 2 In the super desktop scenario shown, there are fewer applications configured in the smart screen 103, which may not meet the user's usage needs. Therefore, the mobile phone 102 and the smart screen 103 can directly project the applications installed in the mobile phone 102 to the smart screen 103 for display through the super desktop function, and the smart screen 103 can directly operate the applications installed in the mobile phone 102. For example, based on the video applications, news applications, fitness applications, etc. in the mobile phone 102, users can watch short videos, read news, watch fitness courses, etc. directly on the smart screen 103. In addition, based on the super desktop function, the smart screen 103 can also directly call the hardware capabilities of the mobile phone 102, such as calling the speakers, microphones, cameras, etc. of the mobile phone 102.

[0091] For example, Figure 3 In the screen projection scenario shown, the mobile phone 102 can project the video being played and other files to the smart screen 103 (or other large-screen devices) for display in response to user operations, thereby providing the user with a larger screen display effect.

[0092] Among them, Figure 4 As shown, during the execution of various distributed collaborative services in the above examples, the sending device needs to encode the content to be synchronized at a certain bit rate. After that, the sending device negotiates with the opposite device according to the communication protocol, and sends the encoded content to be synchronized to the receiving device at a certain frame rate. Correspondingly, the receiving device also needs to receive and decode the content to be synchronized according to the corresponding frame rate and bit rate to ensure the smoothness and clarity of the displayed image. Among them, communication protocols include transmission control protocol (TCP), user datagram protocol (UDP), etc. Transmission methods include wireless fidelity (Wi-Fi) transmission, Bluetooth transmission, etc. As a result, the power consumption of electronic devices executing distributed collaborative services is relatively high, which increases the power consumption of the equipment.

[0093] In this regard, some solutions reduce power consumption by reducing the transmission frame rate and / or bit rate. For example, the transmitting device reduces the video frame rate from 60 frames per second (FPS) to 45fps or lower (such as 30fps). For another example, the transmitting device reduces the video bit rate from 5 megabits per second (Mbps) to 3Mbps or lower (such as 1Mbps).

[0094] However, the reduction of frame rate will lead to the reduction of picture smoothness, and the reduction of bit rate will lead to the reduction of picture clarity. Therefore, sacrificing frame rate and bit rate to save power consumption will affect the user's viewing experience.

[0095] Therefore, the embodiment of the present application provides a data transmission method, in which a first electronic device transmits data to a second electronic device by buffering and sending according to preset conditions, thereby effectively reducing data transmission power consumption and not affecting the user's viewing experience.

[0096] Figure 5 Schematic diagram of a communication system to which the data transmission method provided in the embodiment of the present application is applied. Figure 5 As shown, the communication system includes a first electronic device 100 and a second electronic device 200 .

[0097] Optionally, the first electronic device 100 or the second electronic device 200 may be, for example, a mobile phone, a tablet computer, a laptop computer, a smart screen, a wearable device, a vehicle terminal, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device or other terminal device, and the operating system installed in the first electronic device 100 or the second electronic device 200 includes but is not limited to Or other operating systems, or the first electronic device 100 or the second electronic device 200 does not have an operating system installed. This application does not limit the specific type of the first electronic device 100 or the second electronic device 200, whether an operating system is installed, and the installed operating system.

[0098] In some embodiments, a wired communication connection or a wireless communication connection is established between the first electronic device 100 and the second electronic device 200. The manner of establishing the wired communication connection includes but is not limited to at least one of the following: a universal serial bus (USB) interface connection, or other video interface connection.

[0099] Optionally, the wireless communication technology for establishing the wireless communication connection includes but is not limited to at least one of the following: wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT) (for example, traditional Bluetooth or bluetooth low energy (BLE) Bluetooth), ultra wide band (UWB), near field communication (NFC), Zigbee, frequency modulation (FM), infrared (IR), etc.

[0100] Optionally, the first electronic device 100 and the second electronic device 200 may also establish a communication connection through a third-party device in the local area network, such as a router, a gateway, a smart device controller, a server, etc.

[0101] In some embodiments, after the first electronic device 100 and the second electronic device 200 establish a communication connection, the first electronic device 100 is, for example, a sending device, and the second electronic device 200 is, for example, a receiving device, and the first electronic device 100 sends data to be synchronized to the second electronic device 200. In some examples, the first electronic device 100 and / or the second electronic device 200 may receive a user operation, and after detecting the operation, may send an indication to the opposite device to inform the opposite device that the user operation is detected on this side.

[0102] Optionally, the first electronic device 100 and the second electronic device 200 in the embodiment of the present application may be implemented by the same or different devices, and the different devices may have the same, similar or somewhat different hardware structures, such as Figure 6 The hardware structure shown.

[0103] For example, the first electronic device 100 has Figure 6 Take the hardware structure shown in the figure as an example. Figure 6 The hardware structure shown is described.

[0104] like Figure 6As shown, the first electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, 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 sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0105] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0106] 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 processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0107] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0108] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0109] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.

[0110] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to a touch sensor, a charger, a flash, a camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to a touch sensor through an I2C interface, so that the processor 110 communicates with the touch sensor through the I2C bus interface to realize the touch function of the first electronic device 100.

[0111] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the first electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the first electronic device 100.

[0112] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the first electronic device 100, and can also be used to transfer data between the first electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0113] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0114] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the first electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0115] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0116] The wireless communication function of the first 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.

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

[0118] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the first 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.

[0119] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, 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 set in the same device as the mobile communication module 150 or other functional modules.

[0120] 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., applied on the first electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0121] In some embodiments, the antenna 1 of the first electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the first electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0122] The first electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0123] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-led, Micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the first electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0124] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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, the first electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0125] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0126] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the first electronic device 100 (such as audio data, a phone book, etc.), 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, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the first electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0127] 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 signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The first electronic device 100 can use the audio module 170, such as music playing, recording, etc. The audio module 170 can include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.

[0128] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0129] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The first electronic device 100 may receive key input and generate key signal input related to user settings and function control of the first electronic device 100.

[0130] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of display screen 194. Different application scenarios (for example: time reminder, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects.

[0131] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0132] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the first electronic device 100 by inserting or removing the SIM card interface 195. The first electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0133] The software system of the first electronic device 100 or the second electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the first electronic device 100 or the second electronic device 200.

[0134] Figure 7 It is a software structure block diagram of the first electronic device 100 of the embodiment of the present application. The second electronic device 200 may have the same, similar or somewhat different software structure.

[0135] 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, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0136] The application layer can include a series of application packages.

[0137] like Figure 7 As shown, the application package may include applications such as video, music, memo, sports health, clipboard, gallery, map, camera, video, etc.

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

[0139] like Figure 7 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0140] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0141] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0142] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0143] The phone manager is used to provide communication functions of the first electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0144] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0145] The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. The notification manager can also be a notification that appears in the system top status bar in the form of an icon or scroll bar text.

[0146] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0147] 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.

[0148] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0149] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0150] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0151] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

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

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

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

[0155] The following is an illustrative description of the workflow of the software and hardware of the first electronic device 100 and the second electronic device 200 in conjunction with a scenario of sending video data.

[0156] In the first electronic device 100, when the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation is the control of the video application icon as an example, the video application calls the interface of the application framework layer to start the video application. Afterwards, during the process of displaying the video application, the first electronic device 100 detects the user's touch operation on the screen projection control in the video application through the touch sensor, and determines to synchronously send the played video content to the second electronic device 200 where the user instructs the screen projection.

[0157] In some examples, in response to user operations, the first electronic device 100 determines the second electronic device 200 that the user instructs to cast the screen, and negotiates with the second electronic device 200 to establish a screen casting connection. In the process of establishing the screen casting connection, the first electronic device 100 can determine whether the second electronic device 200 supports the cached playback function, and can inform the second electronic device 200 whether it indicates the cached sending function. In the case where the first electronic device 100 supports the cached sending function, and the second electronic device 200 supports the cached playback function, the first electronic device 100 can cache the video frames to be sent and send the video frames according to a certain sending cycle. Accordingly, after receiving the video frame, the second electronic device 200 plays the video at a corresponding frame rate through the cached playback mode. Thereby, while ensuring that the playback effect does not affect the user's viewing effect, the data transmission frequency is reduced, thereby reducing the power consumption of the electronic device.

[0158] The following uses the first electronic device 100 as a transmitting device and the second electronic device 200 as a receiving device as an example to introduce the data transmission method provided in the embodiment of the present application in detail.

[0159] Figure 8 The flowchart of a data transmission method provided in the embodiment of the present application is shown in FIG. Figure 8 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0160] S801: A first electronic device negotiates cache transmission capabilities with a second electronic device.

[0161] In some embodiments, in response to a user operation, the first electronic device establishes a communication connection with the second electronic device. In the process of establishing the communication connection, or based on the established communication connection, the first electronic device and the second electronic device may exchange their respective capability information so that the opposite device can obtain the capability of the local device.

[0162] Optionally, the capability information includes information indicating whether the device supports cache transmission capability. For example, the capability information of the sending device is used to indicate whether the sending device supports cache transmission capability. The capability information of the receiving device is used to indicate whether the receiving device supports cache playback capability. In some examples, after establishing a collaborative connection, the first electronic device and the second electronic device can determine their identity as a sending device or a receiving device in the communication process; or, during the communication process, the first electronic device or the second electronic device can be both a sending device and a receiving device.

[0163] For example, Figure 1 In the multi-screen collaboration scenario shown, the laptop 101 establishes a multi-screen collaboration connection with the mobile phone 102 in response to user operations, wherein the mobile phone 102 can be used as a sending device and the laptop 101 can be used as a receiving device. Through the negotiation of cache transmission capability, the laptop 101 determines that the mobile phone 102 has the cache transmission capability, and can cache the image frames to be sent and send multiple image frames in batches; the mobile phone 102 determines that the laptop 101 has the cache playback capability, and can receive multiple audio and video frames in batches, and after caching the multiple audio and video frames, send them frame by frame at a certain time interval.

[0164] It should be understood that in the distributed collaboration process, the sending device sends video, audio, image and other content to the receiving device, and the receiving device displays and plays the video, audio, image and other content frame by frame. Among them, multiple video frames are sent and displayed to display the video; multiple audio frames are sent and displayed to play the audio; multiple image frames are sent and displayed to display the image. The embodiment of the present application takes the sending and display of audio and video frames as an example to introduce the data transmission process between devices.

[0165] S802: The first electronic device determines that a cache sending condition is currently met.

[0166] Among them, the cache sending conditions include one or more of the following: the second electronic device supports cache playback capability, the current network communication condition is strong, the first electronic device does not detect user operation, the second electronic device does not detect user operation, and the second electronic device is in cache playback mode.

[0167] Optionally, the strong network communication conditions include one or more of the following: the audio and video frame transmission delay is less than or equal to a preset delay threshold, the received signal strength indicator (RSSI) between devices is greater than or equal to a preset RSSI threshold, the Wi-Fi channel utilization is less than or equal to a preset channel utilization threshold, and the Wi-Fi transmission rate is greater than or equal to a preset transmission rate threshold.

[0168] Correspondingly, weak network communication conditions include one or more of the following: the audio and video frame transmission delay is greater than the preset delay threshold, the RSSI between devices is less than the preset RSSI threshold, the Wi-Fi channel utilization is greater than the preset channel utilization threshold, and the Wi-Fi transmission rate is less than the preset transmission rate threshold.

[0169] Optionally, the cache transmission principle includes caching the generated audio and video frames, and then sending the cached multiple audio and video frames to the opposite device according to a certain period or quantity value. The cache playback principle includes caching the acquired multiple audio and video frames, and then sending them for display at a certain time interval. It can be seen that since the first electronic device or the second electronic device detects the user operation, it is necessary to provide feedback on the user operation in a timely manner. Therefore, it is necessary to turn off the cache transmission, or adjust the cache transmission parameters. Then, when the first electronic device does not detect the user operation and / or the second electronic device does not detect the user operation, the cache transmission condition is met.

[0170] Optionally, the cached playback mode is used to instruct the second electronic device to cache the received audio and video frames, and after the number of cached audio and video frames reaches a preset number, send and display them frame by frame at a certain time interval. Therefore, after the first electronic device determines that the second electronic device has cached at least one frame of audio and video frames, it can determine that the second electronic device is in the cached playback mode and that the cached sending condition is currently met. For example, after the first electronic device generates a frame of audio and video frames, it sends the frame of audio and video frames to the second electronic device. Correspondingly, the second electronic device can also receive the audio and video frames sent by the first electronic device frame by frame. In this process, the second electronic device is in the cached playback mode, then the second electronic device will cache the received audio and video frames until the cached number reaches a preset number, and the second electronic device will send and display the cached audio and video frames frame by frame in the order received. Then, when the second electronic device is in the cached playback mode, the first electronic device can also cache and send audio and video frames.

[0171] In some embodiments, the first electronic device may determine different cache sending conditions according to whether the current distributed collaboration scenario is a delay-sensitive scenario.

[0172] Optionally, delay-sensitive scenarios include, for example, multi-screen collaboration scenarios, super desktop scenarios, and other scenarios with more reverse control of user operation instructions. Such as scenarios with more user operation inputs such as games and typing. In some examples, in delay-sensitive scenarios, the sending device and the receiving device need to provide timely feedback on user operations, and there should be no delay or the delay should be small between the screens of the sending device and the receiving device. For example, in a delay-sensitive scenario, the first electronic device determines whether the cached sending condition is met based on one or more of the following: the second electronic device supports cached playback capabilities, the current network communication condition is strong, the first electronic device does not detect user operations, and the second electronic device does not detect user operations.

[0173] For example, the first electronic device determines that the second electronic device supports cached playback capability, and does not receive indication information from the second electronic device within a preset time period, where the indication information is used to indicate an operation detected by the second electronic device for controlling the first electronic device. Then, in a delay-sensitive scenario, the first electronic device needs to provide timely feedback on user operations, so the first electronic device can determine that the cached transmission condition is currently met.

[0174] For another example, the first electronic device determines that the second electronic device supports cache playback capability and the current network communication condition is strong. Then, the current network communication condition is good, there is no delay or the delay is small, so even in a delay-sensitive scenario, the first electronic device can determine that the cache transmission condition is currently met.

[0175] Optionally, non-delay-sensitive scenarios include, for example, wireless screen projection scenarios, full-screen video playback scenarios in multi-screen collaboration scenarios, super desktop display scenarios, and other scenarios with less reverse control of user operation instructions. In some examples, in non-delay-sensitive scenarios, there may be a delay between the images of the transmitting device and the receiving device without affecting the user's perception. For example, in a non-delay-sensitive scenario, the first electronic device determines whether the cached sending condition is met based on the second electronic device being in cached playback mode.

[0176] For example, the first electronic device determines that the second electronic device is in a cache play mode. Then, the first electronic device may determine that the cache send condition is currently satisfied.

[0177] S803: The first electronic device sends a cache sending request to the second electronic device.

[0178] In some embodiments, after determining that the cache transmission condition is currently met, the first electronic device may send a cache transmission request to the second electronic device, and the cache transmission request is used to indicate to the second electronic device that the first electronic device needs to start cache transmission. Correspondingly, the second electronic device receives the cache transmission request sent by the first electronic device.

[0179] In some embodiments, the cache transmission request carries a cache transmission enable flag and a cache transmission duration. The cache transmission enable flag is used to indicate that subsequent audio and video frames are enabled to be cached and transmitted. The cache transmission duration is used to indicate that subsequent audio and video frames periodically transmit multiple cached audio and video frames at a time interval of the cache transmission duration.

[0180] In other embodiments, the cache transmission request carries a cache transmission enable flag and a cache transmission frame number threshold. The cache transmission enable flag is used to indicate that subsequent audio and video frames are enabled to be cached. The cache transmission frame number threshold is used to indicate that subsequent audio and video frames are cached according to the cache transmission frame number threshold. After the cached audio and video frames reach the cache transmission frame number threshold, the first electronic device sends the cached audio and video frames to the second electronic device.

[0181] In some other embodiments, the buffer sending request carries a buffer sending enable flag, a buffer sending duration, and a buffer sending frame number threshold.

[0182] In some embodiments, the first electronic device can adaptively adjust the buffer transmission time or buffer transmission frame number threshold. For example, the first electronic device adaptively adjusts the buffer transmission time or buffer transmission frame number threshold according to changes in communication conditions, changes in data processing conditions, etc.

[0183] S804: The second electronic device sends a cached response to the first electronic device.

[0184] In some embodiments, after receiving the cache sending request sent by the first electronic device, the second electronic device may determine that it is necessary to start cache playback, such as turning on the cache playback mode. Afterwards, the second electronic device may send a cache sending response to the first electronic device, and the cache sending response is used to indicate to the first electronic device that the second electronic device has received the cache sending request and can perform cache playback. Correspondingly, the first electronic device receives the cache sending response sent by the second electronic device.

[0185] S805: The first electronic device sends data to the second electronic device in a buffered sending mode.

[0186] In some embodiments, after receiving the cached transmission response sent by the second electronic device, the first electronic device may start the cached transmission mode. Afterwards, the first electronic device sends data to the second electronic device through the cached transmission mode. Optionally, in the cached transmission mode, the first electronic device caches and transmits the generated data according to the cached transmission time and / or the cached transmission frame number threshold.

[0187] For example, the first electronic device periodically sends data to the second electronic device according to the buffered transmission time. For example, the buffered transmission time is 1 millisecond (ms), and the first electronic device sends the data buffered in the time period between the time points to the second electronic device at the time points of 1ms, 2ms, 3ms, ... Nms.

[0188] For example, Fig. 9 As shown, in the process of displaying an application, the first electronic device, in response to a user operation, determines to establish a distributed collaborative connection with the second electronic device, and sends data to the second electronic device through a cached sending mode, the data including audio frames and / or video frames. Afterwards, after generating the data, the processing module 911 in the first electronic device determines that the sending cycle has not arrived, and can send the data to the storage module 912 for caching. Afterwards, when the first electronic device determines that the sending cycle has arrived, it can instruct the storage module 912 to send the cached data to the communication module 913. After receiving the data, the communication module 913 can encode the data and package the data and send it to the second electronic device in accordance with the UDP / TCP protocol.

[0189] For another example, the first electronic device maintains a data cache list of user cached data. After the data cache list is cleared, the state of the data cache list is empty. Then, after the first electronic device obtains new data at the Tmsth time and stores the data in the data cache list, the state of the data cache list changes from empty to non-empty. Then the Tms+zmsth time point is the cached data sending time point, and the first electronic device clears the data cache list again. Among them, zms is, for example, the data cache duration.

[0190] For example, Fig. 9 As shown, a data cache list is stored in the storage module 912 of the first electronic device. After the processing module 911 sends the generated data to the storage module 912, the storage module 912 stores the received data in the data cache list. Initially, the data cache list is empty, and then at the Ams, the storage module 912 receives the data sent by the processing module 911 and stores the data in the data cache list. Then at the Ams+zms, the storage module 912 determines that the cache data sending time point has been reached, and the cache data list can be cleared, and the cleared data is sent to the communication module 913 to send these data to the second electronic device. Later, at the Bms, the storage module 912 receives the data sent by the processing module 911 again, then at the Bms+zms, the storage module 912 determines that the cache data sending time point has been reached again, and the cache data list can be cleared, and the cleared data is sent to the communication module 913 to send these data to the second electronic device.

[0191] For another example, after the first electronic device clears the data cache list, it receives new data and stores it in the data cache list. Afterwards, after determining that the data stored in the data cache list reaches the cache transmission frame number threshold, the first electronic device can clear the data cache list again and send the data obtained by clearing the data cache list to the second electronic device.

[0192] For example, Fig. 9 As shown, a data cache list is stored in the storage module 912 of the first electronic device. After the processing module 911 sends the generated data to the storage module 912, the storage module 912 stores the received data in the data cache list. After determining that 8 frames of video frames have been saved in the data cache list, the storage module 912 can clear the data cache list and send the 8 frames of video frames to the communication module 913. That is, the cache sending frame number threshold is 8 frames. The communication module 913 encodes the 8 frames of video frames and packages them and sends them to the second electronic device. Afterwards, the storage module 912 continues to receive the video frames sent by the processing module 911, and when the number of video frames saved in the data cache list is 8 frames, the data cache list is cleared again, and the 8 frames of video frames cached this time are sent to the second electronic device through the communication module 913.

[0193] For another example, take the cache sending duration as 100ms and the cache sending frame number threshold as 8 frames. When the data cache list is empty, the first electronic device receives new data at the Tmsth time. From this time point, it is determined to wait for 100ms, or after determining that the audio and video frames stored in the data cache list have reached 8 frames, the audio and video frames in the data cache list are cleared and sent to the second electronic device. After that, the first electronic device starts again from the time point when the new data is obtained, and the above process is repeated.

[0194] For example, the buffer sending time is still 100ms and the buffer sending frame number threshold is 8 frames. Fig. 9 As shown, a data cache list is maintained in the storage module 912 in the first electronic device 100. At 0 ms, the data cache list is empty, the storage module 912 receives the video frame sent by the processing module 911, and saves the video frame to the data cache list. Afterwards, at 100 ms, the storage module 912 sends the 5 video frames cached in the data cache list to the communication module 913 to clear the data cache list. The communication module 913 sends the 5 video frames to the second electronic device. Afterwards, at 180 ms, the storage module 912 determines that 8 video frames have been cached in the data cache list, and the 8 video frames can be sent to the communication module 913 to clear the data cache list. The communication module 913 sends the 8 video frames to the second electronic device. That is, during the cache transmission process, after the first electronic device determines that at least one of the cache transmission duration or the cache transmission frame number threshold is met, the cached data can be sent to the second electronic device.

[0195] In some embodiments, the storage module used by the first electronic device to cache data is, for example, a random access memory (RAM), a read-only memory (ROM), etc., which can be used as a module for data storage.

[0196] In some embodiments, the above step S804 is an optional step, that is, after the first electronic device sends a cache sending request to the second electronic device, it can directly send data to the second electronic device through the cache sending mode without waiting for the cache sending response fed back by the second electronic device.

[0197] In some embodiments, the above steps S803 and S804 are optional steps. The first electronic device determines that the cached transmission condition is currently met by determining that the second electronic device is in the cached playback mode. Then, the first electronic device can determine that the second electronic device is ready for cached playback, so the first electronic device can directly send data to the second electronic device through the cached transmission mode, without having to send a cached transmission request to the second electronic device and wait for the second electronic device to respond to the cached transmission request.

[0198] S806: The second electronic device performs data processing in a cache playback mode.

[0199] In some embodiments, after receiving the data sent by the first electronic device, the second electronic device processes the data in a cache playback mode. For example, the second electronic device caches the received audio and video frames. Afterwards, the second electronic device decodes the data one by one at a certain time interval and sends them for display.

[0200] For example, Fig. 9 As shown, the second electronic device receives the audio and video frames sent by the first electronic device through the communication module 921. Afterwards, the communication module 921 sends the acquired audio and video frames to the processing module 922. Afterwards, the processing module 922 decodes these audio and video frames and sends them frame by frame to the display module 923 for display at a certain time interval.

[0201] In some examples, the data sent by the first electronic device to the second electronic device carries time interval information, where the time interval is used to indicate the time interval between two audio and video frames generated by the first electronic device.

[0202] For example, in a normal transmission process, the first electronic device sends audio and video frames to the second electronic device frame by frame, and the second electronic device displays the received audio and video frames in the order of the received audio and video frames. In the cache transmission process, after the first electronic device generates audio and video frames, it will not directly send the generated audio and video frames to the second electronic device, but will cache these audio and video frames, and then send the cached audio and video frames to the second electronic device according to the cache transmission duration and / or the cache transmission frame number threshold. For example, the first electronic device packages the cached video frame 1, video frame 2, and video frame 3 and sends them to the second electronic device. In order to prevent the second electronic device from displaying only the most recent video frame 3, the first electronic device carries time information in the transmitted video frame. Among them, the time information is, for example, an indication of the time interval between the current video frame and the previous video frame, or an indication of the timestamp of each video frame. For example, the data sent by the first electronic device to the second electronic device includes the frame out timestamp 1 of video frame 1 and video frame 1, the frame out timestamp 2 of video frame 2 and video frame 2, and the frame out timestamp 3 of video frame 3 and video frame 3. Then, after receiving the video frames, the second electronic device can display video frame 1, video frame 2, and video frame 3 frame by frame according to the time information, thereby ensuring the continuity of the video display.

[0203] For example, Fig.10 As shown in (a), the first electronic device sends audio packets and video packets to the second electronic device frame by frame at a period of 16ms, and receives an ACK signal fed back by the second electronic device. In this process, in order to ensure the frame rate and bit rate of audio and video transmission, the encoding and decoding power consumption and data transmission power consumption of the first electronic device and the second electronic device are relatively high. Fig.10As shown in (b), the first electronic device transmits data with the second electronic device by means of cache transmission. The first electronic device caches the generated audio and video frames, and after determining that the cache transmission time length and / or the cache transmission frame number threshold are met, it packages and sends the cached multiple audio and video frames to the second electronic device. In this way, during the data caching process, the encoding, decoding and data transmission frequency of the first electronic device and the second electronic device are reduced, and energy-saving time is obtained, thereby effectively reducing power consumption.

[0204] In some embodiments, a cache threshold is set in the second electronic device. When the second electronic device processes data in the cache playback mode, it speeds up the processing of historical data that exceeds the cache threshold, thereby avoiding the influence of too much historical data, resulting in delayed display and affecting the user's viewing experience.

[0205] For example, the first electronic device sends data to the second electronic device in a cached transmission mode. During the cached transmission process, due to the influence of network communication conditions, the data sent by the first electronic device may not reach the second electronic device in time. Then, there will be a data accumulation problem on the second electronic device side. For example, the cached transmission duration is 100ms, and the first electronic device sends 5 audio and video frames cached in the corresponding 100ms to the second electronic device every 100ms. Under normal circumstances, after the second electronic device sends the cached 5 audio and video frames frame by frame, it will receive new 5 audio and video frames, so that the electronic device will send the new 5 audio and video frames frame by frame. However, due to the influence of network communication conditions, the second electronic device failed to receive the new 5 audio and video frames in time. Then, in the subsequent process of receiving these 5 audio and video frames and sending them frame by frame, before the second electronic device has completed sending all the 5 audio and video frames, it will receive new 5 audio and video frames, resulting in the accumulation of audio and video frames. In addition, affected by network communication conditions, the accumulation of audio and video frames may be aggravated. Since the second electronic device displays each audio and video frame in sequence according to the frame output time order of the audio and video frames cached in the cache list, the accumulation of audio and video frames will cause the second electronic device to be unable to display new audio and video frames in time.

[0206] Based on the above problem, the second electronic device can speed up the processing of historical data according to the cache threshold when the data cached in the cache list exceeds the cache threshold. Optionally, the second electronic device speeds up the processing of historical data by fast broadcasting or frame dropping.

[0207] Exemplarily, the cache threshold is the cache interval duration, and the cache time interval is greater than the cache duration. For example, the cache duration is 100ms, and the cache interval duration is 120ms. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the frame time of the latest audio and video frame in the cache list is frame time 1, and the historical audio and video frames that have not been displayed include some audio and video frames whose time difference between the frame time and the frame time 1 is greater than the cache interval duration. Then, the second electronic device determines that these audio and video frames need to be processed faster.

[0208] For example, the second electronic device speeds up the processing of the audio and video frames by fast broadcasting, wherein in the process of processing the audio and video frames by fast broadcasting, the second electronic device sends and displays the audio and video frames at a time interval shorter than the frame output time interval of the audio and video frames.

[0209] For another example, the second electronic device speeds up the processing of these audio and video frames by dropping frames. In the process of processing the audio and video frames by dropping frames, the second electronic device discards these audio and video frames. That is, the historical audio and video frames that exceed the cache interval are no longer displayed, and the normal display of new audio and video frames is guaranteed. Alternatively, the second electronic device discards some of the audio and video frames.

[0210] Another exemplary embodiment is that the cache threshold is the number of cache frames, and the number of cache frames is greater than the cache sending frame threshold. For example, the cache sending frame threshold is 8 frames, and the number of cache frames is 10 frames. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the number of audio and video frames cached in the current cache list is greater than the number of cache frames, and the excess number is a first number. Then, the second electronic device determines the first number of audio and video frames that precede the frame output as historical audio and video frames that need to be processed faster based on the frame output time of the audio and video frames cached in the cache list. Afterwards, the second electronic device can speed up the processing of the first number of audio and video frames through the above-mentioned fast broadcast method or frame loss method.

[0211] In some examples, the second electronic device may set a cache threshold according to the cache transmission parameter. For example, the difference between the cache threshold and the cache transmission parameter is less than or equal to the preset threshold. For example, if the preset threshold is 20ms and the cache duration is 100ms, then the second electronic device determines that the cache threshold is 120ms. Alternatively, if the preset threshold is 2 frames and the cache transmission frame number threshold is 8 frames, then the second electronic device determines that the cache threshold is 10 frames.

[0212] In this way, by setting the cache threshold, when an abnormal situation occurs, the timeliness of the second electronic device sending and displaying can be guaranteed, thereby improving the user experience.

[0213] In some scenarios, the first electronic device detects a user operation. In order to provide timely feedback to the user operation, the first electronic device needs to turn off the cache transmission mode or reduce the time interval for cache transmission.

[0214] Optionally, Fig.11 This is a flow chart of another data transmission method provided in an embodiment of the present application. It should be noted that this method does not Fig.11 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0215] S1101. In response to a user operation, the first electronic device turns off a cache transmission mode or adjusts cache transmission parameters.

[0216] In some embodiments, during the cache transmission process, the first electronic device may detect a user operation, which may be an operation to instruct to refresh the displayed content, and the first electronic device needs to refresh the display of the second electronic device in a timely manner. Therefore, the first electronic device needs to turn off the cache transmission mode to achieve timely transmission of the audio and video frames of the generated new display content to the second electronic device, so as to avoid untimely data transmission due to data caching, which affects the user's perception. Alternatively, the first electronic device may also adjust the cache transmission parameters, such as reducing the cache transmission duration, or reducing the cache transmission frame number threshold, thereby reducing the cache transmission time interval. Compared with the original cache transmission time interval, it is also possible to send the generated audio and video frames of the new display content to the second electronic device in a timely manner.

[0217] For example, after detecting a user operation, the first electronic device determines that the current scenario is delay-sensitive and can determine to turn off the cache transmission mode, thereby avoiding increasing the data transmission delay in the delay-sensitive scenario and sending the response to the user operation to the second electronic device in a timely manner.

[0218] For another example, after detecting a user operation, the first electronic device determines that the current scenario is not delay-sensitive and can adjust the buffer transmission parameters, thereby reducing power consumption while avoiding increasing the data transmission delay in the non-delay-sensitive scenario.

[0219] S1102: The first electronic device sends a cache change notification to the second electronic device.

[0220] In some embodiments, the cache transmission change notification is used to indicate that the first electronic device has turned off the cache transmission mode.

[0221] In other embodiments, the buffer transmission change notification is used to indicate that the first electronic device has adjusted the buffer transmission parameters. In addition, the buffer transmission change notification carries the adjusted buffer transmission parameters, such as the adjusted buffer duration and / or buffer transmission frame number threshold.

[0222] S1103: The second electronic device turns off the cache playback mode, or adjusts cache playback parameters.

[0223] In some embodiments, the second electronic device receives a cache transmission change notification sent by the first electronic device. When the cache transmission change notification is used to indicate that the first electronic device has turned off the cache transmission mode, the second electronic device may also turn off the cache playback mode accordingly to ensure the consistency of the screens of the transmitting device and the receiving device. Alternatively, when the cache transmission change notification is used to indicate that the first electronic device has adjusted the cache transmission parameters, the second electronic device may adjust the cache playback parameters of the second electronic device according to the changes in the cache transmission parameters of the first electronic device to ensure the subsequent normal display of the second electronic device.

[0224] In some embodiments, after the second electronic device turns off the cache play mode, if there is still data in the cache list, it is necessary to accelerate the processing of these data. Optionally, as described above, the accelerated processing method includes, for example, a fast play method or a frame drop method.

[0225] In other embodiments, the second electronic device adjusts the cache playback parameters including adjusting the cache threshold. For example, the original cache duration of the first electronic device is 100ms. Correspondingly, the cache threshold of the second electronic device is 120ms. Subsequently, in response to user operation, the first electronic device adjusts the cache duration to 50ms. Then, correspondingly, the second electronic device adjusts the cache threshold to 80ms. In some embodiments, after the second electronic device turns off the cache playback mode or adjusts the cache playback parameters, it can send a feedback message to the first electronic device to indicate to the first electronic device that the second electronic device has made corresponding adjustments.

[0226] Afterwards, the first electronic device and the second electronic device may perform data transmission according to the normal transmission mode, or perform data transmission according to the adjusted cache transmission parameters.

[0227] In this way, during the buffer transmission process, the first electronic device can also adaptively adjust the transmission timing according to the user operation, thereby avoiding the impact on the touch delay of the transmitting end, or reducing the impact on the touch delay of the transmitting end device.

[0228] In addition, when the transmission mode or cache transmission parameters of the first electronic device change, the second electronic device is notified in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving transmission without frame loss.

[0229] In some embodiments, after detecting a preset user operation, the first electronic device may not adjust the cache sending parameters. For example, the first electronic device determines that the current scene is a screen projection scene, and the screen projection scene is a non-delay sensitive scene. The first electronic device detects the user operation and determines that the user operation is an operation to indicate switching to play the next episode of the video. The first electronic device can determine that the operation is a preset operation and does not need to adjust the cache sending parameters. Among them, in the video projection scene, not timely feedback on the operation of switching to play the next episode of the video will not affect the user's video viewing experience, and can reduce the power consumption of video transmission.

[0230] In some embodiments, the above step S1102 is an optional step, and the first electronic device does not need to separately notify the second electronic device after turning off the cache transmission mode or adjusting the cache transmission parameters. Optionally, the first electronic device can directly send data to the second electronic device according to the adjusted transmission mode or parameters. Accordingly, after receiving the data, the second electronic device can determine that the cache transmission mode or cache transmission parameters of the first electronic device have changed according to the change in the data transmission frequency, and can also adaptively adjust the cache playback mode or cache playback parameters.

[0231] In some scenarios, the second electronic device detects a user operation and needs to promptly notify the first electronic device in order to provide timely feedback on the user operation so that the first electronic device turns off the cache transmission mode.

[0232] Optionally, Fig.12 This is a flow chart of another data transmission method provided in an embodiment of the present application. It should be noted that this method does not Fig.12 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0233] S1201: In response to a user operation, the second electronic device turns off a cache playback mode.

[0234] In some embodiments, during the cache transmission process, the second electronic device may detect a user operation, which may be an operation to instruct to refresh the displayed content. The second electronic device needs to promptly notify the first electronic device to refresh the display of the second electronic device. Therefore, the second electronic device needs to turn off the cache transmission mode to promptly feedback the user operation to the first electronic device to avoid the user waiting.

[0235] Whether in a delay-sensitive scenario or a delay-insensitive scenario, if the second electronic device detects a user operation during the display process, it means that the user needs to obtain display feedback in a timely manner. Therefore, the second electronic device can directly turn off the cache playback mode.

[0236] In some embodiments, after the second electronic device turns off the cache play mode, if there is still data in the cache list, it is necessary to accelerate the processing of these data. Optionally, as described above, the accelerated processing method includes, for example, a fast play method or a frame drop method.

[0237] S1202: The second electronic device sends a buffer play change notification to the first electronic device.

[0238] In some embodiments, the second electronic device sends a buffered play change notification to the first electronic device, the buffered play change notification being used to indicate that the first electronic device has turned off the buffered play mode. Correspondingly, the first electronic device receives the buffered play change notification sent by the second electronic device.

[0239] S1203: The first electronic device turns off the cache sending mode.

[0240] In some embodiments, after the first electronic device receives the cache playback change notification sent by the second electronic device, the first electronic device may also turn off the cache transmission mode accordingly to ensure the consistency of the screens of the transmitting device and the receiving device.

[0241] In some embodiments, after the first electronic device turns off the cache transmission mode, it can send a feedback message to the second electronic device to indicate to the second electronic device that the first electronic device has made corresponding adjustments.

[0242] Afterwards, data can be transmitted between the first electronic device and the second electronic device in a normal transmission mode.

[0243] In this way, during the cache transmission process, the second electronic device will promptly feedback to the first electronic device after detecting the user operation, and the first electronic device can also adaptively adjust the transmission timing according to the user's reverse control operation, thereby avoiding the impact on the touch delay of the receiving device.

[0244] In addition, when the playback mode of the second electronic device changes, it notifies the first electronic device in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving display without frame loss.

[0245] In some embodiments, after detecting the user operation, the second electronic device can also reduce the touch delay by adjusting the cache playback parameters. Correspondingly, the first electronic device can also adjust the cache transmission parameters. In this way, the first electronic device and the second electronic device reduce the impact of the touch delay on the receiving end by adjusting the cache transmission parameters.

[0246] In some embodiments, during the cache transmission process, a user operation detected on the first electronic device or the second electronic device is obtained, and the first electronic device determines that the cache transmission condition is not currently met, and can stop the cache transmission, or change the cache transmission parameters. Afterwards, after a preset time, if the first electronic device no longer obtains the user operation detected on the first electronic device or the second electronic device, it can be determined that the cache transmission condition is met, and cache transmission is performed again, or the original cache transmission parameters are adjusted.

[0247] Alternatively, during the cache transmission process of a single execution of a distributed service, after the first electronic device obtains a preset number of user operations detected on the first electronic device or the second electronic device, it no longer performs cache transmission. For example, during the cache transmission process in a multi-screen collaborative scenario, after the first electronic device obtains the user operations detected on the second electronic device, in the subsequent multi-screen collaborative transmission process, the first electronic device and the second electronic device no longer perform cache transmission.

[0248] In this way, the first electronic device adaptively adjusts the cache transmission process to reduce power consumption while more flexibly meeting the user's usage needs.

[0249] In some scenarios, the first electronic device determines that the current communication condition changes to a weak network communication condition. To ensure smooth display, it is necessary to turn off the cache transmission mode or reduce the cache transmission time interval.

[0250] Optionally, Fig.13 This is a flow chart of another data transmission method provided in an embodiment of the present application. It should be noted that this method does not Fig.13 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0251] S1301: The first electronic device determines that the current network communication condition is weak, and turns off the cache transmission mode or adjusts the cache transmission parameters.

[0252] In some embodiments, during the cache transmission process, the first electronic device determines that the current communication condition switches from a strong network communication condition to a weak network communication condition. Then, the first electronic device may determine that the cache transmission needs to be adjusted to avoid the risk of transmission jams and failures due to excessively long cache time under poor transmission conditions.

[0253] Optionally, the weak network communication conditions include one or more of the following: the audio and video frame transmission delay is greater than a preset delay threshold, the RSSI between devices is less than a preset RSSI threshold, the Wi-Fi channel utilization is greater than a preset channel utilization threshold, and the Wi-Fi transmission rate is less than a preset transmission rate threshold.

[0254] Optionally, the first electronic device may adjust the buffer sending by turning off the buffer sending mode or adjusting the buffer sending parameters.

[0255] S1302: The first electronic device sends a cache change notification to the second electronic device.

[0256] In some embodiments, the cache transmission change notification is used to indicate that the first electronic device has turned off the cache transmission mode.

[0257] In other embodiments, the buffer transmission change notification is used to indicate that the first electronic device has adjusted the buffer transmission parameters. In addition, the buffer transmission change notification carries the adjusted buffer transmission parameters, such as the adjusted buffer duration and / or buffer transmission frame number threshold.

[0258] S1303: The second electronic device turns off the cache playback mode, or adjusts cache playback parameters.

[0259] In some embodiments, the second electronic device receives a cache transmission change notification sent by the first electronic device. When the cache transmission change notification is used to indicate that the first electronic device has turned off the cache transmission mode, the second electronic device may also turn off the cache playback mode accordingly to ensure the consistency of the screens of the transmitting device and the receiving device. Alternatively, when the cache transmission change notification is used to indicate that the first electronic device has adjusted the cache transmission parameters, the second electronic device may adjust the cache playback parameters of the second electronic device according to the changes in the cache transmission parameters of the first electronic device to ensure the subsequent normal display of the second electronic device.

[0260] In some embodiments, after the second electronic device turns off the cached playback mode or adjusts the cached playback parameters, it can send a feedback message to the first electronic device to indicate to the first electronic device that the second electronic device has made corresponding adjustments.

[0261] Afterwards, the first electronic device and the second electronic device may perform data transmission according to the normal transmission mode, or perform data transmission according to the adjusted cache transmission parameters.

[0262] In this way, during the buffer transmission process, the first electronic device can also adaptively adjust the transmission timing according to changes in communication conditions, thereby avoiding or reducing the impact of changes in communication conditions.

[0263] In addition, when the transmission mode or cache transmission parameters of the first electronic device change, the second electronic device is notified in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving transmission without frame loss.

[0264] In some embodiments, the above step S1302 is an optional step, and the first electronic device does not need to separately notify the second electronic device after turning off the cache transmission mode or adjusting the cache transmission parameters. Optionally, the first electronic device can directly send data to the second electronic device according to the adjusted transmission mode or parameters. Accordingly, after receiving the data, the second electronic device can determine that the transmission mode or parameters of the first electronic device have changed according to the change in the data transmission frequency, and can also adaptively adjust the playback mode or parameters.

[0265] Optionally, Fig.14 The flowchart of another data transmission method provided in the embodiment of the present application is shown in FIG. Fig.14 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0266] S1401: A first electronic device generates a first frame of data.

[0267] The first frame data may be, for example, audio frame data, video frame data, audio and video frame data, etc.

[0268] In some embodiments, the first electronic device draws and renders the frame data according to the bit rate and frame rate requirements, wherein the frame rate affects the smoothness of the screen display, and the bit rate affects the clarity of the screen display.

[0269] S1402: The first electronic device determines that the first buffering time length and / or the first buffering frame quantity has been reached. If so, execute step S1403; if not, execute step S1404.

[0270] S1403: The first electronic device sends cached multiple frames of data to the second electronic device, where the multiple frames of data include the first frame of data.

[0271] S1404: The first electronic device buffers the first frame data.

[0272] In some embodiments, the first electronic device sends frame data to the second electronic device through a cache transmission mode. Optionally, in the cache transmission mode, the first electronic device caches and transmits the generated data according to the cache transmission duration and / or the cache transmission frame number threshold. Among them, the cache duration is, for example, the first cache duration, and the cache transmission frame number threshold is, for example, the first cache frame number. In the cache transmission mode, after generating the first frame data, the first electronic device determines whether the first cache duration and / or the first cache frame number are reached. If the first cache duration and / or the first cache frame number are reached, the first electronic device sends the cached multi-frame data to the second electronic device, and the multi-frame data includes the newly generated first frame data. If the first cache duration and / or the first cache frame number are not reached, the first electronic device caches the newly generated first frame data.

[0273] In some examples, in response to the first frame data, the first electronic device determines that the cached data transmission cycle has been reached. Then, the first electronic device sends the cached multi-frame data to the second electronic device. The length of the cached data transmission cycle is equal to the first cache duration. That is, the first electronic device periodically sends the cached multi-frame data in the current cycle to the second electronic device according to the first cache duration.

[0274] In other examples, in response to the first frame of data, the first electronic device determines that the time since the last clearing of cached data has reached the first cache duration. Then, the first electronic device sends cached multiple frames of data to the second electronic device, and the multiple frames of data are all the data cached by the first electronic device.

[0275] For example, the first electronic device maintains a data cache list of user cached data. After the data cache list is cleared, the state of the data cache list is empty. Then, after the first electronic device obtains new data at the Tmsth time and stores the data in the data cache list, the state of the data cache list changes from empty to non-empty. Then the Tms+zmsth time point is the cached data sending time point, and the first electronic device clears the data cache list again. Among them, zms is, for example, the first cache duration.

[0276] In some other examples, the first electronic device determines that the first frame of data is the Nth frame of data to be sent, where N is equal to the number of first buffered frames, and N is a positive integer greater than 2. Then, the first electronic device sends the buffered multi-frame data to the second electronic device, and the multi-frame data is all the data buffered by the first electronic device.

[0277] For example, after the first electronic device clears the data cache list, it receives new data and stores it in the data cache list. Afterwards, after determining that the data stored in the data cache list has reached the first cache frame number, the first electronic device can clear the data cache list again and send the data obtained by clearing the data cache list to the second electronic device.

[0278] In some other examples, in response to the first frame of data, the first electronic device determines that the time since the last clearing of the cached data has reached the first cache duration, or determines that the first frame of data is the Nth frame of data to be sent, where N is equal to the number of first cached frames. Then, the first electronic device sends the cached multi-frame data to the second electronic device, and the multi-frame data is all the data cached by the first electronic device.

[0279] For example, take the first cache duration as 100ms and the first cache frame number as 8 frames. When the data cache list is empty, the first electronic device receives new data at Tms. From this time point, it waits for 100ms, or determines that the audio and video frames stored in the data cache list reach 8 frames, clears the audio and video frames in the data cache list, and sends them to the second electronic device. After that, the first electronic device starts again from the time point when the new data is obtained, and repeats the above process.

[0280] In this way, the first electronic device measures whether to send the cached multi-frame data to the second electronic device through the first cache duration and / or the first cache frame number, and while implementing the cache transmission, the first cache duration and / or the first cache frame number ensure the smoothness and clarity of the screen display of the second electronic device. While saving power consumption, it does not affect the user's viewing experience.

[0281] In some embodiments, after generating the first frame data, the first electronic device determines whether the cache sending condition is currently met. If the cache sending condition is met, it determines whether to cache the first frame data or send multiple frames of cached data based on the first cache duration and / or the number of first cache frames. Among them, the cache sending condition includes one or more of the following: the second electronic device supports cache playback capability, the first network communication condition is currently met, the first electronic device does not detect user operation, the second electronic device does not detect user operation, and the second electronic device is in cache playback mode. Optionally, the first network communication condition is, for example, a strong network communication condition.

[0282] In some embodiments, before generating the first frame data, the first electronic device also negotiates the cache capability with the second electronic device to determine whether the first electronic device and the second electronic device have the cache transmission capability. For example, the first electronic device sends the first information to the second electronic device, and the first information is used to indicate that the first electronic device supports the cache transmission capability. In addition, the first electronic device receives the second information sent by the second electronic device, and the second information is used to indicate that the second electronic device supports the cache playback capability.

[0283] In some embodiments, the first electronic device sends the cached multi-frame data to the second electronic device, including sending the packaged multi-frame data to the second electronic device. For example, when the first electronic device determines that the cached multi-frame data needs to be sent, it packages the cached multi-frame data and sends it to the second electronic device. Optionally, the packaged multi-frame data also carries a timestamp of each frame of data being framed, or the packaged multi-frame data also carries a time interval between the frame outgoing of two frames of data.

[0284] S1405: The second electronic device buffers multiple frames of data.

[0285] In some embodiments, after receiving the multi-frame data sent by the first electronic device, the second electronic device caches the multi-frame data so as to subsequently display the multi-frame data in a cached playback mode.

[0286] S1406: The second electronic device displays the multiple frames of data frame by frame according to the frame output time interval of the multiple frames of data.

[0287] In some embodiments, the second electronic device displays the cached multiple frames of data in a cached playback mode. For example, the second electronic device displays the multiple frames of data frame by frame according to the frame output sequence and frame output time interval of the multiple frames of data.

[0288] In some embodiments, a cache threshold is set in the second electronic device. When the second electronic device processes data in the cache playback mode, it speeds up the processing of historical data that exceeds the cache threshold, thereby avoiding the influence of too much historical data, resulting in delayed display and affecting the user's viewing experience.

[0289] In some examples, the second electronic device determines that the cached data is greater than the cache threshold. Then, the second electronic device adjusts the display time interval of the historical data in the cached data that exceeds the cache threshold, or discards the historical data in the cached data that exceeds the cache threshold. The adjusted display time interval of the historical data is less than the frame output time interval of the historical data.

[0290] Optionally, the buffering threshold is greater than the first buffering duration and / or the first buffering frame quantity.

[0291] Exemplarily, the cache threshold is the cache interval time, which is greater than the first cache time. For example, the first cache time is 100ms, and the cache interval time is 120ms. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the frame time of the latest audio and video frame in the cache list is frame time 1, and the historical audio and video frames that have not been displayed include some audio and video frames whose time difference between the frame time and the frame time 1 is greater than the cache interval time. Then, the second electronic device determines that these audio and video frames need to be processed faster.

[0292] Another exemplary embodiment is that the cache threshold is the number of cache frames, which is greater than the first number of cache frames. For example, the first number of cache frames is 8 frames, and the number of cache frames is 10 frames. During the display process, the second electronic device receives new audio and video frames and caches them in the cache list. The second electronic device determines that the number of audio and video frames cached in the current cache list is greater than the number of cache frames, and the excess number is the first number. Then, the second electronic device determines the first number of audio and video frames that precede the frame output as historical audio and video frames that need to be processed faster based on the frame output time of the audio and video frames cached in the cache list. Afterwards, the second electronic device can speed up the processing of the first number of audio and video frames through the above-mentioned fast broadcast method or frame loss method.

[0293] In this way, by setting the cache threshold, when an abnormal situation occurs, the timeliness of the second electronic device sending and displaying can be guaranteed, thereby improving the user experience.

[0294] In some embodiments, the first electronic device detects the first operation of the user and stops buffer transmission or adjusts buffer transmission parameters. Optionally, adjusting the buffer transmission parameters includes shortening the first buffer duration to the second buffer transmission duration and / or reducing the first buffer frame number to the second buffer frame number.

[0295] In some embodiments, after stopping cache transmission or adjusting cache transmission parameters, the first electronic device sends a cache transmission change notification to the second electronic device, where the cache transmission change notification is used to indicate that the first electronic device has stopped cache transmission or adjusted cache transmission parameters.

[0296] For example, after detecting a user operation, the first electronic device determines that the current scenario is delay-sensitive and can determine to turn off the cache transmission mode, thereby avoiding increasing the data transmission delay in the delay-sensitive scenario and sending the response to the user operation to the second electronic device in a timely manner.

[0297] For another example, after detecting a user operation, the first electronic device determines that the current scenario is not delay-sensitive and can adjust the buffer transmission parameters, thereby reducing power consumption while avoiding increasing the data transmission delay in the non-delay-sensitive scenario.

[0298] In some embodiments, after receiving the buffer transmission change notification, the second electronic device determines that the buffer change notification indicates that the first electronic device adjusts the buffer transmission parameters. Then, the second electronic device adjusts the buffer transmission parameters accordingly. For example, the second electronic device adjusts the buffer playback parameters including adjusting the buffer threshold.

[0299] In this way, during the buffer transmission process, the first electronic device can also adaptively adjust the transmission timing according to the user operation, thereby avoiding the impact on the touch delay of the transmitting end, or reducing the impact on the touch delay of the transmitting end device.

[0300] In addition, when the transmission mode or cache transmission parameters of the first electronic device change, the second electronic device is notified in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving transmission without frame loss.

[0301] In some embodiments, the second electronic device stops buffering and playing after detecting the user's instruction to reverse the operation of the first electronic device. In addition, the second electronic device sends a buffering and playing change notification to the first electronic device, and the buffering and playing change notification is used to indicate that the second electronic device has stopped buffering and playing.

[0302] Accordingly, the first electronic device receives the buffer play change notification sent by the second electronic device, and stops buffer sending in response to the buffer play change notification. Optionally, stopping buffer sending includes the first electronic device sending the generated frame data frame by frame to the second electronic device.

[0303] Whether in a delay-sensitive scenario or a delay-insensitive scenario, if the second electronic device detects a user operation during the display process, it means that the user needs to obtain display feedback in a timely manner. Therefore, the second electronic device can directly turn off the cache playback mode.

[0304] In some embodiments, after the second electronic device turns off the cache play mode, if there is still data in the cache list, it is necessary to accelerate the processing of these data. Optionally, as described above, the accelerated processing method includes, for example, a fast play method or a frame drop method.

[0305] In this way, during the cache transmission process, the second electronic device will promptly feedback to the first electronic device after detecting the user operation, and the first electronic device can also adaptively adjust the transmission timing according to the user's reverse control operation, thereby avoiding the impact on the touch delay of the receiving device.

[0306] In addition, when the playback mode of the second electronic device changes, it notifies the first electronic device in a timely manner, thereby avoiding the occurrence of abnormal frame loss and achieving display without frame loss.

[0307] Combination of the above Figure 5-Figure 14 The data transmission method provided by the embodiment of the present application is described in detail. Fig.15 and Fig.16 The first electronic device and the second electronic device provided in the embodiments of the present application are described in detail.

[0308] In one possible design, Fig.15 This is a schematic diagram of the structure of a first electronic device provided in an embodiment of the present application. Fig.15As shown, the first electronic device 1500 may include: a processing unit 1501, a transceiver unit 1502, and a storage unit 1503. The first electronic device 1500 may be used to implement the functions of the first electronic device involved in the above method embodiment.

[0309] Optionally, the processing unit 1501 is used to support the first electronic device 1500 to execute Figure 8 S802 in; and / or, for supporting the first electronic device 1500 to execute Fig.11 S1101 in; and / or, for supporting the first electronic device 1500 to execute Fig.12 S1102 in; and / or, for supporting the first electronic device 1500 to execute Fig.13 S1301 in; and / or, for supporting the first electronic device 1500 to execute Fig.14 S1401 and S1402 in.

[0310] Optionally, the transceiver unit 1502 is used to support the first electronic device 1500 to execute Figure 8 S801, S803, S804 and S805 in; and / or, for supporting the first electronic device 1500 to execute Fig.11 S1102 in; and / or, for supporting the first electronic device 1500 to execute Fig.12 S1203 in; and / or, for supporting the first electronic device 1500 to execute Fig.13 S1302 in; and / or, for supporting the first electronic device 1500 to execute Fig.14 S1403 in.

[0311] Optionally, the storage unit 1503 is used to support the first electronic device 1500 to execute Figure 8 S805 in; and / or, for supporting the first electronic device 1500 to execute Fig.14 S1404 in.

[0312] Among them, the transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the first electronic device 1500 are respectively to implement the corresponding process of the data transmission method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they will not be repeated here.

[0313] Optionally, a program or instruction is stored in the storage unit 1503. When the processing unit 1501, the transceiver unit 1502 and the storage unit 1503 execute the program or instruction, Fig.15The first electronic device 1500 shown can execute the data transmission method described in the above method embodiment.

[0314] Fig.15 The technical effects of the first electronic device 1500 shown can refer to the technical effects of the data transmission method described in the above method embodiment, and will not be repeated here.

[0315] In addition to being in the form of the first electronic device 1500, the technical solution provided in the present application may also be a functional unit or chip in the first electronic device, or a device used in conjunction with the first electronic device.

[0316] In one possible design, Fig.16 This is a schematic diagram of the structure of the second electronic device provided in the embodiment of the present application. Fig.16 As shown, the second electronic device 1600 may include: a transceiver unit 1601, a storage unit 1602, and a display unit 1603. The second electronic device 1600 may be used to implement the functions of the second electronic device involved in the above method embodiment.

[0317] Optionally, the transceiver unit 1601 is used to support the second electronic device 1600 to execute Figure 8 S801, S803, S804 and S805 in; and / or, for supporting the second electronic device 1600 to execute Fig.11 S1102 in; and / or, for supporting the second electronic device 1600 to execute Fig.12 S1202 in; and / or, for supporting the second electronic device 1600 to execute Fig.13 S1302 in; and / or, for supporting the second electronic device 1600 to execute Fig.14 S1403 in.

[0318] Optionally, the storage unit 1602 is used to support the second electronic device 1600 to execute Fig.14 S1405 in.

[0319] Optionally, the display unit 1603 is used to support the second electronic device 1600 to execute Figure 8 S806 in; and / or, for supporting the second electronic device 1600 to execute Fig.11 S1103 in; and / or, for supporting the second electronic device 1600 to execute Fig.12 S1201 in; and / or, for supporting the second electronic device 1600 to execute Fig.13 S1303 in; and / or, for supporting the second electronic device 1600 to execute Fig.14 S1406 in.

[0320] Among them, the transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the second electronic device 1600 are respectively to implement the corresponding process of the data transmission method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they will not be repeated here.

[0321] Optionally, a program or instruction is stored in the storage unit 1602. When the transceiver unit 1601, the storage unit 1602 and the display unit 1603 execute the program or instruction, Fig.16 The second electronic device 1600 shown can execute the data transmission method described in the above method embodiment.

[0322] Fig.16 The technical effects of the second electronic device 1600 shown can refer to the technical effects of the data transmission method described in the above method embodiment, and will not be repeated here.

[0323] In addition to being in the form of the second electronic device 1600, the technical solution provided by the present application may also be a functional unit or chip in the second electronic device, or a device used in conjunction with the second electronic device.

[0324] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0325] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0326] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0327] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0328] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0329] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a computer, the computer executes the above-mentioned related steps to implement the data transmission method in the above-mentioned embodiment.

[0330] The embodiment of the present application also provides a computer program product. When the computer program product is executed on a computer, the computer is enabled to execute the above-mentioned related steps to implement the data transmission method in the above-mentioned embodiment.

[0331] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device performs the data transmission method in each of the above method embodiments.

[0332] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0333] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0334] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0335] In the several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.

[0336] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0337] Computer-readable storage media include, but are not limited to, any of the following: 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, and other media that can store program codes.

[0338] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: Generate the first frame data; When it is determined that the first cache duration and / or the first cache frame quantity is reached, sending cached multiple frames of data to the second electronic device, the multiple frames of data including the first frame of data; When it is determined that the first cache duration and / or the first cache frame quantity has not been reached, the first frame data is cached.

2. The method according to claim 1, characterized in that After generating the first frame of data, the method further includes: Determine whether the cache sending conditions are met, and the cache sending conditions include one or more of the following: the second electronic device supports cache playback capability, the first network communication condition is currently met, the first electronic device has not detected any user operation, the second electronic device has not detected any user operation, and the second electronic device is in cache playback mode.

3. The method according to claim 1 or 2, characterized in that: The sending of the first frame of data is buffered sending, and the method further includes: A first operation of the user is detected, and cache sending is stopped or cache sending parameters are adjusted, wherein the adjustment of cache sending parameters includes shortening the first cache duration to a second cache sending duration and / or reducing the first cache frame quantity to a second cache frame quantity.

4. The method according to claim 3, characterized in that The method further comprises: A buffer transmission change notification is sent to the second electronic device, where the buffer transmission change notification is used to indicate that the first electronic device has stopped buffer transmission or has adjusted buffer transmission parameters.

5. The method according to claim 1 or 2, characterized in that: The sending of the first frame of data is buffered sending, and the method further includes: receiving a buffered playback change notification sent by the second electronic device, wherein the buffered playback change notification is used to instruct the second electronic device to stop buffered playback in response to a user's reverse control operation of the first electronic device; In response to the buffer play change notification, stop buffer sending.

6. The method according to any one of claims 3 to 5, characterized in that: Stop buffer sending, including: The generated frame data is sent frame by frame to the second electronic device.

7. The method according to any one of claims 1 to 6, characterized in that: The step of sending the cached multiple frames of data to the second electronic device when it is determined that the first cache duration and / or the first cache frame quantity has been reached includes: In response to the first frame data, it is determined that the current buffered data sending period has arrived, and the buffered multiple frames of data are sent to the second electronic device, where the length of the buffered data sending period is equal to the first buffer duration.

8. The method according to any one of claims 1 to 6, characterized in that: The step of sending the cached multiple frames of data to the second electronic device when it is determined that the first cache duration and / or the first cache frame quantity has been reached includes: In response to the first frame data, determining that the time duration since the last clearing of cache data has reached the first cache duration; Sending a plurality of frames of buffered data to the second electronic device, where the plurality of frames of data are all the data buffered by the first electronic device.

9. The method according to any one of claims 1 to 6, characterized in that: The step of sending the cached multiple frames of data to the second electronic device when it is determined that the first cache duration and / or the first cache frame quantity has been reached includes: Determine that the first frame of data is the Nth frame of data to be sent, where N is equal to the number of the first cached frames, and N is a positive integer greater than 2; Sending a plurality of frames of buffered data to the second electronic device, where the plurality of frames of data are all the data buffered by the first electronic device.

10. The method according to any one of claims 1 to 6, characterized in that: The step of sending the cached multiple frames of data to the second electronic device when it is determined that the first cache duration and / or the first cache frame quantity has been reached includes: In response to the first frame data, determining that the time from the last time the cache data was cleared has reached the first cache time, or determining that the first frame data is the Nth frame of data to be sent, where N is equal to the number of the first cache frames; Sending a plurality of frames of buffered data to the second electronic device, where the plurality of frames of data are all the data buffered by the first electronic device.

11. The method according to any one of claims 1 to 10, characterized in that: Before generating the first frame of data, the method further includes: Sending first information to the second electronic device, where the first information is used to indicate that the first electronic device supports a cache transmission capability; Second information sent by the second electronic device is received, where the second information is used to indicate that the second electronic device supports cache playback capability.

12. The method according to any one of claims 1 to 11, characterized in that: The sending the buffered multi-frame data to the second electronic device includes: The packaged multiple frames of data are sent to the second electronic device.

13. A data transmission method, characterized in that: Applied to a second electronic device, the method includes: Receiving a plurality of frames of data sent by a first electronic device, wherein the plurality of frames of data is data sent by the first electronic device when it is determined that a first buffering time length and / or a first buffering frame quantity has been reached; Buffering the multiple frames of data; The multiple frames of data are displayed frame by frame according to the frame output time interval of the multiple frames of data.

14. The method according to claim 13, characterized in that The playback of the multiple frames of data is cache playback, and the method further includes: Detecting that a user instructs to reverse the operation of the first electronic device; Stop cache playback; A buffer play change notification is sent to the first electronic device, where the buffer play change notification is used to indicate that the second electronic device has stopped buffer play.

15. The method according to claim 13, characterized in that The playback of the multi-frame data is cache playback, and the method includes: Receiving a buffer sending change notification sent by the first electronic device; When the buffer transmission change notification indicates that the first electronic device has stopped buffer transmission, stop buffer playback; When the cache sending change notification indicates that the first cache duration is shortened to a second cache sending duration and / or the first cache frame quantity is reduced to a second cache frame quantity, the cache threshold is adjusted.

16. The method according to any one of claims 13 to 15, characterized in that: The method further comprises: Determine that the cached data is greater than the cache threshold; Adjust the display time interval of the historical data in the cache data that exceeds the cache threshold, or discard the historical data in the cache data that exceeds the cache threshold, wherein the adjusted display time interval of the historical data is less than the frame output time interval of the historical data.

17. The method according to claim 16, characterized in that The buffering threshold is greater than the first buffering duration and / or the first buffering frame quantity.

18. The method according to any one of claims 13 to 17, characterized in that: Before receiving the multi-frame data sent by the first electronic device, the method further includes: receiving first information sent by the first electronic device, where the first information is used to indicate that the first electronic device supports a cache transmission capability; Second information is sent to the first electronic device, where the second information is used to indicate that the second electronic device supports cache playback capability.

19. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 1-12.

20. An electronic device, characterized in that: include: A processor, a memory and a display screen, wherein the memory and the display screen are coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 13 to 18.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program, which, when executed on an electronic device, enables the electronic device to execute the method as claimed in any one of claims 1 to 12; or enables the electronic device to execute the method as claimed in any one of claims 13 to 18.

22. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 12; or the computer is enabled to execute the method according to any one of claims 13 to 18.