Data transmission method and device, equipment and storage medium
By acquiring the data transmission identifier and establishing a target transmission channel, the problem of restricted transmission channel selection in the prior art is solved, and the flexibility and adaptability of data transmission between terminal devices is realized.
Patent Information
- Application Number
- CN202411411895.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, data transmission between terminal devices usually relies on a fixed transmission channel and cannot be switched actively, resulting in limited selection of transmission channel and inability to achieve independent switching.
By acquiring the data to be transmitted and its data transmission identifier, the data transmission identifier is used to establish a target transmission channel with the second terminal device to realize data transmission.
The selection of transmission channels during data transmission between devices is realized, and more suitable data transmission channels can be used for data interaction between devices, which improves the flexibility and adaptability of transmission channels.
Smart Images

Figure CN119520581A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to communication technology, and relate to but are not limited to a data transmission method and apparatus, equipment, and storage medium. Background Art
[0002] For different terminal devices, during the process of communication between devices, the communication method adopted is usually to exchange data through a fixed transmission channel.
[0003] However, in actual communication, other transmission channels may need to be used for data exchange between devices, while fixed transmission channels cannot be actively switched, and users cannot actively select data transmission channels. Summary of the invention
[0004] In view of this, the data transmission method, apparatus, device, and storage medium provided in the embodiments of the present application can realize the selection of the transmission channel during the data transmission process between devices. The data transmission method, apparatus, device, and storage medium provided in the embodiments of the present application are implemented as follows:
[0005] In one aspect of an embodiment of the present application, a data transmission method is provided, which is applied to a first terminal device, and the method includes:
[0006] Acquire the data to be transmitted and a data transmission identifier of the data to be transmitted, wherein the data transmission identifier of the data to be transmitted is used to indicate a target transmission channel used by the data to be transmitted;
[0007] When a target transmission channel is established with the second terminal device, the data to be transmitted is sent to the second terminal device through the target transmission channel.
[0008] Another aspect of the embodiment of the present application further provides a data transmission device, which is applied to a first terminal device, and the device includes: an acquisition module and a transmission module;
[0009] An acquisition module, used to acquire the data to be transmitted and a data transmission identifier of the data to be transmitted, wherein the data transmission identifier of the data to be transmitted is used to indicate a target transmission channel used by the data to be transmitted;
[0010] The transmission module is used to send the data to be transmitted to the second terminal device through the target transmission channel when a target transmission channel is established with the second terminal device.
[0011] The computer device provided in the embodiment of the present application includes a memory, a processor and a transceiver. The memory stores a computer program that can be run on the processor. When the processor and the transceiver execute the program, the method of the embodiment of the present application is implemented.
[0012] The computer-readable storage medium provided in the embodiment of the present application has a computer program stored thereon, and when the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented.
[0013] A chip is provided in an embodiment of the present application. The chip can run a computer program and implement the data transmission method provided in the embodiment of the present application during the execution of the computer program.
[0014] In the data transmission method, apparatus, device, and storage medium provided in the embodiments of the present application, the data to be transmitted and the data transmission identifier of the data to be transmitted can be obtained, wherein the data transmission identifier of the data to be transmitted is used to indicate the target transmission channel used by the data to be transmitted; when the target transmission channel is established with the second terminal device, the data to be transmitted is sent to the second terminal device through the target transmission channel. Among them, a designated target transmission channel can be established with the second terminal device through the data transmission identifier, so that data transmission between the first terminal device and the second terminal device can be realized through the target transmission channel, that is, the selection of the transmission channel in the process of data transmission between devices can be realized, so that a more suitable data transmission channel can be used for data interaction between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of an application scenario of the data transmission method provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of the software architecture of a terminal device provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of a data transmission method according to an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of interaction between a first terminal device and a second terminal device provided in an embodiment of the present application;
[0021] Figure 6 Another schematic diagram of interaction between a first terminal device and a second terminal device provided in an embodiment of the present application;
[0022] Figure 7 A schematic diagram of a process for determining a target broadcast channel provided in an embodiment of the present application;
[0023] Figure 8 A schematic diagram of a process for establishing a data transmission channel provided in an embodiment of the present application;
[0024] Fig. 9 A schematic diagram of the overall relationship of the transmission process provided in the embodiments of the present application;
[0025] Fig.10 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0026] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0029] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0030] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0031] In order to more clearly explain the data transmission method provided in the embodiment of the present application, the application scenario of the method is described below.
[0032] Figure 1 This is a schematic diagram of an application scenario of the data transmission method provided in the embodiment of the present application. Please refer to Figure 1 , the scenario includes: a first terminal device 110 and a second terminal device 120.
[0033] Among them, the first terminal device 110 and the second terminal device 120 can be any type of electronic device, for example: a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a smart screen, an artificial intelligence (AI) speaker, a headset, a terminal in industrial control, a terminal in self driving, a terminal in remote medical surgery, a terminal in a smart grid, a terminal in transportation safety, a terminal in a smart city, a terminal in a smart home, a personal digital assistant (PDA), etc., including a touch screen terminal device, and the embodiment of the present application is not limited to this.
[0034] For example, the first terminal device 110 may be a mobile phone, and the second terminal device 120 may be a projector. During data transmission, a data transmission channel may be established between the first terminal device 110 and the second terminal device 120, thereby realizing a projection function.
[0035] The hardware structures of the first terminal device 110 and the second terminal device 120 provided in the embodiments of the present application are explained below.
[0036] Figure 2 For a hardware structure diagram of the terminal device provided in the embodiment of the present application, please refer to Figure 2 The terminal device may be the first terminal device or the second terminal device, and is not specifically limited here. The terminal device includes a processor 210, a memory 220, a transceiver 230, a display unit 240, an input unit 250, a sensor 260 and other components.
[0037] The processor 210 is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 220, and calling data stored in the memory 220, the processor 210 performs various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 210 may include one or more processing units; optionally, the processor 210 may integrate an application processor, which mainly processes operating devices, user interfaces, and application programs, etc. Of course, other processors may also be included, which are not listed here one by one.
[0038] The memory 220 can be used to store software programs and modules. The processor 210 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 220. The memory 220 mainly includes a program storage area and a data storage area, wherein the program storage area can store operating devices, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the memory 220 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0039] The transceiver 230 can provide wireless communication solutions applied to terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The transceiver 230 can be one or more devices integrating at least one communication processing module, for example, integrating an antenna and a baseband processor into the transceiver 230, or integrating an antenna and a modem processor into the transceiver 230, etc., which are not limited here.
[0040] The display unit 240 may be used to display information input by the user or information provided to the user and various menus of the terminal device. The display unit 240 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited here.
[0041] The input unit 250 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the terminal device. Among them, the input unit 250 can collect the user's operations on or near it, and drive the corresponding connection device according to a pre-set program. In addition, the input unit 250 may include a touch panel, which can be implemented in various types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch panel, the input unit 250 may also include other input devices. Among them, other input devices may include but are not limited to one or more of function keys (such as volume control buttons, switch buttons, etc.), trackballs, joysticks, etc.
[0042] The terminal device may also include at least one sensor 260, such as a gyroscope sensor, a motion sensor, and other sensors. The motion sensor may include an acceleration sensor for detecting the magnitude of acceleration in all directions, and the magnitude and direction of gravity when stationary, which may be used for applications that identify the posture of the terminal device, such as horizontal and vertical screen switching, related games, magnetometer posture calibration, etc. As for other sensors that may be configured in the terminal device, such as a pressure gauge, a barometer, a hygrometer, a thermometer, an infrared sensor, a fingerprint sensor, etc., they will not be described in detail here.
[0043] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0044] The above explains the hardware structure of the first terminal device and the second terminal device. The following explains the software architecture of the first terminal device and the second terminal device.
[0045] Figure 3 This is a schematic diagram of the software architecture of the terminal device provided in the embodiment of the present application. Please refer to Figure 3 The software architecture includes: a business layer 310, a framework layer 320 and an implementation layer 330.
[0046] Among them, the business layer 310 is used to realize business docking. For example, a user can actively initiate a connection with other terminal devices through the corresponding application, or receive a connection with other devices. Moreover, during the data transmission process, the user can realize the selection of the data transmission channel through the business layer. In addition, the business layer 310 provides business data, and during the data transmission process, the business data can be transmitted, for example, sending business data or receiving business data.
[0047] The framework layer 320 is used for transmission management, and the framework layer 320 may include the following modules: an interface providing module, a channel selecting module, an interface defining module, and a transmission management module.
[0048] The interface providing module (ITransportInterface) may be a module for providing an interface to the business layer, for example, it may provide a broadcast interface, a device discovery interface, a connection establishment interface, an active disconnection interface, etc. of the business layer.
[0049] The channel selection module (TransportManager) can provide the service quality of various channels such as data transmission channels, broadcast transmission channels, etc., and provides the ability to select channels.
[0050] The interface definition module (ITransportOperator) may be a module for standardizing the definition of various interface functions, and may also register different transmission channels. For example, when a new transmission channel needs to be added, the definition functions related to the channel may be recorded in the module.
[0051] The transmission management module (DefaultTransportImpl) can use a fixed template to record the process adopted in the transmission process, for example: recording a specific transmission path, recording the order of each transmission step, etc., without specific restrictions here. This module can realize the message relationship in the connection process, and this module can be compatible with different types of data transmission, for example: it can be compatible with Bluetooth transmission and wireless network transmission.
[0052] In addition, the transmission management module also includes a timeout disconnection submodule (DisconnectManager), through which management after the transmission channel is established can be provided. For example, after the connection is established for more than a preset time, a timeout disconnection strategy can be triggered to disconnect the connection.
[0053] The implementation layer 330 may include a plurality of different types of transmission channels, as well as multiple transmission channels of the same type, for implementing processes such as data transmission through the transmission channels.
[0054] Among them, a plurality of different types of transmission channels refer to transmission channels with different communication methods, for example: channel 1 is a Bluetooth channel, channel 2 is a WIFI channel, then channel 1 and channel 2 can be transmission channels of different types; multiple channels of the same type refer to multiple transmission channels with the same communication method, for example: channel 3 is a Bluetooth channel, channel 4 is also a Bluetooth channel, then channel 3 and channel 4 can be multiple channels of the same type.
[0055] The above explains the hardware structure and software architecture of the first terminal device and the second terminal device. The following explains the data transmission method provided in the embodiment of the present application.
[0056] It should be noted that for two different terminal devices, for example: a first terminal device and a second terminal device, during the process of communication between devices, the communication method adopted is usually to exchange data through a fixed transmission channel. For example: when sharing information A, the information transmission method adopted is Bluetooth transmission method, which is completed based on the software framework provided in the relevant technology.
[0057] However, in actual communication, other transmission channels may be required for data exchange between devices, for example, wireless communication may be required, or, when a device has multiple Bluetooth channels, another Bluetooth channel may be selected to implement Bluetooth transmission.
[0058] In the related art, a fixed transmission channel cannot be actively switched, and the user cannot actively select the data transmission channel. This leads to large limitations on the transmission channel used and the inability to achieve autonomous switching. In order to solve this technical problem existing in the related art, a data transmission method is provided in an embodiment of the present application. The implementation process of the data transmission method is explained below.
[0059] Figure 4 This is a flow chart of the data transmission method provided in the embodiment of the present application, please refer to Figure 4 , the method comprising:
[0060] S410: Acquire data to be transmitted and a data transmission identifier of the data to be transmitted.
[0061] The data transmission identifier of the data to be transmitted is used to indicate the target transmission channel used by the data to be transmitted.
[0062] It should be noted that the execution subject of the method may be the above-mentioned first terminal device.
[0063] Optionally, the data to be transmitted may be service data generated by a service layer of the first terminal device. For example, for a screen projection service, the video data, audio data, etc. transmitted during the screen projection process may be the data to be transmitted.
[0064] In one embodiment, the data to be transmitted may be data that needs to be transmitted to a second terminal device. For example, for a screen projection service, the first terminal device is a mobile phone and the second terminal device is a projector. If the projector needs to be used to play the corresponding projection content, then the video data and audio data corresponding to these projection contents are the above-mentioned data to be transmitted.
[0065] Optionally, the second terminal device can be determined based on the content of the data to be transmitted, or can be determined based on the user's choice, for example: determining a device from multiple terminal devices as the second terminal device based on the content of the data to be transmitted; or, based on the user's choice, determining a device from multiple terminal devices as the second terminal device.
[0066] For example: the service layer of the first terminal device generates certain service data. After determining the size and type of the service data, or determining the application that generates the service data, the target device to which the service data needs to be sent can be determined according to the size and type of the service data or the application that generates the service data. Service data of different sizes, different types, and service data generated by different applications can be sent to different target devices respectively. For example, the first type of service data can be sent to device A, and the second type of service data can be sent to device B. Based on the above method, multiple different data to be transmitted can be obtained.
[0067] It should be noted that, in addition to carrying the data to be transmitted, it can also carry a data transmission identifier of the data to be transmitted, which can indicate the target transmission channel used by the data to be transmitted. For example, multiple transmission channels that can be used in the first terminal device can be numbered, and then in the process of generating the data to be transmitted, an identifier is generated to specify the number of the transmission channel to be used, so that the data transmission identifier of the data to be transmitted can be obtained.
[0068] The data transmission identifier may be an identifier actively selected or input by the user through the service layer.
[0069] For example, the business layer can obtain the identifiers of various channels that can be used in the implementation layer through the corresponding interface, and then provide corresponding options. Based on the user's operation on the business layer, the corresponding option can be selected to generate the corresponding identifier.
[0070] For example: if the first terminal device has two Bluetooth channels, the identifier of Bluetooth channel 1 is: BT1, and the identifier of Bluetooth channel 2 is: BT2. After the business layer obtains these identifiers through the corresponding interface, BT1 and BT2 can be displayed in the display interface of the first terminal device. Then, based on the user's selection of display content, for example, if BT2 is selected, the identifier BT2 corresponding to Bluetooth channel 2 can be generated, so that it can be determined that the transmission channel to be used for the data to be transmitted during the transmission process is Bluetooth channel 2, that is, the target transmission channel is Bluetooth channel 2.
[0071] S420: When a target transmission channel is established with the second terminal device, the data to be transmitted is sent to the second terminal device through the target transmission channel.
[0072] Optionally, the first terminal device can determine the communication connection relationship between itself and other terminal devices. When it is determined to establish a target transmission channel with the second terminal device, the acquired data to be transmitted can be sent to the second terminal device. For example, the data to be transmitted can be sent to the second terminal device through the target transmission channel.
[0073] It should be noted that if the first terminal device has multiple Bluetooth channels, such as Bluetooth channel 1 and Bluetooth channel 2, the target transmission channel to be used can be determined according to the data transmission identifier of the data to be transmitted, and then the target transmission channel can be used to send the data to be transmitted to the second terminal device.
[0074] In the data transmission method provided in the embodiment of the present application, the data to be transmitted and the data transmission identifier of the data to be transmitted can be obtained, wherein the data transmission identifier of the data to be transmitted is used to indicate the target transmission channel used by the data to be transmitted; in the case of establishing a target transmission channel with the second terminal device, the data to be transmitted is sent to the second terminal device through the target transmission channel. Among them, the specified target transmission channel can be established with the second terminal device through the data transmission identifier, so that the data transmission between the first terminal device and the second terminal device can be realized through the target transmission channel, that is, the selection of the transmission channel in the data transmission process between devices can be realized, so that a more suitable data transmission channel can be used for data interaction between devices.
[0075] In order to more clearly demonstrate the process of data interaction between the first terminal device and the second terminal device, the data transmission method provided in the embodiment of the present application is explained below through a feasible interaction method.
[0076] Figure 5 For a schematic diagram of the interaction between the first terminal device and the second terminal device provided in the embodiment of the present application, please refer to Figure 5 , the method comprising:
[0077] S510: The first terminal device receives first broadcast data sent by the second terminal device.
[0078] S520: The first terminal device obtains the data to be transmitted and a data transmission identifier of the data to be transmitted.
[0079] S530: When the first terminal device and the second terminal device establish a target transmission channel, the first terminal device sends the data to be transmitted to the second terminal device through the target transmission channel.
[0080] In one embodiment, before acquiring the data to be transmitted and the data transmission identifier of the data to be transmitted, the method further includes: receiving first broadcast data sent by the second terminal device.
[0081] The first broadcast data includes at least one first data transmission channel identifier, and the first data transmission channel identifier is used to indicate the type of transmission channel supported by the second terminal device for transmitting data.
[0082] It should be noted that the second terminal device can use the method of sending broadcasts to find other devices with which data interaction can be performed. After the first terminal device receives the broadcast sent by the second terminal device, a data transmission channel can be established.
[0083] Optionally, the content broadcast by the second terminal device may be first broadcast data, wherein the first broadcast data may include a device identifier of the second terminal device and a first data transmission channel identifier, wherein the first data transmission channel identifier is used to indicate the type of transmission channel supported by the second terminal device for transmitting data, for example: if the second terminal device supports Bluetooth transmission and WIFI transmission, the first data transmission channel identifier may represent the identification information corresponding to Bluetooth and WIFI.
[0084] After acquiring the first broadcast data, the first terminal device can determine the type of data transmission channel that the second terminal device can support through the framework layer, and then in the process of generating the data transmission identifier of the data to be transmitted, it can generate an identifier corresponding to the transmission channel of this type.
[0085] It should be noted that the second terminal device and the first terminal device have at least one identical data transmission channel identifier.
[0086] In the data transmission method provided in the embodiment of the present application, the first broadcast data sent by the second terminal device can be received before obtaining the data to be transmitted and the data transmission identifier of the data to be transmitted. The first broadcast data includes at least one first data transmission channel identifier, and the first data transmission channel identifier is used to indicate the type of transmission channel supported by the second terminal device for transmitting data. The first broadcast data can more quickly and accurately determine the type of transmission channel supported by the second terminal device for transmitting data, thereby more quickly determining that the first terminal device can select multiple data transmission channels.
[0087] In one embodiment, the target transmission channel is one of at least one data transmission channel corresponding to at least one identical data transmission channel identifier.
[0088] For example, if the second terminal device has a Bluetooth channel and a WIFI channel, and the first terminal device also has a Bluetooth channel and a WIFI channel, it can be determined that these two channels are the data transmission channels corresponding to the same data transmission channel identifier, and either the Bluetooth channel or the WIFI channel can be used as the data transmission channel.
[0089] In the case that the first terminal device has multiple Bluetooth channels and multiple WIFI channels, all of these channels can be used as data transmission channels, and one of them can be selected from these channels as the target transmission channel.
[0090] It should be noted that, in the process of selecting the target transmission channel, multiple data transmission channels can be first determined according to the transmission channel types supported by both the first terminal device and the second terminal device, and then one is determined from these data transmission channels as the target transmission channel. In the process of selecting the target transmission channel, the following method can be used for selection:
[0091] In one embodiment, the method further includes: in response to a selection operation for a transmission channel, determining a target transmission channel from at least one data transmission channel corresponding to at least one same data transmission channel identifier.
[0092] It should be noted that the framework layer of the first terminal device can determine at least one data transmission channel based on the first broadcast data, and transmit the options corresponding to multiple data transmission channels to the business layer. The user can select the data transmission channel by interacting with the display interface.
[0093] For example: the data transmission channels include: Bluetooth channel 1, Bluetooth channel 2, WIFI channel 1, and WIFI channel 2. The business layer can display these channels in the display interface, and then respond to the user's selection operation, that is, the selection operation for the transmission channel, select one of the above four channels as the target transmission channel, and accordingly, generate a data transmission identifier corresponding to the target transmission channel.
[0094] It should be noted that the above process is a process in which the second terminal device actively initiates the broadcast. In the actual implementation process, in addition to the second terminal device initiating the broadcast, the first terminal device can also initiate the broadcast.
[0095] Figure 6 Another interaction diagram between the first terminal device and the second terminal device provided in the embodiment of the present application is shown in FIG. Figure 6 , the method comprising:
[0096] S610: The first terminal device broadcasts second broadcast data.
[0097] S620: The first terminal device receives a channel establishment request sent by the second terminal device.
[0098] S630: The first terminal device obtains the data to be transmitted and a data transmission identifier of the data to be transmitted.
[0099] S640: When the first terminal device establishes a target transmission channel with the second terminal device, the first terminal device sends the data to be transmitted to the second terminal device through the target transmission channel.
[0100] In one embodiment, before obtaining the data to be transmitted and the data transmission identifier of the data to be transmitted, the method also includes: broadcasting second broadcast data, the second broadcast data including: at least one second data transmission channel identifier of the first terminal device, the second data channel identifier is used to indicate the type of transmission channel supported by the first terminal device for transmitting data; receiving a channel establishment request sent by the second terminal device, and establishing a target transmission channel according to the channel establishment request.
[0101] The second broadcast data includes at least one second data transmission channel identifier, and the second data transmission channel identifier is used to indicate the type of transmission channel supported by the first terminal device for transmitting data.
[0102] It should be noted that the first terminal device can use the broadcast method to find other devices with which data can be interacted. After the second terminal device receives the broadcast sent by the first terminal device, the first terminal device can receive the channel establishment request sent by the second terminal device.
[0103] Optionally, the content broadcast by the first terminal device may be second broadcast data, wherein the second broadcast data may include a device identifier of the first terminal device and a second data transmission channel identifier, wherein the second data transmission channel identifier is used to indicate the type of transmission channel supported by the first terminal device for transmitting data, for example: if the first terminal device supports Bluetooth transmission and WIFI transmission, the second data transmission channel identifier may represent the identification information corresponding to Bluetooth and WIFI.
[0104] Optionally, the first terminal device can send the second broadcast data by broadcasting. After receiving the second broadcast data, the second terminal device can establish a channel connection with the first terminal device. For example, a channel establishment request can be sent first, and after the first terminal device agrees, a data transmission channel between the first terminal device and the second terminal device can be established, thereby realizing data transmission.
[0105] In the data transmission method provided in the embodiment of the present application, before obtaining the data to be transmitted and the data transmission identifier of the data to be transmitted, the first terminal device can broadcast the second broadcast data, and then the first terminal device receives the channel establishment request sent by the second terminal device. The second broadcast data can more quickly and accurately determine the second terminal device that can perform data transmission with the first terminal device, thereby realizing data transmission more quickly.
[0106] It should be noted that, during the broadcasting process, the first terminal device may also use the corresponding broadcast channel to complete the broadcast transmission.
[0107] Figure 7 Please refer to the flowchart of determining the target broadcast channel provided in the embodiment of the present application. Figure 7 , before broadcasting the second broadcast data, the method further includes:
[0108] S710: Determine a target broadcast channel according to at least one broadcast channel corresponding to at least one broadcast channel identifier.
[0109] Among them, at least one broadcast channel identifier is used to indicate the type of broadcast channel supported by other terminal devices discovered by the first terminal device.
[0110] For example, if the first terminal device has two broadcast channels, namely a Bluetooth channel and a WIFI channel, it can be determined that these two channels are broadcast channels, and one of the broadcast channels can be selected from the multiple broadcast channels as the target broadcast channel.
[0111] It should be noted that the broadcast channel identifier can be used to indicate one of the transmission channels, and the first terminal device can broadcast based on the transmission channel.
[0112] The broadcast channel and the data transmission channel can be the same channel or different channels, and there is no specific limitation here. For example, if Bluetooth channel 1 is used for broadcasting and Bluetooth channel 2 is used for data transmission, then in this scenario, Bluetooth channel 1 is the broadcast channel and Bluetooth channel 2 is the data transmission channel; if Bluetooth channel 1 is used for broadcasting and data transmission in turn, then in this scenario, Bluetooth channel 1 is both the broadcast channel and the data transmission channel.
[0113] Optionally, determining the target broadcast channel according to at least one broadcast channel identifier includes: determining the target broadcast channel from at least one broadcast channel in response to a selection operation on the broadcast channel.
[0114] It should be noted that the framework layer of the first terminal device can determine at least one broadcast channel based on the broadcast capability of the first terminal device itself, and transmit the options corresponding to multiple broadcast channels to the business layer. The user can select the broadcast channel by interacting with the display interface.
[0115] For example: the broadcast channels include: Bluetooth channel 1, Bluetooth channel 2, WIFI channel 1, and WIFI channel 2. The business layer can display these channels in the display interface, and then respond to the user's selection operation, that is, the selection operation for the broadcast channel, and select one of the above four channels as the target broadcast channel.
[0116] Accordingly, broadcasting the second broadcast data includes:
[0117] S720: Broadcast the second broadcast data through the target broadcast channel.
[0118] It should be noted that after determining the target broadcast channel from the multiple broadcast channels in the above manner, the second broadcast data can be broadcast through the target broadcast channel, so that the second terminal device can receive the second broadcast data.
[0119] In the data transmission method provided in the embodiment of the present application, the target broadcast channel can be determined according to at least one broadcast channel corresponding to at least one broadcast channel identifier; and the second broadcast data can be broadcast through the target broadcast channel. Among them, the broadcast channel identifier can more quickly determine multiple broadcast channels that can be selected, and then the target broadcast channel can be determined more quickly.
[0120] In one embodiment, the target transmission channel is a factory-preset data transmission channel of the terminal device, or a data transmission channel configured by the user.
[0121] It should be noted that the target transmission channel used by the first terminal device or the second terminal device may be a default data transmission channel or an additionally added data transmission channel, wherein the default data transmission channel may be a factory-preset data transmission channel and the additionally added data transmission channel may be a user-configured data transmission channel.
[0122] For example: the first terminal device is configured with one Bluetooth channel and one WIFI channel when leaving the factory, and both channels are factory preset data transmission channels; if the user actively adds another Bluetooth channel, this Bluetooth channel can be a data transmission channel configured by the user.
[0123] In the actual implementation process, both types of data transmission channels mentioned above can be used as target transmission channels.
[0124] The specific implementation process of establishing a data transmission channel provided in the embodiment of the present application is explained below.
[0125] Figure 8 Please refer to the flowchart of establishing a data transmission channel provided in the embodiment of the present application. Figure 8 , the method further comprises:
[0126] S810: Obtain channel configuration information.
[0127] S820: Establish a data transmission channel configured by the user according to the channel configuration information.
[0128] The channel configuration information includes at least one of the type of the channel, the transmission protocol used by the channel, and the interface information of the channel.
[0129] It should be noted that the channel configuration information may be information input by the user. For example, the configuration information may be input into the framework layer of the first terminal device, and the interface definition module may store the type of channel, the transmission protocol used by the channel, etc., and the interface provision module may store the interface information of the channel, etc., thereby realizing access to a new channel.
[0130] It should be noted that after obtaining the channel configuration information, a new data transmission channel can be established, for example: a new transmission channel is established in the implementation layer, and the framework layer manages the transmission channel in the implementation layer, thereby completing the establishment of the user-configured data transmission channel.
[0131] In the data transmission method provided in the embodiment of the present application, channel configuration information can be obtained; and a user-configured data transmission channel can be established according to the channel configuration information. The establishment of the user-configured data transmission channel can be realized through the software architecture of the first terminal device, so that a new data transmission channel can be additionally established for the first terminal device.
[0132] Optionally, when establishing a target transmission channel with the second terminal device, the method further includes: disconnecting the target transmission channel when no data transmission in the target transmission channel exceeds a target preset time length.
[0133] It should be noted that this process can be implemented by the timeout disconnection submodule in the transmission management module in the framework layer of the first terminal device, which is used to manage the connection disconnection strategy and can implement the reporting and disconnection process of the encapsulated connection.
[0134] For example, the default implementation can be timeout disconnection. The optional strategy is that the idle time of each channel cannot exceed 60s. The timing start time can be refreshed after each data transmission is completed, and the timed-out channel can be removed after the timer times out.
[0135] For example, if transmission channel 1 does not transmit any data within 60 seconds, it can be determined that transmission channel 1 is a timed-out transmission channel and the connection of the transmission channel can be disconnected.
[0136] The data transmission method provided in the embodiment of the present application encapsulates the broadcast, discovery, connection establishment, and disconnection processes into a unified transmission management framework, and isolates the implementation of the specific transmission process through the interface provided to the outside, so as to achieve the purpose of decoupling the upper-layer business from the specific connection process. At the same time, the access method implemented by the underlying specific transmission technology is opened, and the user can independently access the transmission channel and can also independently select the transmission channel used for broadcast and data transmission.
[0137] Fig. 9 For the overall relationship diagram of the transmission process provided in the embodiment of this application, please refer to Fig. 9 The first terminal device and the second terminal device may both have a business layer, a framework layer and an implementation layer. When the two terminal devices establish a channel connection, they may select a corresponding transmission channel at the implementation layer to realize the connection.
[0138] For example: Fig. 9 In the process shown in , the first terminal device and the second terminal device may both have two Bluetooth channels and one WIFI channel. During the process of establishing a data channel, the two may select corresponding channels to establish a connection.
[0139] pass Fig. 9 According to the process shown, the data transmission method can be divided into a device discovery process and a data transmission process.
[0140] Among them, during the device discovery process, the business layer transmits the selected scanning and discovery channels and the required transmission channel types to be carried in the broadcast data through the broadcast and scanning interfaces provided by the framework layer. For example, device 1 specifies broadcasting and discovery through Bluetooth channel 1, and carries a tag that the business data supports transmission through Bluetooth channel 1, Bluetooth channel 2, and WIFI channel; device 2 specifies broadcasting and discovery through Bluetooth channel 1, and carries a tag that the business data supports transmission through Bluetooth channel 1 and WIFI channel. The framework layer encapsulates the information of the current device and the transmission channel type required by the business, and passes the scanned data to the corresponding selected transmission channel. Depending on the implementation of the specific transmission channel, the broadcast data is broadcasted and the broadcast data of the other end is scanned and obtained, and the received broadcast data is passed to the transmission management framework layer for parsing and encapsulation as the scanned device, and further passed to the business layer.
[0141] In the data transmission process, the business layer passes the selected transmission channel and the data to be transmitted through the interface provided by the framework layer. The framework layer finds the specific transmission channel implementation according to the channel provided by the calling service. If the current transmission channel has established a connection, the business data is directly transmitted, otherwise the channel establishment process is executed first. After the channel is established, the business data is transmitted to the peer device depending on the implementation of the specific transmission channel.
[0142] It should be understood that, although the steps in the above-mentioned flowcharts are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flowcharts may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0143] Based on the foregoing embodiments, an embodiment of the present application provides a data transmission device, which includes the modules included and the units included in the modules, and can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0144] Fig.10 This is a schematic diagram of the structure of the data transmission device provided in the embodiment of the present application. Please refer to Fig.10, a data transmission device, applied to a first terminal device, the device comprises: an acquisition module 1010 and a transmission module 1020;
[0145] An acquisition module 1010 is used to acquire data to be transmitted and a data transmission identifier of the data to be transmitted, wherein the data transmission identifier of the data to be transmitted is used to indicate a target transmission channel used by the data to be transmitted;
[0146] The transmission module 1020 is used to send the data to be transmitted to the second terminal device through the target transmission channel when a target transmission channel is established with the second terminal device.
[0147] In one embodiment, the acquisition module 1010 is also used to receive first broadcast data sent by a second terminal device, the first broadcast data includes at least one first data transmission channel identifier, the first data transmission channel identifier is used to indicate the type of transmission channel supported by the second terminal device for transmitting data, and the second terminal device and the first terminal device have at least one identical data transmission channel identifier.
[0148] In one embodiment, in the device, the target transmission channel is one of at least one data transmission channel corresponding to at least one identical data transmission channel identifier.
[0149] In an embodiment, the transmission module 1020 is further configured to determine, in response to a selection operation for a transmission channel, a target transmission channel from at least one data transmission channel corresponding to at least one same data transmission channel identifier.
[0150] In one embodiment, the transmission module 1020 is also used to broadcast second broadcast data, the second broadcast data including: at least one second data transmission channel identifier of the first terminal device, the second data channel identifier is used to indicate the type of transmission channel supported by the first terminal device for transmitting data; receiving a channel establishment request sent by the second terminal device, and establishing a target transmission channel according to the channel establishment request.
[0151] In one embodiment, the transmission module 1020 is also used to determine the target broadcast channel based on at least one broadcast channel corresponding to at least one broadcast channel identifier, and at least one broadcast channel identifier is used to indicate the type of broadcast channel supported by other terminal devices discovered by the first terminal device; and broadcast the second broadcast data through the target broadcast channel.
[0152] In one embodiment, the transmission module 1020 is further configured to determine a target broadcast channel from at least one broadcast channel in response to a selection operation on a broadcast channel.
[0153] In one embodiment, in the device, the target transmission channel is a factory-preset data transmission channel of the terminal device, or a data transmission channel configured by the user.
[0154] In one embodiment, the acquisition module 1010 is further used to acquire channel configuration information, which includes: at least one of the type of channel, the transmission protocol used by the channel, and the interface information of the channel; and establish a user-configured data transmission channel according to the channel configuration information.
[0155] In one embodiment, the transmission module 1020 is further configured to disconnect the target transmission channel when no data is transmitted in the target transmission channel for more than a target preset time period.
[0156] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0157] It should be noted that in the embodiments of this application Fig.10 The division of modules in the data transmission device shown is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. It may also be implemented in the form of a combination of software and hardware.
[0158] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0159] Fig.11 For a schematic diagram of the structure of the computer device provided in the embodiment of the present application, please refer to Fig.11, an embodiment of the present application provides a computer device, which may be the first terminal device or the second terminal device mentioned above, and its internal structure diagram may be as shown in Fig.11 As shown. The computer device includes a processor 1120, a memory and a transceiver 1140 connected via a system bus 1110. Among them, the processor 1120 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium 1131 and an internal memory 1132. The non-volatile storage medium 1131 stores an operating system, a computer program and a database. The internal memory 1132 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium 1131. The database of the computer device is used to store data. The transceiver 1140 of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor 1120, the above method is implemented.
[0160] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the above embodiment are implemented.
[0161] An embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps of the method provided in the above method embodiment.
[0162] A chip is provided in an embodiment of the present application. The chip can run a computer program and implement the data transmission method provided in the embodiment of the present application during the execution of the computer program.
[0163] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0164] In one embodiment, the data transmission device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.11 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the above-mentioned device. The computer program composed of various program modules enables the processor to execute the steps in the method of each embodiment of the present application described in this specification.
[0165] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0166] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similarities can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0167] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0168] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0169] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0170] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0171] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0172] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0173] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0174] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0175] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0176] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0177] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data transmission method, characterized in that: Applied to a first terminal device, the method includes: Acquire data to be transmitted and a data transmission identifier of the data to be transmitted, wherein the data transmission identifier of the data to be transmitted is used to indicate a target transmission channel used by the data to be transmitted; When the target transmission channel is established with the second terminal device, the data to be transmitted is sent to the second terminal device through the target transmission channel.
2. The method according to claim 1, characterized in that Before obtaining the data to be transmitted and the data transmission identifier of the data to be transmitted, the method further includes: Receive first broadcast data sent by a second terminal device, where the first broadcast data includes at least one first data transmission channel identifier, where the first data transmission channel identifier is used to indicate the type of transmission channel supported by the second terminal device for transmitting data, and the second terminal device and the first terminal device have at least one identical data transmission channel identifier.
3. The method according to claim 2, characterized in that The target transmission channel is one of at least one data transmission channel corresponding to the at least one data transmission channel identifier that is the same as the at least one data transmission channel.
4. The method according to claim 3, characterized in that After receiving the first broadcast data sent by the second terminal device, the method further includes: In response to a selection operation for a transmission channel, the target transmission channel is determined from at least one data transmission channel corresponding to the at least one same data transmission channel identifier.
5. The method according to claim 1, characterized in that Before obtaining the data to be transmitted and the data transmission identifier of the data to be transmitted, the method further includes: Broadcasting second broadcast data, where the second broadcast data includes: at least one second data transmission channel identifier of the first terminal device, where the second data channel identifier is used to indicate a type of a transmission channel supported by the first terminal device for transmitting data; A channel establishment request sent by the second terminal device is received, and the target transmission channel is established according to the channel establishment request.
6. The method according to claim 5, characterized in that Before broadcasting the second broadcast data, the method further includes: Determining a target broadcast channel according to at least one broadcast channel corresponding to at least one broadcast channel identifier, wherein the at least one broadcast channel identifier is used to indicate a type of a broadcast channel supported by other terminal devices discovered by the first terminal device; The broadcasting of the second broadcast data includes: The second broadcast data is broadcasted through the target broadcast channel.
7. The method according to claim 6, characterized in that The determining the target broadcast channel according to at least one broadcast channel corresponding to at least one broadcast channel identifier includes: In response to a selection operation on a broadcast channel, the target broadcast channel is determined from the at least one broadcast channel.
8. The method according to claim 1, characterized in that The target transmission channel is a factory preset data transmission channel of the terminal device, or a data transmission channel configured by the user.
9. The method according to claim 8, characterized in that The method further comprises: Acquire channel configuration information, where the channel configuration information includes: at least one of the type of the channel, the transmission protocol used by the channel, and the interface information of the channel; The data transmission channel configured by the user is established according to the channel configuration information.
10. The method according to claim 1, characterized in that In the case of establishing the target transmission channel with the second terminal device, the method further includes: When no data transmission in the target transmission channel exceeds a target preset time length, the target transmission channel is disconnected.
11. A data transmission device, characterized in that: Applied to a first terminal device, the apparatus comprises: an acquisition module and a transmission module; The acquisition module is used to acquire the data to be transmitted and a data transmission identifier of the data to be transmitted, wherein the data transmission identifier of the data to be transmitted is used to indicate a target transmission channel used by the data to be transmitted; The transmission module is configured to send the data to be transmitted to the second terminal device through the target transmission channel when the target transmission channel is established with the second terminal device.
12. A computer device comprising a memory, a processor and a transceiver, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor and the transceiver execute the program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Multi-wifi module transmission method, transmission device and terminal
CN105592504A
Data communication method, device and apparatus
CN107819811A
Data transmission method and device, terminal device and storage medium
CN112020019A
Display device and content pushing method
CN113794918A
Data synchronization method, electronic equipment and computer readable storage medium
CN113923230A