Data transmission method and device, electronic equipment and storage medium

By dynamically splitting or adjusting data packets based on bandwidth differences between electronic devices, the problem of low efficiency in cross-end data transmission is solved, achieving more efficient and reliable data transmission.

CN119052187APending Publication Date: 2024-11-29ZHUHAI MOJIE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310617013.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Existing technologies cannot effectively adapt to bandwidth differences between different electronic devices in cross-device data transmission, leading to low transmission efficiency and an increased risk of failure.

Method used

By dynamically splitting or adjusting data packets based on the bandwidth difference between the first and second electronic devices, data transmission is ensured to meet the bandwidth capabilities of the target device. This dynamic adjustment mechanism improves cross-end data transmission efficiency.

Benefits of technology

It improves the efficiency of cross-terminal data transmission, reduces the risk of data transmission failure, and enhances the success rate of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052187A_ABST
    Figure CN119052187A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and device, electronic equipment and a storage medium, and belongs to the field of data transmission. The data transmission method is applied to a target electronic device. The method comprises the following steps: receiving a target data packet sent by a first electronic device based on a first bandwidth corresponding to the first electronic device; and sending the target data packet to the second electronic equipment according to the first bandwidth and a second bandwidth corresponding to the second electronic equipment. According to the method, the cross-end data transmission efficiency is improved, and the cross-end data transmission success rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a data transmission method, device, electronic equipment and storage medium. Background Art

[0002] Currently, common data transmission methods include two-end transmission (such as data from device A is transmitted to device B) and cross-end transmission (such as data from device A is forwarded to device C via device B). Summary of the invention

[0003] Embodiments of the present invention provide a data transmission method, device, electronic device and storage medium, aiming to improve the efficiency of cross-end data transmission.

[0004] In a first aspect, an embodiment of the present invention provides a data transmission method, the data transmission method being applied to a target electronic device, the method comprising:

[0005] receiving a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device;

[0006] The target data packet is sent to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

[0007] Optionally, sending the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device includes:

[0008] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets, and sending the sub-data packets to the second electronic device;

[0009] If the first bandwidth is less than or equal to the second bandwidth, the target data packet is sent to the second electronic device based on the second bandwidth.

[0010] Optionally, if the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes:

[0011] If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth, and monitoring whether the second bandwidth has been updated during the process of splitting the target data packet;

[0012] If the second bandwidth has been updated, the remaining target data packets are split according to the updated second bandwidth to obtain split sub-data packets.

[0013] Optionally, if the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes:

[0014] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the target data packet is a complete data packet;

[0015] If the target data packet is an incomplete data packet, when the last target data packet that belongs to the same complete data packet as the target data packet is received, the received multiple target data packets are split according to the second bandwidth to obtain split sub-data packets.

[0016] Optionally, the method further comprises:

[0017] Determine a first bandwidth of a transmission channel with the first electronic device, and determine a second bandwidth of a transmission channel with the second electronic device;

[0018] If the first bandwidth is smaller than the second bandwidth, sending a bandwidth adjustment instruction to the first electronic device, wherein the bandwidth adjustment instruction is used to instruct to increase the first bandwidth;

[0019] If a bandwidth response instruction corresponding to the bandwidth adjustment instruction is received from the first electronic device, determining the adjusted first bandwidth according to the bandwidth response instruction;

[0020] The receiving, based on the first bandwidth corresponding to the first electronic device, a target data packet sent by the first electronic device includes:

[0021] A target data packet sent by the first electronic device is received based on the adjusted first bandwidth.

[0022] Optionally, sending the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device includes:

[0023] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state;

[0024] If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is greater than or equal to the first bandwidth, the target data packet is sent to the second electronic device based on the adjusted second bandwidth.

[0025] Optionally, sending the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device includes:

[0026] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state;

[0027] If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is smaller than the first bandwidth, and the difference between the adjusted second bandwidth and the second bandwidth before adjustment is greater than a preset threshold, the target data packet is split based on the adjusted second bandwidth to obtain split sub-data packets, and the sub-data packets are sent to the second electronic device.

[0028] In a second aspect, an embodiment of the present invention further provides a data transmission device, which is applied to a target electronic device, and the data transmission device includes:

[0029] A data receiving module, configured to receive a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device;

[0030] The data sending module is used to send the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

[0031] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the data transmission method as described in the first aspect is realized.

[0032] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data transmission method as described in the first aspect.

[0033] Embodiments of the present invention provide a data transmission method, device, electronic device and storage medium. The technical solution provided by the embodiments of the present invention realizes that during the cross-end data transmission process, data can be transmitted according to the bandwidth corresponding to the transmission protocol between the electronic devices, rather than according to a fixed bandwidth, thereby improving the efficiency of cross-end data transmission, avoiding the occurrence of data transmission failure due to insufficient bandwidth during cross-end data transmission, and improving the success rate of cross-end data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0036] Figure 2 It is a flowchart of a data transmission method provided by an embodiment of the present invention;

[0037] Figure 3 is a schematic diagram of cross-end device data transmission provided by an embodiment of the present invention;

[0038] Figure 4 is a schematic diagram of a data transmission protocol interface provided by an embodiment of the present invention;

[0039] Figure 5 is a flow chart of another data transmission method provided by an embodiment of the present invention;

[0040] Figure 6 It is a schematic block diagram of the structure of a data transmission device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0043] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0044] Data transmission between electronic devices can be achieved using transmission protocols such as Bluetooth, SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter), and WIFI. Different transmission protocols have different corresponding bandwidths. For data transmission between different electronic devices, how to adapt to the bandwidth of different transmission protocols and achieve efficient data transmission is an urgent problem to be solved.

[0045] To solve the above problems, the embodiments of the present invention provide a data transmission method, device, electronic device and storage medium. The embodiments of the present invention provide a technical solution.

[0046] In the embodiments of the present invention, the electronic devices include but are not limited to cameras, smart phones, tablet computers, laptop computers, desktop computers, personal digital assistants, wearable devices, and self-moving devices. The self-moving devices may be sweepers, food delivery machines, drones, or logistics vehicles. The wearable devices may be AR (Augmented Reality) devices, VR (Virtual Reality) devices, etc.

[0047] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0048] Figure 1 It is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0049] like Figure 1 As shown, the electronic device 100 includes a processor 101 and a memory 102, and the processor 101 and the memory 102 are connected via a bus 103, such as an I2C (Inter-integrated Circuit) bus. The electronic device 100 can be a target electronic device, a first electronic device, or a second electronic device.

[0050] Specifically, the processor 101 is used to provide computing and control capabilities to support the operation of the entire electronic device 100. The processor 101 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0051] Specifically, the memory 102 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0052] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the electronic device to which the embodiment of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0053] The processor 101 is used to run a computer program stored in the memory 102. The computer program can be set in a target electronic device and implement any one of the data transmission methods provided in the embodiments of the present invention when the computer program is executed.

[0054] In one embodiment, the processor is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:

[0055] receiving a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device;

[0056] The target data packet is sent to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

[0057] In one embodiment, sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes:

[0058] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets, and sending the sub-data packets to the second electronic device;

[0059] If the first bandwidth is less than or equal to the second bandwidth, the target data packet is sent to the second electronic device based on the second bandwidth.

[0060] In one embodiment, if the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes:

[0061] If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth, and monitoring whether the second bandwidth has been updated during the process of splitting the target data packet;

[0062] If the second bandwidth has been updated, the remaining target data packets are split according to the updated second bandwidth to obtain split sub-data packets.

[0063] In one embodiment, if the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes:

[0064] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the target data packet is a complete data packet;

[0065] If the target data packet is an incomplete data packet, when the last target data packet that belongs to the same complete data packet as the target data packet is received, the received multiple target data packets are split according to the second bandwidth to obtain split sub-data packets.

[0066] In one embodiment, a first bandwidth of a transmission channel with the first electronic device is determined, and a second bandwidth of a transmission channel with the second electronic device is determined;

[0067] If the first bandwidth is smaller than the second bandwidth, sending a bandwidth adjustment instruction to the first electronic device, wherein the bandwidth adjustment instruction is used to instruct to increase the first bandwidth;

[0068] If a bandwidth response instruction corresponding to the bandwidth adjustment instruction is received from the first electronic device, determining the adjusted first bandwidth according to the bandwidth response instruction;

[0069] The receiving, based on the first bandwidth corresponding to the first electronic device, a target data packet sent by the first electronic device includes:

[0070] A target data packet sent by the first electronic device is received based on the adjusted first bandwidth.

[0071] In one embodiment, sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes:

[0072] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state;

[0073] If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is greater than or equal to the first bandwidth, the target data packet is sent to the second electronic device based on the adjusted second bandwidth.

[0074] In one embodiment, sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes:

[0075] If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state;

[0076] If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is smaller than the first bandwidth, and the difference between the adjusted second bandwidth and the second bandwidth before adjustment is greater than a preset threshold, the target data packet is split based on the adjusted second bandwidth to obtain split sub-data packets, and the sub-data packets are sent to the second electronic device.

[0077] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device described above can refer to the corresponding process in the following data transmission method embodiment, and will not be repeated here.

[0078] The following will be combined Figure 1 The electronic device in the embodiment of the present invention will introduce the data transmission method provided by the embodiment of the present invention in detail. It should be noted that Figure 1 The electronic device is only used to explain the data transmission method provided in the embodiment of the present invention, but does not constitute a limitation on the application scenario of the data transmission method provided in the embodiment of the present invention.

[0079] See also Figure 2 , Figure 2 It is a flowchart of a data transmission method provided by an embodiment of the present invention.

[0080] like Figure 2 As shown, the data transmission method is applied to a target electronic device, and the data transmission method includes steps S101 to S102.

[0081] Step S101: receiving a target data packet sent by a first electronic device based on a first bandwidth corresponding to the first electronic device;

[0082] In this application, the target electronic device, the first electronic device, and the second electronic device may be of the same type or of different types. For example, the target electronic device, the first electronic device, and the second electronic device may all be AR glasses, or the target electronic device may be AR glasses, while the first electronic device and the second electronic device may be mobile phones. Figure 3 , Figure 3 This is a schematic diagram of cross-device data transmission. Figure 3 In the embodiment, end A may be a first electronic device, end B may be a target electronic device, end C may be a second electronic device, bandwidth M represents a first bandwidth, and bandwidth N represents a second bandwidth.

[0083] When the target electronic device is transmitting data with the first electronic device, the first electronic device may generate a data request. The data request may be actively generated by the first electronic device, that is, when the first electronic device has data to send to the target electronic device, the first electronic device generates the data request; the data request may also be passively generated by the first electronic device, that is, when the target electronic device needs to obtain data from the first electronic device, the target electronic device will send a request instruction to the first electronic device, and the first electronic device will generate a data request after receiving the request instruction.

[0084] When the first electronic device generates the data request, it sends the data request to the target electronic device, and the target electronic device receives the target data packet sent by the first electronic device based on the first bandwidth corresponding to the first electronic device, wherein the data request carries the target data packet sent by the first electronic device to the target electronic device. It can be understood that the first bandwidth corresponding to the first electronic device is the bandwidth corresponding to the first data transmission protocol adopted by the first electronic device and the target electronic device, and different transmission protocols have different bandwidths. In the application embodiment, the data transmission protocol adopted by the first electronic device and the target electronic device is not limited, such as the data transmission protocol can be a WiFi protocol, a 5G protocol or a Bluetooth protocol.

[0085] See also Figure 4 , Figure 4 In the data transmission protocol, the data transmission protocol will provide interfaces for receiving (recv) and sending (send) data. While providing the data transmission and receiving interface, the data transmission protocol will also provide a buffer (Cache) to meet the needs of data that is larger than the bandwidth, that is, to meet the data transmission needs where the bandwidth required during the data transmission process is larger than the available bandwidth corresponding to the data transmission protocol. It can be understood that the buffer can be used to cache the split sub-data packets and / or cache the data packets that need to be split. Figure 4In the data transmission protocol, TX means data transmission and RX means data reception. The data transmission protocol includes a protocol header and data (header+value_data). The protocol header can mark the status of the current data. The protocol header format is as follows:

[0086]

[0087] Among them, Magic represents the data transmission protocol identifier, which can distinguish data sending and data response (i.e., data reception); Type represents the type of the current data packet, such as a picture data packet or a video data packet; Packet_index: -1 indicates that the current packet is a single packet, that is, the data packet is a complete data packet and has not been split; 0~N represents a cache packet, that is, the data packet is a split data packet, and the size of the data can understand the order in which the data packet is split; Value_len represents the length of the current packet payload value_data.

[0088] Step S102: sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device.

[0089] When the target electronic device receives the target data packet, the target electronic device determines the second bandwidth corresponding to the second electronic device. It can be understood that the second bandwidth is the bandwidth corresponding to the second data transmission protocol adopted by the first electronic device and the target electronic device, wherein the first bandwidth may be the same as the second bandwidth or may be different. In an embodiment of the present application, the first bandwidth and the second bandwidth are the currently available bandwidths, that is, the first bandwidth is less than or equal to the maximum bandwidth corresponding to the first data transmission protocol, and the second bandwidth is less than or equal to the maximum bandwidth corresponding to the second data transmission protocol. The size of the first bandwidth and the second bandwidth is determined by the maximum bandwidth of the corresponding data transmission protocol and the used bandwidth in the corresponding transmission channel. After the second electronic device determines the second bandwidth, the second electronic device sends the target data packet to the second electronic device according to the first bandwidth and the second bandwidth.

[0090] In the process of cross-end data transmission, this embodiment performs data transmission according to the bandwidth corresponding to the transmission protocol between the electronic devices, rather than performing data transmission according to a fixed bandwidth, thereby improving the efficiency of cross-end data transmission and avoiding the occurrence of data transmission failure due to insufficient bandwidth during cross-end data transmission, thereby improving the success rate of cross-end data transmission.

[0091] In one embodiment, step S102 includes: sub-step a and sub-step b.

[0092] Sub-step a: if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, split the target data packet according to the second bandwidth to obtain split sub-data packets, and send the sub-data packets to the second electronic device.

[0093] Sub-step b: if the first bandwidth is less than or equal to the second bandwidth, sending the target data packet to the second electronic device based on the second bandwidth.

[0094] In the embodiment of the present disclosure, after the target electronic device determines the first bandwidth and the second bandwidth, the target electronic device determines whether the first bandwidth is greater than the second bandwidth. If the first bandwidth is greater than the second bandwidth, the target electronic device splits the target data packet according to the second bandwidth to obtain the split sub-data packets, and sends the split sub-data packets to the second electronic device. In the process of sending the split sub-data packets to the second electronic device, the target electronic device can send the split sub-data packets to the second electronic device from front to back in the order of splitting. In the process of splitting the target data packet according to the second bandwidth, the target data packet will be split according to the size of the second bandwidth. It can be understood that the data volume of the last sub-data packet obtained by splitting is less than or equal to the data volume that can be transmitted by the second data transmission channel corresponding to the second bandwidth. If the first bandwidth is less than or equal to the second bandwidth, it means that the data volume that can be transmitted by the first data transmission channel between the first electronic device and the target electronic device at a time is less than the data volume that can be transmitted by the second data transmission channel between the second electronic device and the target electronic device at a time, that is, the data packet that can be transmitted by the first data transmission channel can definitely be transmitted in the second data transmission channel without splitting. Therefore, when the first bandwidth is less than or equal to the second bandwidth, the target electronic device directly sends the target data packet to the second electronic device without splitting.

[0095] In one embodiment, if the first bandwidth is greater than the second bandwidth in sub-step a, the target data packet is split according to the second bandwidth to obtain split sub-data packets, including step a1 and step a2.

[0096] Step a1: if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, split the target data packet according to the second bandwidth, and monitor whether the second bandwidth has been updated during the process of splitting the target data packet.

[0097] If the first bandwidth is greater than the second bandwidth, the target electronic device splits the target data packet according to the second bandwidth, and monitors whether the second bandwidth has been updated during the process of splitting the target data packet. It can be understood that although the maximum bandwidth corresponding to the data transmission channel is fixed, since some data are processed in parallel, if some data previously transmitted in the data transmission channel is suspended, the bandwidth corresponding to the suspended data will be released, thereby increasing the available bandwidth. Conversely, it may also reduce the current available bandwidth.

[0098] Step a2: If the second bandwidth has been updated, the remaining target data packets are split according to the updated second bandwidth to obtain split sub-data packets.

[0099] If the second bandwidth has been updated, the target electronic device splits the remaining unsplit target data packet according to the updated second bandwidth to obtain the split sub-data packets. At this time, there are at least two data packets of different sizes in the sub-data packets obtained by splitting the target data packet. The second bandwidth has been updated, including reducing the second bandwidth or increasing the second bandwidth. If the second bandwidth has not been updated, the target electronic device continues to split the remaining target data packets according to the current second bandwidth.

[0100] In another embodiment, if the second bandwidth has been updated and the updated second bandwidth is greater than the second bandwidth before the update, the target electronic device determines the bandwidth difference between the updated second bandwidth and the second bandwidth before the update. If the bandwidth difference is less than a preset threshold, the target electronic device continues to split the remaining target data packets with the second bandwidth before the update. If the bandwidth difference is greater than or equal to the preset threshold, the target electronic device splits the remaining target data packets with the updated second bandwidth to obtain split sub-data packets, thereby avoiding frequent splitting of target data packets with different bandwidths.

[0101] In the process of cross-end (i.e., cross-device) transmission of data packets, this embodiment decides whether to split the data packets based on the bandwidth between any two devices, rather than simply deciding whether to split the data packets based on the current amount of data to be transmitted and the amount of data that can be transmitted through the current data transmission channel, thereby further improving the accuracy of data packet splitting.

[0102] In one embodiment, if the first bandwidth is greater than the second bandwidth in sub-step a, the target data packet is split according to the second bandwidth to obtain split sub-data packets, including step a3 and step a4.

[0103] Step a3: If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, determine whether the target data packet is a complete data packet.

[0104] Step a4: if the target data packet is an incomplete data packet, when the last target data packet that belongs to the same complete data packet as the target data packet is received, the received multiple target data packets are split according to the second bandwidth to obtain split sub-data packets.

[0105] If the first bandwidth is greater than the second bandwidth, the target electronic device determines whether the target data packet received from the first electronic device is a complete data packet, that is, determines whether the target data packet is a split data packet. It is understandable that when the first electronic device transmits the data to be transmitted to the target electronic device through the first data transmission channel, it may be necessary to split the data, or it may not be necessary to split the data. If the first electronic device is split when transmitting the data to the target electronic device, the target data packet is not a complete data packet; if the first electronic device is not split when transmitting the data to the target electronic device, the target data packet is a complete data packet. If the target data packet is an incomplete data packet, the target electronic device determines whether the last target data packet belonging to the same complete data packet as the target data packet is received. When splitting the data packet, a sequence identifier can be added from front to back for each sub-data packet obtained by splitting according to the order of splitting, and the sequence identifier can be used to determine whether the last target data packet is received. For example, the sequence identifier of the first sub-data packet obtained by splitting is 0, and the sequence identifier of the second sub-data packet obtained by splitting is 1. It is understandable that in this embodiment, the first electronic device sends the target data packet to the target electronic device from front to back according to the order of the split data packets.

[0106] When the target electronic device receives the last target data packet that belongs to the same complete data packet as the target data packet, the target electronic device splits the received multiple target data packets according to the second bandwidth to obtain the split sub-data packets. In one embodiment, the target electronic device may first merge all the received target data packets that belong to the same complete data packet into a complete data packet, and then split the merged complete data packet according to the second bandwidth to obtain the split sub-data packets. For example, after the target electronic device receives three target data packets A1, A2 and A3 that belong to the same complete data packet A, it first merges A1, A2 and A3 into A, and then splits A according to the second bandwidth to obtain the split sub-data packets. In another embodiment, the target electronic device may split the first received one or more target data packets according to the second bandwidth to obtain the split sub-data packets. For example, after the target electronic device receives target data packets A1 and target data packets A2 that belong to a complete data packet A, A1 is split into A11 and A12 according to the second bandwidth, and A2 is split into A21 and A22 according to the second bandwidth, A11, A12, A21 and A22 are sub-data packets after splitting, wherein the data packet sizes of A12 and A22 are less than or equal to A11 and A21; or after the target electronic device receives three target data packets A1 and A2 that belong to a complete data packet A, A1 and A2 are split into a1, a2 and a3 according to the second bandwidth.

[0107] After the target electronic device obtains the split sub-data packets, it can send the split sub-data packets to the second electronic device first, or send the split sub-data packets to the second electronic device after completing the splitting of the complete data packet.

[0108] If the target data packet is a complete data packet, that is, the first electronic device did not split the data packet when sending the target data packet to the target electronic device, then the target electronic device can directly split the target data packet according to the second bandwidth to obtain the split sub-data packets. It is understandable that if the bandwidth required for the data packet sent by the first electronic device to the target electronic device is less than or equal to the first bandwidth, the first electronic device can send the data packet to the target electronic device without splitting the data packet, and the target data packet received by the target electronic device is a complete data packet; if the bandwidth required for the data packet sent by the first electronic device to the target electronic device is greater than the first bandwidth, the first electronic device needs to split the data packet, and the target data packet received by the target electronic device is not a complete data packet. It is understandable that when two devices are transmitting, it is only necessary to compare the bandwidth occupied by the data packet to be transmitted and the size of the bandwidth corresponding to the transmission protocol between the two devices to know whether the data packet needs to be split. The bandwidth occupied by the transmission data packet is greater than the size of the data packet.

[0109] In the process of splitting data packets, if the received target data packet is not a complete data packet, the data packet will be split after all data packets that belong to the same complete data packet as the target data packet are received, thereby avoiding confusion in data packet splitting and improving the intelligence of the data packet splitting process.

[0110] Reference Figure 5 In another embodiment of the present application, the data transmission method further includes:

[0111] Step S103: determining a first bandwidth of a transmission channel with the first electronic device, and determining a second bandwidth of a transmission channel with the second electronic device.

[0112] When the target electronic device determines that the data sent by the first electronic device needs to be transmitted to the second electronic device, the target electronic device can first determine the first bandwidth of the transmission channel between the target electronic device and the first electronic device, and determine the second bandwidth of the transmission channel between the target electronic device and the second electronic device, that is, determine the first bandwidth of the first data transmission channel, and determine the second bandwidth of the second data transmission channel. It is understandable that the target electronic device can determine the first bandwidth through signaling interaction with the first electronic device, and determine the second bandwidth through signaling interaction with the second electronic device.

[0113] Step S104: If the first bandwidth is smaller than the second bandwidth, a bandwidth adjustment instruction is sent to the first electronic device, wherein the bandwidth adjustment instruction is used to instruct to adjust the first bandwidth to the second bandwidth.

[0114] After the target electronic device determines the first bandwidth and the second bandwidth, the target electronic device determines whether the first bandwidth is greater than the second bandwidth. If the first bandwidth is less than the second bandwidth, the target electronic device sends a bandwidth adjustment instruction to the first electronic device, wherein the bandwidth adjustment instruction is used to indicate the increase of the first bandwidth. When the first electronic device receives the bandwidth adjustment instruction, the first electronic device determines whether some currently used bandwidths can be released according to the bandwidth adjustment instruction, such as stopping the data being downloaded, or stopping the online playback of the video, etc. If the first electronic device determines that there is currently a releasable bandwidth, the first electronic device releases part of the currently occupied bandwidth according to the bandwidth adjustment instruction to increase the first bandwidth. In order to ensure the normal operation of the first electronic device as much as possible, the size of the second bandwidth can be carried in the bandwidth adjustment instruction, so that the first electronic device can adjust the first bandwidth to the same size as the second bandwidth at most, that is, the second bandwidth is equal to the adjusted first bandwidth. When the first electronic device obtains the adjusted first bandwidth, the first electronic device generates a corresponding bandwidth response instruction, and the bandwidth response instruction is used to indicate the size of the adjusted first bandwidth. If the first electronic device does not adjust the first bandwidth, the first electronic device will also generate a corresponding response instruction, and at this time, the first bandwidth indicated by the response instruction is the same as the original first bandwidth.

[0115] Step S105: If a bandwidth response instruction corresponding to the bandwidth adjustment instruction sent by the first electronic device is received, the adjusted first bandwidth is determined according to the bandwidth response instruction.

[0116] Step S101 includes:

[0117] Step S1011: receiving a target data packet sent by a first electronic device based on the adjusted first bandwidth.

[0118] When the target electronic device receives the bandwidth response instruction sent by the first electronic device, the target electronic device determines the adjusted first bandwidth according to the bandwidth response instruction, and receives the target data packet sent by the first electronic device based on the adjusted first bandwidth when receiving the data sent by the first electronic device. It can be understood that the adjusted first bandwidth is greater than the original unadjusted first bandwidth. The adjusted first bandwidth is less than or equal to the maximum available bandwidth of the first data transmission channel.

[0119] In this embodiment, if the first bandwidth is smaller than the second bandwidth before data is transmitted across ends and the first bandwidth can be increased, the first bandwidth is increased first, so as to reduce the number of times of splitting data packets during the cross-end data transmission process, thereby improving data splitting efficiency.

[0120] In another embodiment, the data transmission method further includes:

[0121] Step c: if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, determine whether the second bandwidth is in an adjustable state.

[0122] Step d: if the second bandwidth is in an adjustable state and the adjusted second bandwidth is greater than or equal to the first bandwidth, sending the target data packet to the second electronic device based on the adjusted second bandwidth.

[0123] If the first bandwidth corresponding to the first electronic device is greater than the second bandwidth corresponding to the second electronic device, the target electronic device determines whether the second bandwidth is in an adjustable state. For example, the target electronic device can send an adjustment instruction to the second electronic device. After receiving the adjustment instruction, if the second electronic device determines that the current second bandwidth is in an adjustable state, the second electronic device sends a bandwidth response instruction to the target electronic device, and the bandwidth response instruction is used to indicate that the second bandwidth is in an adjustable state, and is used to indicate the size of the adjusted second bandwidth. When the second electronic device determines whether the second bandwidth is in an adjustable state, the second electronic device can determine whether the second bandwidth is in an adjustable state based on the currently occupied bandwidth. It can be understood that the second electronic device will trigger the bandwidth response instruction only when the second bandwidth before adjustment is less than the second bandwidth after adjustment.

[0124] When the target electronic device receives the bandwidth adjustment instruction sent by the second electronic device, the target electronic device determines that the second bandwidth is in an adjustable state according to the bandwidth adjustment instruction, determines the adjusted second bandwidth based on the bandwidth adjustment instruction, and sends the target data packet to the second electronic device based on the adjusted second bandwidth.

[0125] In another embodiment, after the target electronic device determines the adjusted second bandwidth, the target electronic device determines whether the adjusted second bandwidth is greater than or equal to the first bandwidth. If the adjusted second bandwidth is greater than or equal to the first bandwidth, the target electronic device sends the target data packet to the second electronic device based on the adjusted second bandwidth. If the adjusted second bandwidth is less than the first bandwidth, the target electronic device sends the target data packet to the second electronic device based on the second bandwidth before adjustment. Or

[0126] In another embodiment, the data transmission method further includes:

[0127] Step e: if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state;

[0128] Step f: if the second bandwidth is in an adjustable state, and the adjusted second bandwidth is smaller than the first bandwidth, and the difference between the adjusted second bandwidth and the second bandwidth before adjustment is greater than a preset threshold, the target data packet is split based on the adjusted second bandwidth to obtain split sub-data packets, and the sub-data packets are sent to the second electronic device.

[0129] The implementation method of the above step e is the same as that of step c, and the implementation method of step e will not be repeated here. If the target electronic device determines that the second bandwidth is in an adjustable state, and determines that the adjusted second bandwidth is less than the first bandwidth, the target electronic device calculates the difference between the adjusted second bandwidth and the second bandwidth before adjustment. If the difference is less than or equal to the preset difference, the target electronic device sends the target data packet to the second electronic device based on the second bandwidth before adjustment; if the difference is greater than the preset difference, the target electronic device splits the target data packet based on the adjusted second bandwidth to obtain the split sub-data packets, and sends the split sub-data packets to the second electronic device. Among them, the size of the preset difference can be set according to specific needs, and the size of the preset difference is not specifically limited here.

[0130] In this embodiment, when the target electronic device needs to forward data sent by the first electronic device to the second electronic device, when the first bandwidth and / or the second bandwidth can be adjusted, data transmission is performed based on the adjusted first bandwidth and / or the adjusted second bandwidth to increase the amount of data transmitted in a single time, reduce the number of times the data packet is split during the cross-end data transmission process, and thus improve the efficiency of cross-end data transmission.

[0131] See also Figure 6 , Figure 6 It is a schematic block diagram of the structure of a data transmission device provided by an embodiment of the present invention.

[0132] like Figure 6 As shown, the data transmission device 200 is applied to a target electronic device, and the data transmission device 200 includes a receiving module, wherein:

[0133] The data receiving module 210 is configured to receive a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device;

[0134] The data sending module 220 is configured to send the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

[0135] In some embodiments, the data sending module 220 is also used to split the target data packet according to the second bandwidth to obtain split sub-data packets and send the sub-data packets to the second electronic device if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device; if the first bandwidth is less than or equal to the second bandwidth, send the target data packet to the second electronic device based on the second bandwidth.

[0136] In some embodiments, the data sending module 220 includes a first data splitting unit, which is used to split the target data packet according to the second bandwidth if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, and monitor whether the second bandwidth has been updated during the process of splitting the target data packet; if the second bandwidth has been updated, split the remaining target data packet according to the updated second bandwidth to obtain the split sub-data packets.

[0137] In some embodiments, the data sending module 220 includes a second data splitting unit, which is used to determine whether the target data packet is a complete data packet if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device; if the target data packet is an incomplete data packet, then when the last target data packet belonging to the same complete data packet as the target data packet is received, the received multiple target data packets are split according to the second bandwidth to obtain split sub-data packets.

[0138] In some embodiments, the device further includes a bandwidth determination module, a bandwidth adjustment module and an instruction sending module, wherein the bandwidth determination module is used to determine a first bandwidth of a transmission channel with the first electronic device and to determine a second bandwidth of a transmission channel with the second electronic device;

[0139] The instruction sending module is used to send a bandwidth adjustment instruction to the first electronic device if the first bandwidth is smaller than the second bandwidth, wherein the bandwidth adjustment instruction is used to instruct to increase the first bandwidth;

[0140] The bandwidth adjustment module is configured to determine the adjusted first bandwidth according to the bandwidth response instruction if a bandwidth response instruction corresponding to the bandwidth adjustment instruction sent by the first electronic device is received;

[0141] The data receiving module is further configured to receive a target data packet sent by the first electronic device based on the adjusted first bandwidth.

[0142] In some embodiments, the data sending module is also used to determine whether the second bandwidth is in an adjustable state if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device; if the second bandwidth is in an adjustable state and the adjusted second bandwidth is greater than or equal to the first bandwidth, the target data packet is sent to the second electronic device based on the adjusted second bandwidth.

[0143] In some embodiments, the data sending module 220 is also used to determine whether the second bandwidth is in an adjustable state if the first bandwidth is greater than the second bandwidth corresponding to the second electronic device; if the second bandwidth is in an adjustable state, and the adjusted second bandwidth is less than the first bandwidth, and the difference between the adjusted second bandwidth and the second bandwidth before adjustment is greater than a preset threshold, then split the target data packet based on the adjusted second bandwidth to obtain split sub-data packets, and send the sub-data packets to the second electronic device.

[0144] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the data transmission device described above can refer to the corresponding process in the aforementioned data transmission method embodiment, and will not be repeated here.

[0145] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any data transmission method provided in the description of the embodiment of the present invention.

[0146] The storage medium may be an internal storage unit of the electronic device described in the above embodiment, such as a hard disk or memory of the electronic device. The storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device.

[0147] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0148] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0149] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: The data transmission method is applied to a target electronic device, and the method comprises: receiving a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device; The target data packet is sent to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

2. The data transmission method according to claim 1, characterized in that: The method of sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes: If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets, and sending the sub-data packets to the second electronic device; If the first bandwidth is less than or equal to the second bandwidth, the target data packet is sent to the second electronic device based on the second bandwidth.

3. The data transmission method according to claim 2, characterized in that: If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes: If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth, and monitoring whether the second bandwidth has been updated during the process of splitting the target data packet; If the second bandwidth has been updated, the remaining target data packets are split according to the updated second bandwidth to obtain split sub-data packets.

4. The data transmission method according to claim 2, characterized in that: If the first bandwidth is greater than the second bandwidth corresponding to the second electronic device, splitting the target data packet according to the second bandwidth to obtain split sub-data packets includes: If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the target data packet is a complete data packet; If the target data packet is an incomplete data packet, when the last target data packet that belongs to the same complete data packet as the target data packet is received, the received multiple target data packets are split according to the second bandwidth to obtain split sub-data packets.

5. The data transmission method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine a first bandwidth of a transmission channel with the first electronic device, and determine a second bandwidth of a transmission channel with the second electronic device; If the first bandwidth is smaller than the second bandwidth, sending a bandwidth adjustment instruction to the first electronic device, wherein the bandwidth adjustment instruction is used to instruct to increase the first bandwidth; If a bandwidth response instruction corresponding to the bandwidth adjustment instruction is received from the first electronic device, determining the adjusted first bandwidth according to the bandwidth response instruction; The receiving, based on the first bandwidth corresponding to the first electronic device, a target data packet sent by the first electronic device includes: The target data packet sent by the first electronic device is received based on the adjusted first bandwidth.

6. The data transmission method according to claim 1, characterized in that: The sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes: If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state; If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is greater than or equal to the first bandwidth, the target data packet is sent to the second electronic device based on the adjusted second bandwidth.

7. The data transmission method according to claim 1, characterized in that: The sending the target data packet to the second electronic device according to the first bandwidth and the second bandwidth corresponding to the second electronic device includes: If the first bandwidth is greater than a second bandwidth corresponding to the second electronic device, determining whether the second bandwidth is in an adjustable state; If the second bandwidth is in an adjustable state, and the adjusted second bandwidth is smaller than the first bandwidth, and the difference between the adjusted second bandwidth and the second bandwidth before adjustment is greater than a preset threshold, the target data packet is split based on the adjusted second bandwidth to obtain split sub-data packets, and the sub-data packets are sent to the second electronic device.

8. A data transmission device, characterized in that: The data transmission device is applied to a target electronic device, and the data transmission device comprises: A data receiving module, configured to receive a target data packet sent by the first electronic device based on a first bandwidth corresponding to the first electronic device; The data sending module is used to send the target data packet to the second electronic device according to the first bandwidth and a second bandwidth corresponding to the second electronic device.

9. An electronic device, characterized in that: The electronic device includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the data transmission method according to any one of claims 1 to 7 is realized.

10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data transmission method according to any one of claims 1 to 7.