WO2021169687A1 - 一种数据传输方法、数据传输装置及电子设备 - Google Patents

一种数据传输方法、数据传输装置及电子设备 Download PDF

Info

Publication number
WO2021169687A1
WO2021169687A1 PCT/CN2021/073078 CN2021073078W WO2021169687A1 WO 2021169687 A1 WO2021169687 A1 WO 2021169687A1 CN 2021073078 W CN2021073078 W CN 2021073078W WO 2021169687 A1 WO2021169687 A1 WO 2021169687A1
Authority
WO
WIPO (PCT)
Prior art keywords
parameter
bluetooth
connection interval
rate
connection
Prior art date
Application number
PCT/CN2021/073078
Other languages
English (en)
French (fr)
Inventor
林进全
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to EP21760480.0A priority Critical patent/EP4099736B1/en
Publication of WO2021169687A1 publication Critical patent/WO2021169687A1/zh
Priority to US17/866,004 priority patent/US20220353932A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/25Maintenance of established connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application belongs to the field of Bluetooth technology, and in particular relates to a data transmission method, a data transmission device, an electronic device, and a computer-readable storage medium.
  • Bluetooth technology is a widely used short-range wireless connection technology, which is still being optimized.
  • the 4.0 version of Bluetooth has added the Bluetooth Low Energy (BLE) function.
  • BLE Bluetooth Low Energy
  • This BLE function is mainly used in scenarios with high real-time requirements and low transmission rate requirements, such as blood pressure. Computer, keyboard and mouse and other equipment.
  • the current application range of BLE is becoming wider and wider, and it can even be applied to scenarios such as big data transmission, for example, using BLE technology to upgrade peripheral device firmware. Based on this, considering that users have increasingly higher requirements for transmission rates, the existing BLE technology can no longer meet the needs of users.
  • the embodiments of the present application provide a data transmission method, a data transmission device, an electronic device, and a computer-readable storage medium, which can realize high-speed data transmission in a Bluetooth connection state.
  • an embodiment of the present application provides a data transmission method.
  • the above data transmission method is applied to an electronic device with Bluetooth function.
  • the above data transmission method includes:
  • the first rate parameter is used to record the maximum transmission rate
  • the second rate parameter is used to indicate the data transmission process.
  • the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter
  • the above-mentioned second connection interval parameter is used to dynamically adjust the connection interval used in the data transmission process;
  • the first rate parameter is less than the second rate parameter, the first rate parameter, the first connection interval parameter, and the second connection interval parameter are updated, and the execution of the second connection interval parameter based on the second connection interval parameter is performed.
  • the Bluetooth connection with the Bluetooth device is maintained based on the first connection interval parameter.
  • an embodiment of the present application provides a data transmission device, the above data transmission device is applied to an electronic device with Bluetooth function, and the above data transmission device includes:
  • the connection establishment unit is used to establish a Bluetooth connection with a Bluetooth device
  • the parameter creation unit is used to create and initialize the first rate parameter, the second rate parameter, the first connection interval parameter, and the second connection interval parameter, wherein the first rate parameter is used to record the maximum transmission rate, and the second rate parameter is Used to indicate the average transmission rate in the data transmission process, the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter, and the above-mentioned second connection interval parameter is used to dynamically adjust the connection interval used in the data transmission process ;
  • the first update unit is configured to perform data transmission with the Bluetooth device within a preset time length based on the second connection interval parameter, and update the second rate parameter through the average transmission rate within the time length;
  • the parameter comparison unit is used to compare the above-mentioned first rate parameter and the above-mentioned second rate parameter
  • the second update unit is configured to update the first rate parameter, the first connection interval parameter, and the second connection interval parameter if the first rate parameter is smaller than the second rate parameter, and trigger the execution of the first update unit ;
  • the connection maintaining unit is configured to maintain the Bluetooth connection with the Bluetooth device based on the first connection interval parameter if the first rate parameter is greater than or equal to the second rate parameter.
  • an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the above-mentioned memory and capable of running on the above-mentioned processor.
  • the above-mentioned processor executes the above-mentioned computer program, the above-mentioned Any one of the above-mentioned data transmission methods in one aspect.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program is executed by a processor, the data as described in any one of the first aspect is realized. Transmission method.
  • the embodiments of the present application provide a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute any one of the above-mentioned data transmission methods in the above-mentioned first aspect.
  • FIG. 1 is a schematic diagram of the implementation process of a data transmission method provided by an embodiment of the present application
  • Figure 2 is a logical diagram of a data transmission method provided by an embodiment of the present application.
  • Fig. 3 is a structural block diagram of a data transmission device provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the data transmission method in the embodiment of the present application is applied to an electronic device with Bluetooth function, and the data transmission method includes:
  • Step 101 Establish a Bluetooth connection with a Bluetooth device
  • another electronic device with Bluetooth function is recorded as a Bluetooth device, and the electronic device can first establish a Bluetooth connection with the Bluetooth device.
  • a Bluetooth connection For example, when device A and device B establish a Bluetooth connection, from the perspective of device A, device B will be used as a Bluetooth device, and device A itself will be used as an electronic device to apply the solution of the embodiment of this application; and the station From the perspective of device B, device A will be used as a Bluetooth device, and device B itself will be used as an electronic device to apply the solutions of the embodiments of the present application.
  • the electronic devices and Bluetooth devices in the embodiments are relative concepts, rather than absolute concepts.
  • the aforementioned Bluetooth connection refers to a Bluetooth connection established through an ACL (Asynchronous Connectionless) link of BLE.
  • Step 102 Create and initialize a first rate parameter, a second rate parameter, a first connection interval parameter, and a second connection interval parameter;
  • the first rate parameter can be created in the local cache area of the above-mentioned electronic device, including the first rate parameter, the second rate parameter, the first connection interval parameter, and the second connection interval parameter.
  • These parameters are initialized, where the above-mentioned first rate parameter is used to record the maximum transmission rate, the above-mentioned second rate parameter is used to indicate the current transmission rate, and the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter ( Connection Interval, CI), the above-mentioned second connection interval parameter is used to dynamically adjust the connection interval used in the data transmission process.
  • the above-mentioned first rate parameter is used to record the maximum transmission rate
  • the above-mentioned second rate parameter is used to indicate the current transmission rate
  • the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter ( Connection Interval, CI)
  • the above-mentioned second connection interval parameter is used to dynamically adjust the connection interval used in the data
  • the first rate parameter, the second rate parameter, and the first connection interval parameter are all initialized to 0, and the second connection interval parameter is initialized to a preset minimum value of the connection interval parameter, the connection interval parameter
  • the minimum value is usually 7.5 milliseconds (ms).
  • the minimum value of the second connection interval parameter can also be set to other values by the researcher or user, which is not limited here.
  • Step 103 Based on the connection interval parameter, perform data transmission with the Bluetooth device within a preset time length, and update the second rate parameter through the average transmission rate within the time length;
  • the BLE technology uses a frequency hopping mechanism in the connection of two devices.
  • the two devices use a specific channel to send and receive data, and then switch the physical channel after each connection interval. Affected by the memory size, the device cannot send packets indefinitely within the connection interval. Therefore, the connection interval directly affects the transmission rate: when the connection interval is too small, the frequency will be hopped before the data is sent; when the connection interval is too large In this case, the air interface takes a large proportion of time, which will cause a waste of bandwidth. Therefore, a proper connection interval can achieve a balance between frequency hopping and bandwidth, and increase the transmission rate. Based on this, the embodiment of the present application initializes the second connection interval parameter to the minimum value of the connection interval parameter.
  • connection interval parameter Starting from the minimum value of the connection interval parameter, data transmission is performed with the above-mentioned Bluetooth device within a preset time length to obtain this time.
  • the average transmission rate within the length of time, and the average transmission rate within this time length is assigned to the second rate parameter, that is, the average transmission rate indicated by the above second rate parameter refers specifically to the most recent data transmission period
  • the average transmission rate within that is, within the previous length of time.
  • the aforementioned time length can be set to 10 seconds.
  • the user or researcher can also set the aforementioned time length to other values, which is not limited here.
  • Step 104 Compare the above-mentioned first rate parameter and the above-mentioned second rate parameter;
  • the above-mentioned first rate parameter and the above-mentioned second rate parameter can be carried out. Compare to determine whether the above-mentioned first rate parameter needs to be updated.
  • Step 105 If the first rate parameter is less than the second rate parameter, update the first rate parameter, the first connection interval parameter, and the second connection interval parameter, and return to execute the above based on the second connection interval parameter, The step of performing data transmission with the aforementioned Bluetooth device within a preset time length, and updating the aforementioned second rate parameter through the average transmission rate within the aforementioned time length and subsequent steps;
  • the first rate parameter needs to be updated based on the second rate parameter. Specifically, the value of the second rate parameter is assigned to the first rate parameter.
  • the value of the above-mentioned second connection interval parameter can be assigned to the above-mentioned first connection interval parameter to achieve The update of the first connection interval parameter; and, considering that a new connection interval needs to be used for data transmission within the next length of time, therefore, the above-mentioned second connection interval parameter can be updated based on the preset connection interval unit value, Specifically, the value of the second connection interval parameter before the update is added to the connection interval unit value to obtain the updated second connection interval parameter, where the connection interval unit value is preferably 1.25 ms. It should be noted that in this step, the first connection interval parameter must be updated first, and then the second connection interval parameter must be updated.
  • the average transmission rate tends to increase first and then decrease with the increase of the connection interval, before reaching the theoretical maximum transmission rate, as the connection interval increases, the average transmission rate also increases. At this time, the average transmission rate The update of the first rate parameter can make the first rate parameter continuously approach the theoretical maximum transmission rate. Therefore, when the change trend of the first rate parameter is still in the increasing stage, each time the update of the first rate parameter, the first connection interval parameter, and the second connection interval parameter is completed, return to step 103 and Next steps.
  • Step 106 If the first rate parameter is greater than or equal to the second rate parameter, the Bluetooth connection with the Bluetooth device is maintained based on the first connection interval parameter.
  • the transmission rate corresponding to the current second connection interval parameter has entered a stage of decline.
  • the transmission rate (that is, the current first rate parameter) corresponding to the second connection interval parameter (that is, the current first connection interval parameter) is closest to the theoretical maximum transmission rate. Therefore, at this time, the Bluetooth connection with the Bluetooth device can be maintained based on the current first connection interval parameter, that is, subsequent data transmissions with the Bluetooth device are performed based on the current first connection interval parameter.
  • FIG. 2 shows the logic diagram of steps 101 to 106 described above.
  • the foregoing data transmission method further includes:
  • the foregoing creation and initialization of the first rate parameter, the second rate parameter, the first connection interval parameter, and the second connection interval parameter include:
  • the electronic device establishes a Bluetooth connection with the Bluetooth device for the first time, create and initialize a first rate parameter, a second rate parameter, a first connection interval parameter, and a second connection interval parameter;
  • the electronic device does not establish a Bluetooth connection with the Bluetooth device for the first time, the device identification code of the Bluetooth device is obtained, and the first connection interval parameter associated with the device identification code is searched in the local area of the electronic device based on the device identification code , To realize data transmission with the above-mentioned Bluetooth device based on the above-mentioned first connection interval parameter.
  • the above-mentioned electronic device only when the above-mentioned electronic device establishes a Bluetooth connection with the above-mentioned Bluetooth device for the first time, it is necessary to create and initialize the first rate parameter, the second rate parameter, the first connection interval parameter, and the second connection interval. Parameters; further, in the process of data transmission through the Bluetooth connection for the first time, the device identification code of the Bluetooth device can also be obtained, and the finally determined first connection interval parameter (that is, the connection that is closest to the theoretical maximum transmission rate The interval parameter) establishes an association relationship with the above-mentioned device identification code, and stores the above-mentioned association relationship in the local of the above-mentioned electronic device.
  • a subsequent electronic device when a subsequent electronic device establishes a Bluetooth connection with the same Bluetooth device, it can directly search for the associated first connection interval parameter locally through the device identification code of the Bluetooth device, so as to realize the connection with the first connection interval parameter based on the above-mentioned first connection interval parameter. Data transmission of the above-mentioned Bluetooth device.
  • device A determines that the first connection interval parameter is X1 through the above steps 101 to 106, that is, under the first connection interval parameter X1, the transmission between device A and device B With the highest rate, device A associates device B with the first connection interval parameter X1 and stores it locally; when device A connects to device B again, it directly finds the first connection interval parameter X1 associated with device B locally , And perform data transmission with the device B based on the connection interval indicated by the first connection interval parameter X1.
  • the processing pressure of the Bluetooth device can be reduced to a certain extent, and it can avoid re-searching the connection interval that can reach the maximum transmission rate every time a Bluetooth connection is made with other devices, and help the data between the electronic device and the Bluetooth device.
  • the transmission quickly reaches the maximum transmission rate.
  • the transmission rate can also be increased in other ways.
  • the above data transmission method further includes:
  • the high-speed encoding function is activated by setting the preset first flag bit to realize the high-speed encoding of the physical layer, and by setting the preset first The two flags enable the data length extension function;
  • the aforementioned electronic device and/or the aforementioned Bluetooth device does not support the preset first Bluetooth version, it is detected whether the aforementioned electronic device and the aforementioned Bluetooth device support the preset second Bluetooth version, wherein the aforementioned second Bluetooth version is lower than the aforementioned first Bluetooth version.
  • the data length extension function is activated by setting the second flag bit.
  • the first Bluetooth version is 5.0 version
  • the second Bluetooth version is 4.2 version.
  • version 5.0 not only supports high-speed encoding function, but also supports data length extension function
  • version 4.2 does not support high-speed Encoding function, only supports data length extension function (Data Length Extension).
  • the above-mentioned high-speed encoding function specifically refers to the physical layer encoding at a speed of 2Mb/s. Compared with the physical layer encoding at a speed of 1Mb/s when the high-speed encoding function is not applied, the transmission rate can be greatly increased; the above-mentioned data length extension function
  • the BLE controller is allowed to send data packets with up to 251 bytes in the connected state.
  • the transmission rate can be greatly improved.
  • the two can exchange version numbers, that is, the Bluetooth device sends the version number of the Bluetooth device to the electronic device, and the electronic device sends the version number of the electronic device to the Bluetooth device. And by analyzing the version numbers of the opposite end and the local end, it is known whether the opposite end and the local end support the first Bluetooth version.
  • the high-speed encoding function can be activated by setting the preset first flag bit, and at the same time, the data length extension function can also be activated by setting the preset second flag bit; if either party exists If the first Bluetooth version is not supported, continue to check whether both parties support the second Bluetooth version. In the case that both parties support the second Bluetooth version, the data length extension function can be activated by setting the preset second flag bit.
  • the transmission rate can also be increased in other ways. Then, after the Bluetooth connection with the Bluetooth device is established, the above The data transmission method also includes:
  • the target size is used to indicate the size of the data packet that the electronic device transmits to the Bluetooth device.
  • the above-mentioned Maximum Transmission Unit size refers to the length of the entire ATT data packet, where the above-mentioned ATT data packet is specifically an upper layer protocol stack communication protocol based on BLE (attribute protocol), the minimum value of the size of the above-mentioned maximum transmission unit is 23, and the maximum value is not specified.
  • BLE attribute protocol
  • the larger the size of the largest transmission unit the smaller the proportion of the header in each corresponding data packet, which will increase the data transmission rate. Based on this, before the electronic device and the Bluetooth device start data transmission, the size of the maximum transmission unit of the opposite terminal can be obtained first.
  • the size of each data packet to be transmitted is determined according to the size of the maximum transmission unit of the opposite terminal. size. That is, the electronic device obtains the size L1 of the maximum transmission unit of the Bluetooth device, and the Bluetooth device obtains the size L2 of the maximum transmission unit of the electronic device; when the electronic device performs data transmission, the size of the data packet transmitted to the Bluetooth device is L1, and the Bluetooth device When the device transmits data, the size of the data packet transmitted to the electronic device is L2.
  • the above-mentioned target size can be added to the association relationship between the first connection interval parameter and the device identification code of the above-mentioned Bluetooth device, that is, the device identification code of the Bluetooth device-first
  • the connection interval parameter-target size is associated with each other, when subsequent connections are made to the same Bluetooth device, the corresponding first connection interval parameter and target size can be directly obtained for data transmission.
  • connection interval parameter that can obtain the maximum transmission rate is determined by dynamically adjusting the connection interval, and after the connection interval parameter that can obtain the maximum transmission rate is obtained, the connection interval parameter is maintained.
  • Bluetooth data connection to achieve high-speed data transmission.
  • the size of the largest transmission unit supported by both parties can be exchanged, and data packets can be transmitted to the opposite end with the size of the largest transmission unit supported by the opposite end, and high-speed data transmission can also be realized.
  • the high-speed encoding function and the data length extension function can be selected to be enabled under the support of both parties to further realize the high-speed data transmission.
  • the second embodiment of the present application provides a data transmission device, and the above data transmission device can be integrated into an electronic device with Bluetooth function.
  • the data transmission device 300 in the embodiment of the present application includes:
  • the connection establishment unit 301 is used to establish a Bluetooth connection with a Bluetooth device
  • the parameter creation unit 302 is configured to create and initialize a first rate parameter, a second rate parameter, a first connection interval parameter, and a second connection interval parameter, wherein the first rate parameter is used to record the maximum transmission rate, and the second rate
  • the parameter is used to indicate the average transmission rate in the data transmission process
  • the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter
  • the above-mentioned second connection interval parameter is used to dynamically adjust the connection used in the data transmission process. interval;
  • the first update unit 303 is configured to perform data transmission with the Bluetooth device within a preset time length based on the second connection interval parameter, and update the second rate parameter through the average transmission rate within the time length;
  • the parameter comparison unit 304 is configured to compare the above-mentioned first rate parameter and the above-mentioned second rate parameter;
  • the second update unit 305 is configured to update the first rate parameter, the first connection interval parameter, and the second connection interval parameter if the first rate parameter is smaller than the second rate parameter, and trigger the execution of the first update Unit 303;
  • the connection maintaining unit 306 is configured to maintain the Bluetooth connection with the Bluetooth device based on the first connection interval parameter if the first rate parameter is greater than or equal to the second rate parameter.
  • the aforementioned data transmission device 300 further includes:
  • the connection times detection unit is configured to detect whether the electronic device establishes a Bluetooth connection with the Bluetooth device for the first time after the connection establishment unit 301 establishes the Bluetooth connection with the Bluetooth device;
  • the parameter creation unit 302 is specifically configured to create and initialize a first rate parameter, a second rate parameter, a first connection interval parameter, and a second connection interval if the electronic device establishes a Bluetooth connection with the Bluetooth device for the first time Parameter. If the electronic device does not establish a Bluetooth connection with the Bluetooth device for the first time, obtain the device identification code of the Bluetooth device, and search for the first connection associated with the device identification code in the local area of the electronic device based on the device identification code The interval parameter is to realize data transmission with the Bluetooth device based on the first connection interval parameter.
  • the aforementioned data transmission device 300 further includes:
  • the device identification code obtaining unit is configured to obtain the device identification code of the above-mentioned Bluetooth device
  • An association relationship detection unit configured to establish an association relationship between the first connection interval parameter and the device identification code
  • the association relationship storage unit is used to store the above association relationship.
  • the aforementioned data transmission device 300 further includes:
  • the first version detection unit is configured to detect whether the electronic device and the Bluetooth device support the preset first Bluetooth version after the connection establishment unit 301 establishes the Bluetooth connection with the Bluetooth device;
  • the first function activation unit is configured to enable the high-speed encoding function by setting the preset first flag bit to realize the high-speed encoding of the physical layer if both the electronic device and the Bluetooth device support the preset first Bluetooth version, And start the data length extension function by setting the preset second flag bit.
  • the aforementioned data transmission device 300 further includes:
  • the second version detection unit is configured to, after the first version detection unit detects whether the electronic device and the Bluetooth device support the preset first Bluetooth version, if the electronic device and/or the Bluetooth device does not support the preset first Bluetooth version A Bluetooth version, detecting whether the electronic device and the Bluetooth device support a preset second Bluetooth version, where the second Bluetooth version is lower than the first Bluetooth version;
  • the second function activation unit is configured to activate the data length extension function by setting the second flag bit if both the electronic device and the Bluetooth device support the preset second Bluetooth version.
  • the aforementioned data transmission device 300 further includes:
  • the target size determining unit is configured to obtain the size of the largest transmission unit supported by the Bluetooth device as the target size after the Bluetooth connection with the Bluetooth device is established by the connection establishing unit 301, and the target size is used to instruct the electronic device to transfer to the The size of the data packet transmitted by the Bluetooth device.
  • the above-mentioned second update unit 305 includes:
  • the first rate parameter update subunit is configured to update the first rate parameter based on the second rate parameter
  • the first connection interval parameter update subunit is configured to update the first connection interval parameter based on the second connection interval parameter
  • the second connection interval parameter update subunit is configured to update the above-mentioned second connection interval parameter based on the preset connection interval unit value.
  • the data transmission device determines the connection interval parameter that can obtain the maximum transmission rate by dynamically adjusting the connection interval, and maintains this connection after obtaining the connection interval parameter that can obtain the maximum transmission rate.
  • the interval parameter carries on the bluetooth data connection, in order to realize the high-speed transmission of the data.
  • the size of the largest transmission unit supported by both parties can be exchanged, and data packets can be transmitted to the opposite end with the size of the largest transmission unit supported by the opposite end, and high-speed data transmission can also be realized.
  • the high-speed encoding function and the data length extension function can be selected to further realize the high-speed transmission of data.
  • the third embodiment of the present application provides an electronic device. Please refer to FIG. 4.
  • the electronic device 4 in the embodiment of the present application has a Bluetooth function.
  • the electronic device includes a memory 401, one or more processors 402 (only Show one) and a computer program stored on the memory 401 and running on the processor.
  • the memory 401 is used to store software programs and units, and the processor 402 executes various functional applications and data processing by running the software programs and units stored in the memory 401 to obtain resources corresponding to the aforementioned preset events.
  • the processor 402 implements the following steps when running the above-mentioned computer program stored in the memory 401:
  • the first rate parameter is used to record the maximum transmission rate
  • the second rate parameter is used to indicate the data transmission process.
  • the above-mentioned first connection interval parameter is used to record the connection interval related to the first rate parameter
  • the above-mentioned second connection interval parameter is used to dynamically adjust the connection interval used in the data transmission process;
  • the first rate parameter is less than the second rate parameter, the first rate parameter, the first connection interval parameter, and the second connection interval parameter are updated, and the execution of the second connection interval parameter based on the second connection interval parameter is performed.
  • the Bluetooth connection with the Bluetooth device is maintained based on the first connection interval parameter.
  • the processor 402 runs and stores The following steps are implemented in the above-mentioned computer program in the memory 401:
  • the foregoing creation and initialization of the first rate parameter, the second rate parameter, the first connection interval parameter, and the second connection interval parameter include:
  • the electronic device establishes a Bluetooth connection with the Bluetooth device for the first time, create and initialize a first rate parameter, a second rate parameter, a first connection interval parameter, and a second connection interval parameter;
  • the electronic device does not establish a Bluetooth connection with the Bluetooth device for the first time, the device identification code of the Bluetooth device is obtained, and the first connection interval parameter associated with the device identification code is searched in the local area of the electronic device based on the device identification code , To realize data transmission with the above-mentioned Bluetooth device based on the above-mentioned first connection interval parameter.
  • the processor 402 runs and stores in The above-mentioned computer program in the memory 401 implements the following steps:
  • the processor 402 implements the following steps by running the foregoing computer program stored in the memory 401: :
  • the high-speed encoding function is activated by setting the preset first flag bit to realize the high-speed encoding of the physical layer, and by setting the preset first The two flags enable the data length extension function.
  • the processor 402 runs and stores The following steps are implemented in the above-mentioned computer program in the memory 401:
  • the aforementioned electronic device and/or the aforementioned Bluetooth device does not support the preset first Bluetooth version, it is detected whether the aforementioned electronic device and the aforementioned Bluetooth device support the preset second Bluetooth version, wherein the aforementioned second Bluetooth version is lower than the aforementioned first Bluetooth version.
  • the data length extension function is activated by setting the second flag bit.
  • the processor 402 realizes the following by running the foregoing computer program stored in the memory 401: step:
  • the size of the largest transmission unit supported by the Bluetooth device is acquired as a target size, and the target size is used to indicate the size of the data packet that the electronic device transmits to the Bluetooth device.
  • the fifth possible implementation manner is used as the basis, or the seventh possible implementation manner provided on the basis of the above-mentioned sixth possible implementation manner, the above-mentioned update of the above-mentioned first rate parameter, the above-mentioned first connection interval parameter, and the above-mentioned first Two connection interval parameters, including:
  • the above-mentioned second connection interval parameter is updated.
  • the processor 402 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors or digital signal processors (Digital Signal Processors, DSPs). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 401 may include a read-only memory and a random access memory, and provides instructions and data to the processor 402. A part or all of the memory 401 may also include a non-volatile random access memory. For example, the memory 401 may also store information about the device category.
  • the electronic device determines the connection interval parameter that can obtain the maximum transmission rate by dynamically adjusting the connection interval, and maintains this connection interval after obtaining the connection interval parameter that can obtain the maximum transmission rate.
  • Parameter for Bluetooth data connection to achieve high-speed data transmission.
  • the size of the largest transmission unit supported by both parties can be exchanged, and data packets can be transmitted to the opposite end with the size of the largest transmission unit supported by the opposite end, and high-speed data transmission can also be realized.
  • the high-speed encoding function and the data length extension function can be selected to be enabled under the support of both parties to further realize the high-speed data transmission.
  • the disclosed device and method may be implemented in other ways.
  • the system embodiment described above is only illustrative.
  • the division of the above-mentioned modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by computer programs instructing associated hardware.
  • the above-mentioned computer programs can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the above-mentioned computer-readable storage medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer readable memory, read-only memory (ROM, Read-Only Memory) ), Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunications signal, and software distribution media, etc.
  • the content contained in the above-mentioned computer-readable storage medium can be appropriately added or deleted according to the requirements of the legislation and patent practice in the jurisdiction.
  • the computer-readable storage The medium does not include electrical carrier signals and telecommunication signals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开了一种数据传输方法、数据传输装置、电子设备及计算机可读存储介质,其中,该方法包括:建立与蓝牙设备的蓝牙连接;创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;基于第二连接间隔参数,在预设的时间长度内与蓝牙设备进行数据传输,通过时间长度内的平均传输速率更新上述第二速率参数;比对第一速率参数及第二速率参数;若第一速率参数小于第二速率参数,则更新各参数,并返回与数据传输相关的步骤及后续步骤;若第一速率参数不小于第二速率参数,则基于第一连接间隔参数,保持与蓝牙设备的蓝牙连接。本申请方案可通过动态调整连接间隔参数确定最大传输速率,以实现数据的高速传输。

Description

一种数据传输方法、数据传输装置及电子设备 技术领域
本申请属于蓝牙技术领域,尤其涉及一种数据传输方法、数据传输装置、电子设备及计算机可读存储介质。
背景技术
蓝牙技术是一种广泛使用的近距离无线连接技术,其仍在不断的优化中。近几年,蓝牙所推出的4.0版本加入了低功耗蓝牙的功能(Bluetooth Low Energy,BLE),该BLE功能主要应用在对实时性要求较高,对传输速率要求比较低的场景,比如血压计、键鼠等设备。然而,当前BLE的应用范围越来越广泛,甚至可以应用于大数据传输等场景中,例如,使用BLE技术对外围设备固件升级等。基于此,考虑到用户对传输速率的要求越来越高,现有的BLE技术已无法满足用户的需求。
发明内容
本申请实施例提供了一种数据传输方法、数据传输装置、电子设备及计算机可读存储介质,可在蓝牙连接的状态下实现数据的高速传输。
第一方面,本申请实施例提供了一种数据传输方法,上述数据传输方法应用于具备蓝牙功能的电子设备,上述数据传输方法包括:
建立与蓝牙设备的蓝牙连接;
创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,上述第一速率参数用于记录最大传输速率,上述第二速率参数用于指示数据传输过程中的平均传输速率,上述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,上述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数;
比对上述第一速率参数及上述第二速率参数;
若上述第一速率参数小于上述第二速率参数,则更新上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数,并返回执行上述基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数的步骤及后续步骤;
若上述第一速率参数大于或等于上述第二速率参数,则基于上述第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接。
第二方面,本申请实施例提供了一种数据传输装置,上述数据传输装置应用于具备蓝牙功能的电子设备,上述数据传输装置包括:
连接建立单元,用于建立与蓝牙设备的蓝牙连接;
参数创建单元,用于创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,上述第一速率参数用于记录最大传输速率,上述第二速率参数用于指示数据传输过程中的平均传输速率,上述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,上述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
第一更新单元,用于基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数;
参数比对单元,用于比对上述第一速率参数及上述第二速率参数;
第二更新单元,用于若上述第一速率参数小于上述第二速率参数,则更新上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数,并触发执行上述第一更新单元;
连接保持单元,用于若上述第一速率参数大于或等于上述第二速率参数,则基于上述第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接。
第三方面,本申请实施例提供了一种电子设备,包括存储器、处理器以及存储在上述存储器中并可在上述处理器上运行的计算机程序,上述处理器执行上述计算机程序时实现如上述第一方面中任一项上述的数据传输方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,上述计算机可读存储介质存储有计算机程序,上述计算机程序被处理器执行时实现如上述第一方面中任一项上述的数据传输方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面中任一项上述的数据传输方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的数据传输方法的实现流程示意图;
图2是本申请实施例提供的数据传输方法的逻辑图;
图3是本申请实施例提供的数据传输装置的结构框图;
图4是本申请实施例提供的电子设备的结构示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体 细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所提出的技术方案,下面通过具体实施例来进行说明。
实施例1
下面对本申请实施例提供的一种数据传输方法进行描述。请参阅图1,本申请实施例中的数据传输方法应用于具备蓝牙功能的电子设备,该数据传输方法包括:
步骤101,建立与蓝牙设备的蓝牙连接;
在本申请实施例中,为了便于区分,将具备蓝牙功能的另一电子设备记为蓝牙设备,则电子设备可以首先建立与该蓝牙设备的蓝牙连接。例如,当设备A与设备B建立蓝牙连接时,站在设备A的角度来看,设备B将被作为蓝牙设备,而设备A自身将被作为电子设备以应用本申请实施例的方案;而站在设备B的角度看,设备A将被作为蓝牙设备,而设备B自身将被作为电子设备以应用本申请实施例的方案。也即,本身实施例中的电子设备及蓝牙设备为相对概念,而非绝对概念。具体地,上述蓝牙连接指的是通过BLE的ACL(Asynchronous Connectionless)链路所建立的蓝牙连接。
步骤102,创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;
在本申请实施例中,可以在上述电子设备本地的缓存区域创建若干个参数,包括第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,并在创建完成后对这些参数进行初始化,其中,上述第一速率参数用于记录最大传输速率,上述第二速率参数用于指示当前传输速率,上述第一连接间隔参数用于记录与第一速率参数相关的连接间隔(Connection Interval,CI),上述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔。具体地,上述第一速率参数、第二速率参数及第一连接间隔参数均被初始化为0,而上述第二连接间隔参数则被初始化为一预设的连接间隔参数最小值,该连接间隔参数最小值通常情况下为7.5毫秒(ms),当然,也可以由研发人员或用户将上述第二连接间隔参数最小值设定为其它数值,此处不作限定。
步骤103,基于上述连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数;
在本申请实施例中,BLE技术在两个设备的连接中使用跳频机制,这两个设备使用特定的信道发送和接收数据,然后每个连接间隔后切换物理信道。受内存大小的影响,设备无法在连接间隔内无限发包,因此连接间隔的大小直接影响了传输速率:在连接间隔太小的情况下,数据没发完就要跳频;在连接间隔太大的情况下,空口时间占比大,会造成带宽 的浪费。因而,合适的连接间隔能够实现跳频及带宽之间的平衡,提高传输速率。基于此,本申请实施例将第二连接间隔参数初始化为连接间隔参数最小值,从该连接间隔参数最小值开始,在预设的时间长度内与上述蓝牙设备进行数据传输,以获得这一时间长度内的平均传输速率,并将这一时间长度内的平均传输速率赋予第二速率参数,也即,上述第二速率参数所指示的平均传输速率,具体指的是在最近的一个数据传输周期内(也即前一时间长度内)的平均传输速率。可选地,上述时间长度可被设定为10秒,当然,用户或研发人员也可将上述时间长度设定为其它数值,此处不作限定。
步骤104,比对上述第一速率参数及上述第二速率参数;
在本申请实施例中,由于第一速率参数所要记录的是到当前时刻为止,蓝牙连接的数据传输过程中的最大传输速率,因而,此时可以将上述一速率参数及上述第二速率参数进行比对,以确定上述第一速率参数是否需要更新。
步骤105,若上述第一速率参数小于上述第二速率参数,则更新上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数,并返回执行上述基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数的步骤及后续步骤;
在本申请实施例中,如果通过比对发现上述第一参数小于上述第二速率参数,也即,这种情况下,在最近的一个数据传输周期内的平均传输速率大于当前所记录的最大传输速率,则此时需要基于上述第二速率参数对上述第一速率参数进行更新,具体为将上述第二速率参数的值赋予上述第一速率参数。除了上述第一速率参数之外,由于第一连接间隔参数记录的是与第一速率参数相关的连接间隔,因而,可以将上述第二连接间隔参数的值赋予上述第一连接间隔参数,以实现第一连接间隔参数的更新;并且,考虑到下一时间长度内需要采用一个新的连接间隔进行数据传输,因而,可以基于预设的连接间隔单位值,对上述第二连接间隔参数进行更新,具体表现为将更新前的第二连接间隔参数的值加上连接间隔单位值,得到更新后的第二连接间隔参数,其中,该连接间隔单位值优选为1.25ms。需要注意的是,本步骤中,必须先更新第一连接间隔参数,再更新第二连接间隔参数。
考虑到平均传输速率随着连接间隔的增长往往呈现先增长后减小的规律,在达到理论最大传输速率之前,随着连接间隔的增长,平均传输速率也不断增长,此时通过平均传输速率对第一速率参数进行更新,可使得该第一速率参数不断逼近上述理论最大传输速率。因而,在第一速率参数的变化趋势仍处于增长的阶段时,每次完成对上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数的更新后,都返回执行步骤103及后续步骤。
步骤106,若上述第一速率参数大于或等于上述第二速率参数,则基于上述第一连接间 隔参数,保持与上述蓝牙设备的蓝牙连接。
在本申请实施例中,一旦发现上述第一速率参数大于或等于上述第二速率参数,则可认为当前的第二连接间隔参数所对应的传输速率已进入下降的阶段,此时,可知前次的第二连接间隔参数(也即当前的第一连接间隔参数)所对应的传输速率(也即当前的第一速率参数)最逼近理论最大传输速率。因而,这时候可基于当前的第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接,也即,后续均基于当前的第一连接间隔参数与蓝牙设备进行数据传输。
为了方便理解,请查阅图2,图2示出了上述步骤101至步骤106的逻辑图。
可选地,为了提升本申请实施例的处理效率,在上述步骤101之后,上述数据传输方法还包括:
检测上述电子设备是否为初次与上述蓝牙设备建立蓝牙连接;
相应地,上述创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,包括:
若上述电子设备为初次与上述蓝牙设备建立蓝牙连接,则创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;
若上述电子设备非初次与上述蓝牙设备建立蓝牙连接,则获取上述蓝牙设备的设备识别码,并基于上述设备识别码在上述电子设备的本地查找与上述设备识别码相关联的第一连接间隔参数,以基于上述第一连接间隔参数实现与上述蓝牙设备的数据传输。
在本申请实施例中,只有在上述电子设备是初次与上述蓝牙设备建立蓝牙连接的情况下,才需要创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;进一步地,在初次通过蓝牙连接进行数据传输的过程中,还可以获取上述蓝牙设备的设备识别码,并对最后确定的上述第一连接间隔参数(也即最逼近理论最大传输速率的连接间隔参数)与上述设备识别码建立关联关系,将上述关联关系存储于上述电子设备的本地。这样一来,后续电子设备再与同一蓝牙设备建立蓝牙连接时,即可直接通过该蓝牙设备的设备识别码在本地查找相关联的第一连接间隔参数,以基于上述第一连接间隔参数实现与上述蓝牙设备的数据传输。例如,设备A与设备B初次连接时,设备A通过上述步骤101至步骤106,确定第一连接间隔参数为X1,也即,在该第一连接间隔参数X1下,设备A与设备B的传输速率最高,设备A会将该设备B与该第一连接间隔参数X1关联起来存储于本地;后续设备A再次与设备B连接时,直接通过本地查找到与设备B关联的第一连接间隔参数X1,并基于该第一连接间隔参数X1所指示的连接间隔与设备B进行数据传输。可见,通过这一方式,可以一定程度的减轻蓝牙设备的处理压力,避免每一次与其它设备进行蓝牙连接时都重新查找能够达到最大传输速率的连接间隔,帮助电子设备与蓝牙 设备之间的数据传输快速达到最大传输速率。
可选地,除了动态调节连接间隔以获得最大传输速率之外,还可以通过其它方式提升传输速率,则在上述建立与蓝牙设备的蓝牙连接之后,上述数据传输方法还包括:
检测上述电子设备及上述蓝牙设备是否支持预设的第一蓝牙版本;
若上述电子设备及上述蓝牙设备均支持预设的第一蓝牙版本,则通过设定预设的第一标志位启动高速编码功能,以实现物理层的高速编码,并通过设定预设的第二标志位启动数据长度扩展功能;
若上述电子设备和/或上述蓝牙设备不支持预设的第一蓝牙版本,则检测上述电子设备及上述蓝牙设备是否支持预设的第二蓝牙版本,其中,上述第二蓝牙版本低于上述第一蓝牙版本;
若上述电子设备及上述蓝牙设备均支持预设的第二蓝牙版本,则通过设定上述第二标志位启动数据长度扩展功能。
在本申请实施例中,上述第一蓝牙版本具体为5.0版本,上述第二蓝牙版本具体为4.2版本,其中,5.0版本不仅支持高速编码功能,而且支持数据长度扩展功能,而4.2版本不支持高速编码功能,仅支持数据长度扩展功能(Data Length Extension)。上述高速编码功能具体指的是物理层以2Mb/s的速度进行编码,与未应用高速编码功能时物理层以1Mb/s的速度进行编码相比,可大大提升传输速率;上述数据长度扩展功能允许BLE控制器在连接状态下发送具有高达251字节的数据包,与未应用数据长度扩展功能时BLE控制器的数据通道27字节的最大有效载荷相比,可大大提升传输速率。基于此,在电子设备与蓝牙设备建立蓝牙连接后,二者可交换版本号,也即,蓝牙设备向电子设备发送该蓝牙设备的版本号,电子设备向蓝牙设备发送该电子设备的版本号,并通过对对端及本端的版本号进行分析,获知对端及本端是否支持该第一蓝牙版本。若双方都支持第一蓝牙版本,则可通过设定预设的第一标志位启动高速编码功能,同时,还可通过设定预设的第二标志位启动数据长度扩展功能;若存在任一方不支持第一蓝牙版本,则继续检测双方是否支持第二蓝牙版本,在双方都支持第二蓝牙版本的情况下,可通过设定预设的第二标志位启动数据长度扩展功能。
可选地,除了动态调节连接间隔以获得最大传输速率、启动高速编码功能及启动数据长度扩展功能之外,还可以通过其它方式提升传输速率,则在上述建立与蓝牙设备的蓝牙连接之后,上述数据传输方法还包括:
获取上述蓝牙设备所支持的最大传输单元的尺寸,作为目标尺寸,上述目标尺寸用于 指示上述电子设备向上述蓝牙设备所传输的数据包的大小。
在本申请实施例中,上述最大传输单元的尺寸(Maximum Transmission Unit size,MTU size)指的是整个ATT数据包的长度,其中,上述ATT数据包具体为基于BLE的上层协议栈通信协议(attribute protocol)的数据包,上述最大传输单元的尺寸的最小取值23,最大取值无规定。通常来说,最大传输单元的尺寸越大,则相应的每个数据包中的包头占比越小,这将提升数据传输的速率。基于此,在电子设备与蓝牙设备开始进行数据传输之前,可以先获取对端的最大传输单元的尺寸,在进行数据传输时,根据对端的最大传输单元的尺寸来决定所要传输的每一个数据包的大小。也即,电子设备获取蓝牙设备的最大传输单元的尺寸L1,蓝牙设备获取电子设备的最大传输单元的尺寸L2;电子设备进行数据传输时,向蓝牙设备所传输的数据包的大小为L1,蓝牙设备进行数据传输时,向电子设备所传输的数据包的大小为L2。与上述第一连接间隔参数相类似的,可在第一连接间隔参数与上述蓝牙设备的设备识别码的关联关系中,再加入上述目标尺寸,也即,形成蓝牙设备的设备识别码-第一连接间隔参数-目标尺寸的关联关系,则后续再与同一蓝牙设备进行连接时,可直接获取对应的第一连接间隔参数及目标尺寸进行数据传输。
由上可见,本申请实施例中,通过动态调整连接间隔来确定能够获得最大传输速率的连接间隔参数,并在得到了该能够获得最大传输速率的连接间隔参数后,保持这一连接间隔参数进行蓝牙数据连接,以实现数据的高速传输。除此之外,还可以交换双方所支持的最大传输单元的尺寸,并以对端所支持的最大传输单元的尺寸向对端传输数据包,也可实现数据的高速传输。进一步地,还可以在双方支持的情况下选择开启高速编码功能及数据长度扩展功能,以进一步实现数据的高速传输。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
实施例2
本申请实施例二提供了一种数据传输装置,上述数据传输装置可集成于具备蓝牙功能的电子设备中。如图3所示,本申请实施例中的数据传输装置300包括:
连接建立单元301,用于建立与蓝牙设备的蓝牙连接;
参数创建单元302,用于创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,上述第一速率参数用于记录最大传输速率,上述第二速率参数用于指示数据传输过程中的平均传输速率,上述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,上述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
第一更新单元303,用于基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙 设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数;
参数比对单元304,用于比对上述第一速率参数及上述第二速率参数;
第二更新单元305,用于若上述第一速率参数小于上述第二速率参数,则更新上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数,并触发执行上述第一更新单元303;
连接保持单元306,用于若上述第一速率参数大于或等于上述第二速率参数,则基于上述第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接。
可选地,上述数据传输装置300还包括:
连接次数检测单元,用于在上述连接建立单元301建立与蓝牙设备的蓝牙连接之后,检测上述电子设备是否为初次与上述蓝牙设备建立蓝牙连接;
相应地,上述参数创建单元302,具体用于若上述电子设备为初次与上述蓝牙设备建立蓝牙连接,则创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,若上述电子设备非初次与上述蓝牙设备建立蓝牙连接,则获取上述蓝牙设备的设备识别码,并基于上述设备识别码在上述电子设备的本地查找与上述设备识别码相关联的第一连接间隔参数,以基于上述第一连接间隔参数实现与上述蓝牙设备的数据传输。
可选地,上述数据传输装置300还包括:
设备识别码获取单元,用于获取上述蓝牙设备的设备识别码;
关联关系检测单元,用于建立上述第一连接间隔参数与上述设备识别码的关联关系;
关联关系存储单元,用于存储上述关联关系。
可选地,上述数据传输装置300还包括:
第一版本检测单元,用于在上述连接建立单元301建立与蓝牙设备的蓝牙连接之后,检测上述电子设备及上述蓝牙设备是否支持预设的第一蓝牙版本;
第一功能启动单元,用于若上述电子设备及上述蓝牙设备均支持预设的第一蓝牙版本,则通过设定预设的第一标志位启动高速编码功能,以实现物理层的高速编码,并通过设定预设的第二标志位启动数据长度扩展功能。
可选地,上述数据传输装置300还包括:
第二版本检测单元,用于在上述第一版本检测单元检测上述电子设备及上述蓝牙设备是否支持预设的第一蓝牙版本之后,若上述电子设备和/或上述蓝牙设备不支持预设的第一蓝牙版本,则检测上述电子设备及上述蓝牙设备是否支持预设的第二蓝牙版本,其中,上述第二蓝牙版本低于上述第一蓝牙版本;
第二功能启动单元,用于若上述电子设备及上述蓝牙设备均支持预设的第二蓝牙版本,则通过设定上述第二标志位启动数据长度扩展功能。
可选地,上述数据传输装置300还包括:
目标尺寸确定单元,用于在上述连接建立单元301建立与蓝牙设备的蓝牙连接之后,获取上述蓝牙设备所支持的最大传输单元的尺寸,作为目标尺寸,上述目标尺寸用于指示上述电子设备向上述蓝牙设备所传输的数据包的大小。
可选地,上述第二更新单元305,包括:
第一速率参数更新子单元,用于基于上述第二速率参数,更新上述第一速率参数;
第一连接间隔参数更新子单元,用于基于上述第二连接间隔参数,更新上述第一连接间隔参数;
第二连接间隔参数更新子单元,用于基于预设的连接间隔单位值,更新上述第二连接间隔参数。
由上可见,本申请实施例中,数据传输装置通过动态调整连接间隔来确定能够获得最大传输速率的连接间隔参数,并在得到了该能够获得最大传输速率的连接间隔参数后,保持这一连接间隔参数进行蓝牙数据连接,以实现数据的高速传输。除此之外,还可以交换双方所支持的最大传输单元的尺寸,并以对端所支持的最大传输单元的尺寸向对端传输数据包,也可实现数据的高速传输。进一步地,还可以在双方支持的情况下选择开启高速编码功能及数据长度扩展功能,以进一步实现数据的高速传输升。
实施例3
本申请实施例三提供了一种电子设备,请参阅图4,本申请实施例中的电子设备4具备蓝牙功能,该电子设备包括:存储器401,一个或多个处理器402(图4中仅示出一个)及存储在存储器401上并可在处理器上运行的计算机程序。其中:存储器401用于存储软件程序以及单元,处理器402通过运行存储在存储器401的软件程序以及单元,从而执行各种功能应用以及数据处理,以获取上述预设事件对应的资源。具体地,处理器402通过运行存储在存储器401的上述计算机程序时实现以下步骤:
建立与蓝牙设备的蓝牙连接;
创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,上述第一速率参数用于记录最大传输速率,上述第二速率参数用于指示数据传输过程中的平均传输速率,上述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,上述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数;
比对上述第一速率参数及上述第二速率参数;
若上述第一速率参数小于上述第二速率参数,则更新上述第一速率参数、上述第一连 接间隔参数及上述第二连接间隔参数,并返回执行上述基于上述第二连接间隔参数,在预设的时间长度内与上述蓝牙设备进行数据传输,通过上述时间长度内的平均传输速率更新上述第二速率参数的步骤及后续步骤;
若上述第一速率参数大于或等于上述第二速率参数,则基于上述第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接。
假设上述为第一种可能的实施方式,则在第一种可能的实施方式作为基础而提供的第二种可能的实施方式中,在建立与蓝牙设备的蓝牙连接之后,处理器402通过运行存储在存储器401的上述计算机程序时实现还以下步骤:
检测上述电子设备是否为初次与上述蓝牙设备建立蓝牙连接;
相应地,上述创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,包括:
若上述电子设备为初次与上述蓝牙设备建立蓝牙连接,则创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;
若上述电子设备非初次与上述蓝牙设备建立蓝牙连接,则获取上述蓝牙设备的设备识别码,并基于上述设备识别码在上述电子设备的本地查找与上述设备识别码相关联的第一连接间隔参数,以基于上述第一连接间隔参数实现与上述蓝牙设备的数据传输。
在上述第二种可能的实施方式作为基础而提供的第三种可能的实施方式中,在上述基于上述第一连接间隔参数,保持与上述蓝牙设备的蓝牙连接之后,处理器402通过运行存储在存储器401的上述计算机程序时实现还以下步骤:
获取上述蓝牙设备的设备识别码;
建立上述第一连接间隔参数与上述设备识别码的关联关系;
存储上述关联关系。
在上述一种可能的实施方式作为基础而提供的第四种可能的实施方式中,在建立与蓝牙设备的蓝牙连接之后,处理器402通过运行存储在存储器401的上述计算机程序时实现还以下步骤:
检测上述电子设备及上述蓝牙设备是否支持预设的第一蓝牙版本;
若上述电子设备及上述蓝牙设备均支持预设的第一蓝牙版本,则通过设定预设的第一标志位启动高速编码功能,以实现物理层的高速编码,并通过设定预设的第二标志位启动数据长度扩展功能。
在上述第四种可能的实施方式作为基础而提供的第五种可能的实施方式中,在上述检测上述电子设备及上述蓝牙设备是否支持预设的第一蓝牙版本之后,处理器402通过运行存储在存储器401的上述计算机程序时实现还以下步骤:
若上述电子设备和/或上述蓝牙设备不支持预设的第一蓝牙版本,则检测上述电子设备及上述蓝牙设备是否支持预设的第二蓝牙版本,其中,上述第二蓝牙版本低于上述第一蓝牙版本;
若上述电子设备及上述蓝牙设备均支持预设的第二蓝牙版本,则通过设定上述第二标志位启动数据长度扩展功能。
在上述第一种可能的实施方式作为基础而提供的第六种可能的实施方式中,在建立与蓝牙设备的蓝牙连接之后,处理器402通过运行存储在存储器401的上述计算机程序时实现还以下步骤:
获取上述蓝牙设备所支持的最大传输单元的尺寸,作为目标尺寸,上述目标尺寸用于指示上述电子设备向上述蓝牙设备所传输的数据包的大小。
在上述第一种可能的实施方式作为基础,或者上述第二种可能的实施方式作为基础,或者上述第三种可能的实施方式作为基础,或者上述第四种可能的实施方式作为基础,或者上述第五种可能的实施方式作为基础,或者上述第六种可能的实施方式作为基础而提供的第七种可能的实施方式中,上述更新上述第一速率参数、上述第一连接间隔参数及上述第二连接间隔参数,包括:
基于上述第二速率参数,更新上述第一速率参数;
基于上述第二连接间隔参数,更新上述第一连接间隔参数;
基于预设的连接间隔单位值,更新上述第二连接间隔参数。
应当理解,在本申请实施例中,所称处理器402可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器401可以包括只读存储器和随机存取存储器,并向处理器402提供指令和数据。存储器401的一部分或全部还可以包括非易失性随机存取存储器。例如,存储器401还可以存储设备类别的信息。
由上可见,本申请实施例中,电子设备通过动态调整连接间隔来确定能够获得最大传输速率的连接间隔参数,并在得到了该能够获得最大传输速率的连接间隔参数后,保持这一连接间隔参数进行蓝牙数据连接,以实现数据的高速传输。除此之外,还可以交换双方所支持的最大传输单元的尺寸,并以对端所支持的最大传输单元的尺寸向对端传输数据包, 也可实现数据的高速传输。进一步地,还可以在双方支持的情况下选择开启高速编码功能及数据长度扩展功能,以进一步实现数据的高速传输。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将上述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者外部设备软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,上述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关联的硬件来完成,上述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方 法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读存储介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机可读存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括是电载波信号和电信信号。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种数据传输方法,其特征在于,所述数据传输方法应用于具备蓝牙功能的电子设备,所述数据传输方法包括:
    建立与蓝牙设备的蓝牙连接;
    创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,所述第一速率参数用于记录最大传输速率,所述第二速率参数用于指示数据传输过程中的平均传输速率,所述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,所述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
    基于所述第二连接间隔参数,在预设的时间长度内与所述蓝牙设备进行数据传输,通过所述时间长度内的平均传输速率更新上述第二速率参数;
    比对所述第一速率参数及所述第二速率参数;
    若所述第一速率参数小于所述第二速率参数,则更新所述第一速率参数、所述第一连接间隔参数及所述第二连接间隔参数,并返回执行所述基于所述第二连接间隔参数,在预设的时间长度内与所述蓝牙设备进行数据传输,通过所述时间长度内的平均传输速率更新上述第二速率参数的步骤及后续步骤;
    若所述第一速率参数大于或等于所述第二速率参数,则基于所述第一连接间隔参数,保持与所述蓝牙设备的蓝牙连接。
  2. 如权利要求1所述的数据传输方法,其特征在于,在所述建立与蓝牙设备的蓝牙连接之后,所述数据传输方法还包括:
    检测所述电子设备是否为初次与所述蓝牙设备建立蓝牙连接;
    相应地,所述创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,包括:
    若所述电子设备为初次与所述蓝牙设备建立蓝牙连接,则创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;
    若所述电子设备非初次与所述蓝牙设备建立蓝牙连接,则获取所述蓝牙设备的设备识别码,并基于所述设备识别码在所述电子设备的本地查找与所述设备识别码相关联的第一连接间隔参数,以基于所述第一连接间隔参数实现与所述蓝牙设备的数据传输。
  3. 如权利要求2所述的数据传输方法,其特征在于,在所述基于所述第一连接间隔参数,保持与所述蓝牙设备的蓝牙连接之后,所述数据传输方法还包括:
    获取所述蓝牙设备的设备识别码;
    建立所述第一连接间隔参数与所述设备识别码的关联关系;
    存储所述关联关系。
  4. 如权利要求1所述的数据传输方法,其特征在于,在所述建立与蓝牙设备的蓝牙连接之后,所述数据传输方法还包括:
    检测所述电子设备及所述蓝牙设备是否支持预设的第一蓝牙版本;
    若所述电子设备及所述蓝牙设备均支持预设的第一蓝牙版本,则通过设定预设的第一标志位启动高速编码功能,以实现物理层的高速编码,并通过设定预设的第二标志位启动数据长度扩展功能。
  5. 如权利要求4所述的数据传输方法,其特征在于,在所述检测所述电子设备及所述蓝牙设备是否支持预设的第一蓝牙版本之后,所述数据传输方法还包括:
    若所述电子设备和/或所述蓝牙设备不支持预设的第一蓝牙版本,则检测所述电子设备及所述蓝牙设备是否支持预设的第二蓝牙版本,其中,所述第二蓝牙版本低于所述第一蓝牙版本;
    若所述电子设备及所述蓝牙设备均支持预设的第二蓝牙版本,则通过设定所述第二标志位启动数据长度扩展功能。
  6. 如权利要求1所述的数据传输方法,其特征在于,在建立与蓝牙设备的蓝牙连接之后,所述数据传输方法还包括:
    获取所述蓝牙设备所支持的最大传输单元的尺寸,作为目标尺寸,所述目标尺寸用于指示所述电子设备向所述蓝牙设备所传输的数据包的大小。
  7. 如权利要求1所述的数据传输方法,其特征在于,所述第一速率参数、所述第二速率参数及所述第一连接间隔参数均被初始化为0,所述第二连接间隔参数被初始化为预设的连接间隔参数最小值。
  8. 如权利要求1至7任一项所述的数据传输方法,其特征在于,所述更新所述第一速率参数、所述第一连接间隔参数及所述第二连接间隔参数,包括:
    基于所述第二速率参数,更新所述第一速率参数;
    基于所述第二连接间隔参数,更新所述第一连接间隔参数;
    基于预设的连接间隔单位值,更新所述第二连接间隔参数。
  9. 如权利要求8所述的数据传输方法,其特征在于,所述基于所述第二速率参数,更新所述第一速率参数,包括:
    将所述第二速率参数的值赋予所述第一速率参数,以使得更新后的所述第一速率参数的值等于所述第二速率参数的值;
    所述基于所述第二连接间隔参数,更新所述第一连接间隔参数,包括:
    将所述第二连接间隔参数的值赋予所述第一连接间隔参数,以使得更新后的所述第一连接间隔参数的值等于所述第二速率参数的值;
    所述基于预设的连接间隔单位值,更新所述第二连接间隔参数,包括:
    将所述第二连接间隔参数的值加上所述连接间隔单位值,得到更新后的第二连接间隔参数。
  10. 一种数据传输装置,其特征在于,所述数据传输装置应用于具备蓝牙功能的电子设备,所述数据传输装置包括:
    连接建立单元,用于建立与蓝牙设备的蓝牙连接;
    参数创建单元,用于创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,所述第一速率参数用于记录最大传输速率,所述第二速率参数用于指示数据传输过程中的平均传输速率,所述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,所述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
    第一更新单元,用于基于所述第二连接间隔参数,在预设的时间长度内与所述蓝牙设备进行数据传输,通过所述时间长度内的平均传输速率更新上述第二速率参数;
    参数比对单元,用于比对所述第一速率参数及所述第二速率参数;
    第二更新单元,用于若所述第一速率参数小于所述第二速率参数,则更新所述第一速率参数、所述第一连接间隔参数及所述第二连接间隔参数,并触发执行上述第一更新单元;
    连接保持单元,用于若所述第一速率参数大于或等于所述第二速率参数,则基于所述第一连接间隔参数,保持与所述蓝牙设备的蓝牙连接。
  11. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如下步骤:
    建立与蓝牙设备的蓝牙连接;
    创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,其中,所述第一速率参数用于记录最大传输速率,所述第二速率参数用于指示数据传输过程中的平均传输速率,所述第一连接间隔参数用于记录与第一速率参数相关的连接间隔,所述第二连接间隔参数用于动态调整数据传输过程中所采用的连接间隔;
    基于所述第二连接间隔参数,在预设的时间长度内与所述蓝牙设备进行数据传输,通过所述时间长度内的平均传输速率更新上述第二速率参数;
    比对所述第一速率参数及所述第二速率参数;
    若所述第一速率参数小于所述第二速率参数,则更新所述第一速率参数、所述第一连接间隔参数及所述第二连接间隔参数,并返回执行所述基于所述第二连接间隔参数,在预设的时间长度内与所述蓝牙设备进行数据传输,通过所述时间长度内的平均传输速率更新上述第二速率参数的步骤及后续步骤;
    若所述第一速率参数大于或等于所述第二速率参数,则基于所述第一连接间隔参数,保持与所述蓝牙设备的蓝牙连接。
  12. 如权利要求11所述的电子设备,其特征在于,在所述建立与蓝牙设备的蓝牙连接之后,所述处理器执行所述计算机程序时还实现以下步骤:
    检测所述电子设备是否为初次与所述蓝牙设备建立蓝牙连接;
    相应地,所述创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数,包括:
    若所述电子设备为初次与所述蓝牙设备建立蓝牙连接,则创建并初始化第一速率参数、第二速率参数、第一连接间隔参数及第二连接间隔参数;
    若所述电子设备非初次与所述蓝牙设备建立蓝牙连接,则获取所述蓝牙设备的设备识别码,并基于所述设备识别码在所述电子设备的本地查找与所述设备识别码相关联的第一连接间隔参数,以基于所述第一连接间隔参数实现与所述蓝牙设备的数据传输。
  13. 如权利要求12所述的电子设备,其特征在于,在所述基于所述第一连接间隔参数,保持与所述蓝牙设备的蓝牙连接之后,所述处理器执行所述计算机程序时还实现以下步骤:
    获取所述蓝牙设备的设备识别码;
    建立所述第一连接间隔参数与所述设备识别码的关联关系;
    存储所述关联关系。
  14. 如权利要求11所述的电子设备,其特征在于,在所述建立与蓝牙设备的蓝牙连接之后,所述处理器执行所述计算机程序时还实现以下步骤:
    检测所述电子设备及所述蓝牙设备是否支持预设的第一蓝牙版本;
    若所述电子设备及所述蓝牙设备均支持预设的第一蓝牙版本,则通过设定预设的第一标志位启动高速编码功能,以实现物理层的高速编码,并通过设定预设的第二标志位启动数据长度扩展功能。
  15. 如权利要求14所述的电子设备,其特征在于,在所述检测所述电子设备及所述蓝牙设备是否支持预设的第一蓝牙版本之后,所述处理器执行所述计算机程序时还实现以 下步骤:
    若所述电子设备和/或所述蓝牙设备不支持预设的第一蓝牙版本,则检测所述电子设备及所述蓝牙设备是否支持预设的第二蓝牙版本,其中,所述第二蓝牙版本低于所述第一蓝牙版本;
    若所述电子设备及所述蓝牙设备均支持预设的第二蓝牙版本,则通过设定所述第二标志位启动数据长度扩展功能。
  16. 如权利要求11所述的电子设备,其特征在于,在建立与蓝牙设备的蓝牙连接之后,所述处理器执行所述计算机程序时还实现以下步骤:
    获取所述蓝牙设备所支持的最大传输单元的尺寸,作为目标尺寸,所述目标尺寸用于指示所述电子设备向所述蓝牙设备所传输的数据包的大小。
  17. 如权利要求11所述的电子设备,其特征在于,所述处理器执行所述计算机程序时,所述第一速率参数、所述第二速率参数及所述第一连接间隔参数均被初始化为0,所述第二连接间隔参数被初始化为预设的连接间隔参数最小值。
  18. 如权利要求11至17任一项所述的电子设备,其特征在于,所述处理器执行所述计算机程序时,所述更新所述第一速率参数、所述第一连接间隔参数及所述第二连接间隔参数,包括:
    基于所述第二速率参数,更新所述第一速率参数;
    基于所述第二连接间隔参数,更新所述第一连接间隔参数;
    基于预设的连接间隔单位值,更新所述第二连接间隔参数。
  19. 如权利要求18所述的电子设备,其特征在于,所述处理器执行所述计算机程序时,所述基于所述第二速率参数,更新所述第一速率参数,包括:
    将所述第二速率参数的值赋予所述第一速率参数,以使得更新后的所述第一速率参数的值等于所述第二速率参数的值;
    所述基于所述第二连接间隔参数,更新所述第一连接间隔参数,包括:
    将所述第二连接间隔参数的值赋予所述第一连接间隔参数,以使得更新后的所述第一连接间隔参数的值等于所述第二速率参数的值;
    所述基于预设的连接间隔单位值,更新所述第二连接间隔参数,包括:
    将所述第二连接间隔参数的值加上所述连接间隔单位值,得到更新后的第二连接间隔参数。
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述方法的步骤。
PCT/CN2021/073078 2020-02-25 2021-01-21 一种数据传输方法、数据传输装置及电子设备 WO2021169687A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21760480.0A EP4099736B1 (en) 2020-02-25 2021-01-21 Data transmission method and electronic device
US17/866,004 US20220353932A1 (en) 2020-02-25 2022-07-15 Data transmission method, data transmission apparatus, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010116692.1 2020-02-25
CN202010116692.1A CN111328059B (zh) 2020-02-25 2020-02-25 一种数据传输方法、数据传输装置及电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/866,004 Continuation US20220353932A1 (en) 2020-02-25 2022-07-15 Data transmission method, data transmission apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2021169687A1 true WO2021169687A1 (zh) 2021-09-02

Family

ID=71171230

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073078 WO2021169687A1 (zh) 2020-02-25 2021-01-21 一种数据传输方法、数据传输装置及电子设备

Country Status (4)

Country Link
US (1) US20220353932A1 (zh)
EP (1) EP4099736B1 (zh)
CN (1) CN111328059B (zh)
WO (1) WO2021169687A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115441997A (zh) * 2022-08-30 2022-12-06 京东方科技集团股份有限公司 数据的传输方法、装置、存储介质及电子设备

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111328059B (zh) * 2020-02-25 2023-01-06 Oppo广东移动通信有限公司 一种数据传输方法、数据传输装置及电子设备
CN113157300A (zh) * 2021-05-19 2021-07-23 深圳Tcl新技术有限公司 一种数据处理方法、装置和存储介质
CN112969169A (zh) * 2021-05-19 2021-06-15 北京百瑞互联技术有限公司 一种低功耗蓝牙通信流控方法、系统、存储介质及设备
CN113965915B (zh) * 2021-10-14 2024-03-29 维沃移动通信有限公司 数据处理方法和电子设备
CN115022852B (zh) * 2021-12-16 2023-10-20 荣耀终端有限公司 控制蓝牙传输速率的方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801501B1 (en) * 1999-09-14 2004-10-05 Nokia Corporation Method and apparatus for performing measurement-based admission control using peak rate envelopes
CN102204327A (zh) * 2008-11-07 2011-09-28 株式会社Ntt都科摩 便携无线通信终端以及无线通信方法
CN107000687A (zh) * 2014-09-29 2017-08-01 莱尔德无线技术(上海)有限公司 远程信息处理装置和用于车辆超速检测的方法
CN108011780A (zh) * 2017-12-01 2018-05-08 北京百度网讯科技有限公司 一种数据传输速率测量方法、装置、设备和计算机可读介质
CN111328059A (zh) * 2020-02-25 2020-06-23 Oppo广东移动通信有限公司 一种数据传输方法、数据传输装置及电子设备

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09153000A (ja) * 1995-11-30 1997-06-10 Matsushita Electric Ind Co Ltd パラメータ設定装置
US8737917B2 (en) * 2009-07-24 2014-05-27 Broadcom Corporation Method and system for a dual-mode bluetooth low energy device
US20160014550A1 (en) * 2014-07-09 2016-01-14 Samsung Electronics Co., Ltd. Method of dynamically managing ble communications in wireless communication network and system thereof
KR102583750B1 (ko) * 2015-03-03 2023-09-26 오팡가 네트웍스, 인크. 데이터 흐름을 페이스 조정하기 위한 시스템 및 방법
CN106332132B (zh) * 2015-07-03 2021-05-04 中兴通讯股份有限公司 一种自适应式蓝牙性能调节的通讯终端及方法
CN105451369B (zh) * 2015-12-04 2018-10-19 小米科技有限责任公司 低功耗蓝牙设备的连接参数更新方法及装置
CN105978663B (zh) * 2016-05-11 2020-10-16 北京小米移动软件有限公司 数据传输方法及装置
US11246176B2 (en) * 2017-06-01 2022-02-08 Carrier Corporation Bluetooth™ low energy data transfer communication system and method
US10149340B1 (en) * 2017-07-18 2018-12-04 Thales Avionics, Inc. Slave bluetooth device switching between active bluetooth connections with different master bluetooth devices
CN110248341A (zh) * 2018-03-08 2019-09-17 华为技术有限公司 传输速率切换方法、蓝牙设备及计算机可读介质
TWI659638B (zh) * 2018-04-13 2019-05-11 瑞昱半導體股份有限公司 可維持與遠端藍牙裝置之間的藍牙信號品質的多成員藍牙網路以及相關的主藍牙電路與副藍牙電路
DE102018206785A1 (de) * 2018-05-03 2019-11-07 Audi Ag Datenübertragung mittels des Bluetooth Low Energy (BLE)-Standards
CN109104714B (zh) * 2018-09-12 2020-01-10 江苏盖睿健康科技有限公司 一种应用于心电测量仪中的蓝牙连接间隔动态调整方法
CN109275131B (zh) * 2018-09-25 2021-08-24 Oppo广东移动通信有限公司 蓝牙通信方法和终端设备
CN110337095B (zh) * 2019-06-10 2022-06-10 深圳市豪恩声学股份有限公司 音频聆听设备的参数更新方法、装置及音频聆听设备
US11032766B2 (en) * 2019-06-14 2021-06-08 Silicon Laboratories Inc. Wire-free bluetooth communication system with fast pairing
KR20210017327A (ko) * 2019-08-07 2021-02-17 삼성전자주식회사 전자 장치 간의 빠른 통신을 위한 방법 및 장치
CN112822663B (zh) * 2019-10-31 2022-06-14 华为技术有限公司 蓝牙连接方法及相关装置
US11190920B2 (en) * 2020-03-26 2021-11-30 Ademco Inc. Bluetooth using secondary channel
US11259365B2 (en) * 2020-07-09 2022-02-22 Cassia Networks Inc. Method and system for multiple wireless connection optimization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801501B1 (en) * 1999-09-14 2004-10-05 Nokia Corporation Method and apparatus for performing measurement-based admission control using peak rate envelopes
CN102204327A (zh) * 2008-11-07 2011-09-28 株式会社Ntt都科摩 便携无线通信终端以及无线通信方法
CN107000687A (zh) * 2014-09-29 2017-08-01 莱尔德无线技术(上海)有限公司 远程信息处理装置和用于车辆超速检测的方法
CN108011780A (zh) * 2017-12-01 2018-05-08 北京百度网讯科技有限公司 一种数据传输速率测量方法、装置、设备和计算机可读介质
CN111328059A (zh) * 2020-02-25 2020-06-23 Oppo广东移动通信有限公司 一种数据传输方法、数据传输装置及电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4099736A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115441997A (zh) * 2022-08-30 2022-12-06 京东方科技集团股份有限公司 数据的传输方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
EP4099736A1 (en) 2022-12-07
EP4099736B1 (en) 2024-05-29
US20220353932A1 (en) 2022-11-03
CN111328059A (zh) 2020-06-23
EP4099736A4 (en) 2023-06-07
CN111328059B (zh) 2023-01-06

Similar Documents

Publication Publication Date Title
WO2021169687A1 (zh) 一种数据传输方法、数据传输装置及电子设备
WO2020164520A1 (zh) 数据包分流方法、装置、移动终端及存储介质
US11696207B2 (en) Data transmission method, electronic device, and computer readable storage medium
KR100584443B1 (ko) 소프트웨어 콤포넌트 다운로드 관리 기능을 가지는 이동 단말기와 그 방법
US11146362B2 (en) Internet of things data transmission method, device and system
CN104754003B (zh) 传输数据的方法及系统
CN108040367A (zh) 一种ue位置区域更新方法、接入网实体、ue及核心网实体
CN105847168A (zh) 一种数据传输的方法、网络服务器、用户终端及系统
KR20160045635A (ko) 통신용 논리 채널을 이용한 전자 장치
CN107222372A (zh) 一种信息发送方法和设备
CN107517306B (zh) 资源配置方法及相关产品
CN108696848B (zh) 用于短距离通信的电子设备及其覆盖补偿方法
WO2019201025A1 (zh) Olt端口的配置信息的处理方法、装置及存储介质
KR100656521B1 (ko) 단말의 오퍼레이션 파라메터 변경시스템 및 그 방법
US20220078595A1 (en) Method and apparatus for back-connecting bluetooth device, terminal and computer-readable storage medium
WO2021012328A1 (zh) 智能设备与路由器自动连接的方法、路由器及智能设备
JP2008537868A (ja) カードアプリケーションツールキットにより性能コンフィギュレーションパラメータを用いて通信セッションの開始を要求する装置及び方法
WO2021239032A1 (zh) 蓝牙协议连接方法、装置、存储介质及相关设备
KR20210137702A (ko) 전자 장치 및 전자 장치에서 수신된 데이터 패킷을 처리하는 방법
TW201933832A (zh) 通訊方法及裝置和電子設備
WO2020224418A1 (zh) WiFi信道干扰的解决方法及相关产品
WO2018170835A1 (zh) 一种上行数据传输方法、终端、网络侧设备及系统
CN113825123A (zh) 通信方法、装置、电子设备及计算机存储介质
CN112839326A (zh) 网络切换方法、装置、存储介质及网关设备
WO2021189656A1 (zh) 一种升级方法、头戴设备、存储介质及电子装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21760480

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021760480

Country of ref document: EP

Effective date: 20220902

NENP Non-entry into the national phase

Ref country code: DE