Data transmission method and electronic device

CN115696464BActive Publication Date: 2026-08-11HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

当多个APP中至少一个APP具有较大数据或突发流时,该APP占用物理发送缓冲区队列的资源,使得其他的APP无法进行数据传输,导致多个APP受到影响

Benefits of technology

[0011] In this application embodiment, in a multi-service concurrent scenario, when multiple sending ends compete for the same physical network card resource, the token mechanism provided in this application embodiment can reasonably schedule services, so as to achieve the purpose of not affecting high-priority services and reasonably scheduling low-priority services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115696464B_ABST
    Figure CN115696464B_ABST
Patent Text Reader

Abstract

This application discloses a data transmission method and an electronic device. The electronic device includes multiple sending ends that simultaneously transmit data. The method includes receiving token request requests sent by the sending ends, the token request request carrying a data stream identifier and the number of data streams. When the available resources of the data transmission buffer are detected to meet a first condition, a token packet is determined. The token packet includes the data stream identifier and the number of tokens, the number of tokens being determined based on the number of data streams. The token packet is sent to the sending ends so that the sending ends send data corresponding to the number of tokens to the receiving ends. In this way, when multiple sending ends transmit data simultaneously, the electronic device can determine which one or more sending ends transmit data based on the available resources of the transmission buffer. This effectively avoids the situation where a large amount of data from one sending end affects the data transmission of other sending ends, effectively ensuring that each sending end can use resources in a balanced manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data transmission method and an electronic device. Background Technology

[0002] With the rapid development of electronic devices, the need for interconnection between devices is also increasing. As a result, 1+8+N devices have emerged. Taking mobile phones as an example, the mobile phone screen can be projected onto a large-screen device for display, mobile phone music can be projected onto a supported device for playback, and mobile phones can also share files with other mobile phones, tablets, large screens, personal computers (PCs), and other devices.

[0003] Taking video casting and file sharing on a mobile phone as an example, because the phone is sending data in multiple threads, all of this data is transmitted to at least one destination device via the same physical network card. When the amount of data in the shared file is large and exceeds the resources of the physical sending buffer queue, packet loss occurs on the network. At this time, the phone triggers the retransmission of the shared file data, causing the shared file data to occupy more resources of the physical sending buffer queue. This results in some data being transmitted for video casting, leading to problems such as screen tearing and stuttering.

[0004] Therefore, when multiple applications (APPs) communicate with at least one destination device via the same physical network interface card (NIC), these applications share the same physical transmit buffer queue. When at least one of the APPs has a large amount of data or a burst of data, that APP consumes the resources of the physical transmit buffer queue, preventing other APPs from transmitting data and thus affecting multiple APPs. Summary of the Invention

[0005] The data transmission method and electronic device provided in this application embodiment can ensure balanced use of various APPs under certain physical resource conditions.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions.

[0007] Firstly, embodiments of this application provide a data transmission method applied to an electronic device. The electronic device includes multiple transmitting ends that simultaneously transmit data. The execution subject of this method can be the electronic device itself or a component within the electronic device (e.g., a chip, chip system, or processor). The following description uses an electronic device as the execution subject. The method includes: the electronic device receiving a token request sent by a transmitting end. The token request requests a privilege grant token required by the electronic device during data transmission. The token grants the transmitting end permission to transmit data. The token request carries a data stream identifier and the number of data streams. When the available resources of the data transmission buffer meet a first condition, the electronic device determines a token packet. The token packet includes a data stream identifier and the number of tokens, determined based on the number of data streams. The electronic device sends the token packet to the transmitting end, enabling the transmitting end to send data corresponding to the number of tokens to the receiving end. Thus, when multiple transmitting ends transmit data simultaneously, the electronic device can determine which one or more transmitting ends transmit data based on the available resources of the transmission buffer. This effectively avoids situations where a large amount of data from one transmitting end affects the transmission of data from other transmitting ends, effectively ensuring that each transmitting end can use resources in a balanced manner.

[0008] In one specific implementation, the data transmission buffer includes a data transmission buffer in the transport layer and a data transmission buffer in the driver layer. The first condition includes: the available resources of the data transmission buffer in the transport layer are greater than a first threshold, and the available resources of the data transmission buffer in the physical layer are greater than a second threshold.

[0009] In some possible implementations, the data transmission method provided in this application embodiment may further include: when the available resources of the data transmission buffer do not meet a first condition, the electronic device does not send a token packet to the sending end.

[0010] In one specific implementation, the token request also carries data type and / or sender characteristic information. When the available resources of the data transmission buffer are detected to meet the first condition, a token packet is determined, specifically by configuring a priority identifier for the data stream based on the data type and / or sender characteristic information, and the token packet includes the priority identifier of the data stream.

[0011] In this application embodiment, in a multi-service concurrent scenario, when multiple sending ends compete for the same physical network card resource, the token mechanism provided in this application embodiment can reasonably schedule services, so as to achieve the purpose of not affecting high-priority services and reasonably scheduling low-priority services.

[0012] In some implementations, the data type may include at least one of the following: text, image, audio, video, and bytes.

[0013] In some possible implementations, a data transmission method provided in this application embodiment may further include: when it is determined that no token packet will be sent to the sender, the electronic device instructs the sender to adjust the data transmission rate.

[0014] In some possible implementations, the data transmission method provided in this application embodiment may further include: when it is detected that the available resources of the data transmission buffer do not meet a first condition, the electronic device configures a flow control tag for the data stream of the transmitting end. The electronic device sends a flow control information table to the flow control processing node in the data transmission process, the flow control information table being used to instruct the flow control processing node to perform flow control processing on the received data stream containing the flow control tag.

[0015] Secondly, embodiments of this application provide an electronic device, which may include: a receiving unit, configured to receive a token request request sent by a sending end, the token request request being used by the electronic device to request a privilege grant token required during data transmission, the token being used to grant the sending end permission to send data, and the token request carrying a data stream identifier and the number of data streams; a determining unit, configured to determine a token packet when the available resources of the data transmission buffer are detected to meet a first condition, the token packet including a data stream identifier and the number of tokens, the number of tokens being determined based on the number of data streams; and a first sending unit, configured to send the token packet to the sending end, so that the sending end sends data corresponding to the number of tokens to the receiving end. In this way, when multiple sending ends are sending data simultaneously, the electronic device can determine which one or more sending ends will send data based on the available resources of the transmission buffer, effectively avoiding the situation where a large amount of data from one sending end affects the data transmission of other sending ends, and effectively ensuring that each sending end can use resources in a balanced manner.

[0016] In one specific implementation, the data transmission buffer includes a data transmission buffer in the transport layer and a data transmission buffer in the driver layer. The first condition includes: the available resources of the data transmission buffer in the transport layer are greater than a first threshold, and the available resources of the data transmission buffer in the physical layer are greater than a second threshold.

[0017] In some implementations, the electronic device may further include a second sending unit, configured not to send a token packet to the sending end when the available resources of the data sending buffer do not meet the first condition.

[0018] In one possible implementation, the token request also carries data type and / or sender characteristic information. The determining unit is further configured to: configure a priority identifier for the data stream based on the data type and / or sender characteristic information, wherein the token packet includes the priority identifier of the data stream.

[0019] In this application embodiment, in a multi-service concurrent scenario, when multiple sending ends compete for the same physical network card resource, the token mechanism provided in this application embodiment can reasonably schedule services, so as to achieve the purpose of not affecting high-priority services and reasonably scheduling low-priority services.

[0020] In one specific implementation, the data type may include at least one of the following: text, image, audio, video, and bytes.

[0021] In some implementations, the electronic device may further include an indication unit for instructing the sender to adjust the data transmission rate when it is determined that no token packet will be sent to the sender.

[0022] In some implementations, the electronic device may further include: a configuration unit, configured to configure a flow control tag for the data stream at the sending end when it is detected that the available resources of the data transmission buffer do not meet a first condition; and a third sending unit, configured to send a flow control information table to the flow control processing node during data transmission, the flow control information table being used to instruct the flow control processing node to perform flow control processing on the received data stream containing the flow control tag.

[0023] Thirdly, embodiments of this application provide a device characterized by being applied to the data transmission method of the first aspect.

[0024] Fourthly, embodiments of this application provide a computer-readable storage medium, characterized in that the computer-readable storage medium includes computer instructions, which, when executed on a terminal, cause the terminal to perform the data transmission method of the first aspect.

[0025] Fifthly, embodiments of this application provide a computer program, characterized in that, when the program is invoked by a processor, the data transmission method of the first aspect is executed.

[0026] In a sixth aspect, embodiments of this application provide a chip system, characterized in that it includes one or more processors, wherein when the one or more processors execute instructions, the one or more processors execute the data transmission method of the first aspect.

[0027] For the specific implementation methods and corresponding technical effects of the embodiments in the second to sixth aspects mentioned above, please refer to the specific implementation methods and technical effects of the first aspect mentioned above. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1a This is a schematic diagram of the structure of a data transmission system provided in an embodiment of this application;

[0030] Figure 1b This is a diagram illustrating a data stream lag.

[0031] Figure 1c This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0032] Figure 2 This is a flowchart illustrating a data transmission method.

[0033] Figure 3a This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0034] Figure 3b A flowchart illustrating a data transmission method provided in an embodiment of this application;

[0035] Figure 3c A flowchart illustrating a data transmission method provided in an embodiment of this application;

[0036] Figure 4 This is a schematic diagram illustrating an application scenario of a data transmission method provided in an embodiment of this application.

[0037] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0038] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.

[0039] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this application, unless otherwise stated, "a plurality of" means two or more.

[0040] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0041] Figure 1a A schematic diagram of a data transmission system is shown.

[0042] Data transmission system 10 may include at least two electronic devices (such as...) Figure 1a The diagram shows a first electronic device 11, a second electronic device 12, and a third electronic device 13. The first electronic device 11 can transmit data to the second electronic device 12, and the second electronic device 12 can transmit data to the third electronic device 13. For example, if the first electronic device 11 is a mobile phone, the second electronic device 12 is a tablet computer, and the third electronic device 13 is a television, the screen of the mobile phone 11 can share files to the tablet computer 12 for display, and the mobile phone 11 can be projected onto the television 13.

[0043] Of course, phone 11 can also cast audio to supported tablet 12 for playback, and phone 11 can also cast video and share files to TV 13 (or other phones, tablets, large screens, personal computers (PCs), etc.). For example, when file transfer and screen casting are deployed simultaneously, intermittent I-frames in screen casting cause intermittent peak data. Sudden data spikes lead to packet loss, triggering two FEC algorithms, resulting in a large number of retransmissions. This further increases the data volume, exceeding the limits of the current physical network card, leading to packet loss, ultimately causing screen flickering (packet loss) and stuttering (data cannot be delivered for a long time, and the display shows the old screen continuously). Figure 1b As shown.

[0044] As can be seen, because the phone is sending data in multiple threads, all of this data is transmitted to at least one destination device via the same physical network card. When the amount of data in the shared file is large and exceeds the resources of the physical send buffer queue, packet loss occurs. At this time, the phone triggers the retransmission of the shared file data, causing the shared file data to occupy more resources of the physical send buffer queue. This results in some data being transmitted for video casting, leading to problems such as screen tearing and stuttering.

[0045] Therefore, when multiple applications (APPs) communicate with at least one destination device via the same physical network interface card (NIC), these applications share the same physical transmit buffer queue. When at least one of the APPs has a large amount of data or a burst of data, that APP consumes the resources of the physical transmit buffer queue, preventing other APPs from transmitting data and thus affecting multiple APPs.

[0046] To address the aforementioned technical problems, this application provides a data transmission method applied to an electronic device. The electronic device includes multiple transmitting ends that simultaneously transmit data. The method includes: the electronic device receiving a token request request from one of the transmitting ends. This token request requests a privilege grant token required by the electronic device during data transmission, which grants the transmitting end permission to transmit data. The token request carries a data stream identifier and the number of data streams. The electronic device monitors the available resources of a data transmission buffer. When the available resources of the data transmission buffer meet a first condition, the electronic device determines a token packet. This token packet includes a data stream identifier and the number of tokens, which is determined based on the number of data streams. The electronic device sends the token packet to the transmitting ends, so that the transmitting ends send data corresponding to the number of tokens to the receiving ends.

[0047] Example 1: Multiple sending ends communicate with at least one destination device (or receiving end) via the same physical network card on an electronic device.

[0048] Taking an example where the sending end is an application (APP) installed on an electronic device, and at least one destination device includes a tablet, television, etc., as an example. Assume multiple sending ends are multiple APPs, which can include a first APP and a second APP. The first APP transfers files to the tablet via a first physical network card, and the second APP casts its screen to the television via the first physical network card.

[0049] When the first app needs to send data, it sends a first token request to the electronic device. This first token request carries the identifier of the data stream to be sent by the first app and the quantity of data streams. The electronic device receives the first token request from the first app. The electronic device monitors the available resources of the data transmission buffer. When the available resources of the data transmission buffer meet a first condition, the electronic device determines the number of tokens based on the quantity of data streams carried in the first token request, encapsulates the number of tokens into a token packet, and sends it to the first app. The first app then sends the data corresponding to the number of tokens to the receiving end.

[0050] Similarly, when the second app needs to send data, it also sends a second token request to the electronic device. This second token request carries the data stream identifier and the number of data streams to be sent by the second app. The electronic device receives the second token request from the second app. The electronic device monitors the available resources of the data transmission buffer. When the available resources of the data transmission buffer meet the first condition, the electronic device determines the number of tokens based on the number of data streams carried in the second token request, and encapsulates the number of tokens into a token packet, which is then sent to the second app. The second app then sends the data corresponding to the number of tokens to the receiving end.

[0051] Example 2: Multiple senders communicate with the same destination device (or receiver).

[0052] Typically, most of the equipment uses a single physical channel, such as a single physical network card.

[0053] Multiple senders can be on the same device.

[0054] Taking an application (APP) as the sending end and a mobile phone as the destination device as an example. Assume multiple sending ends are multiple APPs, which can include a first APP and a second APP. The first APP and the second APP communicate with the mobile phone via a single physical network card.

[0055] Similarly, when the first APP needs to send data, the first APP sends a token request to the mobile phone. For details of the operation process, please refer to the relevant description in Example 1 above, which will not be repeated here.

[0056] As can be seen from Examples 1 and 2, in this embodiment, before sending data, each of the multiple sending ends needs to send a token request to the electronic device. Thus, when multiple sending ends are sending data simultaneously, the electronic device can determine which one or more sending ends will send data based on the available resources in the sending buffer. This effectively avoids situations where a large amount of data from one sending end affects the data transmission of other sending ends, ensuring that all sending ends can use resources in a balanced manner.

[0057] For ease of understanding, the hardware and software architectures of the electronic devices involved in the embodiments of this application are described below.

[0058] Figure 1c A schematic diagram of the electronic device is shown.

[0059] Electronic device 100 (i.e., the first electronic device 11, the second electronic device 12, or the third electronic device 13 mentioned above) may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0060] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0061] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0062] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0063] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

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

[0065] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0066] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0067] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0068] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0069] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0070] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

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

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

[0073] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0074] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0075] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0076] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0077] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0078] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0079] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0080] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0081] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0082] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0083] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.).

[0084] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0085] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals.

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

[0087] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0088] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C.

[0089] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0090] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0091] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0092] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0093] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0094] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0095] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0096] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from a nearby object. When sufficient reflected light is detected, it can be determined that an object is near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that no object is near the electronic device 100.

[0097] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0098] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0099] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0100] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0101] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from vibrating bone fragments in the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals.

[0102] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0103] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0104] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0105] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with or separate from the electronic device 100.

[0106] Of course, the electronic device 100 may also include other functional units, and this application embodiment does not limit this.

[0107] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0108] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Linux system is divided into seven layers, supporting the Linux OSI protocol model (7 layers) international protocol, which from top to bottom includes: application layer, presentation layer, session layer, transport layer, network layer, data link layer, and physical layer.

[0109] Specifically, the functions of each layer are shown in Table 1. The Physical Layer is the lowest layer of the OSI protocol model and can include various media, such as serial links or Ethernet devices. The layer above the Physical Layer is the Data Link Layer, which provides device drivers for accessing the Physical Layer. The layer above the Data Link Layer is the Network Layer, which directs data packets to their destination. The layer above the Network Layer is the Transport Layer, which handles end-to-end communication. The layer above the Transport Layer is the Session Layer, which establishes, manages, and terminates sessions between applications. The layer above the Session Layer is the Presentation Layer, which negotiates the data transmission syntax used by the Application Layer. The layer above the Presentation Layer is the Application Layer, which provides network services to application processes.

[0110] Table 1

[0111]

[0112]

[0113] Based on the Linux OSI protocol model described above, the network packet sending process is as follows: Figure 2 As shown, specifically:

[0114] 1. Transmission process from Socket / TCP / UDP / RAW to IP

[0115] The user process calls the socket system function. It then enters the kernel and calls the corresponding kernel function ("sys_" + socket system function name). Next, it calls the callback function for the appropriate protocol family (sock->ops->sendmsg). For example, for IPv4 / v6, it's inet_sendmsg, and for TIPC, it's send_msg. Finally, it calls the transport layer callback function (sk_prot->sendmsg). For example, for IPv4 / v6, these are tcp_sendmsg, udp_sendmsg, and raw_sendmsg. Here, the packet is placed into the corresponding send buffer. After the buffer is scheduled to send, the forwarding table is searched to find the corresponding dst_entry. The packet is then passed to the IP layer by calling dst_entry->output(). Finally, the IP layer callback functions are called, which are ip_output and ip6_output.

[0116] 2. Transmission process from IP to the data link layer

[0117] The `neighbour` is located based on `dst_entry`, and `neighbour->output()` is called. For example, the `neigh_resolve_output` function. Link-layer encapsulation is performed in `neighbour->output()`. First, the `net_device` is located based on the `neighbour`, and link-layer encapsulation is performed by calling `dev->hard_header`. Then, `neigh->ops->queue_xmit` is called to send the packet to the driver function of each `net_device`, typically `dev_queue_xmit`.

[0118] 3. Transmission process from the link layer to the driver layer

[0119] After the link layer encapsulation is completed, the driver layer function is directly called. Typically, `dev_queue_xmit` is called uniformly. This function performs some common processing, such as checksum and fragmentation. Then, `dev_hard_start_xmit` is called, which in turn calls `dev->hard_start_xmit`. This callback function is the actual transmission function for each device, directly manipulating the hardware for transmission. Finally, the `sk_buff` is released.

[0120] The following is based on Figure 1a , Figure 1b and Figure 1c Taking the illustrated architecture as an example, the data transmission method provided in the embodiments of this application will be described. Each unit in the following embodiments may possess... Figure 1cThe components shown are not described in detail. It should be noted that the message names or parameter names in the messages between the various devices in the embodiments of this application are just examples, and other names may be used in the specific implementation. The term "generate" in the embodiments of this application can also be understood as "create" or "determine", and the term "including" in the embodiments of this application can also be understood as "carry". This is a unified explanation, and the embodiments of this application do not make specific limitations in this regard.

[0121] The data transmission method provided in this application can be applied to concurrent scenarios involving multiple services, such as file transfer, audio / video stream transmission, multi-screen collaboration, or control information transmission, between distributed systems. The distributed systems can include software systems commonly used in mobile phones, tablets (PADs), large screens, and personal computers (PCs).

[0122] Specifically, this application will use the transmission of files and audio / video streams as examples for illustration.

[0123] Figure 3a This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 3a As shown, in this embodiment of the application, multiple sending ends can be multiple apps (such as APP1, APP2, and APP3). When each sending end sends data, it can execute a data transmission method provided in this embodiment of the application, as described below:

[0124] Figure 3b This is another schematic flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 3c This is another flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 3b and Figure 3c As shown, the method may include:

[0125] S300: The sending end sends a token request. Correspondingly, the electronic device receives the token request sent by the sending end.

[0126] Among them, the token request is used to request the granting of a privilege token required by the electronic device during data transmission. The token is used to grant the sending end the right to send data.

[0127] The token request includes the data stream identifier and the number of data streams. In other words, the token request carries the identifier and quantity of the data streams that the sender needs to send.

[0128] In one specific implementation, for example, application APP1 sends a token request to the control module of the electronic device (e.g., ...). Figure 4(As shown in the image). The control module receives a token request sent by application APP1. Application APP2 sends the token request to the control module of the electronic device (as shown in the image). Figure 4 (As shown in the image). The control module receives a token request sent by application APP2. Application APP3 sends the token request to the control module of the electronic device (as shown in the image). Figure 4 (As shown in the diagram). The control module receives a token request sent by the application APP3.

[0129] S301. Available resources of the electronic device detection data transmission buffer.

[0130] Among them, such as Figure 4 and Figure 5 As shown, the data transmission buffer may include a data transmission buffer at the transport layer and a data transmission buffer at the physical layer.

[0131] Available resources can be understood as the amount of data that the data transmission buffer of the current electronic device can hold when all sending ends can transmit data simultaneously.

[0132] Following the above example, S301 can be specifically implemented as follows: S3011, the control module of the electronic device requests the available resources of the data transmission buffer of the transport layer and the data transmission buffer of the physical layer. The control module can request the available resources periodically or in real time. S3012, the data transmission buffer and the data transmission buffer of the physical layer feed back the available resources to the control module.

[0133] S302. When the electronic device detects that the available resources of the data transmission buffer meet the first condition, the electronic device determines the token packet.

[0134] The token packet includes a data stream identifier and the number of tokens, which is determined based on the number of data streams.

[0135] The first condition may include: the available resources of the data transmission buffer in the transport layer are greater than a first threshold, and the available resources of the data transmission buffer in the physical layer are greater than a second threshold. The first and second thresholds can be determined based on actual circumstances, and this embodiment does not impose specific limitations.

[0136] Following the above example, S302 can be specifically implemented as follows: S3021, the control module of the electronic device determines, based on the available resources of the data transmission buffer of the transport layer and the data transmission buffer of the physical layer, that the available resources of the data transmission buffer of the transport layer and the data transmission buffer of the physical layer satisfy the first condition. S3022, the control module determines the number of tokens based on the number of data streams at the sending end.

[0137] S303. When the electronic device detects that the available resources of the data transmission buffer do not meet the first condition, the electronic device does not send a token packet to the sending end.

[0138] In one specific implementation, S303 can be implemented as follows: S3031, when the electronic device detects that the available resources of the data transmission buffer do not meet the first condition, the electronic device configures a flow control tag for the data stream at the sending end. S3032, the electronic device sends a flow control information table to the flow control processing node in the data transmission process. The flow control information table is used to instruct the flow control processing node to perform flow control processing on the received data stream containing the flow control tag. At this time, S3033, the electronic device monitors the available resources of the data transmission buffer at predetermined time intervals. S3034, when it is detected that the available resources of the data transmission buffer meet the first condition, the electronic device sends a flow control release message to the sending end.

[0139] In some embodiments, the data transmission method provided in this application may further include: when the available resources of the data transmission buffer of the transport layer and the data transmission buffer of the physical layer meet a first condition, the data transmission buffer of the transport layer and the data transmission buffer of the physical layer send the available resources to the control module and notify the control module that a token packet can be sent. At this time, the control module sends a token packet to the sending end.

[0140] In some embodiments, the data transmission method provided in this application may further include: when it is determined that no token packet will be sent to the sender, the electronic device instructs the sender to adjust the data transmission rate. Specifically, the electronic device sends indication information to the sender, which instructs the sender to adjust the data transmission rate. For example, assuming the data sent by the sender is image data, the sender autonomously reduces the bitrate and / or frame rate of the image data. In other words, the sender actively reduces the image quality to maximize the user experience.

[0141] S304. Send a token packet to the sender.

[0142] Using the example above, S304 can be specifically implemented as follows: the control module sends the number of tokens to the sender.

[0143] S305. The sending end sends data corresponding to the number of tokens to the receiving end.

[0144] Following the example above, S305 can be specifically implemented as follows: S3051, the sending end sends the message to the control module. S3052, the control module sends the message to the transport layer's data transmission buffer. S3053, the transport layer's data transmission buffer sends the message to the physical layer's data transmission buffer. S3054, the physical layer's data transmission buffer sends the message to the receiving end.

[0145] In some embodiments, the data transmission method provided in this application may further include: the token request may also carry data type and / or the characteristic information of the sending end.

[0146] Specifically, S302 can be implemented as follows: the electronic device configures a priority identifier for the data stream based on the data type and / or the characteristic information of the sending end, and the token packet includes the priority identifier of the data stream.

[0147] The priority identifier can be used to indicate the priority order of data stream transmission.

[0148] The data type can include at least one of the following: text, image, audio, video, and bytes.

[0149] The sender's characteristic information can include its attribute information and its operational information. The sender's attribute information can include whether it belongs to a system application, a third-party application, or is a user-defined attribute. The sender's operational information can include whether it is running in the foreground or in the background.

[0150] For example, if the sending end is running in the foreground and belongs to a system application, the electronic device configures the data stream sent by the sending end as a first priority identifier; if the sending end is running in the foreground and belongs to a third-party application, the electronic device configures the data stream sent by the sending end as a second priority identifier; if the sending end is running in the background and belongs to a third-party application, the electronic device configures the data stream sent by the sending end as a third priority identifier. The first, second, and third priority identifiers are arranged in descending order of priority.

[0151] For example, if the data stream sent by the sending end is a video stream, the electronic device configures the data stream sent by the sending end as a first priority identifier; if the data stream sent by the sending end is an audio stream, the electronic device configures the data stream sent by the sending end as a second priority identifier; if the data stream sent by the sending end is text, the electronic device configures the data stream sent by the sending end as a third priority identifier. The first priority identifier, second priority identifier, and third priority identifier are arranged in descending order of priority.

[0152] Of course, it can also be a combination of the two examples above, or other combinations. This application does not impose specific limitations on the embodiments, and the specific settings can be made according to actual needs.

[0153] In another specific implementation, the electronic device can configure a priority identifier for the data stream based on the data type; the electronic device can adjust the priority identifier of the data stream sent by the sender based on the characteristic information of the sender.

[0154] For example, such as Figure 4 As shown, assuming the data stream sent by the sender is a message, the priority flag configured for that message is 1; if the data stream sent by the sender is a file, the priority flag configured for that message is 4; if the data stream sent by the sender is an audio / video stream, the priority flag configured for that message is 2; and if the data stream sent by the sender is a byte stream, the priority flag configured for that message is 3.

[0155] The electronic device adjusts the priority identifier of the data stream sent by the sending end based on the characteristic information of the sending end. Specifically, the electronic device can adjust the priority identifier of the data stream sent by the sending end according to the application type of the sending end, the foreground / background attributes of the sending end, and user-defined attributes.

[0156] For example, suppose the data stream sent by the sender is a message and the sender is running in the background, adjust the priority flag of the message configuration to 4; the data stream sent by the sender is a file and the sender is running in the foreground, adjust the priority flag of the message configuration to 2; the data stream sent by the sender is an audio / video stream and the sender is running in the foreground, adjust the priority flag of the message configuration to 1; the data stream sent by the sender is a byte stream and the sender is running in the background, adjust the priority flag of the message configuration to 3.

[0157] In this application embodiment, in a multi-service concurrent scenario, when multiple sending ends compete for the same physical network card resource, the token mechanism provided in this application embodiment can reasonably schedule services, so as to achieve the purpose of not affecting high-priority services and reasonably scheduling low-priority services.

[0158] For details on the specific implementation of the embodiments of this application, please refer to the above-mentioned relevant content. The embodiments of this application will not be repeated here.

[0159] The various solutions in the above embodiments of this application can be combined without contradiction.

[0160] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 500 may include:

[0161] The receiving unit 501 is used to receive a token request sent by the sending end. The token request is used to request a privilege token for the electronic device to use in the data transmission process. The token is used to grant the sending end the right to send data. The token request carries a data stream identifier and the number of data streams.

[0162] The determining unit 502 is used to determine a token packet when the available resources of the data transmission buffer are detected to meet a first condition. The token packet includes a data stream identifier and a number of tokens, and the number of tokens is determined according to the number of data streams.

[0163] The first sending unit 503 is used to send a token packet to the sending end so that the sending end can send data corresponding to the number of tokens to the receiving end.

[0164] In one implementation, the data transmission buffer includes a data transmission buffer in the transport layer and a data transmission buffer in the driver layer, and the first condition may include:

[0165] The available resources of the data transmission buffer in the transport layer are greater than a first threshold, and the available resources of the data transmission buffer in the physical layer are greater than a second threshold.

[0166] In some embodiments, the electronic device 500 may further include:

[0167] The second sending unit 504 is used to not send a token packet to the sending end when the available resources of the data sending buffer do not meet the first condition.

[0168] In one implementation, the token request also carries data type and / or sender characteristic information;

[0169] The determining unit 502 is also used to: configure a priority identifier for the data stream according to the data type and / or the characteristic information of the sender, wherein the token packet includes the priority identifier of the data stream.

[0170] In one implementation, the data type may include at least one of the following: text, image, audio, video, and bytes.

[0171] In some embodiments, the electronic device 500 may further include:

[0172] The instruction unit 505 is used to instruct the sender to adjust the data transmission rate when it is determined that no token packet will be sent to the sender.

[0173] In some embodiments, the electronic device 500 may further include:

[0174] Configuration unit 506 is used to configure a flow control tag for the data stream of the sending end when it is detected that the available resources of the data transmission buffer do not meet the first condition;

[0175] The third sending unit 507 is used to send a flow control information table to the flow control processing node in the data transmission process. The flow control information table is used to instruct the flow control processing node to perform flow control processing on the received data stream containing flow control tags.

[0176] In this embodiment of the application, when multiple transmitters are transmitting data simultaneously, the electronic device can determine which transmitters or transmitters will transmit data based on the available resources in the transmission buffer. This can effectively prevent a large amount of data from one transmitter from affecting the transmission of data by other transmitters, and effectively ensure that each transmitter can use resources in a balanced manner.

[0177] This application also provides a chip system including at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (e.g., memory). Or, for example, the interface circuit can be used to send signals to other devices (e.g., the processor). Exemplarily, the interface circuit can read instructions stored in memory and send those instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps performed by the electronic device in the above embodiments. Of course, the chip system may also include other discrete devices, and this application does not specifically limit this.

[0178] This application also provides an apparatus included in an electronic device, which has the function of implementing the behavior of the electronic device in any of the methods described above. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, a detection module or unit, and a determination module or unit, etc.

[0179] This application also provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the methods described in the above embodiments.

[0180] This application also provides a computer program product that, when run on a computer, causes the computer to perform any of the methods described in the above embodiments.

[0181] It is understood that, in order to achieve the aforementioned functions, the aforementioned terminals and other devices include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this invention.

[0182] This application embodiment can divide the aforementioned terminal, etc., into functional modules according to the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.

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

[0184] In the embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0185] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0186] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data transmission method applied to an electronic device, the electronic device comprising multiple transmitting ends, the multiple transmitting ends simultaneously transmitting data, characterized in that, The method includes: The device receives a token request sent by the sending end. The token request is used to request a privilege grant token that the electronic device needs to use during data transmission. The token is used to grant the sending end the permission to send data. The token request carries a data stream identifier and the number of data streams. When the available resources of the data transmission buffer are detected to meet a first condition, a token packet is determined. The data transmission buffer includes a data transmission buffer in the transport layer and a data transmission buffer in the driver layer. The first condition includes: the available resources of the data transmission buffer in the transport layer are greater than a first threshold, and the available resources of the data transmission buffer in the physical layer are greater than a second threshold. The token packet includes the data stream identifier and the number of tokens, and the number of tokens is determined according to the number of data streams. The sender sends the token packet to the sender so that the sender can send data corresponding to the number of tokens to the receiver.

2. The method according to claim 1, characterized in that, Also includes: When the available resources of the data transmission buffer do not meet the first condition, a token packet is not sent to the sending end.

3. The method according to claim 1 or 2, characterized in that, The token request also carries data type and / or characteristic information of the sending end; When it is detected that the available resources of the data transmission buffer meet the first condition, the token packet is determined, including: Based on the data type and / or the characteristic information of the sending end, a priority identifier is configured for the data stream, and the token packet includes the priority identifier of the data stream.

4. The method according to claim 3, characterized in that, The data types include at least one of the following: text, image, audio, video, and bytes.

5. The method according to claim 2, characterized in that, Also includes: When it is determined that the token packet will not be sent to the sender, the sender is instructed to adjust the data transmission rate.

6. The method according to any one of claims 1, 2, 4 or 5, characterized in that, The method further includes: When it is detected that the available resources of the data transmission buffer do not meet the first condition, a flow control tag is configured for the data stream of the sending end; A flow control information table is sent to the flow control processing node during the data transmission process. The flow control information table is used to instruct the flow control processing node to perform flow control processing on the received data stream containing the flow control tag.

7. An electronic device, characterized in that, The electronic device includes: The receiving unit is used to receive a token request sent by the sending end. The token request is used to request a privilege grant token that the electronic device needs to use in the data transmission process. The token is used to grant the sending end the permission to send data. The token request carries a data stream identifier and the number of data streams. A determining unit is configured to determine a token packet when the available resources of the data transmission buffer meet a first condition. The data transmission buffer includes a data transmission buffer at the transport layer and a data transmission buffer at the driver layer. The first condition includes: the available resources of the data transmission buffer at the transport layer are greater than a first threshold, and the available resources of the data transmission buffer at the physical layer are greater than a second threshold. The token packet includes the data stream identifier and the number of tokens, wherein the number of tokens is determined based on the number of data streams. The first sending unit is used to send the token packet to the sending end, so that the sending end sends data corresponding to the number of tokens to the receiving end.

8. The electronic device according to claim 7, characterized in that, Also includes: The second sending unit is configured to not send a token packet to the sending end when the available resources of the data sending buffer do not meet the first condition.

9. The electronic device according to claim 7 or 8, characterized in that, The token request also carries data type and / or characteristic information of the sending end; The determining unit is further configured to: configure a priority identifier for the data stream according to the data type and / or the characteristic information of the sending end, wherein the token packet includes the priority identifier of the data stream.

10. The electronic device according to claim 9, characterized in that, The data types include at least one of the following: text, image, audio, video, and bytes.

11. The electronic device according to claim 8, characterized in that, Also includes: An instruction unit is used to instruct the sending end to adjust the data transmission rate when it is determined that the token packet will not be sent to the sending end.

12. The electronic device according to any one of claims 7, 8, 10 or 11, characterized in that, The electronic device also includes: A configuration unit is configured to configure a flow control tag for the data stream of the sending end when it is detected that the available resources of the data transmission buffer do not meet the first condition; The third sending unit is used to send a flow control information table to the flow control processing node in the data transmission process. The flow control information table is used to instruct the flow control processing node to perform flow control processing on the received data stream containing the flow control tag.

13. An electronic device, characterized in that, Includes a processor for performing the data transmission method according to any one of claims 1-6.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on a terminal, cause the terminal to perform the data transmission method as described in any one of claims 1-6.

15. A computer program product, characterized in that, It includes computer program code, and when the computer program code is run on a computer, the data transmission method of any one of claims 1-6 is executed.

16. A chip system, characterized in that, It includes one or more processors, which, when executing instructions, perform the data transfer method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method, device and system for controlling network congestion

    CN111355669A