Data transmission method and device, equipment and storage medium
By displaying Bluetooth transmission controls on the data transmission page, automatically scanning and selecting the target Bluetooth device for data transmission, the problem of cumbersome data transmission process between devices is solved and the transmission efficiency is improved.
Patent Information
- Application Number
- CN202411195661.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, the data transmission process between devices is cumbersome, resulting in low data transmission efficiency.
By displaying Bluetooth transmission controls on the data transmission page, responding to user operations, scanning Bluetooth devices within the preset range, and automatically determining the target Bluetooth device for data transmission based on device information and signal strength. If there are no multiple devices, it will be transmitted directly.
The user does not need to manually select Bluetooth devices, and by automatically determining the target devices, data transmission efficiency between devices is improved.
Smart Images

Figure CN118945633A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of data processing, and specifically relates to a data transmission method, device, equipment and storage medium. Background Art
[0002] In the field of Bluetooth technology, data transmission between devices can be achieved through the Object Push Profile (OPP), and the data may include photos, files, documents, etc.
[0003] At present, the data transmission process between devices is as follows: the terminal device turns on the Bluetooth function and searches for nearby Bluetooth devices; the user of the terminal device selects the target Bluetooth device, selects the data to be transmitted on the terminal device, and generates a transmission request; sends the transmission request to the target Bluetooth device; after the target Bluetooth device receives the transmission request, it prompts the user of the target Bluetooth device whether to accept the transmission. If the user of the target Bluetooth device accepts the transmission, the terminal device transmits data to the target Bluetooth device.
[0004] In the above process, the process of data transmission between devices is relatively complicated, resulting in low efficiency of data transmission between devices. Summary of the invention
[0005] The embodiments of the present application relate to a data transmission method, apparatus, device and storage medium, which are used to solve the defect that the process of data transmission between devices in the prior art is relatively complicated, resulting in low efficiency of data transmission between devices.
[0006] In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a terminal device, and the method includes:
[0007] Display Bluetooth transfer controls on the data transfer page;
[0008] In response to a user selecting a Bluetooth transmission control, scanning Bluetooth devices within a preset range to obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices;
[0009] Determine whether the number of the Bluetooth devices is greater than 1, if so, determine a target Bluetooth device according to device information of the multiple Bluetooth devices, if not, determine the Bluetooth device as the target Bluetooth device;
[0010] Transmit data to the target Bluetooth device.
[0011] In a possible implementation, the device information includes signal strength, and determining the target Bluetooth device according to the device information of the plurality of Bluetooth devices includes:
[0012] Sorting the multiple Bluetooth devices in descending order of signal strength;
[0013] Execute a judgment step, the judgment step comprising: judging whether the i-th Bluetooth device meets a preset condition, initially, the i is 1;
[0014] If so, the i-th Bluetooth device is determined as the target Bluetooth device; if not, i is updated to i+1, and the judgment step is performed until the target Bluetooth device is determined to be obtained, or, when the multiple Bluetooth devices do not meet the preset conditions respectively, the Bluetooth device with the largest signal strength is determined as the target Bluetooth device.
[0015] In a possible implementation, determining whether the i-th Bluetooth device meets a preset condition includes:
[0016] Determine whether there is historical record information of the i-th Bluetooth device, where the historical record information is a transmission acceptance record or a transmission rejection record;
[0017] If yes, obtaining at least one historical record information corresponding to the i-th Bluetooth device, and judging whether the i-th Bluetooth device meets a preset condition according to the at least one historical record information;
[0018] If not, a transmission request is sent to the ith Bluetooth device, a transmission response sent by the ith Bluetooth device is obtained, and according to the transmission response, it is determined whether the ith Bluetooth device meets a preset condition.
[0019] In a possible implementation, judging whether the i-th Bluetooth device meets a preset condition according to the at least one historical record information includes:
[0020] Determining a priority weight of the i-th Bluetooth device according to the at least one historical record information;
[0021] If the priority weight is greater than a threshold, determining whether the latest historical record information corresponding to the i-th Bluetooth device is the received transmission record, and if so, determining that the i-th Bluetooth device meets the preset condition, and if not, determining that the i-th Bluetooth device does not meet the preset condition;
[0022] If the priority weight is not greater than the threshold, it is determined that the i-th Bluetooth device does not meet the preset condition.
[0023] In a possible implementation manner, the transmission response includes an acceptance response and a rejection response, and judging whether the i-th Bluetooth device meets a preset condition according to the transmission response includes:
[0024] If the transmission response is the acceptance response, determining that the i-th Bluetooth device meets a preset condition;
[0025] If the transmission response is the rejection response, it is determined that the i-th Bluetooth device does not meet a preset condition.
[0026] In a possible implementation, after obtaining the transmission response sent by the i-th Bluetooth device:
[0027] According to the transmission response, historical transmission information corresponding to the i-th Bluetooth device is established.
[0028] In a possible implementation, displaying a Bluetooth transmission control on a data transmission page includes:
[0029] Acquire a Bluetooth transmission mode of the terminal device, where the Bluetooth transmission mode is an automatic transmission mode or a manual transmission mode;
[0030] When it is determined that the Bluetooth transmission mode is the automatic transmission mode, a Bluetooth transmission control is displayed on the data transmission page.
[0031] In a second aspect, an embodiment of the present application provides a data transmission device, which is applied to a terminal device, and the device includes:
[0032] A display module, used to display Bluetooth transmission controls on the data transmission page;
[0033] A scanning module, configured to scan Bluetooth devices within a preset range in response to a user selecting a Bluetooth transmission control, and obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices;
[0034] A determination module, used for determining whether the number of the Bluetooth devices is greater than 1, and if so, determining a target Bluetooth device according to device information of the multiple Bluetooth devices, and if not, determining the Bluetooth device as the target Bluetooth device;
[0035] The transmission module is used to transmit data to the target Bluetooth device.
[0036] In a possible implementation manner, the device information includes signal strength, and the determination module is specifically configured to:
[0037] Sorting the multiple Bluetooth devices in descending order of signal strength;
[0038] Execute a judgment step, the judgment step comprising: judging whether the i-th Bluetooth device meets a preset condition, initially, the i is 1;
[0039] If so, the i-th Bluetooth device is determined as the target Bluetooth device; if not, i is updated to i+1, and the judgment step is performed until the target Bluetooth device is determined to be obtained, or, when the multiple Bluetooth devices do not meet the preset conditions respectively, the Bluetooth device with the largest signal strength is determined as the target Bluetooth device.
[0040] In a possible implementation manner, the determination module is specifically configured to:
[0041] Determine whether there is historical record information of the i-th Bluetooth device, where the historical record information is a transmission acceptance record or a transmission rejection record;
[0042] If yes, obtaining at least one historical record information corresponding to the i-th Bluetooth device, and judging whether the i-th Bluetooth device meets a preset condition according to the at least one historical record information;
[0043] If not, a transmission request is sent to the ith Bluetooth device, a transmission response sent by the ith Bluetooth device is obtained, and according to the transmission response, it is determined whether the ith Bluetooth device meets a preset condition.
[0044] In a possible implementation manner, the determination module is specifically configured to:
[0045] Determining a priority weight of the i-th Bluetooth device according to the at least one historical record information;
[0046] If the priority weight is greater than a threshold, determining whether the latest historical record information corresponding to the i-th Bluetooth device is the received transmission record, and if so, determining that the i-th Bluetooth device meets the preset condition, and if not, determining that the i-th Bluetooth device does not meet the preset condition;
[0047] If the priority weight is not greater than the threshold, it is determined that the i-th Bluetooth device does not meet the preset condition.
[0048] In a possible implementation manner, the transmission response includes an acceptance response and a rejection response, and the determination module is specifically configured to:
[0049] If the transmission response is the acceptance response, determining that the i-th Bluetooth device meets a preset condition;
[0050] If the transmission response is the rejection response, it is determined that the i-th Bluetooth device does not meet a preset condition.
[0051] In a possible implementation, the device further includes a storage module, and the storage module is used to:
[0052] According to the transmission response, historical transmission information corresponding to the i-th Bluetooth device is established.
[0053] In a possible implementation manner, the display module is specifically used for:
[0054] Acquire a Bluetooth transmission mode of the terminal device, where the Bluetooth transmission mode is an automatic transmission mode or a manual transmission mode;
[0055] When it is determined that the Bluetooth transmission mode is the automatic transmission mode, a Bluetooth transmission control is displayed on the data transmission page.
[0056] In a third aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the data transmission method as described in any one of the first aspects is implemented.
[0057] In a fourth aspect, the present application provides a chip module having a computer program stored thereon, wherein when the computer program is executed by the chip module, the data transmission method as described in any one of the first aspects is implemented.
[0058] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor, and a transceiver;
[0059] The memory stores computer-executable instructions;
[0060] The processor executes the computer-executable instructions stored in the memory to implement the data transmission method as described in any one of the first aspects.
[0061] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data transmission method described in any one of the first aspects.
[0062] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the data transmission method described in any one of the first aspects.
[0063] The embodiment of the present application provides a data transmission method, apparatus, device and storage medium. In the method, by displaying a Bluetooth transmission control on a data transmission page, in response to a user's selection operation of the Bluetooth transmission control, the Bluetooth devices within a preset range are scanned to obtain a scanning result, the scanning result includes the device information of at least one Bluetooth device and the number of Bluetooth devices, and it is determined whether the number of Bluetooth devices is greater than 1. If so, the target Bluetooth device is determined based on the device information of multiple Bluetooth devices. If not, the Bluetooth device is determined as the target Bluetooth device and data is transmitted to the target Bluetooth device. In this way, the user does not need to manually select a Bluetooth device for transmission. The target Bluetooth device can be quickly and automatically determined through the scanning results and the device information of the Bluetooth device, thereby improving the data transmission efficiency between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the present application, a brief introduction will be given below to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0065] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0066] Figure 2 A flowchart of a data transmission method provided in an embodiment of the present application;
[0067] Figure 3 A flowchart of another data transmission method provided in an embodiment of the present application;
[0068] Figure 4 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0069] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0070] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] It should be noted that, although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. Optionally, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0073] It should be understood that the terms "comprises" and "includes" indicate the presence of the previously mentioned features, steps, operations, but do not exclude the presence, occurrence or addition of one or at least one other feature, step, operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or mean any one or any combination. Optionally, "A and / or B" means "any of the following: A; B; A and B". In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0074] In the field of Bluetooth technology, data transmission between devices can be achieved through the Object Push Profile (OPP), and the data may include photos, files, documents, etc.
[0075] Next, combine Figure 1 , the application scenarios corresponding to the data transmission process are illustrated with examples.
[0076] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , Figure 1 It may include a terminal device 101 and multiple Bluetooth devices 102 .
[0077] The terminal device 101 can establish communication connections with multiple Bluetooth devices 102.
[0078] When the Bluetooth function of the terminal device 101 is turned on, multiple Bluetooth devices 102 can be searched.
[0079] The user of the terminal device 101 selects the Bluetooth device 102 to which data is to be transmitted, selects the data to be transmitted on the terminal device 101 , generates a transmission request, and sends the transmission request to the Bluetooth device 102 .
[0080] After receiving the transmission request, the Bluetooth device 102 may prompt the user of the Bluetooth device whether to accept the transmission. If the user accepts the transmission, the terminal device 101 transmits data to the Bluetooth device 102 .
[0081] In the above process, the process of data transmission between devices is relatively complicated, resulting in low efficiency of data transmission between devices.
[0082] In order to solve the above technical problems, the embodiment of the present application provides a data transmission method, which scans Bluetooth devices within a preset range to obtain scanning results, and determines whether the number of Bluetooth devices in the scanning results is greater than 1. If so, the target Bluetooth device is determined based on the device information of multiple Bluetooth devices. If not, the Bluetooth device is determined as the target Bluetooth device and data is transmitted to the target Bluetooth device. In this way, the user does not need to manually select a Bluetooth device for transmission. The target Bluetooth device can be quickly and automatically determined through the scanning results and the device information of the Bluetooth device, thereby improving the data transmission efficiency between devices.
[0083] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0084] Figure 2 A flow chart of a data transmission method provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be a terminal device, or a data transmission device set in the terminal device. The data transmission device can be implemented by software, or by a combination of software and hardware.
[0085] See also Figure 2 , the method comprising:
[0086] S201. Display a Bluetooth transmission control on a data transmission page.
[0087] The data transfer page can be used by the user to select data to be transferred and perform data transfer.
[0088] The Bluetooth transmission control may be a control for controlling Bluetooth to perform data transmission.
[0089] A data transmission page may be displayed, which may include multiple data and Bluetooth transmission controls.
[0090] The plurality of data may be data that can be transmitted data.
[0091] The multiple data may be pictures, videos, files, etc., which are not limited here.
[0092] Optionally, the Bluetooth transmission control may be displayed on the data transmission page in the following manner: obtaining the Bluetooth transmission mode of the terminal device; and when determining that the Bluetooth transmission mode is the automatic transmission mode, displaying the Bluetooth transmission control on the data transmission page.
[0093] Among them, the Bluetooth transmission mode is automatic transmission mode or manual transmission mode.
[0094] The automatic transmission mode may be a mode for automatically selecting a target Bluetooth device for Bluetooth transmission.
[0095] The manual transmission mode may be a mode in which a user manually selects a target Bluetooth device for Bluetooth transmission.
[0096] S202: In response to the user selecting the Bluetooth transmission control, scanning Bluetooth devices within a preset range to obtain a scanning result.
[0097] The selection operation may be a click operation or a touch operation, which is not limited here.
[0098] The preset range may be a range that can be scanned by the terminal device.
[0099] The Bluetooth device may be a device having a Bluetooth transmission function.
[0100] The scanning result may include device information of at least one Bluetooth device and the number of Bluetooth devices.
[0101] When there is no Bluetooth device within the preset range, the scanning result may also contain no device information of the Bluetooth device. In this case, data transmission cannot be performed.
[0102] In response to the user's selection operation on the Bluetooth transmission control, the Bluetooth application programming interface can be called to broadcast a Bluetooth signal within a preset range to scan Bluetooth devices within the preset range and obtain a scanning result.
[0103] S203, determining whether the number of Bluetooth devices is greater than 1, if so, determining a target Bluetooth device according to device information of the multiple Bluetooth devices, if not, determining the Bluetooth device as the target Bluetooth device.
[0104] Device information may include device name, device type, signal strength, and other information.
[0105] The target Bluetooth device may be a Bluetooth device to which data is to be transmitted.
[0106] It can be determined whether the number of Bluetooth devices is greater than 1. If so, the target Bluetooth device is determined according to the signal strengths and / or device types of the multiple Bluetooth devices. If not, the Bluetooth device is determined as the target Bluetooth device.
[0107] Optionally, the target Bluetooth device may be determined according to the signal strengths of the multiple Bluetooth devices in the following manner: the Bluetooth device with the greatest signal strength among the multiple Bluetooth devices may be determined as the target Bluetooth device.
[0108] Optionally, the target Bluetooth device can be determined based on the signal strength and device type of multiple Bluetooth devices in the following manner: at least one first Bluetooth device with a preset device type can be determined among the multiple Bluetooth devices, and the first Bluetooth device with the largest signal strength among the at least one first Bluetooth device can be determined as the target Bluetooth device.
[0109] Optionally, the target Bluetooth device can be determined based on the device information of multiple Bluetooth devices in the following manner: sort the multiple Bluetooth devices in order of signal strength from large to small; execute a judgment step, the judgment step including: judging whether the ith Bluetooth device meets the preset conditions, initially, i is 1; if so, determining the ith Bluetooth device as the target Bluetooth device; if not, updating i to i+1, and executing the judgment step until the target Bluetooth device is determined to be obtained, or, when multiple Bluetooth devices do not meet the preset conditions respectively, determining the Bluetooth device with the largest signal strength as the target Bluetooth device.
[0110] It should be noted that the target Bluetooth device can be determined according to the device information of multiple Bluetooth devices through any feasible implementation method, and the embodiment of the present application is not limited to this.
[0111] S204: Transmit data to the target Bluetooth device.
[0112] A Bluetooth connection can be established with a target Bluetooth device and data can be transmitted to the target Bluetooth device.
[0113] Optionally, the data may be transmitted in the following manner: the data is packaged to obtain a plurality of data packets, and the plurality of data packets are transmitted separately.
[0114] The data transmission method provided in this embodiment displays a Bluetooth transmission control on a data transmission page, and in response to a user's selection operation of the Bluetooth transmission control, scans Bluetooth devices within a preset range to obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices, and determines whether the number of Bluetooth devices is greater than 1. If so, the target Bluetooth device is determined based on the device information of multiple Bluetooth devices. If not, the Bluetooth device is determined as the target Bluetooth device, and data is transmitted to the target Bluetooth device. In this way, the user does not need to manually select a Bluetooth device for transmission, and the target Bluetooth device can be quickly and automatically determined through the scanning results and the device information of the Bluetooth device, thereby improving the data transmission efficiency between devices.
[0115] Next, combine Figure 3, the process (S203) of determining the target Bluetooth device based on the device information of multiple Bluetooth devices is explained.
[0116] Figure 3 A flowchart of another data transmission method provided by an embodiment of the present application. Based on the above embodiment, see Figure 3 , the method comprising:
[0117] S301. Sort multiple Bluetooth devices in descending order of signal strength.
[0118] The signal strengths of multiple Bluetooth devices can be determined, and the multiple Bluetooth devices can be sorted in descending order of signal strength to obtain a device sequence.
[0119] The device sequence may be used to determine the order in which multiple Bluetooth devices are target Bluetooth devices.
[0120] S302: Initialize i to 1.
[0121] S303: Determine whether there is historical record information for the i-th Bluetooth device.
[0122] If yes, execute S304;
[0123] If not, execute S308.
[0124] The historical record information is a record of accepting transmission or a record of rejecting transmission.
[0125] Bluetooth device information can be obtained, which includes device identifiers corresponding to multiple Bluetooth devices and historical record information corresponding to each Bluetooth device. It is determined whether the Bluetooth device information includes the device identifier corresponding to the i-th Bluetooth device. If so, it is determined that historical record information exists; if not, it is determined that historical record information does not exist.
[0126] For example, the Bluetooth device information may be as shown in Table 1:
[0127] Table 1
[0128]
[0129] S304: Obtain at least one historical record information corresponding to the i-th Bluetooth device.
[0130] At least one historical record information corresponding to the ith Bluetooth device may be determined from the Bluetooth device information.
[0131] S305: Determine the priority weight of the ith Bluetooth device according to at least one historical record information.
[0132] The priority weight may be used to indicate the probability that the Bluetooth device is a target Bluetooth device.
[0133] The priority weight may be determined by at least one historical record information.
[0134] Optionally, the priority weight is calculated as follows: determine a first number corresponding to accepted transmission records and a second number corresponding to rejected transmission records in at least one historical record information, determine a first weight value based on the first number, determine a second weight value based on the second number, and determine the sum of the first weight value and the second weight value as the priority weight.
[0135] Optionally, the priority weight is calculated as follows: it can be determined whether the number of records corresponding to at least one historical record information is greater than 1. If so, sort the multiple historical record information in order from far to near the historical record time, and determine the weight value corresponding to the first historical record information based on the first historical record information. Determine the weight value corresponding to the i-th historical record information based on the i-th historical record information and the i-1-th historical record information, where i is 2, ..., n, n is the number of records corresponding to the multiple historical record information, and the sum of the multiple weight values is determined as the priority weight; if not, determine the priority weight based on the historical record information.
[0136] According to the i-th historical record information and the (i-1)-th historical record information, the weight value corresponding to the i-th historical record information may be determined as follows:
[0137] Case 1: the i-1th historical record information is a transmission acceptance record, the i-th historical record information is a transmission rejection record information, and the weight value corresponding to the i-th historical record information is determined to be a first weight value, for example, the first weight value is -2;
[0138] Case 2: the i-1th historical record information is a transmission rejection record, the i-th historical record information is a transmission acceptance record information, and the weight value corresponding to the i-th historical record information is determined to be a second weight value, for example, the second weight value is 2;
[0139] Case 3: the i-1th historical record information is a transmission rejection record, the i-th historical record information is transmission rejection record information, and the weight value corresponding to the i-th historical record information is determined to be a third weight value, for example, the third weight value is -4;
[0140] Case 4: the (i-1)th historical record information is a transmission acceptance record, the i-th historical record information is a transmission acceptance record information, and the weight value corresponding to the i-th historical record information is determined to be the fourth weight value, for example, the fourth weight value is 4.
[0141] Optionally, after determining the priority weight of the ith Bluetooth device, the historical number of times the ith Bluetooth device is the target Bluetooth device in the manual transmission mode is obtained from the Bluetooth device information, and the priority weight is updated according to the historical number.
[0142] S306: Determine whether the priority weight is greater than a threshold.
[0143] If yes, execute S307;
[0144] If not, execute S312.
[0145] For example, the threshold is 3, and it can be determined whether the priority weight is greater than 3.
[0146] S307: Determine whether the latest historical record information corresponding to the i-th Bluetooth device is a transmission reception record.
[0147] If yes, execute S311;
[0148] If not, execute S312.
[0149] When the priority weight is greater than the threshold, it is determined whether the latest historical record information corresponding to the ith Bluetooth device is a received transmission record. In this way, the accuracy of determining the target terminal can be improved through factors such as the signal strength, priority weight, and latest historical record information of the ith Bluetooth device.
[0150] S308: Send a transmission request to the i-th Bluetooth device.
[0151] The transfer request can be used to request whether the Bluetooth device accepts the transfer.
[0152] A transmission request may be generated and sent to the i-th Bluetooth device.
[0153] S309: Obtain a transmission response sent by the i-th Bluetooth device.
[0154] Get the response information sent by the i-th Bluetooth device, parse the response information, and get the transmission response sent by the i-th Bluetooth device.
[0155] Optionally, after acquiring the transmission response sent by the ith Bluetooth device, historical transmission information corresponding to the ith Bluetooth device may be established according to the transmission response.
[0156] In this way, the historical transmission information can be updated in real time according to the transmission response to improve the accuracy of determining the target terminal.
[0157] S310: Determine whether the transmission response is an acceptance response.
[0158] If yes, execute S311;
[0159] If not, execute S312.
[0160] If the transmission response is an acceptance response, it is determined that the i-th Bluetooth device meets the preset condition;
[0161] If the transmission response is a rejection response, it is determined that the i-th Bluetooth device does not meet the preset condition.
[0162] S311: Determine that the i-th Bluetooth device meets a preset condition, and determine the i-th Bluetooth device as a target Bluetooth device.
[0163] After S311, end.
[0164] S312: Determine that the i-th Bluetooth device does not meet the preset condition, and update i to i+1.
[0165] After S312, S313 is executed.
[0166] S313: Determine whether i is greater than the number of Bluetooth devices.
[0167] If yes, execute S314;
[0168] If not, execute S303.
[0169] S314: Determine the Bluetooth device with the greatest signal strength as the target Bluetooth device.
[0170] Among multiple Bluetooth devices, a Bluetooth device with the greatest signal strength may be determined as a target Bluetooth device.
[0171] Generally speaking, according to user habits, during Bluetooth transmission, the distance between terminals is relatively close and the signal strength is relatively strong.
[0172] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0173] The data transmission method provided in this embodiment sorts multiple Bluetooth devices in descending order of signal strength; executes a judgment step, which includes: judging whether there is historical record information for the ith Bluetooth device, the historical record information being a transmission acceptance record or a transmission rejection record; if so, obtaining at least one historical record information corresponding to the ith Bluetooth device, and determining the priority weight of the ith Bluetooth device based on the at least one historical record information; if the priority weight is greater than a threshold, judging whether the latest historical record information corresponding to the ith Bluetooth device is a transmission acceptance record; if so, determining that the ith Bluetooth device meets the preset condition; if not, determining that the ith Bluetooth device does not meet the preset condition Set conditions; if the priority weight is not greater than the threshold, determine that the ith Bluetooth device does not meet the preset conditions; if not, send a transmission request to the ith Bluetooth device, obtain the transmission response sent by the ith Bluetooth device, and if the transmission response is an acceptance response, determine that the ith Bluetooth device meets the preset conditions; if the transmission response is a rejection response, determine that the ith Bluetooth device does not meet the preset conditions, initially, i is 1; if so, determine the ith Bluetooth device as the target Bluetooth device; if not, update i to i+1, and perform the judgment step until the target Bluetooth device is determined to be obtained, or, when multiple Bluetooth devices do not meet the preset conditions respectively, determine the Bluetooth device with the largest signal strength as the target Bluetooth device. In this way, there is no need for the user to manually select a Bluetooth device for transmission. Through the scanning results and the device information of the Bluetooth device, the target Bluetooth device can be quickly and automatically determined, thereby improving the data transmission efficiency between devices.
[0174] Figure 4 This is a structural diagram of a data transmission device provided in an embodiment of the present application. Figure 4 The device 400 includes a display module 401, a scanning module 402, a judgment module 403 and a transmission module 404, wherein:
[0175] Display module 401, used to display Bluetooth transmission controls on the data transmission page;
[0176] The scanning module 402 is used to scan Bluetooth devices within a preset range in response to a user selecting an operation on a Bluetooth transmission control, and obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices;
[0177] A determination module 403 is used to determine whether the number of the Bluetooth devices is greater than 1, and if so, determine a target Bluetooth device according to device information of the multiple Bluetooth devices, and if not, determine the Bluetooth device as the target Bluetooth device;
[0178] The transmission module 404 is used to transmit data to the target Bluetooth device.
[0179] In a possible implementation manner, the device information includes signal strength, and the determination module 403 is specifically configured to:
[0180] Sorting the multiple Bluetooth devices in descending order of signal strength;
[0181] Execute a judgment step, the judgment step comprising: judging whether the i-th Bluetooth device meets a preset condition, initially, the i is 1;
[0182] If so, the i-th Bluetooth device is determined as the target Bluetooth device; if not, i is updated to i+1, and the judgment step is performed until the target Bluetooth device is determined to be obtained, or, when the multiple Bluetooth devices do not meet the preset conditions respectively, the Bluetooth device with the largest signal strength is determined as the target Bluetooth device.
[0183] In a possible implementation manner, the determination module 403 is specifically configured to:
[0184] Determine whether there is historical record information of the i-th Bluetooth device, where the historical record information is a transmission acceptance record or a transmission rejection record;
[0185] If yes, obtaining at least one historical record information corresponding to the i-th Bluetooth device, and judging whether the i-th Bluetooth device meets a preset condition according to the at least one historical record information;
[0186] If not, a transmission request is sent to the ith Bluetooth device, a transmission response sent by the ith Bluetooth device is obtained, and according to the transmission response, it is determined whether the ith Bluetooth device meets a preset condition.
[0187] In a possible implementation manner, the determination module 403 is specifically configured to:
[0188] Determining a priority weight of the i-th Bluetooth device according to the at least one historical record information;
[0189] If the priority weight is greater than a threshold, determining whether the latest historical record information corresponding to the i-th Bluetooth device is the received transmission record, and if so, determining that the i-th Bluetooth device meets the preset condition, and if not, determining that the i-th Bluetooth device does not meet the preset condition;
[0190] If the priority weight is not greater than the threshold, it is determined that the i-th Bluetooth device does not meet the preset condition.
[0191] In a possible implementation manner, the transmission response includes an acceptance response and a rejection response, and the determination module 403 is specifically configured to:
[0192] If the transmission response is the acceptance response, determining that the i-th Bluetooth device meets a preset condition;
[0193] If the transmission response is the rejection response, it is determined that the i-th Bluetooth device does not meet a preset condition.
[0194] In a possible implementation manner, the device further includes a storage module 405, and the storage module 405 is used to:
[0195] According to the transmission response, historical transmission information corresponding to the i-th Bluetooth device is established.
[0196] In a possible implementation, the display module 404 is specifically used for:
[0197] Acquire a Bluetooth transmission mode of the terminal device, where the Bluetooth transmission mode is an automatic transmission mode or a manual transmission mode;
[0198] When it is determined that the Bluetooth transmission mode is the automatic transmission mode, a Bluetooth transmission control is displayed on the data transmission page.
[0199] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 , the electronic device 500 may include: a memory 501 , a processor 502 , and a transceiver 503 .
[0200] The memory 501 is used to store program instructions;
[0201] The processor 502 is used to execute the program instructions stored in the memory, so as to enable the electronic device 500 to execute any of the above-mentioned data transmission methods.
[0202] The transceiver 503 may include: a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or the like, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or the like. Exemplarily, the memory 501, the processor 502, and the transceiver 503 are interconnected via a bus 504.
[0203] The present application also provides a chip having a computer program stored thereon. When the computer program is executed by the chip, the above-mentioned data transmission method is implemented. The corresponding content and effects can be referred to in the method embodiment part, which will not be described in detail.
[0204] The present application also provides a chip module, on which a computer program is stored. When the computer program is executed by the chip module, the above-mentioned data transmission method is implemented. The corresponding content and effects can be referred to the method embodiment part, which will not be described in detail.
[0205] The embodiment of the present application also provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above-mentioned data transmission method can be implemented.
[0206] The data transmission device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned data transmission method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.
[0207] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0208] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer executable instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0210] These computer executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0211] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data transmission method, characterized in that: Applied in a terminal device, the method comprises: Display Bluetooth transfer controls on the data transfer page; In response to a user selecting a Bluetooth transmission control, scanning Bluetooth devices within a preset range to obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices; Determine whether the number of the Bluetooth devices is greater than 1, if so, determine a target Bluetooth device according to device information of the multiple Bluetooth devices, if not, determine the Bluetooth device as the target Bluetooth device; Transmit data to the target Bluetooth device.
2. The method according to claim 1, characterized in that The device information includes signal strength, and determining a target Bluetooth device according to the device information of the plurality of Bluetooth devices includes: Sorting the multiple Bluetooth devices in descending order of signal strength; Execute a judgment step, the judgment step comprising: judging whether the i-th Bluetooth device meets a preset condition, initially, the i is 1; If so, the i-th Bluetooth device is determined as the target Bluetooth device; if not, i is updated to i+1, and the judgment step is performed until the target Bluetooth device is determined to be obtained, or, when the multiple Bluetooth devices do not meet the preset conditions respectively, the Bluetooth device with the largest signal strength is determined as the target Bluetooth device.
3. The method according to claim 2, characterized in that Determine whether the i-th Bluetooth device meets the preset conditions, including: Determine whether there is historical record information of the i-th Bluetooth device, where the historical record information is a transmission acceptance record or a transmission rejection record; If yes, obtaining at least one historical record information corresponding to the i-th Bluetooth device, and judging whether the i-th Bluetooth device meets a preset condition according to the at least one historical record information; If not, a transmission request is sent to the ith Bluetooth device, a transmission response sent by the ith Bluetooth device is obtained, and according to the transmission response, it is determined whether the ith Bluetooth device meets a preset condition.
4. The method according to claim 3, characterized in that Judging, according to the at least one historical record information, whether the i-th Bluetooth device meets a preset condition includes: Determining a priority weight of the i-th Bluetooth device according to the at least one historical record information; If the priority weight is greater than a threshold, determining whether the latest historical record information corresponding to the i-th Bluetooth device is the received transmission record, and if so, determining that the i-th Bluetooth device meets the preset condition, and if not, determining that the i-th Bluetooth device does not meet the preset condition; If the priority weight is not greater than the threshold, it is determined that the i-th Bluetooth device does not meet the preset condition.
5. The method according to claim 3, characterized in that: The transmission response includes an acceptance response and a rejection response. According to the transmission response, judging whether the i-th Bluetooth device meets the preset condition includes: If the transmission response is the acceptance response, determining that the i-th Bluetooth device meets a preset condition; If the transmission response is the rejection response, it is determined that the i-th Bluetooth device does not meet a preset condition.
6. The method according to claim 5, characterized in that After obtaining the transmission response sent by the i-th Bluetooth device: According to the transmission response, historical transmission information corresponding to the i-th Bluetooth device is established.
7. The method according to any one of claims 1 to 6, characterized in that: Displays Bluetooth transfer controls on the Data Transfer page, including: Acquire a Bluetooth transmission mode of the terminal device, where the Bluetooth transmission mode is an automatic transmission mode or a manual transmission mode; When it is determined that the Bluetooth transmission mode is the automatic transmission mode, a Bluetooth transmission control is displayed on the data transmission page.
8. A data transmission device, characterized in that: Applied in a terminal device, the device comprises: A display module, used to display Bluetooth transmission controls on the data transmission page; A scanning module, configured to scan Bluetooth devices within a preset range in response to a user selecting a Bluetooth transmission control, and obtain a scanning result, wherein the scanning result includes device information of at least one Bluetooth device and the number of Bluetooth devices; A determination module, used for determining whether the number of the Bluetooth devices is greater than 1, and if so, determining a target Bluetooth device according to device information of the multiple Bluetooth devices, and if not, determining the Bluetooth device as the target Bluetooth device; The transmission module is used to transmit data to the target Bluetooth device.
9. An electronic device, characterized in that: include: memory, processors, and transceivers; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Cited By
Data transmission method and apparatus, device, and storage medium
WO2026046099A1
