Data transmission method and device, program product and storage medium
By using flow control messages to adjust the packet sending rate during data migration, the overflow and packet loss problem caused by the UDP protocol is solved, and data transmission performance and migration efficiency are improved.
Patent Information
- Application Number
- CN202411135269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2025-10-03
AI Technical Summary
During the data migration process, the use of the unreliable UDP protocol resulted in overflow and packet loss, resulting in poor data transmission performance and the need for data retransmission, which increased the time required to complete the data migration and reduced efficiency.
The first terminal device actively monitors the queue memory and sends a flow control message before overflow and packet loss may occur, instructing the second terminal device to reduce the data packet sending rate. The second terminal device adjusts the data packet sending rate according to the flow control message to avoid overflow and packet loss and improve data transmission performance.
It effectively avoids overflow and packet loss, reduces data migration time, and improves data migration efficiency.
Smart Images

Figure CN120750871A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device, program product, and storage medium. Background Art
[0002] Currently, data migration uses the User Datagram Protocol (UDP) for data transmission. However, UDP is an unreliable transport layer protocol that allows for packet loss. This can lead to packet loss during data migration, resulting in poor data transmission performance and the need for data retransmission. This can lead to longer data migration times and lower data migration efficiency. Summary of the Invention
[0003] The present application provides a data transmission method, device, program product and storage medium, the purpose of which is to reduce the problem of overflow and packet loss during data migration and improve data migration efficiency.
[0004] In order to achieve the above objectives, this application provides the following technical solutions:
[0005] A first aspect of the present application provides a data transmission method. Specifically, a first terminal device determines a first queue memory size of the first terminal device. When the first queue memory size is greater than a first flow control threshold, the first terminal device sends a first flow control message to a second terminal device. The first flow control message is used to instruct the second terminal device to reduce a data packet transmission rate.
[0006] The method actively monitors the queue memory of the first terminal device through the first terminal device, and actively sends a first flow control message to the second terminal device before overflow and packet loss may occur. In this way, the second terminal device can reduce the rate of sending data packets to the first terminal device based on the first flow control message, thereby avoiding overflow and packet loss, improving data transmission performance, and further reducing the time spent on data migration and improving data migration efficiency.
[0007] In some possible implementations, after sending the first flow control message to the second terminal device, the first terminal device may continue to actively monitor the queue memory of the first terminal device to determine the size of the second queue memory of the first terminal device, and when the second queue memory size is less than a second flow control threshold, send a second flow control message to the second terminal device. The second flow control message is used to instruct the second terminal device to stop reducing the data packet sending rate.
[0008] In this method, the first terminal device continuously monitors the queue memory of the first terminal device. When the second queue memory size of the first terminal device is less than the second flow control threshold, that is, when overflow and packet loss are unlikely to occur, the second flow control message is actively sent to the second terminal device. In this way, the second terminal device can stop reducing the data packet sending rate based on the second flow control message, thereby restoring or relatively improving the data packet sending rate while ensuring that overflow and packet loss do not occur, avoiding the problem that the data processing speed of the first device is greater than the data receiving speed, thereby affecting the data migration speed, thereby further improving the data migration efficiency.
[0009] In some possible implementations, the first flow control message carries a first memory usage of the first terminal device, which is used by the second terminal device to determine a reduced data packet sending rate. This allows the second terminal device to determine the current memory usage of the first terminal device based on the first memory usage, thereby reasonably determining the reduced data packet sending rate and preventing an excessively low data packet sending rate from impacting data migration efficiency.
[0010] In some possible implementations, the first flow control message carries a first memory usage of the first terminal device, which is used to instruct the second terminal device to reduce the rate at which data packets are sent. This allows the second terminal device to reduce the rate at which data packets are sent to the first terminal device based on the first memory usage, thereby avoiding overflow and packet loss, improving data transmission performance, and further reducing the time spent on data migration, thereby improving data migration efficiency.
[0011] In some possible implementations, the first memory percentage is determined based on the first queue memory size and a memory baseline value, thereby providing a feasible method for determining the first memory percentage.
[0012] In some possible implementations, the second flow control message carries a second memory usage of the first terminal device, which is used to instruct the second terminal device to stop reducing the packet transmission rate. This allows the second terminal device to stop reducing the packet transmission rate based on the second memory usage, thereby restoring or relatively increasing the packet transmission rate while ensuring that overflow and packet loss do not occur. This avoids the problem of the first device's data processing speed exceeding the data reception speed, which affects the data migration speed, thereby further improving data migration efficiency.
[0013] In some possible implementations, determining the first queue memory size of the first terminal device includes determining the first queue memory size based on a first receive queue memory size, a first receive queue buffer size, a first input / output (IO) queue memory size, and a first IO queue buffer size. This allows the queue memory size to be reasonably determined so that the first flow control message can be subsequently sent at a reasonable time.
[0014] In some possible implementations, the first flow control threshold and the second flow control threshold are determined based on a memory baseline value, and the first flow control threshold is greater than the second flow control threshold. This provides a feasible method for determining the first flow control threshold and the second flow control threshold.
[0015] In some possible implementations, the data transmission method is applied to mobile phone cloning, where the first terminal device is an old mobile phone and the second terminal device is a new mobile phone. This can reduce the time spent on mobile phone cloning and improve the efficiency of mobile phone cloning.
[0016] A second aspect of the present application provides a data transmission method. Specifically, a second terminal device receives a first flow control message, parses the first flow control message, adjusts a data packet transmission rate to a first transmission rate, and transmits the data packet to the first terminal device based on the first transmission rate. The first flow control message is used to instruct the second terminal device to reduce the data packet transmission rate.
[0017] In this method, the second terminal device receives the first flow control message sent by the first terminal device, so that before overflow and packet loss may occur, the rate of sending data packets to the first terminal device is reduced, thereby avoiding overflow and packet loss, improving data transmission performance, and further reducing the time spent on data migration and improving data migration efficiency.
[0018] In some possible implementations, after sending data packets to a first terminal device at a first sending rate, the first terminal device continuously monitors the size of a queue memory of the first terminal device, and a second terminal device receives a second flow control message sent by the first terminal device, parses the second flow control message, adjusts the sending rate of the data packets to a second sending rate, and sends the data packets to the first terminal device based on the second sending rate. The second flow control message is used to instruct the second terminal device to stop reducing the sending rate of the data packets, and the second sending rate is greater than the first sending rate.
[0019] In this method, the second terminal device receives the second flow control message sent by the first terminal device, so that when overflow and packet loss are unlikely to occur, it will stop reducing the data packet sending rate. This can avoid the problem that the data processing speed of the first device is greater than the data receiving speed, which affects the data migration speed, and can further improve the data migration efficiency.
[0020] In some possible implementations, parsing the first flow control message and adjusting the data packet sending rate to the first sending rate includes: parsing the first flow control message to obtain a first memory usage of the first terminal device, and adjusting the data packet sending rate to the first sending rate based on the first memory usage. In this way, the second terminal device can understand the memory usage of the first terminal device based on the parsed first memory usage, thereby reasonably determining the reduced data packet sending rate, thereby preventing the data packet sending rate from being too low, which may affect data migration efficiency.
[0021] In some possible implementations, adjusting the packet sending rate to the first sending rate based on the first memory usage includes: adjusting the packet sending rate to the first sending rate based on the first memory usage and a second sending rate. The second sending rate is the packet sending rate before the reduction. In this way, the second terminal device can more reasonably determine the reduced packet sending rate based on the current memory usage of the first terminal device and the current packet sending rate of the second terminal device.
[0022] In some possible implementations, the first memory percentage is determined based on a first queue memory size and a memory baseline value of the first terminal device, thereby providing a feasible method for determining the first memory percentage.
[0023] In some possible implementations, the first queue memory is determined based on a first receive queue memory size, a first receive queue buffer size, a first input / output (IO) queue memory size, and a first IO queue buffer size of the first terminal device. This allows the queue memory size to be reasonably determined, allowing the first flow control message to be subsequently sent at a reasonable time.
[0024] In some possible implementations, parsing the second flow control message and adjusting the data packet sending rate to the second sending rate includes: parsing the second flow control message to obtain a second memory usage of the first terminal device, and adjusting the data packet sending rate to the second sending rate based on the second memory usage. This enables the second terminal device to stop reducing the data packet sending rate based on the second memory usage, thereby avoiding the problem of the first device's data processing speed exceeding the data reception speed, which affects the data migration speed, and further improving data migration efficiency.
[0025] In some possible implementations, the data transmission method is applied to mobile phone cloning, where the first terminal device is an old mobile phone and the second terminal device is a new mobile phone. This can reduce the time spent on mobile phone cloning and improve the efficiency of mobile phone cloning.
[0026] A third aspect of the present application provides a data transmission device, which is applied to a first terminal device and includes:
[0027] a determination module, configured to determine a memory size of a first queue of a first terminal device;
[0028] The sending module is used to send a first flow control message to the second terminal device when the memory size of the first queue is greater than the first flow control threshold; the first flow control message is used to instruct the second terminal device to reduce the sending rate of the data packet.
[0029] The data transmission device has the function of implementing the data transmission method in the first aspect or any possible implementation of the first aspect. This function can be implemented by hardware or by hardware executing corresponding software, and the hardware or software includes one or more modules corresponding to the above functions.
[0030] A fourth aspect of the present application provides a data transmission device, which is applied to a second terminal device and includes:
[0031] A receiving module, configured to receive a first flow control message; the first flow control message is used to instruct the second terminal device to reduce a sending rate of data packets;
[0032] an adjustment module, configured to parse the first flow control message and adjust the sending rate of the data packet to the first sending rate;
[0033] A sending module is used to send data packets to a first terminal device based on a first sending rate.
[0034] The data transmission device has the function of implementing the data transmission method in the second aspect or any possible implementation of the second aspect. This function can be implemented by hardware or by hardware executing corresponding software, and the hardware or software includes one or more modules corresponding to the above functions.
[0035] A fifth aspect of the present application provides a data transmission system, the system comprising a first terminal device and a second terminal device,
[0036] The first terminal device is configured to determine a memory size of a first queue of the first terminal device;
[0037] The first terminal device is configured to send a first flow control message to the second terminal device when the memory size of the first queue is greater than the first flow control threshold; the first flow control message is configured to instruct the second terminal device to reduce a sending rate of data packets;
[0038] A second terminal device is configured to receive the first flow control message; the first flow control message is configured to instruct the second terminal device to reduce a sending rate of data packets;
[0039] The second terminal device is configured to parse the first flow control message and adjust the sending rate of the data packet to the first sending rate;
[0040] The second terminal device is used to send data packets to the first terminal device based on the first sending rate.
[0041] The data transmission system has the function of implementing the data transmission method in the above-mentioned first aspect or any possible implementation of the first aspect, and the function of implementing the data transmission method in the above-mentioned second aspect or any possible implementation of the second aspect.
[0042] A sixth aspect of the present application provides a data transmission device, comprising: a memory and at least one processor. The memory is configured to store a computer program or computer instructions, and the at least one processor is configured to execute the computer program or computer instructions stored in the memory, so that the data transmission device implements the data transmission method of the first aspect of the present application or any optional embodiment of the first aspect, or implements the data transmission method of the second aspect of the present application or any optional embodiment of the second aspect.
[0043] The seventh method of the present application provides a computer program product, including a computer program, which, when executed, is used to implement the data transmission method in the first aspect of the present application or any optional implementation of the first aspect, or to implement the data transmission method in the second aspect of the present application or any optional implementation of the second aspect.
[0044] The eighth aspect of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement the data transmission method in the first aspect of the present application or any optional embodiment of the first aspect, or to implement the data transmission method in the second aspect of the present application or any optional embodiment of the second aspect.
[0045] The ninth aspect of the present application provides a chip system, which includes a processor for supporting a device to implement the functions involved in the above aspects, for example, sending or processing the data and / or information involved in the above methods. In one possible design, the chip system also includes a memory for storing program instructions and data necessary for the device. The chip system can be composed of a chip or can include a chip and other discrete devices.
[0046] The tenth aspect of the present application provides a chip, comprising one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the data transmission method in the first aspect or any optional embodiment of the first aspect, or the electronic device executes the data transmission method in the second aspect or any optional embodiment of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a flow chart of overflow packet loss disclosed in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of a data migration scenario provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a data transmission process provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of another data transmission process provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of another data transmission process provided in an embodiment of the present application
[0052] Figure 6 A schematic diagram of the format of a first flow control message provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of a mobile phone cloning process provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of another mobile phone cloning process provided in an embodiment of the present application;
[0055] Figure 9 A schematic diagram of another mobile phone cloning process provided in an embodiment of the present application;
[0056] Figure 10 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0057] Figure 11 A schematic structural diagram of another data transmission device provided in an embodiment of the present application;
[0058] Figure 12 A structural diagram of another data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in 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 limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship.
[0060] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0061] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first" and "second" are only used for the purpose of distinguishing the description and cannot be understood as indicating or implying relative importance or order.
[0062] See also Figure 1 , is a flow chart of overflow packet loss disclosed in an embodiment of the present application. The buffer size limit is 42MB, the send engine receive queue size limit is 150MB, the file transfer protocol main thread size limit is 150MB, and the IO queue size limit is 150MB. Figure 1 The 1w in the datagram indicates that the length is 10,000 data packets. One data packet is 1.5KB, and the total length of 10,000 data packets corresponds to 150MB of data.
[0063] In data migration scenarios, using the unreliable transport layer protocol UDP for data transmission can lead to overflow and packet loss when the buffer exceeds 42MB and the receive queue, retransmission node, and I / O queue exceed 150MB. This can lead to poor data transmission performance and the need for data retransmission, resulting in a longer data migration time and lower data migration efficiency.
[0064] To this end, the present application provides a data transmission method, device, program product and storage medium for solving the problem of overflow and packet loss during data migration and improving data migration efficiency.
[0065] See also Figure 2 , is a schematic diagram of a data migration scenario provided by an embodiment of the present application. The data transmission method provided by an embodiment of the present application can be applied to the data migration scenario. The second terminal device sends a data packet to the first terminal device, and the first terminal device receives and stores the data packet, thereby realizing data migration. In the process of using UDP for data packet transmission, the first terminal device actively monitors the queue memory of the first terminal device, and actively sends a first flow control message to the second terminal device before overflow and packet loss may occur. In this way, the second terminal device can reduce the rate of sending data packets to the first terminal device based on the first flow control message, thereby avoiding the problem of overflow and packet loss during data migration, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0066] In the embodiments provided in the present application, the first terminal device and the second terminal device can be in various forms, for example, a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a vehicle-mounted terminal device, a wireless terminal in self-driving, a wireless terminal in remote medicine, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a wearable terminal device, and the like. Terminal equipment may also sometimes be referred to as user equipment (UE), access terminal equipment, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal equipment, mobile device, UE terminal equipment, terminal equipment, wireless communication equipment, UE agent or UE device, etc. A terminal may also be a fixed terminal or a mobile terminal.
[0067] See also Figure 3 , Figure 3 A schematic diagram of a data transmission process provided for the implementation of this application, which can be executed by a first terminal device. The data transmission method provided in the embodiment of this application may include:
[0068] S301: Determine the memory size of a first queue of a first terminal device.
[0069] In the embodiment of the present application, the first terminal device is the receiver of the data packet. The first terminal device can continuously monitor the queue memory of the first terminal device. After the first terminal device receives the data packet sent by the second terminal device, it can determine the current queue memory size of the first terminal device.
[0070] Queues can include receive queues and I / O queues. The receive queue primarily stores data transmitted from the second terminal device, awaiting processing by the first terminal device. This acts as a buffer, preventing data loss or corruption due to slower processing speeds. The I / O queue is the queue where data packets processed by the first terminal device's receive queue are stored for file I / O storage.
[0071] S302: When the memory size of the first queue is greater than the first flow control threshold, send a first flow control message to the second terminal device.
[0072] The first flow control message is used to instruct the second terminal device to reduce the sending rate of data packets.
[0073] In this embodiment of the present application, when the memory size of the first queue is greater than the first flow control threshold, it can be determined that if the second terminal device continues to send data packets to the first terminal device at the current sending rate, the first terminal device is likely to experience overflow and packet loss after a certain period of time. In this case, the first terminal device will proactively send a first flow control message to the second terminal device, instructing it to reduce the data packet sending rate. In other words, before overflow and packet loss occur, the first terminal device proactively requests the second terminal device to reduce the data packet sending rate.
[0074] In the embodiment of the present application, the first flow control threshold can be set according to actual conditions, such as 180M, 170M, etc., and the embodiment of the present application does not limit this.
[0075] It can be seen that in the embodiment of the present application, the first terminal device actively monitors the queue memory of the first terminal device, and actively sends a first flow control message to the second terminal device before overflow and packet loss may occur. In this way, the second terminal device can reduce the rate of sending data packets to the first terminal device based on the first flow control message, thereby avoiding overflow and packet loss, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0076] See also Figure 4 , Figure 4 A schematic diagram of another data transmission process provided for the implementation of this application, which can be performed by a second terminal device. The data transmission method provided in this embodiment of the application may include:
[0077] S401: Receive a first flow control message.
[0078] The first flow control message is used to instruct the second terminal device to reduce the sending rate of data packets, and the first flow control message is generated when the memory size of the first queue of the first terminal device is greater than the first flow control threshold.
[0079] In the embodiment of the present application, after the first terminal device at the opposite end sends the first flow control message, the second terminal device will receive the first flow control message sent by the first terminal device.
[0080] S402: parse the first flow control message and adjust the sending rate of the data packet to the first sending rate.
[0081] In the embodiment of the present application, the second terminal device can parse the first flow control message to obtain information carried by the first flow control message, and then adjust the data packet transmission rate based on the carried information. It is understood that the embodiment of the present application does not limit the specific method for determining the first transmission rate, and it is sufficient to ensure that the first transmission rate is less than the transmission rate of the data packet before adjustment.
[0082] S403: Send a data packet to the first terminal device based on the first sending rate.
[0083] In the embodiment of the present application, the second terminal device is the sender of the data, and the second terminal device sends data packets to the first terminal device based on the adjusted first sending rate.
[0084] It can be seen that in the embodiment of the present application, the second terminal device receives the first flow control message sent by the first terminal device, so that before overflow and packet loss may occur, the rate of sending data packets to the first terminal device will be reduced, thereby avoiding overflow and packet loss, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0085] See also Figure 5 , Figure 5 A schematic diagram of another data transmission process provided for the implementation of this application, which can be performed by a data transmission system, which can include a first terminal device and a second terminal device. The data transmission method provided in the embodiment of this application may include:
[0086] S501: A first terminal device determines a memory size of a first queue of the first terminal device.
[0087] It can be understood that S501 in the embodiment of the present application has the same parts as S301 in the above embodiment, and the same parts will not be repeated here.
[0088] In one possible implementation, S501 in the embodiment of the present application may include: determining the first queue memory size based on the first receive queue memory size, the first receive queue cache size, the first IO queue memory size, and the first IO queue cache size. Specifically, the first queue memory size = the first receive queue memory size + the first receive queue cache size + the first IO queue memory size + the first IO queue cache size. In this way, based on the receive queue and the IO queue, and in combination with the memory and cache, the queue memory size can be reasonably determined, so that the first flow control message can be sent at a reasonable time subsequently.
[0089] In the embodiment of the present application, the receive queue can be divided into a receive memory queue and a receive cache queue, and the IO queue can be divided into an IO memory queue and an IO cache queue. During the data migration process, the data packets are first stored in the receive memory queue, and then the data packets are taken out of the receive memory queue and stored in the receive cache queue to wait for processing. After that, the data packets are sequentially taken out from the receive cache queue for processing. After that, the processed data packets are stored in the IO memory queue, and then the processed data packets are taken out of the IO memory queue and stored in the IO cache queue to wait for IO disk. After that, the processed data packets are sequentially taken out from the IO cache queue for IO disk.
[0090] The receive queue memory size refers to the size of the data packets stored in the receive memory queue, the receive queue cache size refers to the size of the data packets stored in the receive cache queue, the IO queue memory size refers to the size of the processed data packets stored in the IO memory queue, and the IO queue cache size refers to the size of the processed data packets stored in the IO cache queue.
[0091] It can be understood that the first receive queue memory size refers to the size of the data packets stored in the current receive memory queue, the first receive queue cache size refers to the size of the data packets stored in the current receive cache queue, the first IO queue memory size refers to the size of the processed data packets stored in the current IO memory queue, and the first IO queue cache size refers to the size of the processed data packets stored in the current IO cache queue.
[0092] It should be noted that determining the total queue memory based on the receive and I / O queues can avoid overflow and packet loss in the receive and I / O queues. Furthermore, avoiding overflow and packet loss in the receive queue prevents packet retransmission, thereby avoiding overflow and packet loss at the retransmission node. Buffer overflow and packet loss can be avoided by controlling the rate at which packets are retrieved from the buffer, or by increasing the buffer size by modifying the corresponding configuration file.
[0093] S502: When the memory size of the first queue is greater than the first flow control threshold, the first terminal device sends a first flow control message to the second terminal device.
[0094] The first flow control message is used to instruct the second terminal device to reduce the sending rate of data packets.
[0095] It can be understood that S502 in the embodiment of the present application has the same parts as S302 in the above embodiment, and the same parts will not be repeated here.
[0096] See also Figure 6, which is a schematic diagram of the format of a first flow control message provided in an embodiment of the present application. The type field is used to distinguish messages with different functions; the Flag field is used to further subdivide frames of the same type; the Session ID field is used to identify a unique transmission session; the Trans ID field is used to describe the specific task sequence number in the session; the data length field is used to describe the payload message length; the moduleType field is used to identify a data packet corresponding to any of the following protocols: the message transmission protocol, the streaming media transmission protocol, and the file transfer protocol; and queueRat io is used to describe the current memory usage of the first terminal device, i.e., the first memory usage. Figure 6 The Type field is 8 bits long, the Flag field is 8 bits long, the Session ID field is 16 bits long, the Trans ID field is 16 bits long, the Data Length field is 16 bits long, the Module Type field is 8 bits long, and the QueueRat io field is 32 bits long. 8 bits is one byte.
[0097] In one possible implementation, the first flow control message carries the first memory share of the first terminal device, and the first memory share is used to instruct the second terminal device to reduce the sending rate of the data packets. For example: the first memory share carried by the first flow control message is 70%, and the second terminal device parses the first flow control message, determines that 70% is greater than the first share threshold of 60%, and determines to reduce the sending rate of the data packets. It will be understood that the above is only an exemplary description and should not be understood as a limitation on the embodiments of the present application. In this way, the second terminal device can reduce the rate at which data packets are sent to the first terminal device based on the first memory share, thereby avoiding overflow and packet loss, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0098] In one possible implementation, the first flow control message in the embodiment of the present application carries the first memory usage of the first terminal device, which can also be used by the second terminal device to determine the reduced data packet transmission rate. In this way, the second terminal device can obtain the current memory usage of the first terminal device based on the first memory usage, thereby reasonably determining the reduced data packet transmission rate and preventing the data packet transmission rate from being too low, which may affect data migration efficiency.
[0099] In one possible implementation, the first memory share in the embodiments of the present application can be determined based on the first queue memory size and the memory baseline value. This provides a feasible method for determining the first memory share. For example, if the first queue memory size is 200MB and the memory baseline value is 280MB, the first memory share is 200 / 280≈0.714. It will be understood that the above is merely an example and should not be construed as limiting the embodiments of the present application.
[0100] It can be understood that the memory baseline value in the embodiment of the present application is a memory indicator defined by the data service middleware of the first terminal device, which can be set according to the actual situation of the first terminal device. For example, the memory baseline value can be set to 280MB, 290MB, etc. The embodiment of the present application does not impose any restrictions on this.
[0101] In one possible implementation, the first flow control threshold in the embodiments of the present application can be determined based on the memory baseline value. This provides a feasible method for determining the first flow control threshold. For example, if the memory baseline value is 280MB, the first flow control threshold is 280×0.6=168MB. It should be understood that the above is merely an example and should not be construed as limiting the embodiments of the present application.
[0102] S503: The second terminal device receives the first flow control message.
[0103] It can be understood that S503 in the embodiment of the present application has the same parts as S401 in the above embodiment, and the same parts will not be repeated here.
[0104] S504: The second terminal device parses the first flow control message and adjusts the sending rate of the data packet to the first sending rate.
[0105] It can be understood that S504 in the embodiment of the present application has the same parts as S402 in the above embodiment, and the same parts will not be repeated here.
[0106] In one possible implementation, S504 in the embodiment of the present application may include: the second terminal device parses the first flow control message to obtain the first memory share of the first terminal device; the second terminal device adjusts the data packet sending rate to the first sending rate based on the first memory share.
[0107] The larger the first memory ratio, the smaller the adjusted first sending rate, and the smaller the first memory ratio, the larger the adjusted first sending rate. This allows the second terminal device to understand the memory ratio of the first terminal device based on the parsed first memory ratio, thereby reasonably determining the reduced data packet sending rate and preventing the data packet sending rate from being too low, affecting data migration efficiency.
[0108] In one possible implementation, the second terminal device may adjust the sending rate of the data packet to the first sending rate based on the first memory usage and the second sending rate.
[0109] The second sending rate is the sending rate of the data packets before the reduction. In this way, the second terminal device can more reasonably determine the sending rate of the data packets after the reduction by combining the current memory usage of the first terminal device and the current sending rate of the data packets of the second terminal.
[0110] In a possible implementation, the first sending rate may be determined by the following formula:
[0111] dSendRate1=(1-O1)×a×dSendRate2
[0112] Among them, dSendRate1 represents the first sending rate, that is, the sending rate of the data packet after reduction, dSendRate2 represents the second sending rate, that is, the sending rate of the data packet before reduction, O1 represents the first memory ratio, a represents a constant, a can be set to 0.1, or 0.2, etc. according to the actual situation of the first terminal device and / or the second terminal device, and the embodiment of the present application does not limit this.
[0113] For example, if dSendRate2 is 40, a is 0.1, and O1 is 0.7, then dSendRate1 = (1-0.7) × 0.1 × 40 = 1.2. It should be understood that the above is merely an example and should not be construed as limiting the embodiments of the present application.
[0114] S505. The second terminal device sends a data packet to the first terminal device based on the first sending rate.
[0115] It can be understood that S505 in the embodiment of the present application has the same parts as S403 in the above embodiment, and the same parts will not be repeated here.
[0116] S506: The first terminal device determines a memory size of a second queue of the first terminal device.
[0117] In the embodiment of the present application, the second terminal device sends a data packet to the first terminal device at a reduced data packet sending rate. After the first terminal device receives the data packet, it determines the memory size of the second queue of the first terminal device.
[0118] It should be noted that the method for determining the memory size of the second queue of the first terminal device is similar to the method for determining the memory size of the first queue of the first terminal device, and similar parts are not repeated here. In the embodiment of the present application, S506 may include: determining the memory size of the second queue based on the memory size of the second receive queue, the cache size of the second receive queue, the memory size of the second IO queue, and the cache size of the second IO queue.
[0119] It can be understood that the second receive queue memory size also refers to the size of the data packets stored in the current receive memory queue, the second receive queue cache size also refers to the size of the data packets stored in the current receive cache queue, the second IO queue memory size also refers to the size of the processed data packets stored in the current IO memory queue, and the second IO queue cache size also refers to the size of the processed data packets stored in the current IO cache queue.
[0120] S507: When the memory size of the second queue is smaller than the second flow control threshold, the first terminal device sends a second flow control message to the second terminal device.
[0121] The second flow control message is used to instruct the second terminal device to stop reducing the sending rate of data packets.
[0122] In the embodiment of the present application, when the memory size of the second queue is less than the second flow control threshold, it can be determined that if the second terminal device continues to send data packets to the first terminal device at the current sending rate, the first terminal device will not experience overflow or packet loss, and the data processing speed in the first terminal device will be greater than the data receiving speed. After a certain period of time, it may be necessary to wait for the second terminal device to send data before the first terminal device begins processing the data, which will affect the speed of data migration. In this case, the first terminal device will proactively send a second flow control message to the second terminal device to instruct it to stop reducing the data packet sending rate. In other words, it will proactively request the second terminal device to stop reducing the data packet sending rate before affecting the speed of data migration.
[0123] In the embodiment of the present application, the second flow control threshold can be set according to actual conditions, such as 110M, 120M, etc., and the embodiment of the present application does not limit this. Among them, the first flow control threshold is greater than the second flow control threshold.
[0124] In one possible implementation, the second flow control threshold in the embodiments of the present application can be determined based on the memory baseline value. This provides a feasible method for determining the second flow control threshold. For example, if the memory baseline value is 280MB, the first flow control threshold is 280×0.4=112MB. It should be understood that the above is merely an example and should not be construed as limiting the embodiments of the present application.
[0125] It should be noted that the format of the second flow control message is the same as that of the first flow control message, except that the format of the second flow control message can also be set as follows: Figure 6 The message format shown.
[0126] In one possible implementation, the second flow control message carries the second memory percentage of the first terminal device, and the second memory percentage is used to instruct the second terminal device to stop reducing the sending rate of data packets. For example: the second memory percentage carried by the second flow control message is 35%, and the second terminal device parses the second flow control message, determines that 35% is less than the second percentage threshold of 40%, and determines to stop reducing the sending rate of data packets. It will be understood that the above is only an exemplary description and should not be understood as a limitation on the embodiments of the present application. In this way, the second terminal device can stop reducing the sending rate of data packets based on the second memory percentage, thereby being able to restore or relatively increase the sending rate of data packets while ensuring that overflow and packet loss do not occur, which can further improve data migration efficiency.
[0127] In one possible implementation, the second memory share in the embodiments of the present application can be determined based on the second queue memory size and the memory baseline value. This provides a feasible method for determining the first memory share. For example: if the second queue memory size is 100MB and the memory baseline value is 280MB, the first memory share is 100 / 280≈0.357. It will be understood that the above is merely an exemplary description and should not be construed as limiting the embodiments of the present application.
[0128] S508. The second terminal device receives the second flow control message.
[0129] S509: The second terminal device parses the second flow control message and adjusts the sending rate of the data packet to the second sending rate.
[0130] The second sending rate is greater than the first sending rate.
[0131] In the embodiment of the present application, the sending rate of the data packets can be restored to the sending rate of the data packets before the reduction, or the sending rate of the data packets can be adjusted to a sending rate greater than the first sending rate.
[0132] In one possible implementation, S509 in the embodiment of the present application may include: the second terminal parses the second flow control message to obtain the second memory share of the first terminal device; the second terminal device adjusts the data packet sending rate to the second sending rate based on the second memory share. The second sending rate may be the sending rate of the data packet before the reduction, or the second sending rate may be a rate greater than the first sending rate, that is, the sending rate of the data packet may be restored to the sending rate of the data packet before the reduction, or the sending rate of the data packet may be adjusted to a rate greater than the first sending rate. If the sending rate of the data packet is adjusted to a rate greater than the first sending rate, it may be set that the smaller the second memory share, the larger the adjusted second sending rate, and the larger the first memory share, the smaller the adjusted second sending rate. In this way, the second terminal device can stop reducing the sending rate of the data packet based on the second memory share, thereby being able to restore or relatively increase the sending rate of the data packet while ensuring that no overflow or packet loss occurs, thereby further improving data migration efficiency.
[0133] S510. The second terminal device sends a data packet to the first terminal device based on a second sending rate.
[0134] It can be seen that in the embodiment of the present application, the queue memory size of the first terminal device is determined in real time. When the queue memory size exceeds the first flow control threshold, flow control is triggered and a first flow control message is sent to the second terminal device to reduce the speed. When the queue memory size is less than the second flow control threshold, flow control is triggered to be released and a second flow control message is sent to the second terminal device to notify the stop of speed reduction. After the second terminal device receives the corresponding flow control message, speed reduction is triggered or speed reduction is stopped. In this way, the sending rate of data packets can be dynamically adjusted, thereby improving data migration efficiency while avoiding overflow and packet loss.
[0135] To make the technical solution of this application clearer and easier to understand, the data transmission method of this application is described in detail below, using a specific mobile phone cloning scenario. Mobile phone cloning can also be referred to as phone replacement cloning, phone replacement cloning service, etc. The old phone is the second terminal device in the above embodiment, and the new phone is the first terminal device in the above embodiment.
[0136] See also Figure 7 , is a flow chart of a mobile phone cloning process provided by the embodiment of the present application. Figure 7 This article explains the general process of mobile phone cloning.
[0137] Let's first explain the old phone side. The old phone scans the QR code of the new phone to establish a connection with the new phone. The user selects the data to be transferred to the new phone in the old phone, such as pictures, audio, video, contact information, text messages, etc., and then the old phone sends the selected data to the new phone. During the data transmission process, if the old phone has no operation for a certain period of time, such as 15 seconds, the old phone can add an Always On Display (AOD) so that the old phone can send data with lower power consumption. After the data transmission is completed, the old phone can remove the AOD.
[0138] Let's use the new phone side to explain. After the old phone scans the QR code generated by the new phone, the new phone establishes a connection with the old phone, and the new phone receives the data sent by the old phone. During the data reception process, if the new phone has no operation for a certain period of time, such as 15 seconds of misoperation, the new phone can add AOD, and enter the AOD through the low-power display system (LPDS) to identify the layer stack, so that the new phone can receive data with lower power consumption. After entering the AOD, if the user clicks on the phone interface of the new phone, the new phone will remove the AOD, and pop the layer stack through the LPDS identification layer to exit the AOD. If the new phone has no operation for a certain period of time, the new phone will add the AOD again. After the data import is completed, the new phone can remove the AOD.
[0139] See also Figure 8 , is a flow chart of another mobile phone cloning process provided by an embodiment of the present application, Figure 8 The left side shows the process of the old phone in the phone cloning process. Figure 8 The right side shows the process corresponding to the new phone in mobile phone cloning. Mobile phone cloning is based on file direct transfer, stream direct transfer, session management layer, file transfer protocol, streaming data transmission protocol, sending engine, buffer, and network card driver. Among them, the session management layer is used to establish a connection between the old phone and the new phone; the file transfer protocol in the minimalist protocol can be a file transfer protocol developed by the device manufacturer, such as DFI LE, etc., and the streaming media transmission protocol in the minimalist protocol can be a streaming media transmission protocol developed by the device manufacturer, such as DSTREAM, etc.; the buffer can be a UDP socket buffer. During the mobile phone cloning process, if the sending rate of the data packet is not adjusted, there may be overflow packet loss in the UDP socket buffer, overflow packet loss in the receiving queue corresponding to the sending engine, overflow packet loss in the retransmission node corresponding to the minimalist protocol, and overflow packet loss in the IO queue corresponding to the minimalist protocol.
[0140] See also Figure 9 , is a flow chart of another mobile phone cloning process provided by an embodiment of the present application, Figure 9The mobile phone clone, transfer service middle platform, and transfer dynamic library on the left correspond to the old mobile phone. Figure 9 The mobile phone clone, transfer service middle platform, and transfer dynamic library on the right correspond to the new mobile phone. Figure 9 The mobile phone clone in is a functional module. Figure 9 The detailed process of mobile phone cloning is described. The steps of mobile phone cloning may include:
[0141] 1. The user selects this device as the old device on the phone clone of the old phone, and the old phone pops up the QR code scanning interface.
[0142] 2. The user selects this device as the new device on the phone clone of the new phone, and the generated QR code pops up on the new phone.
[0143] 3. The user uses the scanning interface of the old phone to scan the QR code generated by the new phone, and the new phone and the old phone service establish an ultra-high-speed physical connection.
[0144] 4. Start the transmission service in the transmission service center of the old mobile phone.
[0145] 5. Create a session in the old phone's transfer service center.
[0146] 6. Open the client on the transfer service desk of the old phone.
[0147] 7. Launch the client in the old phone's transfer dynamic library and save the business use case.
[0148] 8. The old phone’s transmission dynamic library notifies the old phone’s transmission service center, and the client is launched successfully.
[0149] 9. The transmission service center of the old phone negotiates with the transmission service center of the new phone and starts the server on the transmission service center of the new phone.
[0150] 10. Launch the server in the transmission dynamic library of the new phone.
[0151] 11. The transmission dynamic library of the new mobile phone notifies the transmission service middle platform of the new mobile phone, and the server is successfully launched.
[0152] 12. The transmission service center of the new phone notifies the transmission service center of the old phone, and the server-side transmission service is successfully started.
[0153] 13. The old phone's transfer service center notifies the old phone's phone clone that the service is successfully started; the new phone's transfer service center notifies the new phone's phone clone that the service is successfully started.
[0154] 14. The user selects the data to be cloned on the phone clone of the old phone.
[0155] 15. The old phone reads the data to be cloned, performs protocol encapsulation on the data to be cloned, obtains a data packet, and then sends the data packet to the kernel driver, that is, to the transmission dynamic library of the old phone.
[0156] 16. The transmission dynamic library of the old mobile phone sends the data packet to the transmission dynamic library of the new mobile phone through air interface transmission.
[0157] 17. The transmission dynamic library of the new phone parses the data packet and monitors the real-time memory. If the memory is greater than the flow control threshold after the file is saved to the disk, a flow control message is sent to the transmission dynamic library of the old phone.
[0158] It can be understood that the memory here corresponds to the first queue memory size in the above embodiment, the flow control threshold corresponds to the above first flow control threshold, and the flow control message corresponds to the above first flow control threshold.
[0159] 18. The transmission dynamic library of the old phone parses the flow control message, determines to start speed reduction, calculates the speed reduction value based on the memory usage obtained from the analysis, and sends the data packet to the new phone based on the speed reduction value.
[0160] 19. The transmission dynamic library of the new phone parses the data packet. After the file is written to the disk, if the memory is less than the flow control stop threshold, a flow control release message is sent to the transmission dynamic library of the old phone.
[0161] It can be understood that the memory here corresponds to the second queue memory size in the above embodiment, the flow control stop threshold corresponds to the above second flow control threshold, and the flow control release message corresponds to the above second flow control threshold.
[0162] 20. The transmission dynamic library of the old mobile phone parses the flow control release message and stops the speed reduction.
[0163] It can be seen that in the embodiment of the present application, by determining the memory of the new mobile phone after the files are written to the disk in real time and sending a flow control message or a flow control release message to the old mobile phone accordingly, the old mobile phone can dynamically adjust the sending rate of the data packet, thereby avoiding overflow and packet loss, reducing the time spent on mobile phone cloning and improving the efficiency of mobile phone cloning.
[0164] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0165] In order to better implement the above-mentioned solutions of the embodiments of the present application, relevant devices for implementing the above-mentioned solutions are also provided below.
[0166] See also Figure 10 , Figure 10 A schematic structural diagram of a data transmission device provided for the implementation of this application is provided. The data transmission device 1000 is applied to a first terminal device and may include:
[0167] A determination module 1001 is configured to determine a memory size of a first queue of a first terminal device;
[0168] The sending module 1002 is used to send a first flow control message to the second terminal device when the memory size of the first queue is greater than the first flow control threshold; the first flow control message is used to instruct the second terminal device to reduce the sending rate of data packets.
[0169] It can be seen that in the embodiment of the present application, the first terminal device actively monitors the queue memory of the first terminal device, and actively sends a first flow control message to the second terminal device before overflow and packet loss may occur. In this way, the second terminal device can reduce the rate of sending data packets to the first terminal device based on the first flow control message, thereby avoiding overflow and packet loss, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0170] In a possible implementation, the determining module 1001 in the data transmission apparatus provided in the embodiment of the present application is further configured to determine a memory size of the second queue of the first terminal device;
[0171] The sending module 1002 is further used to send a second flow control message to the second terminal device when the memory size of the second queue is less than the second flow control threshold; the second flow control message is used to instruct the second terminal device to stop reducing the sending rate of data packets.
[0172] In one possible implementation, the first flow control message in the data transmission device provided in the embodiment of the present application carries the first memory share of the first terminal device, and the first memory share is used by the second terminal device to determine the reduced data packet sending rate.
[0173] In one possible implementation, the first flow control message in the data transmission device provided in the embodiment of the present application carries the first memory share of the first terminal device, and the first memory share is used to instruct the second terminal device to reduce the sending rate of data packets.
[0174] In one possible implementation, the first memory ratio in the data transmission device provided in the embodiment of the present application is determined based on the first queue memory size and the memory baseline value.
[0175] In one possible implementation, the second flow control message in the data transmission device provided in the embodiment of the present application carries the second memory share of the first terminal device, and the second memory share is used to instruct the second terminal device to stop reducing the sending rate of data packets.
[0176] In one possible implementation, the determination module 1001 in the data transmission device provided in an embodiment of the present application is specifically used to determine the first queue memory size based on the first receive queue memory size, the first receive queue cache size, the first input / output IO queue memory size and the first IO queue cache size.
[0177] In one possible implementation, the first flow control threshold and the second flow control threshold in the data transmission device provided in the embodiment of the present application are determined based on the memory baseline value, and the first flow control threshold is greater than the second flow control threshold.
[0178] In a possible implementation, the data transmission device provided in the embodiment of the present application is applied to mobile phone cloning, where the first terminal device is an old mobile phone and the second terminal device is a new mobile phone.
[0179] See also Figure 11 , Figure 11 A schematic structural diagram of another data transmission device provided for the implementation of this application, wherein the data transmission device 1100 is applied to a second terminal device and may include:
[0180] The receiving module 1101 is configured to receive a first flow control message, wherein the first flow control message is configured to instruct the second terminal device to reduce a data packet transmission rate.
[0181] An adjustment module 1102 is configured to parse the first flow control message and adjust the sending rate of the data packet to a first sending rate;
[0182] The sending module 1103 is used to send data packets to the first terminal device based on the first sending rate.
[0183] It can be seen that in the embodiment of the present application, the second terminal device receives the first flow control message sent by the first terminal device, so that before overflow and packet loss may occur, the rate of sending data packets to the first terminal device will be reduced, thereby avoiding overflow and packet loss, improving the performance of data transmission, and further reducing the time spent on data migration and improving data migration efficiency.
[0184] In a possible implementation, the receiving module 1101 in the data transmission apparatus provided in the embodiment of the present application is further configured to receive a second flow control message; the second flow control message is configured to instruct the second terminal device to stop reducing the sending rate of the data packet;
[0185] The adjustment module 1102 is further configured to parse the second flow control message and adjust the sending rate of the data packet to a second sending rate; the second sending rate is greater than the first sending rate;
[0186] The sending module 1103 is further configured to send data packets to the first terminal device based on the second sending rate.
[0187] In one possible implementation, the adjustment module 1102 in the data transmission device provided in the embodiment of the present application includes:
[0188] A parsing unit, configured to parse the first flow control message to obtain a first memory usage of the first terminal device;
[0189] The adjusting unit is configured to adjust the sending rate of the data packet to a first sending rate based on the first memory usage.
[0190] In one possible implementation, the adjustment unit in the data transmission device provided in the embodiment of the present application is specifically used to adjust the sending rate of the data packet to the first sending rate based on the first memory usage and the second sending rate; the second sending rate is the sending rate of the data packet before the reduction.
[0191] In one possible implementation, the first memory proportion in the data transmission apparatus provided in the embodiment of the present application is determined based on the first queue memory size and the memory baseline value of the first terminal device.
[0192] In one possible implementation, the first queue memory in the data transmission device provided in an embodiment of the present application is determined based on the first receiving queue memory size, the first receiving queue cache size, the first input / output IO queue memory size and the first IO queue cache size of the first terminal device.
[0193] In one possible implementation, the adjustment module 1102 in the data transmission device provided in the embodiment of the present application includes:
[0194] a parsing unit, configured to parse the second flow control message to obtain a second memory usage of the first terminal device;
[0195] The adjusting unit is configured to adjust the sending rate of the data packet to a second sending rate based on the second memory usage.
[0196] In a possible implementation, the data transmission device provided in the embodiment of the present application is applied to mobile phone cloning, where the first terminal device is an old mobile phone and the second terminal device is a new mobile phone.
[0197] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and no further details will be given here.
[0198] Figure 12 This is another example of the composition of a data transmission device provided in an embodiment of the present application. The data transmission device can be a first terminal device or a second terminal device, and the first terminal device or the second terminal device includes but is not limited to electronic devices such as mobile phones and smart wearable devices (such as smart watches). Taking a mobile phone as an example, the data transmission device may include a processor 310, an external memory interface 320, an internal memory 321, a display screen 330, a camera 340, an antenna 1, an antenna 2, a mobile communication module 350, and a wireless communication module 360.
[0199] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the data transmission device. In other embodiments, the data transmission device may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0200] The processor 310 may include one or more processing units. For example, the processor 310 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). Different processing units may be independent devices or integrated into one or more processors.
[0201] It is understood that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0202] External memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the data transmission device. The external memory card communicates with processor 310 via external memory interface 320 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0203] The internal memory 321 can be used to store computer executable program code, which includes instructions. The processor 310 executes various functional applications and data processing of the data transmission device by running the instructions stored in the internal memory 321, thereby implementing the data transmission method in the above embodiment. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area can 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 can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 321 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 memory (UFS), etc. The processor 310 executes various functional applications and data processing of the data transmission device by running the instructions stored in the internal memory 321 and / or the instructions stored in the memory provided in the processor.
[0204] The wireless communication function of the data transmission device can be implemented through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor.
[0205] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the data transmission device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0206] The mobile communication module 350 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for electronic devices. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be provided in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be provided in the same device as at least some of the modules of the processor 310.
[0207] In some embodiments, the data transmission device initiates or receives a call request via the mobile communication module 350 and the antenna 1 .
[0208] Furthermore, an operating system runs on the aforementioned components, such as the iOS operating system, the Android operating system, and the Windows operating system. Application programs can be installed and run on the operating system. Those skilled in the art will clearly understand that, for ease of description and brevity, the explanation and beneficial effects of any of the aforementioned electronic devices can be referred to the corresponding method embodiments provided above, and will not be further elaborated here.
[0209] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0210] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of the present embodiment according to actual needs.
[0211] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0212] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the part that essentially contributes to the technical solution of the present application or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the process of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
[0213] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data transmission method, characterized in that: The method is used for a first terminal device, and the method includes: Determining a memory size of a first queue of the first terminal device; When the memory size of the first queue is greater than the first flow control threshold, a first flow control message is sent to the second terminal device, where the first flow control message is used to instruct the second terminal device to reduce the sending rate of data packets.
2. The method according to claim 1, characterized in that After sending the first flow control message to the second terminal device, the method further includes: determining a memory size of a second queue of the first terminal device; When the memory size of the second queue is less than the second flow control threshold, a second flow control message is sent to the second terminal device; the second flow control message is used to instruct the second terminal device to stop reducing the sending rate of the data packet.
3. The method according to any one of claims 1 to 2, characterized in that The first flow control message carries a first memory share of the first terminal device, and the first memory share is used by the second terminal device to determine the reduced sending rate of the data packet.
4. The method according to any one of claims 1 to 3, characterized in that The first flow control message carries a first memory share of the first terminal device, and the first memory share is used to instruct the second terminal device to reduce the sending rate of the data packet.
5. The method according to any one of claims 3 to 4, characterized in that The first memory proportion is determined based on the first queue memory size and a memory baseline value.
6. The method according to any one of claims 2 to 5, characterized in that The second flow control message carries the second memory ratio of the first terminal device, and the second memory ratio is used to instruct the second terminal device to stop reducing the sending rate of the data packet.
7. The method according to any one of claims 1 to 6, characterized in that Determining the memory size of the first queue of the first terminal device includes: The first queue memory size is determined based on the first receive queue memory size, the first receive queue buffer size, the first input / output (IO) queue memory size, and the first IO queue buffer size.
8. The method according to any one of claims 1 to 7, characterized in that The first flow control threshold and the second flow control threshold are determined based on a memory baseline value, and the first flow control threshold is greater than the second flow control threshold.
9. A data transmission method, characterized in that: The method is used for a second terminal device, and the method includes: receiving a first flow control message, where the first flow control message is used to instruct the second terminal device to reduce a sending rate of data packets; parsing the first flow control message, and adjusting the sending rate of the data packet to a first sending rate; The data packet is sent to the first terminal device based on the first sending rate.
10. The method according to claim 9, characterized in that After sending the data packet to the first terminal device based on the first sending rate, the method further includes: receiving a second flow control message, where the second flow control message is used to instruct the second terminal device to stop reducing the sending rate of the data packet; parsing the second flow control message, and adjusting the sending rate of the data packet to a second sending rate, where the second sending rate is greater than the first sending rate; The data packet is sent to the first terminal device based on the second sending rate.
11. The method according to any one of claims 9 to 10, characterized in that The parsing the first flow control message and adjusting the sending rate of the data packet to the first sending rate includes: Parsing the first flow control message to obtain a first memory percentage of the first terminal device; Based on the first memory usage, the sending rate of the data packet is adjusted to a first sending rate.
12. The method according to claim 11, characterized in that The adjusting the sending rate of the data packet to a first sending rate based on the first memory usage includes: Based on the first memory usage and the second sending rate, the sending rate of the data packet is adjusted to the first sending rate, and the second sending rate is the sending rate of the data packet before the reduction.
13. The method according to any one of claims 9 to 12, characterized in that The first memory proportion is determined based on a first queue memory size and a memory baseline value of the first terminal device.
14. The method according to claim 13, characterized in that The first queue memory is determined based on a first receiving queue memory size, a first receiving queue buffer size, a first input / output IO queue memory size, and a first IO queue buffer size of the first terminal device.
15. The method according to any one of claims 10 to 14, characterized in that The parsing the second flow control message and adjusting the sending rate of the data packet to the second sending rate includes: Parsing the second flow control message to obtain a second memory usage of the first terminal device; Based on the second memory usage, the sending rate of the data packet is adjusted to a second sending rate.
16. A data transmission device, characterized in that: The data transmission device includes: Memory for storing computer programs or computer instructions; A processor, configured to execute a computer program or computer instruction stored in the memory, so that the data transmission device executes the data transmission method according to any one of claims 1 to 8, or executes the data transmission method according to any one of claims 9 to 15.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed, the data transmission method according to any one of claims 1 to 8 or the data transmission method according to any one of claims 9 to 15 is implemented.
18. A computer storage medium for storing a computer program, wherein when the computer program is executed, it is used to implement the data transmission method according to any one of claims 1 to 8, or the data transmission method according to any one of claims 9 to 15.
Citation Information
Patent Citations
Method and device for teleconference
CN108900794A
Data transmission method, data transmission device and electronic device
CN113840272A
Message transmission method, device, equipment, medium and product
CN116506366A
Object migration method and device, electronic equipment and storage medium
CN116737088A
Communication method and communication device
CN117016004A