A data transmission method and electronic device
By unifying the management of the transmission control modules for Bluetooth and Wi-Fi channels and optimizing the data packet sending strategy, the stuttering problem caused by Wi-Fi channel interference in the Bluetooth channel was resolved, resulting in smooth data transmission and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-26
- Publication Date
- 2026-04-24
AI Technical Summary
Bluetooth channel data transmission is susceptible to interference from other channels, causing stuttering, especially when transmitting video data simultaneously, as Bluetooth channel resources are preempted, resulting in unsmooth data transmission.
A unified transmission control module is used to manage data in Bluetooth and Wi-Fi channels. Preset strategies are used to optimize the timing of data packet transmission, including transmission latency, data transmission rate, throughput, Quality of Service (QoS) and Quality of Experience (QoE), to achieve flow control and congestion control and avoid interference between channels.
It effectively avoids the lag caused by the large amount of data transmission in the Wi-Fi channel in the Bluetooth channel, and achieves high-speed and smooth data transmission, thus improving the quality of user experience.
Smart Images

Figure CN120434694B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a data transmission method and an electronic device. Background Technology
[0002] Electronic devices can transmit data through transmission channels. This data can be from applications such as fitness tracking and calendars. Generally, electronic devices support multiple types of transmission channels, such as Bluetooth and Wi-Fi. Bluetooth channels transmit data based on the Bluetooth protocol, while Wi-Fi channels transmit data based on the Wi-Fi protocol.
[0003] Currently, control over data transmission via Bluetooth channels is relatively lacking, which may lead to conflicts between Bluetooth and other channels, causing data transmission lag. For example, when a watch and a phone are transmitting data from a fitness app via Bluetooth while simultaneously downloading video data via Wi-Fi, the video data consuming significant transmission resources can cause Bluetooth transmission lag. Summary of the Invention
[0004] This application provides a data transmission method and an electronic device that can optimize the process of transmitting data via a Bluetooth channel.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, a method is provided, comprising: a service module sending first service data of a first session to a session management module; the session management module obtaining the transmission channel type (first transmission channel type) corresponding to the first session, wherein the first transmission channel type is a Bluetooth channel or a Wi-Fi channel; the session management module sending the first service data and the first transmission channel type to a transmission control module; the transmission control module generating a first data packet based on the first service data, adding the first data packet to a first transmission list corresponding to the first session, and transmitting the first data packet through a first transmission channel corresponding to the first transmission channel type. The timing of the transmission control module transmitting the first data packet is determined according to a preset strategy, which includes determining the transmission rate of data packets in the first transmission list based on at least one of the following: transmission latency of the first transmission channel, data transmission rate, throughput, Quality of Service (QoS), and Quality of Experience (QoE).
[0007] In this method, data transmitted via Bluetooth or Wi-Fi channels are processed uniformly by the transmission control module (simplified module). In this way, the simplified module can uniformly manage data transmitted through various transmission channels such as Bluetooth or Wi-Fi channels. For example, it can perform unified flow control, congestion control, and QoS scheduling algorithms on the sending lists of each session (each service), so that data packets can be sent at high speed and smoothly, avoiding transmission lag.
[0008] In one possible implementation, the service module further sends second service data of the second session to the session management module. The transmission channel type corresponding to the second session is different from that of the first session. After obtaining the transmission channel type corresponding to the second session, the session management module sends the second service data and the transmission channel type corresponding to the second session to the transmission control module. The transmission control module generates a second data packet based on the second service data, adds the second data packet to the second transmission list corresponding to the second session, and obtains the second transmission channel identifier based on the transmission channel type corresponding to the second session. The transmission control module then sends the second data packet through the second transmission channel indicated by the second transmission channel identifier. The timing of the transmission control module sending the second data packet is determined according to a preset strategy. The preset strategy includes determining the transmission rate of data packets in the second transmission list based on at least one of the following: transmission delay of the second transmission channel, data transmission rate, throughput, Quality of Service (QoS), and Quality of Experience (QoE).
[0009] In this method, the transmission channel types of the first session and the second session are different. The service data of the first session and the service data of the second session are processed using a unified process. In this way, the congestion control can be carried out in a unified manner by combining the situation of the Bluetooth channel and the Wi-Fi channel, so as to avoid the Bluetooth channel from being stuck due to the large amount of data transmitted through the Wi-Fi channel.
[0010] In conjunction with the first aspect, in one possible implementation, if the transmission channel type corresponding to the first session is a Bluetooth channel and the transmission channel type corresponding to the second session is a 2.4G Wi-Fi channel, then data packets from the first transmission list and data packets from the second transmission list are transmitted in a time-division manner.
[0011] In this method, the frequency bands of 2.4G Wi-Fi and Bluetooth are relatively close. By transmitting the data of the 2.4G Wi-Fi channel and the Bluetooth channel in a time-sharing manner, mutual interference between the 2.4G Wi-Fi channel and the Bluetooth channel can be avoided.
[0012] In conjunction with the first aspect, in one possible implementation, the transmission control module sending the first data packet through the first transmission channel includes: the transmission control module obtaining a first transmission function corresponding to the first transmission channel type, and the transmission control module calling the first transmission function to send the first data packet. The transmission function includes a Bluetooth transmission function or a Wi-Fi transmission function.
[0013] In one possible implementation, when the first sending function is a Bluetooth sending function, the transmission control module calling the first sending function to send the first data packet includes: the transmission control module sending the first data packet to the connection module; the connection module obtaining the sending sequence number of the first data packet and sending the first data packet and the sending sequence number of the first data packet to the networking module; and the networking module sending the first data packet through the first transmission channel according to the sending sequence number of the first data packet.
[0014] In another possible implementation, when the first sending function is a Wi-Fi sending function, the transmission control module calling the first sending function to send the first data packet includes: the transmission control module sending the first data packet through the socket corresponding to the first session.
[0015] In conjunction with the first aspect, in one possible implementation, before the service module sends the first service data to the session management module, the method further includes: during the establishment of the first session, the transmission control module allocates a first transmission channel according to the type of the first session; wherein the type of session includes messages, audio / video data streams, or files.
[0016] Secondly, an electronic device is provided, which has the function of implementing the method described in the first aspect. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.
[0017] Thirdly, an electronic device is provided, comprising: a processor, a memory, and a communication interface; the communication interface is used for the electronic device to communicate with other devices, the memory is used to store computer-executed instructions, and when the electronic device is running, the processor executes the computer-executed instructions stored in the memory to cause the electronic device to perform the method as described in any one of the first aspects above.
[0018] Fourthly, a computer-readable storage medium is provided that stores instructions which, when executed on a computer, cause the computer to perform the method described in any one of the first aspects.
[0019] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, enables the computer to perform the method described in any one of the first aspects.
[0020] The technical effects of any of the design methods in aspects two through five can be found in the technical effects of different design methods in aspect one, and will not be repeated here. Attached Figure Description
[0021] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0022] Figure 2 A schematic diagram of a system architecture for an electronic device provided in an embodiment of this application;
[0023] Figure 3A A schematic diagram illustrating module interaction for mutual discovery between electronic devices provided in an embodiment of this application;
[0024] Figure 3B A schematic diagram of module interaction for establishing a connection between electronic devices provided in an embodiment of this application;
[0025] Figure 4 A schematic diagram of module interaction for a session establishment process provided in an embodiment of this application;
[0026] Figure 5 A schematic diagram of a module interaction for an electronic device A to send data, as provided in an embodiment of this application;
[0027] Figure 6 This is a schematic diagram of a module interaction for an electronic device A receiving data, as provided in an embodiment of this application.
[0028] Figure 7 A schematic flowchart of a data transmission method provided in an embodiment of this application;
[0029] Figure 8 Another flowchart illustrating the data transmission method provided in this application embodiment;
[0030] Figure 9 A schematic diagram of module interaction for another session establishment process provided in this application embodiment;
[0031] Figure 10 Another module interaction diagram for electronic device A transmitting data provided in the embodiments of this application;
[0032] Figure 11 This is another schematic diagram of module interaction for receiving data by electronic device A provided in an embodiment of this application;
[0033] Figure 12 This is a schematic diagram of the structural composition of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0035] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of 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 "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "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 technical features indicated.
[0036] 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.
[0037] The data transmission method provided in this application can be applied to data transmission between electronic devices. These electronic devices may include watches, mobile phones, tablets, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, smart home devices (e.g., smart TVs, smart screens, large screens, smart speakers, smart air conditioners, etc.), personal digital assistants (PDAs), wearable devices (e.g., smartwatches, smart bracelets, etc.), in-vehicle devices, virtual reality devices, etc. This application does not impose any limitations on these.
[0038] For example, Figure 1 A schematic diagram of a hardware structure of an electronic device 100 is shown.
[0039] like Figure 1 As shown, the electronic device 100 may include a processor 110, a memory 120, a power module 130, an antenna 1, an antenna 2, a mobile communication module 140, a wireless communication module 150, a display screen 160, an audio module 170, etc.
[0040] 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.
[0041] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0042] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0043] 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.
[0044] The memory 120 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the device 100 by running the instructions stored in the memory 120. The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc. The data storage area may store data created during the use of the device 100, etc. Furthermore, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0045] The power module 130 can be used to supply power to the various components included in the electronic device 100. In some embodiments, the power module 130 can be a battery, such as a rechargeable battery.
[0046] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 140, wireless communication module 150, modem processor, and baseband processor.
[0047] 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.
[0048] The mobile communication module 140 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 140 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 140 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 140 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 140 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 140 and at least some modules of the processor 110 may be housed in the same device.
[0049] The wireless communication module 150 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 150 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.
[0050] Electronic device 100 implements display functions through a GPU, a display screen 160, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 160 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.
[0051] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0052] It is understandable that electronic devices require multiple modules to work together to complete the data transmission process.
[0053] For example, Figure 2 A schematic diagram of a system architecture for an electronic device is shown.
[0054] like Figure 2 As shown, electronic devices may include service modules, discovery modules, session management modules, transmission control modules (also known as simplified modules), connection modules, networking modules, etc.
[0055] The business modules can include various services provided by the application and system services, such as the sports and health services of a sports and health app, the audio playback services of an audio and video playback application, and the chat services and file sharing services of a chat application. Each service in the business module can generate business data; for example, the sports service generates sports data, and the audio playback service generates audio data and / or image data.
[0056] The discovery module manages the discovery process between electronic devices. The connectivity module establishes connections between electronic devices, which can include Bluetooth connections, Wi-Fi Direct, etc.
[0057] The session management module manages the creation, modification, and deletion of sessions. Optionally, the session management module may include various transmission service interfaces, such as message transmission service interfaces, file transmission service interfaces, audio transmission service interfaces, video transmission service interfaces, and keyboard / mouse transmission service interfaces. These transmission service interfaces provide transmission services to the application and system services of the business modules; for example, they match the corresponding transmission protocols to the data streams issued by the business modules and provide a pathway between the business modules and the transmission control module.
[0058] The simplified module manages data stream transmission. It includes a transmission protocol module and a transmission engine module. The transmission protocol module encapsulates and parses various transmission protocols, such as real-time streaming media transmission protocols, message transmission protocols, DFILE (file transfer protocol), and broadcast / multicast protocols. It also includes various transmission algorithms, such as latency optimization algorithms, rate control algorithms, reliability algorithms, and throughput algorithms. These algorithms provide high throughput, low latency, high reliability, and jitter resistance. The transmission engine module includes various data transmission engines, such as a Quality of Service (QoS) control engine, a multi-path fusion engine, a Quality of Experience (QoE) detection engine, and a data management engine. The multi-path fusion engine provides concurrent transmission capabilities across multiple paths (multiple transmission channels). The data management engine provides packet sending and receiving processing capabilities, thread management, and device information management. The QoS control engine provides automatic bandwidth allocation for concurrent transmission across multiple devices and services, ensuring a good user experience. The QoE detection engine provides dynamic feedback on network transmission quality, supporting dynamic adjustments to transmission strategies for different services. QoE (Quality of Service) can be used to represent users' experience and perception of services and networks in a near-quantitative way, reflecting the gap between the current service and network quality and user expectations. From the perspective of communication networks, the best solution to achieve better QoE is to provide excellent end-to-end Quality of Service (QoS). QoS is reflected in the performance indicators of underlying packet data transmission, such as latency, jitter, bandwidth, and bit error rate. The QoS mechanism is mainly responsible for service management and providing service differentiation from the network perspective; electronic devices handle different services according to different quality requirements.
[0059] A networking module provides a physical link for data transmission between electronic devices. For example, an electronic device can send data to or receive data from another electronic device via the networking module.
[0060] Understandably, depending on the capabilities and supported interfaces of the electronic device's operating system, as well as the rules for module division, an electronic device may include a C / C++ language framework, a Java language framework, or both. The C / C++ language framework is compiled using C / C++, and the Java language framework is compiled using Java. The modules mentioned above may belong to either the C / C++ language framework or the Java language framework.
[0061] For example, the business module, session management module, and networking module on the watch belong to the C / C++ language framework; the business module, session management module, and networking module on the mobile phone belong to the Java language framework.
[0062] The following is combined Figure 2 Each module shown in the document provides a detailed description of the data transmission method provided in the embodiments of this application.
[0063] In one scenario, electronic devices can establish rapid connections and interactions. For example, users can achieve seamless connection and data synchronization between electronic devices through simple operations such as proximity connection, QR code connection, or contacting with a near field communication (NFC) chip. One exemplary implementation of this scenario is MagicLink. MagicLink technology is applied to electronic devices such as mobile phones, laptops, and smart screens, enabling users to enjoy a more convenient and efficient experience. For instance, users can share the clipboard between a laptop and a mobile phone, enabling copy and paste operations between different electronic devices, facilitating the transfer of files and information. Another example is that by contacting with an NFC chip, users can quickly project content from their mobile phone onto a smart screen for large-screen display without needing to download a projection app; projection can also be achieved between electronic devices connected to different networks. Furthermore, MagicLink provides a plug-and-play experience, allowing users to achieve rapid connection and data synchronization between electronic devices without complex setup or installation steps.
[0064] This application uses MagicLink as an example to illustrate the process of establishing a connection and synchronizing data between electronic devices. It should be noted that the data transmission method provided in this application is not only applicable to MagicLink, but also to other implementations that can achieve fast connection and data sharing between electronic devices.
[0065] In some embodiments, electronic devices can establish a MagicLink connection in various ways. For example, the connection can be initiated via proximity connection, QR code connection, USB connection, or multi-device control panel connection. Proximity connection enables quick pairing via Bluetooth and NFC; QR code connection connects by scanning a QR code; USB connection connects via a USB cable; and multi-device control panel connection connects devices via the control panel.
[0066] Electronic devices need to discover each other before a connection can be established. For example, electronic device A and electronic device B can discover each other. In some scenarios, electronic device A initiates the discovery process between itself and electronic device B, while in other scenarios, electronic device B initiates the discovery process between itself and electronic device A.
[0067] For example, Figure 3A This diagram illustrates a module interaction method where electronic devices discover each other. Figure 3A The discovery process initiated by electronic device A will be used as an example for explanation. The discovery process initiated by electronic device B can refer to the discovery process initiated by electronic device A. It will not be repeated in this embodiment.
[0068] Combination Figure 2 ,like Figure 3A As shown, the method includes:
[0069] S301, The discovery module of electronic device A sends a broadcast message.
[0070] If the switches on electronic devices A and B that allow discovery by other devices are turned on, then electronic devices A and B can discover each other. In one example, the switches that allow discovery by other devices include a WLAN switch and a Bluetooth switch. Electronic devices A and B can turn on the WLAN and Bluetooth switches based on user operations on them.
[0071] In some embodiments, after receiving user input to controls on the user interface of electronic device A, electronic device A initiates a discovery process to obtain information about nearby devices. In one implementation, the business module of electronic device A notifies the discovery module to initiate the discovery process, and the discovery module then sends a broadcast message, such as a Bluetooth broadcast, which includes the device account hash, device identifier, device type (e.g., mobile phone, tablet, PC, TV, etc.), device capabilities (screen on / off, unlock, network connectivity, support for trust rings, etc.), and device score of electronic device A.
[0072] In other embodiments, the discovery module of electronic device A may periodically send broadcast messages.
[0073] S302, The discovery module of electronic device B sends a unicast message to electronic device A.
[0074] After electronic device B detects the broadcast message, its discovery module sends a unicast message to electronic device A.
[0075] The unicast message includes the device account hash of electronic device B, device identifier, device type (such as mobile phone, tablet, PC, TV, etc.), device capabilities (screen on / off, unlock, network connection, support for trust ring, etc.), device score, etc.
[0076] S303. The discovery modules of electronic device A and electronic device B respectively notify their corresponding network modules to perform device authentication. Electronic device A and electronic device B respectively perform device authentication through the network module. If the authentication is successful, the network module returns an authentication success message to the discovery module.
[0077] In one implementation, the discovery module of electronic device A sends a device authentication notification to the networking module. The discovery module of electronic device B also sends a device authentication notification to the networking module. The networking modules of both electronic devices send their respective authentication information (e.g., user login account) to each other. The networking module of electronic device A authenticates the authentication information of electronic device B; if authentication is successful, the networking module returns a success message to the discovery module.
[0078] S304. The discovery module of electronic device A returns the device information of electronic device B to the service module, and the discovery module of electronic device B returns the device information of electronic device A to the service module.
[0079] For example, equipment information includes equipment type, equipment identification, etc.
[0080] Electronic device A's service module receives device information from electronic device B. After electronic device B's service module receives device information from electronic device A, electronic device A and electronic device B discover each other.
[0081] After electronic devices A and B discover each other, a user can share data from a specific service on electronic device A with electronic device B, or vice versa. In one example, after electronic device A receives a user's request to share data with electronic device B, a session is established between them. A single service can establish one or more sessions. Before the session is terminated, electronic devices A and B can interact and transfer data multiple times.
[0082] In some embodiments, after electronic device A and electronic device B discover each other, electronic device A and electronic device B further establish a connection. Upon receiving an operation to share data from a user, electronic device A and electronic device B establish a session based on the already established connection. In other embodiments, after electronic device A and electronic device B discover each other, upon receiving an operation to share data from a user, electronic device A then establishes a connection with electronic device B, and subsequently, electronic device A and electronic device B establish a session based on the already established connection.
[0083] For example, Figure 3B This diagram illustrates a modular interaction method for establishing connections between electronic devices. Figure 2 The modules shown, such as Figure 3B As shown, the method includes:
[0084] S310. The service module of electronic device A notifies the session management module to initiate a connection establishment with electronic device B. The session management module notifies the connection module to initiate a connection establishment with electronic device B.
[0085] In some embodiments, after receiving device information from electronic device B, the service module of electronic device A notifies the session management module to establish a connection with electronic device B.
[0086] S311. The connection module of electronic device A establishes a connection with the connection module of electronic device B.
[0087] Electronic device A and electronic device B can establish a connection via a connection module. Optionally, electronic device A and electronic device B can establish a Bluetooth connection, a Wi-Fi connection (e.g., Wi-Fi Direct, or Wi-Fi P2P), etc. Electronic device A and electronic device B can establish a connection using conventional technologies, and this application embodiment is not limited to any particular method. In this application embodiment, the Bluetooth connection established between electronic device A and electronic device B is also referred to as a Bluetooth channel. The Wi-Fi connection established between electronic device A and electronic device B is also referred to as a Wi-Fi channel.
[0088] S312. The connection module of electronic device B notifies the session management module that a connection has been established with electronic device A. The session management module notifies the service module that a connection has been established with electronic device A.
[0089] It should be noted that in some other examples, the connection can also be initiated by electronic device B. The specific process can be referred to the connection establishment initiated by electronic device A, which will not be repeated in the embodiments of this application.
[0090] Once electronic device A establishes a connection with electronic device B, a session can be established based on that connection.
[0091] During session establishment, the session is assigned a corresponding transmission channel (connection). Subsequently, all data within the session is transmitted through this transmission channel. Optionally, a session can be assigned one transmission channel; alternatively, a session can also be assigned multiple transmission channels, and the session's data can be transmitted on one of the multiple transmission channels or transmitted in parallel on multiple transmission channels.
[0092] For example, Figure 4 This diagram illustrates the module interaction of a session establishment process.
[0093] like Figure 4 As shown, the method includes:
[0094] S401, The service module of electronic device A sends a session establishment instruction to the session management module.
[0095] When electronic device A needs to send service data for a specific service within a service module—for example, after receiving a user's data sharing operation—a session can be established for that service. Once the session is established, service data belonging to that session can be sent and received.
[0096] In one implementation, the service module of electronic device A sends a session establishment instruction to the session management module. The session establishment instruction includes a session identifier, a session type, etc. The session identifier is used to uniquely identify a session, and the session type includes messages, files, audio and video data streams, etc.
[0097] S402. The session management module of electronic device A allocates session resources for this session.
[0098] For example, the session management module can bind the correspondence between listeners and sessions registered by business modules.
[0099] The session management module can also obtain the session name, service package name, protocol type, session priority, etc.
[0100] In one implementation, the session management module can also assign a transmission channel type to the session, which may be a Bluetooth channel or a Wi-Fi channel. In one example, the transmission channel type is assigned to the session based on the session type. For instance, messages are assigned a Bluetooth channel, and audio / video data streams are assigned a Wi-Fi channel.
[0101] S403. The session management module of electronic device A sends a connection start request to the connection module.
[0102] In one implementation, the connection opening request includes session identifier, session type, session name, service packet name, protocol type, session priority, and transmission channel type.
[0103] S404. The connection module of electronic device A sends a connection request to the connection module of electronic device B.
[0104] In one implementation, the connection module determines the transmission channel based on the transmission channel type. For example, if the transmission channel type is a Bluetooth channel, the connection request is initiated through the Bluetooth port. If the transmission channel type is a Wi-Fi channel, a socket is allocated for the session, including, for example, an IP address and a port number; the connection request is then initiated through this socket.
[0105] In one implementation, the connection request includes the device identifier of electronic device A, session identifier, session type, session key, session name, service package name, protocol type, session priority, and whether smart interconnection is supported.
[0106] Optionally, if the transmission channel type is a Wi-Fi channel, the connection request may also include the local IP address, port number, etc.
[0107] S405, the connection module of electronic device B sends a connection instruction to the session management module.
[0108] In one implementation, the connection indication includes a session identifier, session type, session key, session name, service package name, protocol type, session priority, and whether smart interconnection is supported, obtained from electronic device A.
[0109] S406. The session management module of electronic device B allocates session resources for this session.
[0110] S407. The session management module of electronic device B sends a session initiation instruction to the service module.
[0111] S408, The connection module of electronic device B sends a connection confirmation to the connection module of electronic device A.
[0112] In one implementation, the connection confirmation includes the device identifier, session identifier, session name, service packet name, protocol type, session priority, and whether smart interconnection is supported by electronic device B.
[0113] Optionally, if the transmission channel type is a Wi-Fi channel, the connection confirmation also includes the local IP address, port number, etc.
[0114] S409. The connection module of electronic device A sends a connection confirmation response to the session management module.
[0115] In one implementation, the connection confirmation response includes session identifier, session name, service packet name, and transmission channel type.
[0116] S410, the session management module of electronic device A sends a session establishment response to the service module.
[0117] At this point, a session has been established between electronic device A and electronic device B, and one or more transmission channels (connections) have been associated between electronic device A and electronic device B for this session. Data for that session can then be transmitted on the corresponding transmission channel.
[0118] The following description uses the process of electronic device A sending and receiving data as an example. The process of electronic device B sending and receiving data can be referred to electronic device A, and will not be repeated in this embodiment.
[0119] Combination Figure 2 , Figure 5 and Figure 6 This illustration shows one implementation of the data transmission method provided in this application. It should be noted that the following embodiments use examples of electronic device A sending data to electronic device B via a Bluetooth channel and electronic device A receiving data from electronic device B via a Bluetooth channel for detailed description. For specific implementations of electronic device A sending data to electronic device B via a Wi-Fi channel and electronic device A receiving data from electronic device B via a Wi-Fi channel, please refer to... Figure 5 and Figure 6 .
[0120] For example, Figure 5 This diagram illustrates a module interaction diagram of electronic device A transmitting data. (Combined with...) Figure 2 ,like Figure 5 As shown, the method includes:
[0121] S501. A certain business function in the business module generates business data, and the business module sends the business data and session information to the session management module.
[0122] After electronic device A and electronic device B establish a session, a certain service on electronic device A generates the service data for that session.
[0123] For example, a certain business function of a business module generates business data, such as sports and health data, audio data, image data, picture data, message data, etc. It is understood that electronic device A has already established a session for this business function, meaning that the business data belongs to a session.
[0124] In one implementation, the business module calls the SendMsg (message sending) function, which includes business data and session information. The session information indicates the session to which the business data belongs; for example, the session information is a session identifier.
[0125] S502. The session management module obtains the sending sequence number and transmission channel type corresponding to the service data.
[0126] In one implementation, the session management module can obtain the transmission channel type corresponding to the session based on session information (such as session identifier).
[0127] The session management module can also record the sequence number of the business data sent according to the order in which the business data is received from the business module.
[0128] The session management module can also obtain session type, session name, service package name, protocol type, session priority, etc. based on session information (such as session identifier).
[0129] S503. The session management module sends service data, including the sequence number, transmission channel type, and session identifier, to the connection module.
[0130] S504. The connection module obtains the connection information for business data based on the session identifier.
[0131] For example, if the transmission channel type of the session indicated by the session identifier is a Bluetooth channel, then the connection information of the service data is the port number of the Bluetooth port.
[0132] For example, if the transmission channel type of the session indicated by the session identifier is a Wi-Fi channel, then the connection information of the service data is the socket corresponding to the session.
[0133] S505: The connection module sends service data, including the sequence number, transmission channel type, and connection information, to the networking module.
[0134] S506, the networking module generates data packets.
[0135] The networking module segments the business data, generates segmented data, and encrypts the segmented data.
[0136] The networking module also adds corresponding transmission headers to the encrypted fragmented data to generate data packets. In one implementation, the transmission header of the data packet may include a sequence number, etc.
[0137] In one implementation, the networking module adds each generated data packet to the corresponding session's send list.
[0138] S507, the networking module obtains the networking information corresponding to each data packet.
[0139] Network information includes the sending function, maximum transmission unit (MTU), and ack (response) type.
[0140] In one implementation, the networking module obtains the corresponding sending function, MTU, ack type, etc., according to the transmission channel type, that is, it obtains the sending function, MTU, ack type, etc. of the data packet corresponding to the service data.
[0141] The S508 and networking module sequentially send data packets from the session's send list.
[0142] The networking module sequentially sends the data packets in the session's send list on the corresponding transmission channel according to the networking information. In one example, the transmission channel type is a Bluetooth channel, and the networking module sends the data packets in the session's send list through the Bluetooth channel.
[0143] In this method, electronic device A packages the service data of the service module through the session management module, connection module, and networking module, and then sends the data through the Bluetooth channel. However, no congestion control or QoS monitoring is performed during the data transmission process. If data is transmitted in parallel through both the Bluetooth and Wi-Fi channels, the large amount of data transmitted through the Wi-Fi channel may cause lag in the Bluetooth channel.
[0144] For example, Figure 6 This diagram illustrates a module interaction method for electronic device A to receive data. (Combined with...) Figure 2 ,like Figure 6 As shown, the method includes:
[0145] S601, the networking module receives data packets.
[0146] For example, the networking module of electronic device A receives data packets from electronic device B through the transmission port corresponding to the Bluetooth channel.
[0147] S602, the networking module obtains the transmission channel type and networking information.
[0148] In one implementation, after receiving a data packet, the networking module can obtain the corresponding transmission channel type based on the transmission port that received the data packet.
[0149] The networking module obtains the message receiving function, MTU, ACK type, etc. corresponding to each data packet based on the transmission channel type.
[0150] S603, the networking module obtains fragmented data based on data packets.
[0151] The networking module decrypts data packets to obtain fragmented data.
[0152] S604, the networking module obtains transport layer information.
[0153] In one implementation, the networking module parses the data packet header and obtains the transport layer identifier based on the header.
[0154] S605, the networking module sends fragmented data and transport layer information to the connection module.
[0155] S606, The connection module obtains business data based on the fragmented data.
[0156] In one implementation, the connection module can reassemble multiple data fragments to generate a single frame of business data.
[0157] S607. The connection module sends business data and transport layer information to the session management module.
[0158] S608. The session management module obtains session information based on the transport layer information and sends service data and session information to the service module.
[0159] In one implementation, the session management module obtains the corresponding session information (such as the session identifier) and the receiving function of the service registration corresponding to the session based on the transport layer identifier, and transmits service data to the corresponding service of the service module through the receiving function.
[0160] S609. The corresponding service of the service module receives the service data.
[0161] Combination Figure 5 and Figure 6 ,like Figure 7 As shown, in the above data transmission method, after the electronic device's service module generates service data, it sequentially transmits the data through the session management module, connection module, and networking module via the Bluetooth channel. After receiving data through the Bluetooth channel, the electronic device's networking module sequentially transmits the data to the service module through the connection module and session management module. Since electronic devices send or receive data via the Bluetooth channel, there is a lack of data management, such as congestion control and QoS monitoring, which increases the likelihood of data transmission stuttering and other problems.
[0162] The process of sending and receiving data via Wi-Fi can be referenced to sending and receiving data via Bluetooth.
[0163] In other embodiments, the functions of each module can differ when transmitting data via a Wi-Fi channel compared to when transmitting data via a Bluetooth channel. For example, when transmitting data via a Wi-Fi channel, methods such as congestion control and QoS monitoring can be used to improve data transmission performance. However, since the functions implemented by each module differ depending on whether data is transmitted via Wi-Fi or Bluetooth, this can lead to redundancy and clutter in module functionality.
[0164] This application provides a data transmission method in which an electronic device includes a simplified module for unified management of the sending and receiving processes of various transmission channels, optimizing data transmission performance; and making the functional division of the electronic device's service module, session management module, connection module, and networking module clearer, with each module having a more singular function, reducing redundant processing of each module.
[0165] For example, Figure 8 This illustration shows another flowchart of the data transmission method provided in an embodiment of this application.
[0166] like Figure 8 As shown, after the electronic device's service module generates service data, the session management module sends the service data to the simplified module. The simplified module can control the transmission of the service data according to the preset transmission algorithm and data transmission engine. For data transmitted via the Bluetooth channel, the simplified module sends the service data to the connection module, which then sends it to the networking module. For data transmitted via the Wi-Fi channel, the simplified module sends it directly through the socket corresponding to the session.
[0167] The modules through which data received by electronic devices pass are the reverse of those for data sent, and will not be elaborated here.
[0168] In this method, business data passes through a simplified module. This module provides unified management of data sent or received through various transmission channels. For example, it manages congestion during the data transmission process, enabling real-time, high-speed transmission of business data. Furthermore, the simplified module's unified management of data transmission and reception clarifies the functional division of other modules such as the connection module and networking module, reducing redundancy in their functions.
[0169] It is understandable that electronic devices need to establish a session before sending or receiving service data.
[0170] For example, Figure 9 This illustration shows a module interaction diagram of another session establishment process provided in an embodiment of this application.
[0171] like Figure 9 As shown, the method includes:
[0172] S901, the service module of electronic device A sends a session establishment instruction to the session management module.
[0173] For specific implementation details, please refer to S401.
[0174] S902, the session management module of electronic device A allocates session resources for the session and sends a session start instruction to the simplified module.
[0175] For example, the session management module can bind the correspondence between listeners and sessions registered by business modules.
[0176] The session management module can also obtain the session name, service package name, protocol type, session priority, etc.
[0177] In one example, the session initiation instruction includes the session identifier, session name, service package name, protocol type, session priority, etc.
[0178] S903, The simplified module of electronic device A sends a connection start request to the connection module.
[0179] The simplified module can assign a simplified-level session identifier to the session. In one implementation, the simplified module assigns simplified-level session identifiers one-to-one with the session identifiers, thus uniquely identifying a session within the simplified module. The simplified module can then send the simplified-level session identifiers to the session management module, which stores the mapping between session identifiers and simplified-level session identifiers.
[0180] In one implementation, the minimal module can also assign a transmission channel type to the session, which can be either a Bluetooth channel or a Wi-Fi channel. In one example, the transmission channel type is assigned to the session based on the session type. For instance, messages are assigned a Bluetooth channel, and audio / video data streams are assigned a Wi-Fi channel.
[0181] In one implementation, the connection opening request includes session identifier, session type, session name, service packet name, protocol type, session priority, and transmission channel type.
[0182] S904. The connection module of electronic device A initiates a connection request to the connection module of electronic device B.
[0183] In one implementation, the connection module of electronic device A determines the transmission channel based on the transmission channel type. For example, if the transmission channel type is a Bluetooth channel, it determines that the connection request will be initiated through the Bluetooth port. If the transmission channel type is a Wi-Fi channel, a socket is allocated for the session, including, for example, an IP address and a port number; the connection request is then initiated through this socket.
[0184] In one implementation, the connection request includes the device identifier of electronic device A, session identifier, session type, session key, session name, service package name, protocol type, session priority, and whether smart interconnection is supported.
[0185] Optionally, if the transmission channel type is a Wi-Fi channel, the connection request may also include the local IP address, port number, etc.
[0186] S905, the connection module of electronic device B sends a connection instruction to the simplified module, and the simplified module sends a connection notification to the session management module.
[0187] In one implementation, the connection indication includes a session identifier, session type, session key, session name, service package name, protocol type, session priority, and whether smart interconnection is supported, obtained from electronic device A.
[0188] S906. The session management module of electronic device B allocates session resources for this session.
[0189] S907, The session management module of electronic device B sends a session initiation instruction to the service module.
[0190] S908, the connection module of electronic device B sends a connection confirmation to the connection module of electronic device A.
[0191] In one implementation, the connection confirmation includes the device identifier, session identifier, session name, service packet name, protocol type, session priority, and whether smart interconnection is supported by electronic device B.
[0192] Optionally, if the transmission channel type is a Wi-Fi channel, the connection confirmation also includes the local IP address, port number, etc.
[0193] S909, the connection module of electronic device A sends a connection confirmation response to the simplified module, and the simplified module sends a connection confirmation response to the session management module.
[0194] In one implementation, the connection confirmation response includes session identifier, session name, service packet name, and transmission channel type.
[0195] S910, the session management module of electronic device A sends a session establishment response to the service module.
[0196] At this point, a session has been established between electronic device A and electronic device B, and one or more transmission channels (connections) have been associated with this session. Data for that session can then be transmitted on the corresponding transmission channel.
[0197] For example, Figure 10 This illustrates another module interaction diagram for electronic device A transmitting data. (Combined with...) Figure 2 ,like Figure 10 As shown, the method includes:
[0198] S1001. A certain business function of the business module generates business data, and the business module sends the business data and session information to the session management module.
[0199] After electronic device A and electronic device B establish a session, a certain service on electronic device A generates the service data for that session. For specific implementation details, please refer to S501, which will not be elaborated here.
[0200] S1002, The session management module obtains information such as the sending sequence number, transmission channel type, protocol type, and simplified layer session identifier corresponding to the service data.
[0201] In one implementation, the session management module can record the sequence number of the service data according to the order in which the service data is received from the service module.
[0202] In one implementation, the session management module can obtain the transmission channel type corresponding to the session based on session information (such as session identifier).
[0203] The session management module can also obtain session type, session name, service package name, protocol type (e.g., real-time streaming media transmission protocol, message transmission protocol, DFILE, etc.) and session priority based on session information (e.g., session identifier).
[0204] In one implementation, the session management module can also obtain the simplified layer session identifier corresponding to the session based on session information (such as session identifier).
[0205] S1003. The session management module sends business data, sequence number, transmission channel type, simplified layer session identifier and other information to the simplified module.
[0206] S1004, the simplified module obtains connection information and network information, and also generates data packets based on business data.
[0207] In one implementation, the simplified module obtains the corresponding connection information based on the simplified layer session identifier. For example, if the transmission channel type of the session indicated by the simplified layer session identifier is a Bluetooth channel, then the connection information of the service data is the Bluetooth port number. Similarly, if the transmission channel type of the session indicated by the simplified layer session identifier is a Wi-Fi channel, then the connection information of the service data is the socket corresponding to that session.
[0208] In one implementation, network information includes a transmission function, Maximum Transmission Unit (MTU), and ACK (response) type. The simplified module obtains the corresponding transmission function, MTU, and ACK type based on the transmission channel type. The simplified module fragments the service data, generating fragmented data, and encrypts the fragmented data. The network module also adds corresponding transmission headers to the encrypted fragmented data, generating data packets. In one implementation, the data packet's transmission header may include a sequence number and a simplified layer session identifier.
[0209] S1005, the simplified module adds the generated data packets to the corresponding session's send list.
[0210] It should be noted that storing data packets in the form of a sending list is only one implementation method. In other implementation methods, it may also be in other forms such as a sending queue. This application does not make any specific limitation.
[0211] Furthermore, the minimal module calls the send function to send data packets from the session's send list.
[0212] In some embodiments, data packets transmitted through various transmission channel types (such as Bluetooth, Wi-Fi, etc.) all pass through a simplified module, which can uniformly manage the sending lists of each session (each service). In one implementation, the simplified module can perform unified flow control, congestion control, QoS scheduling algorithms, etc., on the sending lists of each session (each service), enabling data packets to be sent at high speed and smoothly, avoiding transmission lag.
[0213] In some examples, the simplified module includes algorithms such as latency optimization, rate control, reliability, and throughput. The latency optimization algorithm reduces data transmission latency, the rate control algorithm increases data transmission rate, the reliability algorithm enhances data transmission reliability, and the throughput algorithm increases data transmission throughput. The latency optimization, rate control, reliability, and throughput algorithms can be derived from conventional techniques, and this application does not limit their application to these methods.
[0214] In some examples, the minimalist module includes a QoS control engine for automatically allocating bandwidth for concurrent multi-service transmission based on QoS. In one implementation, the QoS control engine configures service priorities according to preset rules, such as service type (session type) or whether the service runs in the foreground or background. The QoS control engine can allocate bandwidth to each session based on the service priority corresponding to the data packets, determining the packet transmission order and rate for each session.
[0215] In some examples, the minimalist module includes a QoE detection engine to provide dynamic feedback on network transmission quality, supporting dynamic adjustments to transmission strategies by services. For instance, it can increase the data transmission rate through the corresponding transmission channel when the QoE is good, and decrease the data transmission rate through the corresponding transmission channel when the QoE is poor.
[0216] In some examples, the minimalist module includes a multipath fusion engine to provide multipath (multi-transmission channel) concurrent transmission capabilities.
[0217] In some examples, the simplified module can control the transmission order of data packets across multiple transmission channels to avoid interference between different channels. For instance, Session 1 corresponds to the 2.4GHz Wi-Fi channel, and Session 2 corresponds to the Bluetooth channel. The simplified module can control the transmission order of data packets in the transmission lists of Session 1 and Session 2, allowing the 2.4GHz Wi-Fi channel and Bluetooth channel to transmit data packets in a time-sharing manner, thus preventing interference from the 2.4GHz Wi-Fi channel to the Bluetooth channel.
[0218] The simplified module can determine the transmission parameters of data packets in the transmission list for each session based on the aforementioned strategies such as flow control, congestion control, QoS scheduling algorithms, multipath fusion, and interference control. These transmission parameters include transmission period and transmission rate. The simplified module then calls the transmission function to send the data packets based on the transmission time determined by the transmission parameters. In one implementation, for sessions with a Bluetooth transmission channel, the Bluetooth transmission function is called to send the data packets in the transmission list. In another implementation, for sessions with a Wi-Fi transmission channel, the Wi-Fi transmission function is called to send the data packets in the transmission list.
[0219] For example, sending list 1 is the sending list of session A, and the transmission channel type of session A is Bluetooth channel. The simplified module determines the data transmission rate 1 of the Bluetooth channel based on the aforementioned strategies such as flow control, congestion control, QoS scheduling algorithms, multipath fusion, and interference control; that is, it determines the transmission rate 1 of the data packets in sending list 1. In one implementation, the simplified module can call the Bluetooth sending function according to this transmission rate 1, thus sending the data packets in list 1 according to this transmission rate 1.
[0220] For example, sending list 2 is the sending list of session B, and the transmission channel type of session B is a Wi-Fi channel. The simplified module can determine the data transmission rate of the Wi-Fi channel based on the above-mentioned strategies such as flow control, congestion control, QoS scheduling algorithms, multipath fusion, and interference control, that is, determine the transmission rate of the data packets in sending list 2. In one implementation, the simplified module can call the Wi-Fi sending function according to this transmission rate 2, that is, implement the transmission of data packets in list 2 according to this transmission rate 2.
[0221] For example, when the simplified module determines that there is a transmission list 1 for session A and a transmission list 2 for session B, where session A uses a Bluetooth channel and session B uses a Wi-Fi channel, the simplified module can determine the data transmission rate 1 for the Bluetooth channel and the data transmission rate 2 for the Wi-Fi channel based on the aforementioned strategies such as flow control, congestion control, QoS scheduling algorithms, multipath fusion, and interference control. The simplified module then calls the Bluetooth transmission function according to transmission rate 1 and the Wi-Fi transmission function according to transmission rate 2. In this way, the simplified module can uniformly manage the data transmission rates of the Bluetooth and Wi-Fi channels; for example, it can prevent the Bluetooth channel from becoming choppy due to excessively fast data transmission in the Wi-Fi channel. Optionally, based on time-sharing transmission between the Wi-Fi and Bluetooth channels, the Bluetooth and Wi-Fi transmission functions can also be called in a time-sharing manner, ensuring that the Wi-Fi and Bluetooth channels do not interfere with each other.
[0222] Continue to refer to Figure 10 If the data packet corresponds to a Bluetooth channel, the method further includes:
[0223] S1010, the minimalist module calls the Bluetooth sending function to send the data packet to the connection module.
[0224] S1011 The connection module parses the transmission header of the data packet to obtain information such as the sending sequence number, and sends the data packet and the sending sequence number to the networking module.
[0225] S1012 The networking module sends data packets through the corresponding transmission port of the Bluetooth transmission channel according to the sending sequence number.
[0226] Continue to refer to Figure 10 If the data packet corresponds to a Wi-Fi channel, the method further includes:
[0227] S1020, the simplified module calls the Wi-Fi sending function to send the data packet.
[0228] In one implementation, the minimal module sends data packets through the Socket corresponding to the session.
[0229] The data transmission method provided in this application embodiment processes data transmitted via Bluetooth or Wi-Fi channels through a unified simplified module. This simplified module can manage data transmitted through various transmission channels such as Bluetooth or Wi-Fi channels in a unified manner. For example, it can control the sending rate of data packets in the sending list of each session (each service) and implement unified flow control, congestion control, QoS scheduling algorithms, etc., so that data packets can be sent at high speed and smoothly, avoiding transmission lag.
[0230] For example, Figure 11 This illustrates another module interaction diagram for electronic device A receiving data. (Combined with...) Figure 2 ,like Figure 11 As shown, the method includes:
[0231] In some embodiments, electronic device A receives data via a Bluetooth channel. The method includes:
[0232] S1101, The networking module receives the data packet.
[0233] For example, the networking module of electronic device A receives data packets from electronic device B via a Bluetooth channel.
[0234] S1102, The networking module obtains connection information.
[0235] In one implementation, after receiving a data packet, the networking module can obtain the corresponding connection information (such as the port number of the transmission port) based on the transmission channel through which the data packet was received.
[0236] S1103, The networking module sends data packets and corresponding connection information to the connection module.
[0237] S1104. The connection module obtains the corresponding transmission channel type based on the connection information and sends the data packet and the corresponding transmission channel type to the simplified module.
[0238] In other embodiments, electronic device A receives data via a Wi-Fi channel. The method includes:
[0239] S1110, the simplified module receives data packets from the socket and determines that the transmission channel type is a Wi-Fi channel.
[0240] For example, electronic device A receives a data packet sent by electronic device B via a Wi-Fi channel from a socket.
[0241] Subsequently, the simplified module can uniformly process data packets from various transmission channel types. The method also includes:
[0242] S1120, the simplified module obtains network information based on the transmission channel type.
[0243] The simplified module obtains the message receiving function, MTU, ACK type, etc. corresponding to each data packet based on the transmission channel type.
[0244] S1121, The simplified module obtains business data based on the data packet.
[0245] In one implementation, the simplified module decrypts the data packets to obtain fragmented data. The simplified module can also reassemble multiple fragmented data to generate a single frame of service data.
[0246] In one implementation, the simplified module can parse the sequence number from the data packet header, sort the received service data according to the sequence number, and transmit the service data to the session management module in the order indicated by the sequence number.
[0247] S1122. The simplified module obtains the simplified layer session identifier corresponding to the business data based on the data packet.
[0248] In one implementation, the minimal module parses the transport header from the data packet and obtains the corresponding minimal layer session identifier from the transport header.
[0249] S1123. The simplified module sends business data and the corresponding simplified layer session identifier to the session management module.
[0250] S1124. The session management module obtains session information based on the simplified layer session identifier and sends business data and session information to the business module.
[0251] In one implementation, the session management module obtains the corresponding session information (such as the session identifier) and the receiving function of the service registration corresponding to the session based on the simplified layer session identifier, and transmits service data to the corresponding service of the service module through the receiving function.
[0252] S1125, The corresponding service of the service module receives the service data.
[0253] The data transmission method provided in this application allows for unified management of service data transmitted across various transmission channels using a simplified module. This enables control over the timing and rate of service data transmission, ensuring high-speed and smooth transmission across all channels. Furthermore, each module has a relatively singular function and a clearer module division. For different types of transmission channels, each functional module employs a unified process, avoiding duplication and redundancy in module functionality.
[0254] It is understood that, in order to achieve the aforementioned functions, the electronic device includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the 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 by 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 application.
[0255] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0256] Figure 12 A possible structural diagram of the electronic device involved in the above embodiments is shown. The electronic device 1200 includes: a processing unit 1201, a communication unit 1202, and a storage unit 1203. The processing unit 1201 is used to control and manage the operation of the electronic device 1200; the communication unit 1202 is used to support communication between the electronic device 1200 and other network entities; and the storage unit 1203 stores the instructions and data of the electronic device 1200.
[0257] Of course, the unit modules in the above-mentioned electronic device 1200 include, but are not limited to, the processing unit 1201, the communication unit 1202, and the storage unit 1203. For example, the electronic device 1200 may also include a power supply unit, which is used to supply power to the electronic device 1200.
[0258] The processing unit 1201 can be a processor or controller, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The communication unit 1202 can be a transceiver, transceiver circuit, etc. The storage unit 1203 can be a memory.
[0259] For example, processing unit 1201 is a processor (such as...) Figure 1 The processor 110 shown, and the communication unit 1202 include a mobile communication module (such as...). Figure 1 The mobile communication module 140 shown) and / or wireless communication module (such as Figure 1 The wireless communication module 150 shown can be a memory (such as a storage unit 1203). Figure 1The memory 120 shown in this application embodiment can be the electronic device 1200. Figure 1 The electronic device 100 shown above. The processor, memory, communication interface, etc., can be connected together, for example, via a bus. The processor calls the program code stored in the memory to execute the various steps in the above method embodiments.
[0260] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device performs the method described in the above embodiments.
[0261] This application also provides a computer program product that, when run on a computer, causes the computer to perform the methods described in the above embodiments.
[0262] In this application, the electronic device 1200, computer-readable storage medium, or computer program product provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0263] Through the above description of the implementation methods, those skilled in the art can 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.
[0264] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0265] Furthermore, the functional units in the various embodiments of this application 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 described above can be implemented in hardware or as a software functional unit.
[0266] 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 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 software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, 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 USB flash drives, portable hard drives, ROMs, magnetic disks, or optical disks.
[0267] 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, characterized in that, Applied to an electronic device, the electronic device including a service module, a session management module, and a transmission control module, the method includes: The service module sends first service data to the session management module, and the first service data belongs to the first session; The session management module obtains the first transmission channel type corresponding to the first session, and the first transmission channel type includes a Bluetooth channel or a Wi-Fi channel. The session management module sends the first service data and the first transmission channel type to the transmission control module; The transmission control module generates a first data packet based on the first service data and adds the first data packet to the first sending list corresponding to the first session. The transmission control module sends the first data packet through a first transmission channel, and the first transmission channel corresponds to the first transmission channel type. The timing at which the transmission control module sends the first data packet is associated with the transmission rate of the data packets in the first transmission list. The transmission rate is determined based on at least one of the following: transmission delay of the first transmission channel, data transmission rate, throughput, Quality of Service (QoS), and Quality of Experience (QoE).
2. The method according to claim 1, characterized in that, The method further includes: The service module sends second service data to the session management module, and the second service data belongs to the second session; The session management module obtains the second transmission channel type corresponding to the second session, and the second transmission channel type is different from the first transmission channel type; The session management module sends the second service data and the second transmission channel type to the transmission control module; The transmission control module generates a second data packet based on the second service data and adds the second data packet to the second sending list corresponding to the second session; The transmission control module sends the second data packet through a second transmission channel, and the second transmission channel corresponds to the second transmission channel type. The timing at which the transmission control module sends the second data packet is associated with the transmission rate of the data packets in the second transmission list. The transmission rate of the data packets in the second transmission list is determined based on at least one of the following: transmission delay of the second transmission channel, data transmission rate, throughput, quality of service (QoS), and quality of user experience (QoE).
3. The method according to claim 2, characterized in that, The method further includes: Data packets from the first sending list and data packets from the second sending list are sent in a time-division manner.
4. The method according to claim 1 or 2, characterized in that, The transmission control module sends the first data packet through the first transmission channel, including: The transmission control module obtains the first transmission function corresponding to the first transmission channel type, and the transmission function includes a Bluetooth transmission function or a Wi-Fi transmission function; The transmission control module calls the first sending function to send the first data packet.
5. The method according to claim 4, characterized in that, The electronic device also includes a connection module and a networking module. When the first sending function is a Bluetooth sending function, the transmission control module calling the first sending function to send the first data packet includes: The transmission control module sends the first data packet to the connection module; The connection module obtains the transmission sequence number of the first data packet and sends the first data packet and the transmission sequence number of the first data packet to the networking module. The networking module sends the first data packet through the first transmission channel according to the sending sequence number of the first data packet.
6. The method according to claim 4, characterized in that, When the first sending function is a Wi-Fi sending function, the transmission control module calling the first sending function to send the first data packet includes: The transmission control module sends the first data packet through the socket corresponding to the first session.
7. The method according to any one of claims 1-6, characterized in that, Before the service module sends the first service data to the session management module, the method further includes: During the establishment of the first session, the transmission control module allocates the first transmission channel according to the type of the first session, which includes messages, audio / video data streams, or files.
8. An electronic device, characterized in that, include: A communication interface, a processor, and a memory; the communication interface, the processor, and the memory are coupled; the communication interface is used for the electronic device to communicate with other devices, and the memory is used to store computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-7.
10. A computer program product comprising computer instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Networking method, networking system and electronic equipment
CN114071434A
Communication method and electronic equipment
CN114364026A