WO2022155769A1 - Data transmission method, first chip, electronic device and storage medium - Google Patents

Data transmission method, first chip, electronic device and storage medium Download PDF

Info

Publication number
WO2022155769A1
WO2022155769A1 PCT/CN2021/072627 CN2021072627W WO2022155769A1 WO 2022155769 A1 WO2022155769 A1 WO 2022155769A1 CN 2021072627 W CN2021072627 W CN 2021072627W WO 2022155769 A1 WO2022155769 A1 WO 2022155769A1
Authority
WO
WIPO (PCT)
Prior art keywords
chip
working mode
standard
channel
data transmission
Prior art date
Application number
PCT/CN2021/072627
Other languages
French (fr)
Chinese (zh)
Inventor
郭仕林
Original Assignee
深圳市汇顶科技股份有限公司
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 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2021/072627 priority Critical patent/WO2022155769A1/en
Publication of WO2022155769A1 publication Critical patent/WO2022155769A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/69Spread spectrum techniques
    • H04B1/713Spread spectrum techniques using frequency hopping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/69Spread spectrum techniques
    • H04B1/713Spread spectrum techniques using frequency hopping
    • H04B1/715Interference-related aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B17/00Monitoring; Testing
    • H04B17/30Monitoring; Testing of propagation channels
    • H04B17/382Monitoring; Testing of propagation channels for resource allocation, admission control or handover
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • 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

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a data transmission method, a first chip, an electronic device and a storage medium.
  • the current low-power Bluetooth (Bluetooth Low Energy, BLE) works in the 2400Mhz-2480Mhz frequency band range specified by the standard Bluetooth protocol, with 2Mhz as a step, the entire working frequency band is divided into 40 channels, between 40 channels It is difficult to transmit data in a frequency hopping manner, which is difficult to meet the data transmission requirements in different scenarios.
  • the purpose of some embodiments of this application is to provide a data transmission method, a first chip, an electronic device and a storage medium, so that the transmission requirements in different scenarios can be met while being compatible with the existing standard Bluetooth protocol.
  • An embodiment of the present application provides a data transmission method, which is applied to a first chip.
  • the working modes supported by the first chip and the second chip during data transmission include a standard working mode and a non-standard working mode; the standard working mode The working mode is a working mode in which data is transmitted with the second chip in a frequency hopping manner between standard channels based on the standard Bluetooth protocol; the non-standard working mode includes any one or a combination of the following: A first working mode in which the second chip transmits data; wherein, the first fixed channel is one of the standard channels; data is transmitted with the second chip in a frequency hopping manner between the extended extended channels The second working mode of the device; the third working mode of transmitting data with the second chip in the designated second fixed channel; wherein, the second fixed channel is one of the extended extended channels; A fourth working mode in which data is transmitted with the second chip in a frequency hopping manner between the standard channel of the protocol and the extended extension channel.
  • Embodiments of the present application further provide a first chip, where the first chip is located in an electronic device and is connected to a memory in the electronic device, and the memory stores instructions that can be executed by the first chip, so The instruction is executed by the first chip, so that the first chip can execute the data transmission method applied to the first chip as described above.
  • Embodiments of the present application further provide an electronic device, including: the above-mentioned first chip, and a memory connected to the first chip.
  • Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned data transmission method is implemented.
  • the working modes supported by the first chip and the second chip during data transmission include standard working modes and non-standard working modes, that is, the first chip and the second chip can support different working modes, which is conducive to satisfying Data transmission requirements in different scenarios.
  • the standard working mode is a working mode in which data is transmitted between the standard channels based on the standard Bluetooth protocol and the second chip in a frequency hopping manner, that is, the first chip and the second chip can be compatible with the existing standard Bluetooth protocol while supporting other
  • the non-standard working mode is beneficial to expand the scope of application of the first chip and the second chip while meeting the data transmission requirements in different scenarios, so that the audience of the first chip and the second chip is wider.
  • the first working mode of transmitting data with the second chip in the designated first fixed channel is conducive to meeting the data transmission requirements in the scenario where a certain channel needs to be customized in the standard channel for data transmission, and is also conducive to improving the efficiency of data transmission. efficiency.
  • the second working mode of transmitting data with the second chip in a frequency hopping manner between the extended extended channels is beneficial to meet the data transmission requirements in the scenario where frequency hopping in the extended channel is required, and is also beneficial to avoid the ITU radio Interference in the unlicensed ISM band used by the three major institutions of Industry, Science, and Medicine (ISM) by the Communications Bureau to improve the stability of data transmission.
  • the third working mode of transmitting data with the second chip in the designated second fixed channel is conducive to meeting the data transmission requirements in the scenario where a certain channel needs to be customized in the extended channel for data transmission, and is also conducive to improving data transmission. While avoiding the interference of the ISM frequency band to improve the stability of data transmission.
  • the method includes: if a preset trigger condition is satisfied, sending a switching instruction to the second chip; wherein the switching instruction carries a switching time point and a target working mode, the switching instruction is used to instruct the second chip to switch the current working mode of the second chip to the target working mode at the switching time point; The current working mode of the chip is switched to the target working mode; wherein, the current working mode and the target working mode are two different working modes among the standard working mode and the non-standard working mode.
  • the first chip and the second chip are switched to the same working mode at the same time point, which is beneficial to meet the data transmission requirements of different scenarios and ensure that the switching between the first chip and the second chip after the working mode is switched.
  • the non-standard working mode includes the second working mode and/or the third working mode
  • the triggering condition includes: determining that the first chip is in a state where a Bluetooth connection has been established with the second chip and has not been The state of Bluetooth pairing; the target working mode is the second working mode or the third working mode.
  • the pairing parties need to exchange secret keys.
  • since most of the third-party monitoring devices support the standard Bluetooth protocol it is easy to monitor the working frequency band of the standard Bluetooth protocol, so it is easy to steal the process of Bluetooth pairing. 's secret key.
  • the pairing parties switch the working mode, so that when the Bluetooth pairing is performed, the frequency point of the communication between the pairing parties can jump out of the standard frequency band of the standard Bluetooth protocol.
  • the second working mode or the third working mode will not use the standard frequency band of the standard Bluetooth protocol, which can avoid being monitored by a third-party monitoring device, thereby avoiding the theft of the secret key in the process of Bluetooth pairing, which is conducive to improving the Security during pairing.
  • the working mode before the handover is the standard working mode.
  • the extended frequency band is not an unlicensed ISM frequency band open to the three major institutions of industry, science and medicine for use by the International Communications Union Radiocommunication Bureau, it may be occupied for a long time. This results in a waste of resources. Therefore, after the pairing is completed, the standard working mode or the first working mode is restored, that is, the working mode that does not occupy the extended frequency band, which can improve the pairing security and reduce the waste of resources.
  • the non-standard working mode includes any one or a combination of the following: the second working mode, the third working mode, and the fourth working mode; the standard channel is obtained by dividing the standard frequency band, the The extended channel is obtained by dividing the extended extended frequency band; the standard frequency band corresponds to an upper limit frequency and a lower limit frequency, the extended frequency band includes a first frequency band and a second frequency band, and the frequencies in the first frequency band are all less than the lower limit frequency, The frequencies in the second frequency band are all greater than the upper limit frequency.
  • the upper limit frequency as the reference, the higher the frequency, the worse the communication quality may be, and the lower limit frequency as the reference, the lower the frequency is, the lower the communication quality may be.
  • this application implements For example, in order to expand the same number of channels, the scheme of expanding the first frequency band and the second frequency band, compared with the scheme of expanding only one frequency band, is conducive to maintaining the communication quality at a relative level while increasing the number of expanded channels. within the range of balance.
  • the number of each standard channel divided based on the standard frequency band is a continuous number, and the continuous number includes an initial number and a termination number; the number of the channel divided based on the first frequency band, as the frequency decreases The initial number decreases sequentially based on the reference; the number of the channels divided based on the second frequency band increases sequentially with the termination number as the reference as the frequency increases.
  • the standard channels already have consecutive numbers in the related art, in the embodiment of the present application, the standard channels and the extended channels can be consecutively numbered without renumbering the standard channels, which is convenient to adapt to the existing channel numbering specifications, and the operation efficiency is improved.
  • the speed is faster, that is, the channel after frequency hopping can be determined more quickly, thereby improving the speed of data transmission between chips.
  • the existing adaptive frequency hopping algorithm is performed in the case of continuous numbering
  • the continuous numbering between the extended channel and the standard channel in the present application also facilitates adaptation to the existing adaptive frequency hopping algorithm.
  • FIG. 1 is a flowchart of determining a channel after frequency modulation according to an embodiment of the present application
  • Fig. 2 is a block diagram of determining the number of the channel after frequency hopping according to an embodiment of the present application
  • FIG. 3 is a flowchart of a data transmission method according to an embodiment of the present application when the first chip is a chip that sends a switching instruction;
  • FIG. 4 is a flowchart of a data transmission method when the first chip in an embodiment of the present application is a chip that receives a switching instruction;
  • FIG. 5 is a schematic diagram of data transmission performed by the first chip and the second chip in an embodiment of the present application
  • FIG. 6 is a flowchart of a data transmission method when the first chip is a chip that sends a switching instruction according to an example in the embodiments of the present application;
  • FIG. 7 is a flowchart of a data transmission method according to another example in the embodiments of the present application, when the first chip is a chip that receives a switching instruction;
  • FIG. 8 is an interaction flow diagram between the first chip and the second chip according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the embodiments of the present application relate to a data transmission method, which is applied to a first chip.
  • the data transmission in the embodiments of the present application mainly refers to the data transmission between the first chip and the second chip.
  • the first chip is arranged in the master device, and the second chip is arranged in the slave device; or, the first chip is arranged in the slave device, and the second chip is arranged in the master device. That is to say, among the first chip and the second chip, one of them is set in the master device, and the other is set in the slave device, and the data transmission between the first chip and the second chip can also be understood as the master device and the slave device.
  • Both the first chip and the second chip may be Bluetooth chips.
  • the working modes supported by the first chip and the second chip during data transmission include a standard working mode and a non-standard working mode. That is to say, the working modes of the first chip and the second chip include: a standard working mode and a non-standard working mode.
  • the standard working mode and non-standard working mode are described in detail below:
  • the standard working mode is a working mode in which data is transmitted with the second chip in a frequency hopping manner between standard channels based on the standard Bluetooth protocol.
  • the standard frequency band of the existing standard Bluetooth protocol is the 2.4G ISM frequency band, that is, 2400Mhz-2480Mhz, with a total of 80Mhz.
  • the channels are divided according to the 2Mhz width to obtain 40 standard channels.
  • the standard working mode can be understood as the working mode used by the existing low-power Bluetooth technology, that is, the working mode of adaptive frequency hopping between the standard frequency bands specified by the standard Bluetooth protocol, that is, in the above 40 standard channels.
  • the working mode of adaptive frequency hopping between them are described by the existing low-power Bluetooth technology.
  • the adaptive frequency hopping refers to that the first chip and the second chip continuously update the channel used for communication between the two parties according to the same adaptive frequency hopping algorithm.
  • the adaptive frequency hopping method may be implemented based on the adaptive frequency hopping algorithm specified in the Bluetooth core protocol Core_v5.2, which is not described in detail in this embodiment.
  • the non-standard working mode is a working mode based on a self-defined private protocol, including any one of the following or a combination thereof: a first working mode in which data is transmitted with the second chip in the specified first fixed channel; wherein the first A fixed channel is one of the standard channels.
  • a second working mode in which data is transmitted with the second chip in a frequency hopping manner between the extended extension channels.
  • the first chip and the second chip transmit data in a designated first fixed channel
  • the first fixed channel is one of the standard channels, that is, one of the above 40 standard channels.
  • Transmission of data in the specified first fixed channel can be understood as the first chip and the second chip have been transmitting data in the first fixed channel within a preset period of time, that is, the channel for transmitting data within the preset period of time is not will change.
  • the applicable scenarios of the first working mode may include, but are not limited to: within a preset range, the number of devices that need to transmit data is less than the preset number.
  • the preset range and the preset number can be set according to actual needs, for example, the preset range can be within 5 meters or within one room. That is to say, in the scenario where there are few devices within the preset range, each device can be assigned a channel, and each device can transmit data in the designated channel. In the case of a small number of devices, 40 standard channels are enough to specify, which is conducive to improving data transmission. efficiency.
  • the first fixed channel can be selected by those skilled in the art from multiple standard channels according to actual needs, which is beneficial to realize the customization of the channels.
  • an application program interface Application Program Interface, API
  • API Application Program Interface
  • the first fixed channel can also be uniformly assigned and designated by the central device according to the connection conditions between the devices, which is beneficial to automatically and reasonably realize the designation of the channel.
  • a device can be pre-designated as the central device, and the central device can be used to coordinate the allocation and use of channels, and allocate channels for each device in the Bluetooth low energy network, so that There is no interference in data transmission between devices.
  • multiple devices under the Bluetooth low energy network include the central device, device 1 to device 8, and the central device determines that device 1 has established Bluetooth connections with devices 2, 3, and 4, respectively, that is, device 1 will communicate with devices 2, 3, and 4 respectively. 4 for data transmission.
  • the central device determines that the device 5 has established a Bluetooth connection with the devices 6, 7, and 8 respectively, that is, the device 5 will perform data transmission with the devices 6, 7, and 8. Then the designated result of the channel designation performed by the central device for each device may be: channel 1, channel 2, and channel 3 are respectively designated for data transmission between device 1 and devices 2, 3, and 4; for device 5 and devices 6, 7 Channel 4, Channel 5, and Channel 6 are designated for data transmission between , 8, respectively, to ensure that the data transmission between each device does not interfere with each other, and the communication quality is higher.
  • the above-mentioned device 1 may be provided with a first chip, and devices 2, 3, and 4 may be provided with a second chip respectively, and the central device may send the designation result for the device 1 to the first chip, so that the device 1 can be based on the received designation. As a result, it is determined which channels should be used for data transmission with devices 2, 3, and 4, respectively.
  • the device 1 itself can also have the function of the central device, that is, the device 1 can also be used as the central device. At this time, the device 1 can directly determine which channels should be used for data transmission with the devices 2, 3, and 4 respectively.
  • the use state of the first fixed channel is set to allow Use, the use status of the other channels except the first fixed channel in the standard channel is set to be disabled.
  • 40 standard channels can be represented by 5Byte (40bit) 0xFFFFFFFF, setting 0 means that the usage status of the channel is disabled, and setting 1 means that the usage status of the channel is enabled.
  • the extended channels involved in these three working modes are first described below: the extended channels are obtained based on the extended extended frequency band division, and the extended frequency band is outside the 2.4G ISM frequency band. other frequency bands.
  • the extended extended frequency band may include: a first frequency band and a second frequency band.
  • the standard frequency band based on the standard Bluetooth protocol corresponds to an upper limit frequency and a lower limit frequency, the frequencies in the first frequency band are all less than the lower limit frequency, and the frequencies in the second frequency band are all greater than the upper limit frequency.
  • the upper limit frequency as the reference, the higher the frequency, the worse the communication quality may be, and the lower limit frequency as the reference, the lower the frequency, the lower the communication quality may be. Therefore, in order to extend the Compared with the scheme of expanding only one frequency band, the scheme of extending the first frequency band and the second frequency band with the same number of channels is beneficial to maintain the communication quality in a relatively balanced range while increasing the number of channels to be expanded.
  • the standard frequency band specified by the standard Bluetooth protocol is [2400Mhz, 2480Mhz]
  • the first frequency band is 2360Mhz to 2400Mhz
  • the second frequency band is 2480Mhz to 2520Mhz.
  • the first frequency band can be expressed as [2360Mhz, 2400Mhz)
  • the second frequency band can be expressed as (2480Mhz, 2520Mhz].
  • the first and second frequency bands expanded in this example can be divided into 40 extended channels.
  • only one frequency band is expanded, in order to obtain 40 channels, only the frequency band [2320Mhz, 2400Mhz] may be expanded, or only the frequency band (2480Mhz, 2560Mhz) may be expanded. It can be seen that in order to expand out There are 40 channels. In this example, two frequency bands are expanded. Compared with the method of expanding only one frequency band, it is beneficial to increase the number of expanded channels while maintaining the communication quality within a relatively balanced range. .
  • the extended frequency band extended according to actual needs may also include only the first frequency band or only the second frequency band, which is beneficial to adapt to individual requirements in practical applications.
  • each standard channel and each extended channel may be set with numbers.
  • f the frequency (unit: Mhz)
  • K the number
  • K 0 ⁇ 39.
  • an extended extension channel is added, and the extension channel can be numbered on the basis of the numbers of the existing 40 standard channels.
  • the numbering rule may be: the number of the channels divided based on the first frequency band decreases sequentially with the initial number as the reference; for example, the channel less than 2400Mhz uses a negative number, which is -1 to -20 in sequence.
  • f is the frequency (unit: Mhz)
  • K is the number
  • the standard channels in the related art already have consecutive numbers
  • the standard channels and the extended channels can be consecutively numbered without renumbering the standard channels, which is convenient to adapt to the existing channel numbering specifications, The operation efficiency is higher and the speed is faster, that is, the channel after the frequency hopping can be determined more quickly, thereby improving the speed of data transmission between chips.
  • the existing adaptive frequency hopping algorithm is performed in the case of continuous numbering
  • the continuous numbering between the extended channel and the standard channel in the present application also facilitates adaptation to the existing adaptive frequency hopping algorithm.
  • the existing adaptive frequency hopping algorithm may be the channel selection algorithm 1 (Channel Selection algorithm#1) or the channel selection algorithm 2 (Channel Selection algorithm#2) specified in the Bluetooth core protocol Core_v5.2.
  • the standard channels can also be renumbered, that is, both the standard channels and the extended channels are numbered.
  • the first chip and the second chip transmit data in a frequency hopping manner between the extended extended channels.
  • the extended channels are channels numbered -1 to -20 and channels numbered 40 to 59, that is, the channels through which the first chip and the second chip transmit data within a preset period of time are numbered -1 to -20 and numbered 40 to 59.
  • 40 to 59 channels vary.
  • the applicable scenarios of the second working mode may include but are not limited to: the known interference of the ISM frequency band needs to be avoided, and there are multiple different networks within the preset range.
  • the first chip and the second chip work In the second working mode, it is beneficial to avoid the interference of the ISM frequency band, thereby improving the stability of data transmission.
  • the preset range can be set according to actual needs, such as within 5 meters or within 1 room.
  • the standard channel can be set to disabled.
  • the above-mentioned 80 channels numbered from -20 to 59 can be represented by 10Byte (80bit) 0xFFFFFFFFFFFFFFFFFFFF, and the usage status of the 40 standard channels numbered from 0 to 39 is set to disable, numbered from -20 to -1 and 40.
  • the usage status of 40 extended channels of ⁇ 59 is set to enable.
  • the first chip and the second chip transmit data in a designated second fixed channel
  • the second fixed channel is one of the extended channels, such as channels numbered -1 to -20 and channels numbered 40 to 59 one of the.
  • the transmission of data in the specified second fixed channel can be understood as the fact that the first chip and the second chip have been transmitting data in the second fixed channel within a preset period of time, that is, the channel for transmitting data within the preset period of time is not will change.
  • the applicable scenarios of the third working mode may include but are not limited to: the known interference of the ISM frequency band needs to be avoided, and there is one network within the preset range.
  • the first chip and the second chip work in the first Three working modes are beneficial to avoid the interference of the ISM frequency band, thereby improving the stability of data transmission.
  • the data is transmitted in the designated second fixed channel, it is also beneficial to improve the efficiency of data transmission.
  • the use status of the second fixed channel is set to allow use, and the use status of other channels in the extended channel except the second fixed channel is set to Set to disable.
  • the use state of the standard channel in the third working mode is also set to prohibit use.
  • the above 80 channels numbered from -20 to 59 can be represented by 10Byte (80bit) 0xFFFFFFFFFFFFFFFFFF, setting 0 to indicate that the channel's usage status is disabled, and setting 1 to indicate that the channel's usage status is enabled.
  • the designation method of the second fixed channel is similar to the designation method of the first fixed channel above, except that the designated range of the second fixed channel is the extended channel, and the designated range of the first fixed channel is the standard channel. Repeat, the designation manner of the second fixed channel will not be repeated here.
  • both communication parties perform adaptive frequency hopping on 40 standard channels, and cannot be assigned to a fixed channel. If multiple devices that need to perform data transmission hop to the same channel at the same time in the process of adaptive frequency hopping of 40 standard channels, it may cause interference to data transmission between devices and affect the efficiency of data transmission.
  • both parties in the communication are supported to work in the first working mode or the third working mode, and different channels can be specified for different devices, so that data transmission between multiple devices can be performed according to the specified fixed channel, that is, both parties in the communication can perform data transmission. Identifying which channel should be used for transmission is beneficial to avoid frequency hopping of multiple devices to the same channel during adaptive frequency hopping, thereby avoiding transmission interference between multiple devices and improving the efficiency of data transmission.
  • the first chip and the second chip transmit data in a frequency hopping manner between the standard channel based on the standard Bluetooth protocol and the extended extended channel.
  • the frequency range of the channels is 2360Mhz-2520Mhz, a total of 160Mhz, which are divided into 80 channels, and the channel numbers are -20 to 59.
  • the first chip and the second chip can frequency hop between 80 channels numbered -20 to 59, that is, within a preset period of time, the channel through which the first chip and the second chip transmit data is Changes in channels numbered -20 to 59.
  • Applicable scenarios of the fourth working mode may include, but are not limited to: scenarios with high network density of Bluetooth low energy consumption.
  • multiple devices perform adaptive frequency hopping on 40 channels, and the pressure of data transmission is relatively high.
  • multiple devices are supported to perform adaptive frequency hopping on more than 40 channels (such as the above-mentioned 80 channels), and the data transmission pressure in the 40 channels is averaged in more channels, for example, an average of 80 In each channel, it is beneficial to ease data transmission, thereby improving the stability of data transmission to a certain extent, and can also support more devices in the same network topology for data transmission.
  • the expansion of channels is added in this embodiment, which is beneficial to improve the concurrent capacity of network communication, and can support more devices in the same network topology. Data transmission needs of multiple devices.
  • the first chip and the second chip work in the fourth working mode, for example, data transmission is performed in 80 channels numbered from -20 to 59 in an adaptive frequency hopping manner, and the usage status of the 80 channels is Both are set to allow the use of enable.
  • the common point of the second working mode and the fourth working mode is that both are a frequency hopping working mode, and the difference is that the frequency hopping range is different.
  • the frequency-hopping channel is determined in the following manner, referring to FIG. 1 , including:
  • Step 101 Determine a frequency hopping step value according to the access address allocated by the first chip to the second chip.
  • Step 102 Determine the channel after frequency hopping according to the frequency hopping step value and the total number of channels.
  • the total number of channels is the sum of the number of standard channels and the number of extended channels. It can be understood that when the first chip and the second chip perform data transmission in an adaptive frequency hopping manner, the channel after the frequency hopping will be determined. Therefore, the above steps 101 to 102 are the first chip and the second chip. The steps that are performed in the process of adaptive frequency hopping. The following describes the process of determining the channel after frequency hopping by the first chip:
  • the first chip assigns an access address Access Address to the second chip, and both the first chip and the second chip can store the access address.
  • the first chip determines the channel identifier channelIdentifier according to the access address.
  • the first chip determines the current connection event count value counter, and then determines the frequency hopping step value according to the channel identification code and the connection event count value.
  • the first chip performs a modulo operation on the frequency hopping step value A and the total number B of channels supported by the frequency hopping working mode, that is, A mod B, and determines the channel after the frequency hopping according to the result of the modulo operation.
  • FIG. 2 is a block diagram of determining the number of channels after frequency hopping.
  • the pseudo random number generator outputs the frequency hopping step value, and then the modulo operation is performed on the frequency hopping step value and 80. Get the number of the unmapped channel unmappedChannel. If the usage state of the unmapped channel is enable, the unmapped channel is directly used as the channel after frequency hopping; if the usage state of the unmapped channel is disabled, the hops are remapped in each channel whose usage state is enable. frequency channel.
  • the above adaptive frequency hopping process is equivalent to a further improvement of the channel selection algorithm 2 (Channel Selection algorithm#2) specified in the Bluetooth core protocol Core_v5.2.
  • the improvement lies in the original algorithm 2 used in mod 37, updated to mod 80, so that the output results fall within the range of 0 to 79 (corresponding to channels numbered -20 to 59).
  • the above-mentioned frequency hopping process is only taken as an example in the manners in FIGS. 1 and 2 , and is not limited to this in the specific implementation.
  • the first chip is the chip that sends the switching instruction
  • the second chip is the chip that receives the switching instruction.
  • the flowchart of the data transmission method applied to the first chip can refer to FIG. 3, including:
  • Step 301 If a preset trigger condition is satisfied, send a switching instruction to the second chip.
  • Step 302 Switch the current working mode of the first chip to the target working mode at the switching time point.
  • the switching instruction carries the switching time point and the target operating mode, and the switching instruction is used to instruct the second chip to switch the current operating mode of the second chip to the target operating mode at the switching time point. That is to say, the first chip and the second chip switch their respective current working modes to the target working modes at the same switching time point.
  • the first chip is the chip that receives the switching instruction
  • the second chip is the chip that sends the switching instruction.
  • Step 401 Receive a switching instruction sent by the second chip when a preset trigger condition is met.
  • Step 402 Switch the current working mode of the first chip to the target working mode at the switching time point.
  • the switching instruction carries the switching time point and the target working mode, and the second chip switches the current working mode of the second chip to the target working mode at the switching time point.
  • the current working mode and the target working mode mentioned in step 302 and step 402 are two different working modes in a standard working mode and a non-standard working mode.
  • the working modes supported by the first chip and the second chip include the standard working mode and the above-mentioned 4 non-standard working modes, that is, a total of 5 working modes are supported, and the current working mode and the target working mode are any of the 5 working modes. two kinds.
  • one of the two different operating modes is the standard operating mode. That is, either the current working mode is the standard working mode, or the target working mode is the standard working mode, that is, the first chip and the second chip can switch between the standard working mode and the non-standard working mode. Considering that the chips of most manufacturers support the standard working mode, such a switching method is beneficial to the chips produced by more manufacturers.
  • the current working mode is the standard working mode
  • the target working mode is any one of the first, second, third, and fourth working modes above.
  • the specific target working mode can be determined according to the actual scene in which the first chip and the second chip are located and the applicable scene of the above-mentioned four non-standard working modes. For example, if the actual scene in which the first chip and the second chip are located is a scene with high Bluetooth low energy network density, the target working mode is the fourth working mode.
  • the current working mode is any one of the four non-standard working modes
  • the target working mode is the standard working mode. That is, the working modes of the first chip and the second chip can be switched between the standard working mode and the non-standard working mode.
  • the first chip and the second chip not only support the standard Bluetooth protocol, but also support the newly added link control protocol, that is, the self-defined private protocol based on the non-standard working mode mentioned above.
  • the first chip may send a switching instruction to the second chip based on the newly added link control protocol, where the switching instruction may be a protocol data unit (Protocol Data Unit, PDU) data packet.
  • PDU Protocol Data Unit
  • the fields of the above-mentioned PDU data packet may include: an operation code (Operation Code, OPcode), a switching time point (instant), a sequence number (Mode) of a target working mode, and a number (Ch) of a designated channel.
  • Opera Code Opera Code
  • OPcode a switching time point
  • Mode sequence number
  • Ch number of a designated channel.
  • Operation code It is used to describe the part of the machine code in the machine language instruction that specifies the operation to be performed.
  • the value of OPcode in this embodiment is used to indicate that the PDU data packet is a switching command.
  • the value of OPcode can be selected from the values that have not been used in the standard Bluetooth protocol, so as to avoid conflicts with other instructions in the existing standard Bluetooth protocol; for example, the value of OPcode in this embodiment can be set to 0XDF.
  • the second chip may receive many PDU data packets. If the second chip recognizes that the OPcode value is 0XDF in a PDU data packet, it can be determined that the PDU data packet is actually a switching command.
  • Switching time point It is used to indicate at which time point the first chip and the second chip should switch the working mode together.
  • the switching time point is usually set to the current evt cnt+n, and evt cnt is the count value of the current communication times. , when the two chips just establish a communication connection, the count value of the current communication times is 0.
  • n can be set by those skilled in the art according to actual needs, for example, set to 6. In specific implementation, those skilled in the art can set the value of the above n through APIs provided externally by the first chip and the second chip.
  • the counter starts timing, and each time a communication interval elapses with a duration evt cnt+1, where the communication interval duration is a predetermined fixed value.
  • the current evt cnt+n can be understood as the time after the end of the nth communication interval in the future from the current time.
  • Mode The serial number of the target working mode (Mode):
  • the value of Mode can be: 0, 1, 2, 3, 4; where 0 represents the standard operating mode (referred to as Mode 0), and 1 represents the first operating mode (referred to as Mode 1) , 2 represents the second operating mode (referred to as mode 2), 3 represents the third operating mode (referred to as mode 3), and 4 represents the fourth operating mode (referred to as mode 4).
  • Ch Designated channel number (Ch): when the target working mode is the first working mode, Ch is the number of the first fixed channel; when the target working mode is the third working mode, Ch is the number of the second fixed channel. That is, if the target working mode is the first working mode, the switching instruction also carries the number of the first fixed channel; if the target working mode is the third working mode, the switching instruction also carries the number of the second fixed channel.
  • the field of the above-mentioned PDU data packet may not include the above-mentioned number (Ch) of the designated channel, It is beneficial to reduce the amount of data in the PDU data packet and improve the transmission efficiency of the PDU data packet, that is, the switching instruction.
  • the field of the above-mentioned PDU data packet may also include the above-mentioned number of the designated channel (Ch ), in this case, the value of the specified channel number (Ch) field can be ignored, that is, no matter what the value of the specified channel number (Ch) field is, the chip that receives the PDU data packet ignores this field value of .
  • the first working mode or the third working mode is added to the working modes of the first chip and the second chip according to actual needs, there is no need to add a field in the PDU data packet, which improves the increase of the first working mode or the third working mode.
  • the convenience of the working modes of one chip and the second chip is not include the first working mode or the third working mode.
  • the working modes of the first chip and the second chip include the above five types, namely mode 0, mode 1, mode 2, mode 3, and mode 4, and the fields of the PDU data packet include the above four fields.
  • the target working mode is Mode 0, Mode 2 or Mode 4
  • the chip that receives the PDU data packet can ignore the value of the specified channel number (Ch) field.
  • the switching of the operating modes between the first chip and the second chip may include: switching between mode 0 and mode 1, switching between mode 0 and mode 2, and switching between mode 0 and mode 3 , switching between mode 0 and mode 4, that is, switching between the standard working mode and the non-standard working mode, so that it can meet the data transmission requirements in different scenarios while being compatible with the standard Bluetooth protocol.
  • the first chip and the second chip can also be switched between different non-standard working modes.
  • the non-standard working mode includes at least any one or more of the second, third, and fourth working modes, that is, the extended channel and the standard channel coexist.
  • the following takes the output frequency supported by the first chip and the second chip as 2360Mhz to 2520Mhz, and the numbers of the divided channels are -20 to 59 as an example to illustrate:
  • the target working mode is mode 0, and the first chip and the second chip switch the current working mode to mode 0, which can be understood as: the first chip and the second chip will switch the number of 0 to 36 at the switching time point at the same time.
  • the usage status of the channel is set to enable, and the usage status of the channels numbered -20 to -1 and 37 to 59 is set to disable. Since the existing standard Bluetooth protocol stipulates that the three channels numbered 37 to 39 are channels used for broadcasting, during data transmission, the use state of the channels numbered 0 to 36 can be set to enable.
  • the first chip and the second chip perform data transmission between the channels numbered 0 to 36 in an adaptive frequency hopping manner from the switching time point.
  • the target working mode is Mode 1
  • the number of the first fixed channel is 20, and the first chip and the second chip switch the current working mode to Mode 1, which can be understood as: the first chip and the second chip are switching at the same time
  • the usage status of the channel numbered 20 is set to enable, and the usage status of the other channels with numbers (-20 to 19, 21 to 59) is set to disable.
  • the first chip and the second chip perform data transmission in the channel numbered 20 from the switching time point.
  • the target operating mode is mode 2
  • the first chip and the second chip switch the current operating mode to mode 2, which can be understood as: the first chip and the second chip will be numbered -20 ⁇ - at the switching time point at the same time.
  • the usage states of channels 1 and 40 to 59 are set to enable, and the usage states of the remaining channels (0 to 39) are all set to disable.
  • the first chip and the second chip perform data transmission in a frequency hopping manner between the channels numbered -20 to -1 and 40 to 59 from the switching time point.
  • the target operating mode is mode 4, and the first chip and the second chip switch the current operating mode to mode 4, which can be understood as: the first chip and the second chip will be numbered from -20 to 59 at the switching time point at the same time.
  • the usage status of the channel is set to enable.
  • the first chip and the second chip perform data transmission between the channels numbered -20 to 59 in an adaptive frequency hopping manner from the switching time point.
  • FIG. 5 For a schematic diagram of data transmission between the first chip and the second chip, reference may be made to FIG. 5 . It is assumed that the first chip is set in the master device, the second chip is set in the slave device, and the number of times between the first chip and the second chip is The output frequency range of the frequency converter is 2360Mhz ⁇ 2520Mhz.
  • the register can configure the output frequency of the frequency multiplier, and through the software configuration register, the frequency multiplier can output any frequency between 2360Mhz and 2520Mhz.
  • the software configuration register can control The frequency multiplier outputs 2442Mhz.
  • the first chip modulates the baseband signal to be sent, modulates the baseband signal to 2442Mhz, and then transmits the modulated signal into the air by the antenna of the main device.
  • the second chip After receiving the signal from the antenna of the device, the second chip performs a demodulation operation corresponding to the modulation operation of the first chip, thereby restoring the received signal to the baseband signal to be sent by the first chip.
  • the preset trigger condition is that the first chip receives preset trigger information.
  • the preset trigger message can be set according to actual needs, and the trigger information can carry the switching time point and the target working mode.
  • the target working mode is Mode 1
  • the trigger information can also carry the number of the designated channel.
  • Those skilled in the art can call the above-mentioned API, customize the switching time point and the target working mode according to actual needs, carry the customized switching time point and the target working mode in the trigger message and send it to the first chip.
  • the trigger information may be key information, touch information, and the like.
  • the following description takes the key information as an example: for example, the first chip is set in the main device, and the key information received by the first chip can be triggered by a key set on the main device.
  • the key information received by the first chip may also come from a slave device, and when the slave device detects that a key on the slave device is pressed, the slave device sends key information to the first chip.
  • the key information received by the first chip may also come from a third-party device other than the master device and the slave device. When the third-party device detects that a key on the third-party device is pressed, the key information is sent to the first chip.
  • the preset trigger condition may be: the first chip detects that it is currently in a high-density low-power Bluetooth network transmission scenario.
  • the manner in which the first chip detects a current high-density low-power Bluetooth network transmission scenario may be: in the process of the first chip detecting the current communication, the received signal strength indicator (Received signal strength indicator, RSSI) is greater than a preset strength threshold.
  • the duration is greater than the preset duration threshold, and the packet loss rate within the preset duration threshold is greater than the preset packet loss rate threshold.
  • the preset intensity threshold, preset duration threshold and preset packet loss rate threshold can be set according to actual needs, which are intended to indicate that the RSSI of the first chip is always strong in the current communication process, but packet loss always occurs. happening.
  • the target working mode is the fourth working mode suitable for the high-density transmission scenario of the Bluetooth low energy network.
  • the embodiments of the present application provide switchable working modes for the first chip and the second chip, which is beneficial to meet data transmission requirements in different scenarios.
  • the standard working mode is a working mode in which data is transmitted between the standard channels based on the standard Bluetooth protocol and the second chip in a frequency hopping manner, that is, the first chip and the second chip can be compatible with the existing standard Bluetooth protocol while supporting other
  • the non-standard working mode is beneficial to expand the scope of application of the first chip and the second chip while meeting the data transmission requirements in different scenarios, so that the audience of the first chip and the second chip is wider.
  • the first chip is the chip that sends the switching instruction
  • the second chip is the chip that receives the switching instruction.
  • the flowchart of the data transmission method applied to the first chip may be shown in FIG. 6 , including:
  • Step 601 It is determined that the first chip is in a state in which a Bluetooth connection has been established with the second chip and the Bluetooth pairing has not been performed, and a switching instruction is sent to the second chip.
  • Step 602 Switch the current working mode of the first chip to the target working mode at the switching time point.
  • the first chip is the chip that receives the switching instruction
  • the second chip is the chip that sends the switching instruction.
  • the flowchart of the data transmission method applied to the first chip may be shown in FIG. 7 , including:
  • Step 701 Receive a switching instruction sent by the second chip when it is determined that the second chip is in a state in which a Bluetooth connection has been established with the first chip and a Bluetooth pairing has not been performed.
  • Step 702 Switch the current working mode of the first chip to the target working mode at the switching time point.
  • the target working mode mentioned in step 602 and step 702 is the second working mode or the third working mode.
  • the Bluetooth connection established between the first chip and the second chip may be a low-power Bluetooth connection established based on mode 0. Based on the existing standard Bluetooth protocol, after the low-power Bluetooth connection is established, the first chip and the second chip will enter the Bluetooth pairing process. During the Bluetooth pairing process, the pairing parties will exchange secret keys. In this embodiment, it is considered that most of the current monitoring devices support the standard Bluetooth protocol, and it is easy to monitor the standard frequency band specified by the standard Bluetooth protocol, so it is easy to steal the secret key in the process of Bluetooth pairing.
  • the sending switch The chip that sends the instruction (the first chip or the second chip) determines that the first chip is in a state where the Bluetooth connection has been established with the second chip and the Bluetooth pairing has not yet been performed.
  • the first chip and the second chip exchange secret keys based on the standard frequency band of the standard Bluetooth protocol, thereby preventing the secret keys from being stolen.
  • the first chip is in a state in which a Bluetooth connection has been established with the second chip and the Bluetooth pairing has not yet been performed, which can be understood as: after the first chip sends a security request to the second chip The pairing request sent by the second chip is received.
  • the first chip is in a state where the Bluetooth connection has been established with the second chip and the Bluetooth pairing has not been performed, which can also be understood as: after the first chip receives the security request sent by the second chip, the A chip has not sent a pairing request to the second chip. That is to say, after the first chip receives the Security request and sends the Pairing request, the first chip sends a switching instruction to the second chip, so that the first chip and the second chip can switch the working mode to the target operation at a reasonable time. model.
  • the target operating mode is the second operating mode (mode 2) or the third operating mode (mode 3):
  • the first chip and the second chip perform data transmission in the first fixed channel, which means that the first chip and the second chip perform the key exchange of Bluetooth pairing in the first fixed channel.
  • the key exchange is performed in the channels 0 to 39, so as to avoid the working frequency band of the standard Bluetooth protocol that can be monitored by the third-party monitoring device, so as to improve the security in the pairing process.
  • the first chip and the second chip perform the key exchange of Bluetooth pairing in an adaptive frequency hopping mode on the extended channel, so that even the adaptive frequency hopping method can avoid third-party monitoring
  • the device can monitor the working frequency band of the standard Bluetooth protocol to improve the security during the pairing process.
  • the method further includes: if the first chip determines to complete the Bluetooth pairing with the second chip, sending the switching instruction to the second chip. a restoration instruction; wherein, the restoration instruction carries a restoration time point, and the restoration instruction is used to instruct the second chip to restore the target working mode of the second chip to the working mode before switching at the restoration time point; the first chip restores the first chip at the restoration time point The target working mode of the chip is restored to the working mode before the switch.
  • the method further includes: the first chip receiving the second chip in Determine the restoration instruction sent after completing the Bluetooth pairing with the first chip; wherein, the restoration instruction carries the restoration time point; the first chip restores the target working mode of the first chip to the working mode before the switch at the restoration time point; wherein, the second The chip restores the target working mode of the second chip to the working mode before switching at the restoration time point.
  • the first chip and the second chip restore the current target working mode to the working mode before switching at the same restoration time point.
  • the working mode before switching is the standard working mode or the first working mode, considering that the extended frequency band is not an unlicensed ISM frequency band that is open to three major institutions of industry, science and medicine by the Radiocommunication Bureau of the International Communications Union, Long-term occupation may cause waste of resources. Therefore, after the pairing is completed, it returns to the standard working mode or the first working mode, that is, the working mode that does not occupy the extended frequency band, which can improve the pairing security and reduce the waste of resources.
  • the target working mode and the current working mode mentioned in step 602 and step 702 is the standard working mode
  • the current working mode is the standard working mode, that is, switching The previous working mode is the standard working mode.
  • the interaction flow between the first chip and the second chip can refer to FIG. 8 , including:
  • Step 801 The first chip and the second chip establish a Bluetooth low energy connection based on mode 0.
  • the non-standard operating modes include only mode 1, ie, no extension channels are present.
  • the usage states of the channels numbered 37 to 39 are set to disable, that is, the usage states of the channels used for broadcasting are set to disable, numbered 0 to 0.
  • the usage status of 36 channels are all set to enable.
  • the non-standard working mode includes at least any one of mode 2, mode 3, and mode 4, that is, the standard channel and the extended channel coexist.
  • mode 2, mode 3, and mode 4 that is, the standard channel and the extended channel coexist.
  • Step 802 Initiate a security request.
  • the first chip may initiate the security request, or the second chip may initiate the security request.
  • Step 803 The first chip sends a switching instruction to the second chip.
  • the second chip may also send a switching instruction to the first chip.
  • Step 804 The first chip and the second chip switch the mode 0 to the target operating mode at the same switching time point.
  • the target working mode is mode 2 or mode 3.
  • Step 805 Initiate a pairing request, and perform pairing based on a security management protocol (Security Manager Protocol, SMP for short).
  • SMP Security Manager Protocol
  • Step 806 Key distribution is performed between the first chip and the second chip to complete the key exchange.
  • the method of pairing based on SMP is traditional pairing or secure connection.
  • the first chip and the second chip perform data transmission based on mode 2 or mode 3, which can be understood as performing data transmission in other frequency bands than the standard frequency band specified by the standard Bluetooth protocol.
  • the standard frequency band specified by the standard Bluetooth protocol is called the BLE in-band frequency band
  • the extended frequency band can be called the BLE out-of-band frequency band, that is, the first chip and the second chip in steps 805 and 806 perform data transmission in the BLE out-of-band frequency band .
  • Step 807 The first chip sends a restore instruction to the second chip.
  • Step 808 The first chip and the second chip restore the target working mode to mode 0 at the same restoration time point.
  • the first chip and the second chip are equivalent to returning to the working mode based on the standard Bluetooth protocol after completing the key exchange.
  • a switching instruction and a restoring instruction are inserted before pairing and after pairing, respectively.
  • both the handover instruction and the restoration instruction may be sent based on the link control protocol newly added in this application (the above-mentioned self-defined private protocol).
  • the pairing security can be improved while being compatible with the existing working mode based on the standard Bluetooth protocol.
  • the extended frequency band is not the frequency band specified by ISM, long-term occupation may cause waste of resources. Therefore, after the pairing is completed, it returns to the working mode based on the standard Bluetooth protocol, which can improve the pairing security and reduce the waste of resources.
  • the embodiment of the present application relates to a first chip.
  • the first chip 901 is located in an electronic device and is connected to a memory 902 in the electronic device.
  • the memory 902 stores instructions that can be executed by the first chip 901 ,
  • the instructions are executed by the first chip 901, so that the first chip 901 can execute the above-mentioned data transmission method applied to the first chip.
  • the memory 902 and the first chip 901 are connected by a bus
  • the bus may include any number of interconnected buses and bridges, and the bus connects one or more first chips 901 and various circuits of the memory 902 together.
  • the bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein.
  • the bus interface provides the interface between the bus and the transceiver.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium.
  • the data processed by the first chip 901 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the first chip 901 .
  • the first chip 901 is responsible for managing the bus and general processing, and may also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And the memory 902 may be used to store data used by the first chip 901 when performing operations.
  • the embodiment of the present application relates to an electronic device, as shown in FIG. 9 , including: a first chip 901 in the third embodiment, and a memory 902 connected to the first chip 901 .
  • the embodiments of the present application relate to a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the foregoing method embodiments are implemented.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

Part of the embodiments of the present application provide a data transmission method, a first chip, an electronic device and a storage medium. Working modes supported during a data transmission process of a first chip and a second chip comprise a standard working mode and a non-standard working mode; the standard working mode is a working mode in which data is transmitted with the second chip between standard channels based on a standard Bluetooth protocol by means of frequency hopping; and the non-standard working mode comprises any one among the following or a combination thereof: a first working mode in which data is transmitted in a specified first fixed channel; a second working mode in which data is transmitted by means of frequency hopping between expanded expansion channels; a third working mode in which data is transmitted in a specified second fixed channel; and a fourth working mode in which data is transmitted by means of frequency hopping between a standard channel based on the standard Bluetooth protocol and the expanded expansion channel. By employing the embodiments of the present application, transmission requirements in different scenarios may be met while being compatible with existing standard Bluetooth protocol.

Description

数据传输方法、第一芯片、电子设备和存储介质Data transmission method, first chip, electronic device and storage medium 技术领域technical field
本申请涉及通信技术领域,特别涉及一种数据传输方法、第一芯片、电子设备和存储介质。The present application relates to the field of communication technologies, and in particular, to a data transmission method, a first chip, an electronic device and a storage medium.
背景技术Background technique
目前的低功耗蓝牙(Bluetooth Low Energy,BLE)工作在标准蓝牙协议规定的2400Mhz-2480Mhz频段范围内,以2Mhz为一个步进,将整个工作频段划分为40个信道,在40个信道之间以跳频方式传输数据,难以满足在不同场景下的数据传输需求。The current low-power Bluetooth (Bluetooth Low Energy, BLE) works in the 2400Mhz-2480Mhz frequency band range specified by the standard Bluetooth protocol, with 2Mhz as a step, the entire working frequency band is divided into 40 channels, between 40 channels It is difficult to transmit data in a frequency hopping manner, which is difficult to meet the data transmission requirements in different scenarios.
发明内容SUMMARY OF THE INVENTION
本申请部分实施例的目的在于提供一种据传输方法、第一芯片、电子设备和存储介质,使得可以在兼容现有的标准蓝牙协议的同时满足不同场景下的传输需求。The purpose of some embodiments of this application is to provide a data transmission method, a first chip, an electronic device and a storage medium, so that the transmission requirements in different scenarios can be met while being compatible with the existing standard Bluetooth protocol.
本申请实施例提供了一种数据传输方法,应用于第一芯片,所述第一芯片和第二芯片进行数据传输的过程中支持的工作模式包括标准工作模式和非标准工作模式;所述标准工作模式为基于标准蓝牙协议的标准信道之间以跳频方式与第二芯片传输数据的工作模式;所述非标准工作模式包括以下任意之一或 其组合:在指定的第一固定信道中与所述第二芯片传输数据的第一工作模式;其中,所述第一固定信道为所述标准信道中的一个信道;在扩展的扩展信道之间以跳频方式与所述第二芯片传输数据的第二工作模式;在指定的第二固定信道中与所述第二芯片传输数据的第三工作模式;其中,所述第二固定信道为扩展的扩展信道中的一个信道;在基于标准蓝牙协议的标准信道和扩展的扩展信道之间以跳频方式与所述第二芯片传输数据的第四工作模式。An embodiment of the present application provides a data transmission method, which is applied to a first chip. The working modes supported by the first chip and the second chip during data transmission include a standard working mode and a non-standard working mode; the standard working mode The working mode is a working mode in which data is transmitted with the second chip in a frequency hopping manner between standard channels based on the standard Bluetooth protocol; the non-standard working mode includes any one or a combination of the following: A first working mode in which the second chip transmits data; wherein, the first fixed channel is one of the standard channels; data is transmitted with the second chip in a frequency hopping manner between the extended extended channels The second working mode of the device; the third working mode of transmitting data with the second chip in the designated second fixed channel; wherein, the second fixed channel is one of the extended extended channels; A fourth working mode in which data is transmitted with the second chip in a frequency hopping manner between the standard channel of the protocol and the extended extension channel.
本申请实施例还提供了一种第一芯片,所述第一芯片位于电子设备内且与所述电子设备内的存储器连接,所述存储器存储有可被所述第一芯片执行的指令,所述指令被所述第一芯片执行,以使所述第一芯片能够执行如上述应用于第一芯片的数据传输方法。Embodiments of the present application further provide a first chip, where the first chip is located in an electronic device and is connected to a memory in the electronic device, and the memory stores instructions that can be executed by the first chip, so The instruction is executed by the first chip, so that the first chip can execute the data transmission method applied to the first chip as described above.
本申请实施例还提供了一种电子设备,包括:上述第一芯片,以及与所述第一芯片连接的存储器。Embodiments of the present application further provide an electronic device, including: the above-mentioned first chip, and a memory connected to the first chip.
本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述的数据传输方法。Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned data transmission method is implemented.
本申请实施例,第一芯片和第二芯片进行数据传输的过程中支持的工作模式包括标准工作模式和非标准工作模式,即第一芯片和第二芯片能够支持不同的工作模式,有利于满足不同场景下的数据传输需求。由于标准工作模式为基于标准蓝牙协议的标准信道之间以跳频方式与第二芯片传输数据的工作模式,即第一芯片和第二芯片能够在兼容现有的标准蓝牙协议的同时,支持其他非标准工作模式,有利于在满足不同场景下的数据传输需求的同时扩大第一芯片和第二芯片的适用范围,使得第一芯片和第二芯片的受众更广。在指定的第一固定信道中与第二芯片传输数据的第一工作模式,有利于满足需要在标准信 道中定制某一信道进行数据传输的场景下的数据传输需求,还有利于提高数据传输的效率。在扩展的扩展信道之间以跳频方式与第二芯片传输数据的第二工作模式,有利于满足需要在扩展信道中跳频的场景下的数据传输需求,还有利于避开国际通信联盟无线电通信局开放给工业、科学、医学(Industrial Scientific Medical,ISM)三个主要机构使用的无需授权的ISM频段的干扰以提高数据传输的稳定性。在指定的第二固定信道中与第二芯片传输数据的第三工作模式,有利于满足需要在扩展信道中定制某一信道进行数据传输的场景下的数据传输需求,还有利于在提高数据传输的效率的同时避开ISM频段的干扰以提高数据传输的稳定性。在基于标准蓝牙协议的标准信道和扩展的扩展信道之间以跳频方式与第二芯片传输数据的第四工作模式,即支持在更多的信道(超过40)内以跳频方式传输数据,扩宽了跳频范围,能够将标准信道的数据传输压力,平均在标准信道和扩展信道之间,从而减缓数据传输的压力,提高数据传输的效率,可以传输数据的信道数量多了,从而允许容纳更多的设备进行数据传输,有利于满足低功耗蓝牙网络密度较高的场景下的传输需求。In this embodiment of the present application, the working modes supported by the first chip and the second chip during data transmission include standard working modes and non-standard working modes, that is, the first chip and the second chip can support different working modes, which is conducive to satisfying Data transmission requirements in different scenarios. Since the standard working mode is a working mode in which data is transmitted between the standard channels based on the standard Bluetooth protocol and the second chip in a frequency hopping manner, that is, the first chip and the second chip can be compatible with the existing standard Bluetooth protocol while supporting other The non-standard working mode is beneficial to expand the scope of application of the first chip and the second chip while meeting the data transmission requirements in different scenarios, so that the audience of the first chip and the second chip is wider. The first working mode of transmitting data with the second chip in the designated first fixed channel is conducive to meeting the data transmission requirements in the scenario where a certain channel needs to be customized in the standard channel for data transmission, and is also conducive to improving the efficiency of data transmission. efficiency. The second working mode of transmitting data with the second chip in a frequency hopping manner between the extended extended channels is beneficial to meet the data transmission requirements in the scenario where frequency hopping in the extended channel is required, and is also beneficial to avoid the ITU radio Interference in the unlicensed ISM band used by the three major institutions of Industry, Science, and Medicine (ISM) by the Communications Bureau to improve the stability of data transmission. The third working mode of transmitting data with the second chip in the designated second fixed channel is conducive to meeting the data transmission requirements in the scenario where a certain channel needs to be customized in the extended channel for data transmission, and is also conducive to improving data transmission. While avoiding the interference of the ISM frequency band to improve the stability of data transmission. The fourth working mode of transmitting data with the second chip in a frequency hopping manner between the standard channel based on the standard Bluetooth protocol and the extended extension channel, that is, supporting more channels (more than 40) to transmit data in a frequency hopping manner, The frequency hopping range is expanded, and the data transmission pressure of the standard channel can be averaged between the standard channel and the extended channel, thereby reducing the pressure of data transmission and improving the efficiency of data transmission. Accommodating more devices for data transmission is conducive to meeting the transmission requirements in scenarios with high Bluetooth low energy network density.
另外,若所述第一芯片为发送切换指令的芯片,所述方法包括:若满足预设的触发条件,向所述第二芯片发送切换指令;其中,所述切换指令携带切换时间点和目标工作模式,所述切换指令用于指示所述第二芯片在所述切换时间点将所述第二芯片的当前工作模式切换为所述目标工作模式;在所述切换时间点将所述第一芯片的当前工作模式切换为所述目标工作模式;其中,所述当前工作模式和所述目标工作模式为所述标准工作模式和所述非标准工作模式中的两种不同工作模式。通过发送切换指令,使得第一芯片和第二芯片在同一时间点切换为同一工作模式,有利于在满足不同场景的数据传输需求的同时,确 保切换工作模式后第一芯片和第二芯片之间能够准确传输数据。In addition, if the first chip is a chip that sends a switching instruction, the method includes: if a preset trigger condition is satisfied, sending a switching instruction to the second chip; wherein the switching instruction carries a switching time point and a target working mode, the switching instruction is used to instruct the second chip to switch the current working mode of the second chip to the target working mode at the switching time point; The current working mode of the chip is switched to the target working mode; wherein, the current working mode and the target working mode are two different working modes among the standard working mode and the non-standard working mode. By sending the switching command, the first chip and the second chip are switched to the same working mode at the same time point, which is beneficial to meet the data transmission requirements of different scenarios and ensure that the switching between the first chip and the second chip after the working mode is switched. Ability to transmit data accurately.
例如,所述非标准工作模式包括所述第二工作模式和/或所述第三工作模式,所述触发条件包括:确定所述第一芯片处于已与所述第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态;所述目标工作模式为所述第二工作模式或所述第三工作模式。考虑到蓝牙配对的过程中,配对双方需要进行秘钥交换,而相关技术中由于第三方监听设备大部分支持标准蓝牙协议,容易监听到标准蓝牙协议的工作频段,因此容易窃取蓝牙配对的过程中的秘钥。因此,本申请实施例中,在蓝牙配对前,配对双方切换工作模式,使得蓝牙配对时,配对双方通信的频点可以跳出标准蓝牙协议的标准频段,第一芯片和第二芯片无论是工作在第二工作模式还是工作在第三工作模式,都不会使用标准蓝牙协议的标准频段,可以避免受到第三方监听设备的监听,从而避免蓝牙配对的过程中的秘钥被盗取,有利于提高配对过程中的安全性。For example, the non-standard working mode includes the second working mode and/or the third working mode, and the triggering condition includes: determining that the first chip is in a state where a Bluetooth connection has been established with the second chip and has not been The state of Bluetooth pairing; the target working mode is the second working mode or the third working mode. Considering that in the process of Bluetooth pairing, the pairing parties need to exchange secret keys. In related technologies, since most of the third-party monitoring devices support the standard Bluetooth protocol, it is easy to monitor the working frequency band of the standard Bluetooth protocol, so it is easy to steal the process of Bluetooth pairing. 's secret key. Therefore, in the embodiment of the present application, before the Bluetooth pairing, the pairing parties switch the working mode, so that when the Bluetooth pairing is performed, the frequency point of the communication between the pairing parties can jump out of the standard frequency band of the standard Bluetooth protocol. The second working mode or the third working mode will not use the standard frequency band of the standard Bluetooth protocol, which can avoid being monitored by a third-party monitoring device, thereby avoiding the theft of the secret key in the process of Bluetooth pairing, which is conducive to improving the Security during pairing.
例如,所述切换之前的工作模式为所述标准工作模式,考虑到扩展频段不是国际通信联盟无线电通信局开放给工业、科学、医学三个主要机构使用的无需授权的ISM频段,长期占用,可能造成资源的浪费,因此配对完成后恢复为标准工作模式或第一工作模式,即不占用扩展频段的工作模式,可以在提高配对安全性的同时,减少资源浪费。For example, the working mode before the handover is the standard working mode. Considering that the extended frequency band is not an unlicensed ISM frequency band open to the three major institutions of industry, science and medicine for use by the International Communications Union Radiocommunication Bureau, it may be occupied for a long time. This results in a waste of resources. Therefore, after the pairing is completed, the standard working mode or the first working mode is restored, that is, the working mode that does not occupy the extended frequency band, which can improve the pairing security and reduce the waste of resources.
例如,所述非标准工作模式包括以下任意之一或其组合:所述第二工作模式、所述第三工作模式、所述第四工作模式;所述标准信道基于标准频段划分得到,所述扩展信道基于扩展的扩展频段划分得到;所述标准频段对应有上限频率和下限频率,所述扩展频段包括第一频段和第二频段,所述第一频段中的频率均小于所述下限频率,所述第二频段中的频率均大于所述上限频率。考 虑到以上限频率为基准,频率越来越大,通信质量可能会越来越差,以下限频率为基准,频率越来越小,通信质量也可能会越来越差,因此,本申请实施例为了扩展出相同数量的信道,扩展出第一频段和第二频段的方案相比于仅扩展出一个频段的方案,有利于在增加扩展的信道的数量的同时,将通信质量维持在一个相对平衡的范围之内。For example, the non-standard working mode includes any one or a combination of the following: the second working mode, the third working mode, and the fourth working mode; the standard channel is obtained by dividing the standard frequency band, the The extended channel is obtained by dividing the extended extended frequency band; the standard frequency band corresponds to an upper limit frequency and a lower limit frequency, the extended frequency band includes a first frequency band and a second frequency band, and the frequencies in the first frequency band are all less than the lower limit frequency, The frequencies in the second frequency band are all greater than the upper limit frequency. Considering that with the upper limit frequency as the reference, the higher the frequency, the worse the communication quality may be, and the lower limit frequency as the reference, the lower the frequency is, the lower the communication quality may be. Therefore, this application implements For example, in order to expand the same number of channels, the scheme of expanding the first frequency band and the second frequency band, compared with the scheme of expanding only one frequency band, is conducive to maintaining the communication quality at a relative level while increasing the number of expanded channels. within the range of balance.
例如,基于所述标准频段划分的各标准信道的编号为连续编号,所述连续编号中包括初始编号和终止编号;基于所述第一频段划分的信道的编号,随着频率的降低以所述初始编号为基准依次递减;基于所述第二频段划分的信道的编号,随着频率的增大以所述终止编号为基准依次递增。考虑到相关技术中标准信道已经具有连续编号,本申请实施例中可以无需对标准信道进行重新编号,就可以使得标准信道和扩展信道的编号连续,方便适应现有信道编号的规范,运算效率更高,速度更快,即能够更加快速的确定跳频后的信道,从而提高芯片之间的传输数据的速度。而且,考虑到现有的自适应跳频算法是在连续编号的情况下进行的,本申请中扩展信道与标准信道之间编号连续还方便了适应于现有的自适应跳频算法。For example, the number of each standard channel divided based on the standard frequency band is a continuous number, and the continuous number includes an initial number and a termination number; the number of the channel divided based on the first frequency band, as the frequency decreases The initial number decreases sequentially based on the reference; the number of the channels divided based on the second frequency band increases sequentially with the termination number as the reference as the frequency increases. Considering that the standard channels already have consecutive numbers in the related art, in the embodiment of the present application, the standard channels and the extended channels can be consecutively numbered without renumbering the standard channels, which is convenient to adapt to the existing channel numbering specifications, and the operation efficiency is improved. High, the speed is faster, that is, the channel after frequency hopping can be determined more quickly, thereby improving the speed of data transmission between chips. Moreover, considering that the existing adaptive frequency hopping algorithm is performed in the case of continuous numbering, the continuous numbering between the extended channel and the standard channel in the present application also facilitates adaptation to the existing adaptive frequency hopping algorithm.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute limitations of the embodiments, and elements with the same reference numerals in the drawings are denoted as similar elements, Unless otherwise stated, the figures in the accompanying drawings do not constitute a scale limitation.
图1是根据本申请实施例中的在确定调频后的信道的流程图;FIG. 1 is a flowchart of determining a channel after frequency modulation according to an embodiment of the present application;
图2是根据本申请实施例中的确定跳频后的信道的编号的框图;Fig. 2 is a block diagram of determining the number of the channel after frequency hopping according to an embodiment of the present application;
图3是根据本申请实施例中的第一芯片为发送切换指令的芯片时,数据传输方法的流程图;3 is a flowchart of a data transmission method according to an embodiment of the present application when the first chip is a chip that sends a switching instruction;
图4是根据本申请实施例中的第一芯片为接收切换指令的芯片时,数据传输方法的流程图;4 is a flowchart of a data transmission method when the first chip in an embodiment of the present application is a chip that receives a switching instruction;
图5是根据本申请实施例中的第一芯片和第二芯片进行数据传输的示意图;5 is a schematic diagram of data transmission performed by the first chip and the second chip in an embodiment of the present application;
图6是根据本申请实施例中的一个例子中,第一芯片为发送切换指令的芯片时,数据传输方法的流程图;6 is a flowchart of a data transmission method when the first chip is a chip that sends a switching instruction according to an example in the embodiments of the present application;
图7是根据本申请实施例中的另一个例子中,第一芯片为接收切换指令的芯片时,数据传输方法的流程图;7 is a flowchart of a data transmission method according to another example in the embodiments of the present application, when the first chip is a chip that receives a switching instruction;
图8是根据本申请实施例中的第一芯片和第二芯片之间的交互流程图;FIG. 8 is an interaction flow diagram between the first chip and the second chip according to an embodiment of the present application;
图9是根据本申请实施例中的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施例specific embodiment
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请部分实施例进行进一步详细说明。本领域的普通技术人员可以理解,在各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the present application clearer, some embodiments of the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood by those of ordinary skill in the art that, in each embodiment, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized. The following divisions of the various embodiments are for the convenience of description, and should not constitute any limitation on the specific implementation of the present application, and the various embodiments may be combined with each other and referred to each other on the premise of not contradicting each other.
本申请实施例涉及一种数据传输方法,应用于第一芯片。本申请实施例 的数据传输主要是指第一芯片和第二芯片之间的数据传输。其中,第一芯片设置于主设备中,第二芯片设置于从设备中;或者,第一芯片设置于从设备中,第二芯片设置于主设备中。也就是说,第一芯片和第二芯片中,其中一个设置于主设备中,另一个设置于从设备中,第一芯片与第二芯片之间的数据传输也可以理解为主设备和从设备之间的数据传输。第一芯片和第二芯片均可以为蓝牙芯片。下面对本实施例的数据传输方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The embodiments of the present application relate to a data transmission method, which is applied to a first chip. The data transmission in the embodiments of the present application mainly refers to the data transmission between the first chip and the second chip. Wherein, the first chip is arranged in the master device, and the second chip is arranged in the slave device; or, the first chip is arranged in the slave device, and the second chip is arranged in the master device. That is to say, among the first chip and the second chip, one of them is set in the master device, and the other is set in the slave device, and the data transmission between the first chip and the second chip can also be understood as the master device and the slave device. data transfer between. Both the first chip and the second chip may be Bluetooth chips. The implementation details of the data transmission method in this embodiment will be specifically described below, and the following content is only provided for the convenience of understanding, and is not necessary for implementing this solution.
本实施例中第一芯片和第二芯片进行数据传输的过程中支持的工作模式包括标准工作模式和非标准工作模式。也就是说,第一芯片和第二芯片具有的工作模式包括:标准工作模式和非标准工作模式。下面对标准工作模式和非标准工作模式进行具体说明:In this embodiment, the working modes supported by the first chip and the second chip during data transmission include a standard working mode and a non-standard working mode. That is to say, the working modes of the first chip and the second chip include: a standard working mode and a non-standard working mode. The standard working mode and non-standard working mode are described in detail below:
标准工作模式为在基于标准蓝牙协议的标准信道之间以跳频方式与第二芯片传输数据的工作模式。可以理解的是,现有的标准蓝牙协议的标准频段为2.4G ISM频段,即2400Mhz-2480Mhz,共80Mhz,按照2Mhz宽度划分信道,得到40个标准信道。标准工作模式可以理解为现有的低功耗蓝牙技术所使用的工作模式,即在标准蓝牙协议规定的标准频段之间进行自适应跳频的工作模式,也就是说,在上述40个标准信道之间进行自适应跳频的工作模式。其中,自适应跳频是指第一芯片和第二芯片按照相同的自适应跳频算法,不断的更新双方通信使用的信道。自适应跳频的方式可以基于蓝牙核心协议Core_v5.2中规定的自适应跳频算法实现,本实施例对此不做具体说明。The standard working mode is a working mode in which data is transmitted with the second chip in a frequency hopping manner between standard channels based on the standard Bluetooth protocol. It can be understood that the standard frequency band of the existing standard Bluetooth protocol is the 2.4G ISM frequency band, that is, 2400Mhz-2480Mhz, with a total of 80Mhz. The channels are divided according to the 2Mhz width to obtain 40 standard channels. The standard working mode can be understood as the working mode used by the existing low-power Bluetooth technology, that is, the working mode of adaptive frequency hopping between the standard frequency bands specified by the standard Bluetooth protocol, that is, in the above 40 standard channels. The working mode of adaptive frequency hopping between them. The adaptive frequency hopping refers to that the first chip and the second chip continuously update the channel used for communication between the two parties according to the same adaptive frequency hopping algorithm. The adaptive frequency hopping method may be implemented based on the adaptive frequency hopping algorithm specified in the Bluetooth core protocol Core_v5.2, which is not described in detail in this embodiment.
非标准工作模式即基于自定义的私有协议的一种工作模式,包括以下任意之一或其组合:在指定的第一固定信道中与第二芯片传输数据的第一工作模 式;其中,第一固定信道为标准信道中的一个信道。在扩展的扩展信道之间以跳频方式与第二芯片传输数据的第二工作模式。在指定的第二固定信道中与第二芯片传输数据的第三工作模式;其中,第二固定信道为扩展的扩展信道中的一个信道。在基于标准蓝牙协议的标准信道和扩展的扩展信道之间以跳频方式与第二芯片传输数据的第四工作模式。下面对上述四种非标准工作模式进行具体说明:The non-standard working mode is a working mode based on a self-defined private protocol, including any one of the following or a combination thereof: a first working mode in which data is transmitted with the second chip in the specified first fixed channel; wherein the first A fixed channel is one of the standard channels. A second working mode in which data is transmitted with the second chip in a frequency hopping manner between the extended extension channels. A third working mode in which data is transmitted with the second chip in the designated second fixed channel; wherein the second fixed channel is one of the extended extended channels. A fourth working mode for transmitting data with the second chip in a frequency hopping manner between a standard channel based on a standard Bluetooth protocol and an extended extended channel. The above four non-standard working modes are described in detail below:
第一工作模式,第一芯片和第二芯片在指定的第一固定信道中传输数据,第一固定信道为标准信道中的一个信道,即上述40个标准信道中的一个。在指定的第一固定信道中传输数据可以理解为在预设的一段时间内第一芯片和第二芯片一直在第一固定信道中传输数据,即在预设的一段时间内传输数据的信道不会发生变化。In the first working mode, the first chip and the second chip transmit data in a designated first fixed channel, and the first fixed channel is one of the standard channels, that is, one of the above 40 standard channels. Transmission of data in the specified first fixed channel can be understood as the first chip and the second chip have been transmitting data in the first fixed channel within a preset period of time, that is, the channel for transmitting data within the preset period of time is not will change.
第一工作模式的适用场景可以包括但不限于:在预设范围内,需要传输数据的设备的数量小于预设数量。其中,预设范围和预设数量可以根据实际需要进行设置,比如,预设范围可以为5米内或1间房内。也就是说,在预设范围内设备少的场景下,可以对各设备指定信道,让各设备在指定的信道中传输数据,设备少的情况下40个标准信道足够指定,有利于提高数据传输效率。The applicable scenarios of the first working mode may include, but are not limited to: within a preset range, the number of devices that need to transmit data is less than the preset number. The preset range and the preset number can be set according to actual needs, for example, the preset range can be within 5 meters or within one room. That is to say, in the scenario where there are few devices within the preset range, each device can be assigned a channel, and each device can transmit data in the designated channel. In the case of a small number of devices, 40 standard channels are enough to specify, which is conducive to improving data transmission. efficiency.
在一个例子中,第一固定信道可以由本领域技术人员根据实际需要在多个标准信道中进行选择,有利于实现信道的定制化。比如,针对第一芯片和第二芯片可以对外提供应用程序接口(Application Program Interface,API),从而使得本领域技术人员可以通过该API选择一个信道作为第一固定信道。In an example, the first fixed channel can be selected by those skilled in the art from multiple standard channels according to actual needs, which is beneficial to realize the customization of the channels. For example, an application program interface (Application Program Interface, API) can be provided externally for the first chip and the second chip, so that those skilled in the art can select a channel as the first fixed channel through the API.
在另一个例子中,第一固定信道还可以由中心设备根据各设备之间的连接情况统一分配指定,有利于自动且合理的实现信道的指定。比如,在低功耗 蓝牙网络下的多个设备中可以预先指定一个设备为中心设备,该中心设备可以用于协调信道的分配和使用,为低功耗蓝牙网络下的各设备分配信道,使得各设备之间的数据传输不存在干扰。比如,低功耗蓝牙网络下的多个设备包括中心设备、设备1到设备8,中心设备确定设备1与设备2、3、4分别建立了蓝牙连接,即设备1会与设备2、3、4进行数据传输。中心设备确定设备5与设备6、7、8分别建立了蓝牙连接,即设备5会与设备6、7、8进行数据传输。则中心设备针对各设备进行信道指定的指定结果可以为:为设备1与设备2、3、4之间的数据传输分别指定了信道1、信道2、信道3;为设备5和设备6、7、8之间的数据传输分别指定了信道4、信道5、信道6,确保各个设备之间的数据传输都互不干扰,通信质量更高。上述的设备1中可以设置有第一芯片,设备2、3、4中可以分别设置第二芯片,中心设备可以向第一芯片发送针对设备1的指定结果,使得设备1可以根据接收到的指定结果,确定应该和设备2、3、4分别在哪些信道进行数据传输。在具体实现中,设备1本身也可以具备中心设备的功能,即设备1也可以作为中心设备使用,此时,设备1可以直接确定应该和设备2、3、4分别在哪些信道进行数据传输。In another example, the first fixed channel can also be uniformly assigned and designated by the central device according to the connection conditions between the devices, which is beneficial to automatically and reasonably realize the designation of the channel. For example, among multiple devices in the Bluetooth low energy network, a device can be pre-designated as the central device, and the central device can be used to coordinate the allocation and use of channels, and allocate channels for each device in the Bluetooth low energy network, so that There is no interference in data transmission between devices. For example, multiple devices under the Bluetooth low energy network include the central device, device 1 to device 8, and the central device determines that device 1 has established Bluetooth connections with devices 2, 3, and 4, respectively, that is, device 1 will communicate with devices 2, 3, and 4 respectively. 4 for data transmission. The central device determines that the device 5 has established a Bluetooth connection with the devices 6, 7, and 8 respectively, that is, the device 5 will perform data transmission with the devices 6, 7, and 8. Then the designated result of the channel designation performed by the central device for each device may be: channel 1, channel 2, and channel 3 are respectively designated for data transmission between device 1 and devices 2, 3, and 4; for device 5 and devices 6, 7 Channel 4, Channel 5, and Channel 6 are designated for data transmission between , 8, respectively, to ensure that the data transmission between each device does not interfere with each other, and the communication quality is higher. The above-mentioned device 1 may be provided with a first chip, and devices 2, 3, and 4 may be provided with a second chip respectively, and the central device may send the designation result for the device 1 to the first chip, so that the device 1 can be based on the received designation. As a result, it is determined which channels should be used for data transmission with devices 2, 3, and 4, respectively. In the specific implementation, the device 1 itself can also have the function of the central device, that is, the device 1 can also be used as the central device. At this time, the device 1 can directly determine which channels should be used for data transmission with the devices 2, 3, and 4 respectively.
在具体实现中,若非标准工作模式仅包括第一工作模式,即没有扩展信道的情况下,若第一芯片和第二芯片工作在第一工作模式,第一固定信道的使用状态被设置为允许使用,标准信道中除第一固定信道之外的其他信道的使用状态被设置为禁止使用。比如,40个标准信道可以使用5Byte(40bit)0xFFFFFFFFFF表示,置0表示该信道的使用状态为禁止使用disable,置1表示该信道的使用状态为允许使用enable。In a specific implementation, if the non-standard working mode only includes the first working mode, that is, there is no extended channel, if the first chip and the second chip work in the first working mode, the use state of the first fixed channel is set to allow Use, the use status of the other channels except the first fixed channel in the standard channel is set to be disabled. For example, 40 standard channels can be represented by 5Byte (40bit) 0xFFFFFFFFFF, setting 0 means that the usage status of the channel is disabled, and setting 1 means that the usage status of the channel is enabled.
为便于对第二、三、四工作模式的理解,下面首先对这三种工作模式中涉及的扩展信道进行说明:扩展信道基于扩展的扩展频段划分得到,扩展频段为2.4G ISM频段之外的其他频段。In order to facilitate the understanding of the second, third, and fourth working modes, the extended channels involved in these three working modes are first described below: the extended channels are obtained based on the extended extended frequency band division, and the extended frequency band is outside the 2.4G ISM frequency band. other frequency bands.
在一个例子中,扩展出的扩展频段可以包括:第一频段和第二频段。基于标准蓝牙协议的标准频段对应有上限频率和下限频率,第一频段中的频率均小于下限频率,第二频段中的频率均大于上限频率。考虑到以上限频率为基准,频率越来越大,通信质量可能会越来越差,以下限频率为基准,频率越来越小,通信质量也可能会越来越差,因此,为了扩展出相同数量的信道,扩展出第一频段和第二频段的方案相比于仅扩展出一个频段的方案,有利于在增加扩展的信道的数量的同时,将通信质量维持在一个相对平衡的范围之内。In an example, the extended extended frequency band may include: a first frequency band and a second frequency band. The standard frequency band based on the standard Bluetooth protocol corresponds to an upper limit frequency and a lower limit frequency, the frequencies in the first frequency band are all less than the lower limit frequency, and the frequencies in the second frequency band are all greater than the upper limit frequency. Considering that with the upper limit frequency as the reference, the higher the frequency, the worse the communication quality may be, and the lower limit frequency as the reference, the lower the frequency, the lower the communication quality may be. Therefore, in order to extend the Compared with the scheme of expanding only one frequency band, the scheme of extending the first frequency band and the second frequency band with the same number of channels is beneficial to maintain the communication quality in a relatively balanced range while increasing the number of channels to be expanded. Inside.
比如,标准蓝牙协议规定的标准频段为[2400Mhz,2480Mhz],第一频段为2360Mhz至2400Mhz,第二频段为2480Mhz至2520Mhz。第一频段可以表示为[2360Mhz,2400Mhz),第二频段可以表示为(2480Mhz,2520Mhz]。假设,按照2Mhz宽度划分扩展信道,基于本示例中扩展出的第一频段和第二频段可以划分得到40个扩展信道。如果仅扩展一个频段,为了划分得到40个信道,则可能仅扩展出[2320Mhz,2400Mhz)这一频段,或者仅扩展出(2480Mhz,2560Mhz]这一频段。可见,为了扩展出40个信道,本示例中扩展出两个频段的方式,相比于仅扩展出一个频段的方式,有利于在增加扩展的信道的数量的同时,将通信质量维持在一个相对平衡的范围之内。For example, the standard frequency band specified by the standard Bluetooth protocol is [2400Mhz, 2480Mhz], the first frequency band is 2360Mhz to 2400Mhz, and the second frequency band is 2480Mhz to 2520Mhz. The first frequency band can be expressed as [2360Mhz, 2400Mhz), and the second frequency band can be expressed as (2480Mhz, 2520Mhz]. Assuming that the extended channel is divided according to the width of 2Mhz, the first and second frequency bands expanded in this example can be divided into 40 extended channels. If only one frequency band is expanded, in order to obtain 40 channels, only the frequency band [2320Mhz, 2400Mhz] may be expanded, or only the frequency band (2480Mhz, 2560Mhz) may be expanded. It can be seen that in order to expand out There are 40 channels. In this example, two frequency bands are expanded. Compared with the method of expanding only one frequency band, it is beneficial to increase the number of expanded channels while maintaining the communication quality within a relatively balanced range. .
在另一个例子中,根据实际需要扩展出的扩展频段也可以仅包括第一频段或仅包括第二频段,有利于适应实际应用中的个性化需求。In another example, the extended frequency band extended according to actual needs may also include only the first frequency band or only the second frequency band, which is beneficial to adapt to individual requirements in practical applications.
在具体实现中,各标准信道和各扩展信道均可以设置有编号。In a specific implementation, each standard channel and each extended channel may be set with numbers.
在一个例子中,考虑到相关技术中,标准信道的编号通常为0~39,编号和频率的关系可以用如下公式表示:f=2402+K*2;其中,f为频率(单位:Mhz),K为编号,K=0~39。本实施例中,增加了扩展出的扩展信道,可以在已有的40个标准信道的编号的基础上,对扩展信道进行编号。编号的规则可以为:基于第一频段划分的信道的编号,随着频率的降低以初始编号为基准依次递减;比如,小于2400Mhz的信道使用负数编号,依次为-1~-20。基于第二频段划分的扩展信道的编号,随着频率的增大以终止编号为基准依次递增;比如,大于2400Mhz的信道的编号在39的编号的基础上继续递增,依次为40~59。即信道的编号和频率的关系可以用如下公式表示:f=2402+K*2;其中,f为频率(单位:Mhz),K为编号,K=-20~59。比如,标准信道的编号和标准频段的频率之间的关系,以及扩展信道的编号和扩展频段的频率之间的关系可以如下表1所示:In an example, considering that in the related art, the number of standard channels is usually 0-39, the relationship between the number and frequency can be expressed by the following formula: f=2402+K*2; where, f is the frequency (unit: Mhz) , K is the number, K=0~39. In this embodiment, an extended extension channel is added, and the extension channel can be numbered on the basis of the numbers of the existing 40 standard channels. The numbering rule may be: the number of the channels divided based on the first frequency band decreases sequentially with the initial number as the reference; for example, the channel less than 2400Mhz uses a negative number, which is -1 to -20 in sequence. The number of the extended channel divided based on the second frequency band increases sequentially with the increase of the frequency based on the termination number; for example, the number of the channel greater than 2400Mhz continues to increase based on the number of 39, and is 40 to 59 in sequence. That is, the relationship between the number of the channel and the frequency can be expressed by the following formula: f=2402+K*2; wherein, f is the frequency (unit: Mhz), K is the number, and K=-20~59. For example, the relationship between the number of the standard channel and the frequency of the standard frequency band, and the relationship between the number of the extended channel and the frequency of the extended frequency band can be shown in Table 1 below:
表1Table 1
频段名称Band name 频率范围Frequency Range 信道的编号channel number
第一频段(Low band)The first frequency band (Low band) 2360Mhz~2400Mhz2360Mhz~2400Mhz -20~-1-20~-1
标准频段(BLE band)Standard frequency band (BLE band) 2402Mhz~2480Mhz2402Mhz~2480Mhz 0~390~39
第二频段(High band)Second frequency band (High band) 2480Mhz~2520Mhz2480Mhz~2520Mhz 40~5940~59
上述示例中考虑到相关技术中标准信道已经具有连续编号,本申请实施例中可以无需对标准信道进行重新编号,就可以使得标准信道和扩展信道的编号连续,方便适应现有信道编号的规范,运算效率更高,速度更快,即能够更加快速的确定跳频后的信道,从而提高芯片之间的传输数据的速度。而且,考 虑到现有的自适应跳频算法是在连续编号的情况下进行的,本申请中扩展信道与标准信道之间编号连续还方便了适应于现有的自适应跳频算法。其中,现有的自适应跳频算法可以是蓝牙核心协议Core_v5.2中规定的信道选择算法1(Channel Selection algorithm#1)或者信道选择算法2(Channel Selection algorithm#2)。In the above example, considering that the standard channels in the related art already have consecutive numbers, in the embodiment of the present application, the standard channels and the extended channels can be consecutively numbered without renumbering the standard channels, which is convenient to adapt to the existing channel numbering specifications, The operation efficiency is higher and the speed is faster, that is, the channel after the frequency hopping can be determined more quickly, thereby improving the speed of data transmission between chips. Moreover, considering that the existing adaptive frequency hopping algorithm is performed in the case of continuous numbering, the continuous numbering between the extended channel and the standard channel in the present application also facilitates adaptation to the existing adaptive frequency hopping algorithm. Wherein, the existing adaptive frequency hopping algorithm may be the channel selection algorithm 1 (Channel Selection algorithm#1) or the channel selection algorithm 2 (Channel Selection algorithm#2) specified in the Bluetooth core protocol Core_v5.2.
在另一个例子中,也可以对标准信道进行重新编号,即对标准信道和扩展信道均进行编号。比如,信道的频率范围为2360Mhz-2520Mhz共160Mhz,划分为80个信道,信道编号为0~79,即信道的编号和频率的关系可以用如下公式表示:f=2362+K*2;其中,f为频率(单位:Mhz),K为编号,K=0~79。此种情况下,考虑到相关技术中基于2402Mhz~2480Mhz之间的信道已经设置有编号0~39,为避免冲突可以设置一种对应关系:编号为0~79的信道中,编号为20~59的信道实际为相关技术中基于2402Mhz~2480Mhz划分的编号0~39的信道。In another example, the standard channels can also be renumbered, that is, both the standard channels and the extended channels are numbered. For example, the frequency range of the channel is 2360Mhz-2520Mhz, a total of 160Mhz, divided into 80 channels, and the channel numbers are 0 to 79, that is, the relationship between the channel number and frequency can be expressed by the following formula: f=2362+K*2; where, f is the frequency (unit: Mhz), K is the serial number, K=0~79. In this case, considering that the channels between 2402Mhz and 2480Mhz have been set with numbers 0 to 39 in the related art, a corresponding relationship can be set to avoid conflicts: in the channels numbered 0 to 79, the channels are numbered 20 to 59. The channel is actually the channel numbered 0 to 39 divided based on 2402Mhz to 2480Mhz in the related art.
下面对涉及扩展信道的第二、三、四工作模式分别进行说明:The second, third, and fourth operating modes involving extended channels are described below:
第二工作模式,第一芯片和第二芯片在扩展的扩展信道之间以跳频方式传输数据。比如扩展信道为编号为-1~-20以及编号为40~59的信道,即在预设的一段时间内第一芯片和第二芯片传输数据的信道在编号为-1~-20以及编号为40~59的信道中变化。In the second working mode, the first chip and the second chip transmit data in a frequency hopping manner between the extended extended channels. For example, the extended channels are channels numbered -1 to -20 and channels numbered 40 to 59, that is, the channels through which the first chip and the second chip transmit data within a preset period of time are numbered -1 to -20 and numbered 40 to 59. 40 to 59 channels vary.
第二工作模式的适用场景可以包括但不限于:需要避开ISM频段的已知干扰,且在预设范围内存在多个不同的网络,在这种场景下,第一芯片和第二芯片工作在第二工作模式,有利于避开ISM频段的干扰,从而提高数据传输的稳定性。其中,预设范围可以根据实际需要进行设置,比如5米内或1间房内。The applicable scenarios of the second working mode may include but are not limited to: the known interference of the ISM frequency band needs to be avoided, and there are multiple different networks within the preset range. In this scenario, the first chip and the second chip work In the second working mode, it is beneficial to avoid the interference of the ISM frequency band, thereby improving the stability of data transmission. Among them, the preset range can be set according to actual needs, such as within 5 meters or within 1 room.
在具体实现中,若第一芯片和第二芯片工作在第二工作模式,由于本实施例中兼容标准蓝牙协议,即扩展信道存在的同时标准信道也存在,因此,在第二工作模式下标准信道的使用状态可以被设置为禁止使用。比如,上述的编号为-20~59的80个信道可以使用10Byte(80bit)0xFFFFFFFFFFFFFFFFFFFF表示,编号为0~39的40个标准信道的使用状态被设置为disable,编号为-20~-1以及40~59的40个扩展信道的使用状态被设置为enable。In a specific implementation, if the first chip and the second chip work in the second working mode, since this embodiment is compatible with the standard Bluetooth protocol, that is, when the extended channel exists, the standard channel also exists. Therefore, in the second working mode, the standard The usage status of the channel can be set to disabled. For example, the above-mentioned 80 channels numbered from -20 to 59 can be represented by 10Byte (80bit) 0xFFFFFFFFFFFFFFFFFFFF, and the usage status of the 40 standard channels numbered from 0 to 39 is set to disable, numbered from -20 to -1 and 40. The usage status of 40 extended channels of ~59 is set to enable.
第三工作模式,第一芯片和第二芯片在指定的第二固定信道中传输数据,第二固定信道为扩展信道中的一个,比如编号为-1~-20以及编号为40~59的信道中的一个。在指定的第二固定信道中传输数据可以理解为在预设的一段时间内第一芯片和第二芯片一直在第二固定信道中传输数据,即在预设的一段时间内传输数据的信道不会发生变化。In the third working mode, the first chip and the second chip transmit data in a designated second fixed channel, and the second fixed channel is one of the extended channels, such as channels numbered -1 to -20 and channels numbered 40 to 59 one of the. The transmission of data in the specified second fixed channel can be understood as the fact that the first chip and the second chip have been transmitting data in the second fixed channel within a preset period of time, that is, the channel for transmitting data within the preset period of time is not will change.
第三工作模式的适用场景可以包括但不限于:需要避开ISM频段的已知干扰,且在预设范围内存在1个网络,在这种场景下,第一芯片和第二芯片工作在第三工作模式,有利于避开ISM频段的干扰,从而提高数据传输的稳定性。而且,由于是在指定的第二固定信道中传输数据还有利于提高数据传输的效率。The applicable scenarios of the third working mode may include but are not limited to: the known interference of the ISM frequency band needs to be avoided, and there is one network within the preset range. In this scenario, the first chip and the second chip work in the first Three working modes are beneficial to avoid the interference of the ISM frequency band, thereby improving the stability of data transmission. Moreover, since the data is transmitted in the designated second fixed channel, it is also beneficial to improve the efficiency of data transmission.
在具体实现中,若第一芯片和第二芯片工作在第三工作模式,第二固定信道的使用状态被设置为允许使用,扩展信道中除第二固定信道之外的其他信道的使用状态被设置为禁止使用。可以理解的是,由于本实施例中兼容标准蓝牙协议,即扩展信道存在的同时标准信道也存在,因此,在第三工作模式下标准信道的使用状态也被设置为禁止使用。比如,上述的编号为-20~59的80个信道可以使用10Byte(80bit)0xFFFFFFFFFFFFFFFFFFFF表示,置0表示该信道的使用状态为disable,置1表示该信道的使用状态为enable。In a specific implementation, if the first chip and the second chip work in the third working mode, the use status of the second fixed channel is set to allow use, and the use status of other channels in the extended channel except the second fixed channel is set to Set to disable. It can be understood that, because the present embodiment is compatible with the standard Bluetooth protocol, that is, the extended channel exists and the standard channel also exists, therefore, the use state of the standard channel in the third working mode is also set to prohibit use. For example, the above 80 channels numbered from -20 to 59 can be represented by 10Byte (80bit) 0xFFFFFFFFFFFFFFFFFFFF, setting 0 to indicate that the channel's usage status is disabled, and setting 1 to indicate that the channel's usage status is enabled.
其中,第二固定信道的指定方式与上述的第一固定信道的指定方式类似,不同之处在于,第二固定信道的指定范围为扩展信道,第一固定信道的指定范围为标准信道,为避免重复,此处对第二固定信道的指定方式不再赘述。The designation method of the second fixed channel is similar to the designation method of the first fixed channel above, except that the designated range of the second fixed channel is the extended channel, and the designated range of the first fixed channel is the standard channel. Repeat, the designation manner of the second fixed channel will not be repeated here.
可以理解的是,第一工作模式和第三工作模式的共同点在于均支持第一芯片和第二芯片在指定的固定信道中传输数据。现有技术中,通信双方在40个标准信道进行自适应跳频,无法指定到固定信道。如果需要进行数据传输的多个设备在40个标准信道进行自适应跳频的过程中同时跳频到相同的信道,可能会对设备间的数据传输产生干扰,影响数据传输的效率。而本实施例中,支持通信双方工作在第一工作模式或第三工作模式,可以针对不同的设备指定不同的信道,使得多设备之间可以按照指定的固定信道进行数据传输,即通信双方都明确应该在哪个信道中进行传输,有利于避免自适应跳频时多个设备跳频到相同的信道,从而避免多设备之间的传输干扰,有利于提高数据传输的效率。It can be understood that the common point of the first working mode and the third working mode is that both support the first chip and the second chip to transmit data in a designated fixed channel. In the prior art, both communication parties perform adaptive frequency hopping on 40 standard channels, and cannot be assigned to a fixed channel. If multiple devices that need to perform data transmission hop to the same channel at the same time in the process of adaptive frequency hopping of 40 standard channels, it may cause interference to data transmission between devices and affect the efficiency of data transmission. However, in this embodiment, both parties in the communication are supported to work in the first working mode or the third working mode, and different channels can be specified for different devices, so that data transmission between multiple devices can be performed according to the specified fixed channel, that is, both parties in the communication can perform data transmission. Identifying which channel should be used for transmission is beneficial to avoid frequency hopping of multiple devices to the same channel during adaptive frequency hopping, thereby avoiding transmission interference between multiple devices and improving the efficiency of data transmission.
第四工作模式,第一芯片和第二芯片在基于标准蓝牙协议的标准信道和扩展的扩展信道之间以跳频方式传输数据。在一个例子中,通过表1可以看出,信道的频率范围为2360Mhz-2520Mhz共160Mhz,划分为80个信道,信道的编号为-20~59。第四工作模式下,第一芯片和第二芯片可以在编号为-20~59的80个信道之间跳频,即在预设的一段时间内第一芯片和第二芯片传输数据的信道在编号为-20~59的信道中变化。In the fourth working mode, the first chip and the second chip transmit data in a frequency hopping manner between the standard channel based on the standard Bluetooth protocol and the extended extended channel. In an example, it can be seen from Table 1 that the frequency range of the channels is 2360Mhz-2520Mhz, a total of 160Mhz, which are divided into 80 channels, and the channel numbers are -20 to 59. In the fourth working mode, the first chip and the second chip can frequency hop between 80 channels numbered -20 to 59, that is, within a preset period of time, the channel through which the first chip and the second chip transmit data is Changes in channels numbered -20 to 59.
第四工作模式的适用场景可以包括但不限于:低功耗蓝牙网络密度较高的场景。考虑到现有技术中,在低功耗蓝牙网络密度较高的场景下,多个设备在40个信道进行自适应跳频,数据传输压力较大。本实施例中,支持多个设备在超过40个信道(比如上述的80个信道)进行自适应跳频,将40个信道内的 数据传输压力,平均在更多的信道中,比如平均到80个信道中,有利于缓解数据传输,从而在一定程度上提高数据传输的稳定性,还可以在同一个网络拓扑中支持更多的设备进行数据传输。另外,相比于现有技术在40个信道内自适应跳频,本实施例中增加扩展的信道,有利于提高网络通讯的并发容量,可以在同一个网络拓扑中支持更多设备,满足更多设备的数据传输需求。Applicable scenarios of the fourth working mode may include, but are not limited to: scenarios with high network density of Bluetooth low energy consumption. Considering that in the prior art, in a scenario with a high density of low-power bluetooth network, multiple devices perform adaptive frequency hopping on 40 channels, and the pressure of data transmission is relatively high. In this embodiment, multiple devices are supported to perform adaptive frequency hopping on more than 40 channels (such as the above-mentioned 80 channels), and the data transmission pressure in the 40 channels is averaged in more channels, for example, an average of 80 In each channel, it is beneficial to ease data transmission, thereby improving the stability of data transmission to a certain extent, and can also support more devices in the same network topology for data transmission. In addition, compared with the adaptive frequency hopping within 40 channels in the prior art, the expansion of channels is added in this embodiment, which is beneficial to improve the concurrent capacity of network communication, and can support more devices in the same network topology. Data transmission needs of multiple devices.
在具体实现中,第一芯片和第二芯片工作在第四工作模式时,比如在编号为-20~59的80个信道中以自适应跳频的方式进行数据传输,80个信道的使用状态均设置为允许使用enable。In a specific implementation, when the first chip and the second chip work in the fourth working mode, for example, data transmission is performed in 80 channels numbered from -20 to 59 in an adaptive frequency hopping manner, and the usage status of the 80 channels is Both are set to allow the use of enable.
可以理解的是,第二工作模式和第四工作模式的共同点在于均是一种跳频的工作模式,不同之处在于跳频的范围不同。在一个例子中,在第二工作模式或第四工作模式下,跳频后的信道通过以下方式确定,参考图1,包括:It can be understood that the common point of the second working mode and the fourth working mode is that both are a frequency hopping working mode, and the difference is that the frequency hopping range is different. In an example, in the second working mode or the fourth working mode, the frequency-hopping channel is determined in the following manner, referring to FIG. 1 , including:
步骤101:根据第一芯片为第二芯片分配的接入地址,确定跳频阶跃值。Step 101: Determine a frequency hopping step value according to the access address allocated by the first chip to the second chip.
步骤102:根据跳频阶跃值和信道总数量,确定跳频后的信道。Step 102: Determine the channel after frequency hopping according to the frequency hopping step value and the total number of channels.
其中,信道总数量为标准信道的数量和扩展信道的数量之和。可以理解的是,第一芯片和第二芯片在以自适应跳频的方式进行数据传输时,均会确定跳频后的信道,因此上述步骤101至步骤102为第一芯片和第二芯片在自适应跳频的过程中均会执行的步骤。下面以第一芯片确定跳频后的信道的过程进行说明:The total number of channels is the sum of the number of standard channels and the number of extended channels. It can be understood that when the first chip and the second chip perform data transmission in an adaptive frequency hopping manner, the channel after the frequency hopping will be determined. Therefore, the above steps 101 to 102 are the first chip and the second chip. The steps that are performed in the process of adaptive frequency hopping. The following describes the process of determining the channel after frequency hopping by the first chip:
第一芯片与第二芯片建立蓝牙连接后,第一芯片为第二芯片分配接入地址Access Address,第一芯片与第二芯片中均可以存储该接入地址。第一芯片根据接入地址,确定信道识别码channelIdentifier。第一芯片确定当前的连接事件计数值counter,然后根据信道识别码和连接事件计数值,确定跳频阶跃值。 第一芯片对跳频阶跃值A和跳频工作模式所支持的信道的总数量B进行取模运算即A mod B,并根据取模运算的结果确定跳频后的信道。After the first chip and the second chip establish a Bluetooth connection, the first chip assigns an access address Access Address to the second chip, and both the first chip and the second chip can store the access address. The first chip determines the channel identifier channelIdentifier according to the access address. The first chip determines the current connection event count value counter, and then determines the frequency hopping step value according to the channel identification code and the connection event count value. The first chip performs a modulo operation on the frequency hopping step value A and the total number B of channels supported by the frequency hopping working mode, that is, A mod B, and determines the channel after the frequency hopping according to the result of the modulo operation.
在一个例子中,假设信道总数量为80,为进一步便于理解上述过程,可以参考图2,图2为确定跳频后的信道的编号的框图。其中,信道识别码channelIdentifier和连接事件计数值counter输入伪随机数发生器Pseudo Random Number Generator后,伪随机数发生器输出跳频阶跃值,然后通过对跳频阶跃值和80进行取模运算得到未映射的信道unmappedChannel的编号。如果未映射的信道的使用状态为enable,则直接将未映射的信道作为跳频后的信道;如果未映射的信道的使用状态为disable,则在使用状态为enable的各信道中再映射得到跳频后的信道。In an example, it is assumed that the total number of channels is 80. To further facilitate the understanding of the above process, reference may be made to FIG. 2 , which is a block diagram of determining the number of channels after frequency hopping. Among them, after the channel identification code channelIdentifier and the connection event count value counter are input into the pseudo random number generator Pseudo Random Number Generator, the pseudo random number generator outputs the frequency hopping step value, and then the modulo operation is performed on the frequency hopping step value and 80. Get the number of the unmapped channel unmappedChannel. If the usage state of the unmapped channel is enable, the unmapped channel is directly used as the channel after frequency hopping; if the usage state of the unmapped channel is disabled, the hops are remapped in each channel whose usage state is enable. frequency channel.
需要说明的是,上述自适应跳频的过程相当于是对蓝牙核心协议Core_v5.2中规定的信道选择算法2(Channel Selection algorithm#2)进行的进一步改进,改进之处在于原算法2中使用的mod 37,更新为mod 80,使输出结果落在0~79范围内(对应编号为-20~59的信道)。It should be noted that the above adaptive frequency hopping process is equivalent to a further improvement of the channel selection algorithm 2 (Channel Selection algorithm#2) specified in the Bluetooth core protocol Core_v5.2. The improvement lies in the original algorithm 2 used in mod 37, updated to mod 80, so that the output results fall within the range of 0 to 79 (corresponding to channels numbered -20 to 59).
需要说明的是,上述的跳频过程只是以图1、2中的方式为例,在具体实现中并不以此为限。比如还可以对蓝牙核心协议Core_v5.2中规定的信道选择算法1(Channel Selection algorithm#1)进行进一步改进,将原算法1中使用mod37更新为mod 80。It should be noted that, the above-mentioned frequency hopping process is only taken as an example in the manners in FIGS. 1 and 2 , and is not limited to this in the specific implementation. For example, it is also possible to further improve the channel selection algorithm 1 (Channel Selection algorithm #1) specified in the Bluetooth core protocol Core_v5.2, and update the mod37 used in the original algorithm 1 to mod 80.
在一个例子中,第一芯片为发送切换指令的芯片,则第二芯片为接收切换指令的芯片。应用于第一芯片的数据传输方法的流程图可以参考图3,包括:In one example, the first chip is the chip that sends the switching instruction, and the second chip is the chip that receives the switching instruction. The flowchart of the data transmission method applied to the first chip can refer to FIG. 3, including:
步骤301:若满足预设的触发条件,向第二芯片发送切换指令。Step 301: If a preset trigger condition is satisfied, send a switching instruction to the second chip.
步骤302:在切换时间点将第一芯片的当前工作模式切换为目标工作模 式。Step 302: Switch the current working mode of the first chip to the target working mode at the switching time point.
其中,切换指令携带切换时间点和目标工作模式,切换指令用于指示第二芯片在切换时间点将第二芯片的当前工作模式切换为目标工作模式。也就是说,第一芯片和第二芯片在同一切换时间点将各自的当前工作模式切换为目标工作模式。The switching instruction carries the switching time point and the target operating mode, and the switching instruction is used to instruct the second chip to switch the current operating mode of the second chip to the target operating mode at the switching time point. That is to say, the first chip and the second chip switch their respective current working modes to the target working modes at the same switching time point.
在另一个例子中,第一芯片为接收切换指令的芯片,则第二芯片为发送切换指令的芯片。应用于第一芯片的数据传输方法的流程图可以参考图4,包括:In another example, the first chip is the chip that receives the switching instruction, and the second chip is the chip that sends the switching instruction. For a flowchart of the data transmission method applied to the first chip, reference may be made to FIG. 4 , including:
步骤401:接收第二芯片在满足预设的触发条件时发送的切换指令。Step 401: Receive a switching instruction sent by the second chip when a preset trigger condition is met.
步骤402:在切换时间点将第一芯片的当前工作模式切换为目标工作模式。Step 402: Switch the current working mode of the first chip to the target working mode at the switching time point.
其中,切换指令携带切换时间点和目标工作模式,第二芯片在切换时间点将第二芯片的当前工作模式切换为目标工作模式。The switching instruction carries the switching time point and the target working mode, and the second chip switches the current working mode of the second chip to the target working mode at the switching time point.
步骤302和步骤402中提到的当前工作模式和目标工作模式为标准工作模式和非标准工作模式中的两种不同工作模式。比如,第一芯片和第二芯片支持的工作模式包括标准工作模式和上述4种非标准工作模式,即共支持5种工作模式,则当前工作模式和目标工作模式为5种工作模式中的任意两种。The current working mode and the target working mode mentioned in step 302 and step 402 are two different working modes in a standard working mode and a non-standard working mode. For example, the working modes supported by the first chip and the second chip include the standard working mode and the above-mentioned 4 non-standard working modes, that is, a total of 5 working modes are supported, and the current working mode and the target working mode are any of the 5 working modes. two kinds.
在一个例子中,两种不同工作模式中的其中一种为标准工作模式。即,要么当前工作模式为标准工作模式,要么目标工作模式为标准工作模式,也就是说,第一芯片和第二芯片可以在标准工作模式和非标准工作模式之间切换。考虑到大多数厂家的芯片均支持标准工作模式,这样的切换方式有利于适用更多厂家生产的芯片。In one example, one of the two different operating modes is the standard operating mode. That is, either the current working mode is the standard working mode, or the target working mode is the standard working mode, that is, the first chip and the second chip can switch between the standard working mode and the non-standard working mode. Considering that the chips of most manufacturers support the standard working mode, such a switching method is beneficial to the chips produced by more manufacturers.
在一个例子中,当前工作模式为标准工作模式,目标工作模式为上述第一、二、三、四工作模式中的任意一种。目标工作模式具体为哪一种,可以根据第一芯片和第二芯片所处的实际场景以及上面提到的四种非标准工作模式的适用场景确定。比如,第一芯片和第二芯片所处的实际场景为低功耗蓝牙网络密度较高的场景,则目标工作模式为第四工作模式。In one example, the current working mode is the standard working mode, and the target working mode is any one of the first, second, third, and fourth working modes above. The specific target working mode can be determined according to the actual scene in which the first chip and the second chip are located and the applicable scene of the above-mentioned four non-standard working modes. For example, if the actual scene in which the first chip and the second chip are located is a scene with high Bluetooth low energy network density, the target working mode is the fourth working mode.
在另一个例子中,当前工作模式为四种非标准工作模式中的任意一种,目标工作模式为标准工作模式。也就是说,第一芯片和第二芯片的工作模式可以在标准工作模式和非标准工作模式之间切换。In another example, the current working mode is any one of the four non-standard working modes, and the target working mode is the standard working mode. That is, the working modes of the first chip and the second chip can be switched between the standard working mode and the non-standard working mode.
本实施例中,第一芯片和第二芯片除了支持标准蓝牙协议,还支持新增的链路控制协议,即上述提到的非标准工作模式所基于的自定义的私有协议。第一芯片可以基于新增的链路控制协议,向第二芯片发送切换指令,该切换指令可以为协议数据单元(Protocol Data Unit,PDU)数据包。In this embodiment, the first chip and the second chip not only support the standard Bluetooth protocol, but also support the newly added link control protocol, that is, the self-defined private protocol based on the non-standard working mode mentioned above. The first chip may send a switching instruction to the second chip based on the newly added link control protocol, where the switching instruction may be a protocol data unit (Protocol Data Unit, PDU) data packet.
在一个例子中,上述PDU数据包的字段可以包括:操作码(Operation Code,OPcode)、切换时间点(instant)、目标工作模式的序号(Mode)、指定信道的编号(Ch)。下面对上述的各字段进行具体说明:In an example, the fields of the above-mentioned PDU data packet may include: an operation code (Operation Code, OPcode), a switching time point (instant), a sequence number (Mode) of a target working mode, and a number (Ch) of a designated channel. The above fields are described in detail below:
操作码(OPcode):用于描述机器语言指令中,指定要执行某种操作的那部分机器码。本实施例中OPcode的值用于表明该PDU数据包是一条切换指令。其中,OPcode的值可以在标准蓝牙协议中还未被使用过的值中选择一个,以避免和现有的标准蓝牙协议中的其他指令产生冲突;比如,本实施例中OPcode的值可以设置为0XDF。可以理解的是,第二芯片可能会接收到很多PDU数据包,如果第二芯片在一个PDU数据包中识别出OPcode的值为0XDF,则可以确定该PDU数据包实际是一条切换指令。Operation code (OPcode): It is used to describe the part of the machine code in the machine language instruction that specifies the operation to be performed. The value of OPcode in this embodiment is used to indicate that the PDU data packet is a switching command. Among them, the value of OPcode can be selected from the values that have not been used in the standard Bluetooth protocol, so as to avoid conflicts with other instructions in the existing standard Bluetooth protocol; for example, the value of OPcode in this embodiment can be set to 0XDF. It can be understood that the second chip may receive many PDU data packets. If the second chip recognizes that the OPcode value is 0XDF in a PDU data packet, it can be determined that the PDU data packet is actually a switching command.
切换时间点(instant):用于表明第一芯片和第二芯片应该共同在哪一个时间点切换工作模式,切换时间点通常设置为当前的evt cnt+n,evt cnt为当前通信次数的计数值,两个芯片刚建立通信连接时,当前通信次数的计数值为0。n可以由本领域技术人员根据实际需要进行设置,比如设置为6。在具体实现中,本领域技术人员可以通过针对第一芯片和第二芯片对外提供的API设置上述n的取值。可以理解的是,第一芯片和第二芯片建立连接后,计数器开始计时,每经过一个通信间隔时长evt cnt+1,其中,通信间隔时长为预先确定的固定值。当前的evt cnt+n可以理解为从当前起算未来的第n个通信间隔时长结束后的时刻。Switching time point (instant): It is used to indicate at which time point the first chip and the second chip should switch the working mode together. The switching time point is usually set to the current evt cnt+n, and evt cnt is the count value of the current communication times. , when the two chips just establish a communication connection, the count value of the current communication times is 0. n can be set by those skilled in the art according to actual needs, for example, set to 6. In specific implementation, those skilled in the art can set the value of the above n through APIs provided externally by the first chip and the second chip. It can be understood that, after the first chip and the second chip are connected, the counter starts timing, and each time a communication interval elapses with a duration evt cnt+1, where the communication interval duration is a predetermined fixed value. The current evt cnt+n can be understood as the time after the end of the nth communication interval in the future from the current time.
目标工作模式的序号(Mode):Mode的取值可以为:0、1、2、3、4;其中,0表示标准工作模式(简称模式0),1表示第一工作模式(简称模式1),2表示第二工作模式(简称模式2),3表示第三工作模式(简称模式3),4表示第四工作模式(简称模式4)。The serial number of the target working mode (Mode): The value of Mode can be: 0, 1, 2, 3, 4; where 0 represents the standard operating mode (referred to as Mode 0), and 1 represents the first operating mode (referred to as Mode 1) , 2 represents the second operating mode (referred to as mode 2), 3 represents the third operating mode (referred to as mode 3), and 4 represents the fourth operating mode (referred to as mode 4).
指定信道的编号(Ch):当目标工作模式为第一工作模式,Ch为第一固定信道的编号;当目标工作模式为第三工作模式,Ch为第二固定信道的编号。也就是说,若目标工作模式为第一工作模式,切换指令还携带第一固定信道的编号;若目标工作模式为第三工作模式,切换指令还携带第二固定信道的编号。Designated channel number (Ch): when the target working mode is the first working mode, Ch is the number of the first fixed channel; when the target working mode is the third working mode, Ch is the number of the second fixed channel. That is, if the target working mode is the first working mode, the switching instruction also carries the number of the first fixed channel; if the target working mode is the third working mode, the switching instruction also carries the number of the second fixed channel.
在一个例子中,如果第一芯片和第二芯片具有的工作模式不包括第一工作模式或第三工作模式,则上述PDU数据包的字段中可以不包括上述的指定信道的编号(Ch),有利于减少PDU数据包中的数据量,提高PDU数据包即切换指令的传输效率。然而,在具体实现中,如果第一芯片和第二芯片具有的工作模式不包括第一工作模式或第三工作模式,则上述PDU数据包的字段中也可 以包括上述的指定信道的编号(Ch),这种情况下可以忽略指定信道的编号(Ch)这一字段的值,即无论指定信道的编号(Ch)这一字段的值是多少,接收到PDU数据包的芯片均忽略这一字段的值。这种情况下,即使后续根据实际需要在第一芯片和第二芯片具有的工作模式中再增加第一工作模式或第三工作模式,也无需在PDU数据包中再增加字段,提高了增加第一芯片和第二芯片所具有的工作模式的便捷性。In one example, if the working modes of the first chip and the second chip do not include the first working mode or the third working mode, the field of the above-mentioned PDU data packet may not include the above-mentioned number (Ch) of the designated channel, It is beneficial to reduce the amount of data in the PDU data packet and improve the transmission efficiency of the PDU data packet, that is, the switching instruction. However, in a specific implementation, if the working modes of the first chip and the second chip do not include the first working mode or the third working mode, the field of the above-mentioned PDU data packet may also include the above-mentioned number of the designated channel (Ch ), in this case, the value of the specified channel number (Ch) field can be ignored, that is, no matter what the value of the specified channel number (Ch) field is, the chip that receives the PDU data packet ignores this field value of . In this case, even if the first working mode or the third working mode is added to the working modes of the first chip and the second chip according to actual needs, there is no need to add a field in the PDU data packet, which improves the increase of the first working mode or the third working mode. The convenience of the working modes of one chip and the second chip.
在一个例子中,第一芯片和第二芯片具有的工作模式包括上述5种,即模式0、模式1、模式2、模式3、模式4,PDU数据包的字段中包括上述四个字段。当目标工作模式为模式0、模式2或模式4时,接收到PDU数据包的芯片可以忽略指定信道的编号(Ch)这一字段的值。In an example, the working modes of the first chip and the second chip include the above five types, namely mode 0, mode 1, mode 2, mode 3, and mode 4, and the fields of the PDU data packet include the above four fields. When the target working mode is Mode 0, Mode 2 or Mode 4, the chip that receives the PDU data packet can ignore the value of the specified channel number (Ch) field.
在具体实现中,第一芯片和第二芯片之间工作模式的切换可以包括:模式0和模式1之间的切换、模式0和模式2之间的切换、模式0和模式3之间的切换、模式0和模式4之间的切换,即在标准工作模式和非标准工作模式之间切换,使得在兼容标准蓝牙协议的同时可以满足不场景下的数据传输需求。In a specific implementation, the switching of the operating modes between the first chip and the second chip may include: switching between mode 0 and mode 1, switching between mode 0 and mode 2, and switching between mode 0 and mode 3 , switching between mode 0 and mode 4, that is, switching between the standard working mode and the non-standard working mode, so that it can meet the data transmission requirements in different scenarios while being compatible with the standard Bluetooth protocol.
可选的,根据实际需要,第一芯片和第二芯片也可以在不同的非标准工作模式之间切换。Optionally, according to actual needs, the first chip and the second chip can also be switched between different non-standard working modes.
在一个例子中,非标准工作模式至少包括第二、三、四工作模式中的任意一种或多种,即扩展信道和标准信道同时存在。下面以第一芯片和第二芯片支持的输出频率为2360Mhz~2520Mhz,划分的信道的编号为-20~59为例,进行说明:In an example, the non-standard working mode includes at least any one or more of the second, third, and fourth working modes, that is, the extended channel and the standard channel coexist. The following takes the output frequency supported by the first chip and the second chip as 2360Mhz to 2520Mhz, and the numbers of the divided channels are -20 to 59 as an example to illustrate:
在一个例子中,目标工作模式为模式0,第一芯片和第二芯片将当前工作模式切换为模式0可以理解为:第一芯片和第二芯片同时在切换时间点将编 号为0~36的信道的使用状态设置为enable,将编号为-20~-1、37~59的信道的使用状态设置为disable。由于,现有的标准蓝牙协议规定编号为37~39的3个信道为用于广播的通道,因此,在进行数据传输时,可以将编号为0~36的信道的使用状态设置为enable。第一芯片和第二芯片从切换时间点开始在编号为0~36的信道之间以自适应跳频的方式进行数据传输。In an example, the target working mode is mode 0, and the first chip and the second chip switch the current working mode to mode 0, which can be understood as: the first chip and the second chip will switch the number of 0 to 36 at the switching time point at the same time. The usage status of the channel is set to enable, and the usage status of the channels numbered -20 to -1 and 37 to 59 is set to disable. Since the existing standard Bluetooth protocol stipulates that the three channels numbered 37 to 39 are channels used for broadcasting, during data transmission, the use state of the channels numbered 0 to 36 can be set to enable. The first chip and the second chip perform data transmission between the channels numbered 0 to 36 in an adaptive frequency hopping manner from the switching time point.
在一个例子中,目标工作模式为模式1,第一固定信道的编号为20,第一芯片和第二芯片将当前工作模式切换为模式1可以理解为:第一芯片和第二芯片同时在切换时间点将编号为20的信道的使用状态设置为enable,并将其余编号(-20~19,21~59)的信道的使用状态均设置为disable。第一芯片和第二芯片从切换时间点开始在编号为20的信道中进行数据传输。In an example, the target working mode is Mode 1, the number of the first fixed channel is 20, and the first chip and the second chip switch the current working mode to Mode 1, which can be understood as: the first chip and the second chip are switching at the same time At the time point, the usage status of the channel numbered 20 is set to enable, and the usage status of the other channels with numbers (-20 to 19, 21 to 59) is set to disable. The first chip and the second chip perform data transmission in the channel numbered 20 from the switching time point.
在一个例子中,目标工作模式为模式2,第一芯片和第二芯片将当前工作模式切换为模式2可以理解为:第一芯片和第二芯片同时在切换时间点将编号为-20~-1和40~59的信道的使用状态设置为enable,并将其余编号(0~39)的信道的使用状态均设置为disable。第一芯片和第二芯片从切换时间点开始在编号为-20~-1和40~59的信道之间以跳频方式进行数据传输。In an example, the target operating mode is mode 2, and the first chip and the second chip switch the current operating mode to mode 2, which can be understood as: the first chip and the second chip will be numbered -20~- at the switching time point at the same time. The usage states of channels 1 and 40 to 59 are set to enable, and the usage states of the remaining channels (0 to 39) are all set to disable. The first chip and the second chip perform data transmission in a frequency hopping manner between the channels numbered -20 to -1 and 40 to 59 from the switching time point.
在一个例子中,目标工作模式为模式4,第一芯片和第二芯片将当前工作模式切换为模式4可以理解为:第一芯片和第二芯片同时在切换时间点将编号为-20~59的信道的使用状态均设置为enable。第一芯片和第二芯片从切换时间点开始在编号为-20~59的信道之间以自适应跳频的方式进行数据传输。In an example, the target operating mode is mode 4, and the first chip and the second chip switch the current operating mode to mode 4, which can be understood as: the first chip and the second chip will be numbered from -20 to 59 at the switching time point at the same time. The usage status of the channel is set to enable. The first chip and the second chip perform data transmission between the channels numbered -20 to 59 in an adaptive frequency hopping manner from the switching time point.
在一个例子中,第一芯片和第二芯片进行数据传输的示意图可以参考图5,假设,第一芯片设置于主设备,第二芯片设置于从设备,第一芯片和第二芯片中的倍频器的输出频率范围均为2360Mhz~2520Mhz。寄存器可以配置倍频器 的输出频率,通过软件配置寄存器可以使得倍频器输出2360Mhz~2520Mhz之间任意一种频率。比如,确定第一芯片和第二芯片当前要在编号为20的信道中进行数据传输,编号为20的信道对应的频率为:f=2402+20*2=2442Mhz,则通过软件配置寄存器可以控制倍频器输出2442Mhz。第一芯片将需要发送的基带信号经过调制后,将基带信号调制到2442Mhz,再由主设备的天线将调制后的信号发射到空中。从设备的天线接收到该信号后,由第二芯片对该信号进行与第一芯片的调制操作对应的解调操作,从而将接收到的信号还原为第一芯片需要发送的基带信号。In an example, for a schematic diagram of data transmission between the first chip and the second chip, reference may be made to FIG. 5 . It is assumed that the first chip is set in the master device, the second chip is set in the slave device, and the number of times between the first chip and the second chip is The output frequency range of the frequency converter is 2360Mhz ~ 2520Mhz. The register can configure the output frequency of the frequency multiplier, and through the software configuration register, the frequency multiplier can output any frequency between 2360Mhz and 2520Mhz. For example, it is determined that the first chip and the second chip are currently transmitting data in the channel numbered 20, and the frequency corresponding to the channel numbered 20 is: f=2402+20*2=2442Mhz, then the software configuration register can control The frequency multiplier outputs 2442Mhz. The first chip modulates the baseband signal to be sent, modulates the baseband signal to 2442Mhz, and then transmits the modulated signal into the air by the antenna of the main device. After receiving the signal from the antenna of the device, the second chip performs a demodulation operation corresponding to the modulation operation of the first chip, thereby restoring the received signal to the baseband signal to be sent by the first chip.
在一个例子中,预设的触发条件为第一芯片接收到预设的触发信息。其中,预设的触发消息可以根据实际需要进行设置,触发信息中可以携带切换时间点和目标工作模式,当目标工作模式为模式1时,触发信息中还可以携带指定的信道的编号。本领域技术人员可以调用上述的API,根据实际需要自定义切换时间点和目标工作模式,将自定义的切换时间点和目标工作模式携带在触发消息中发送给第一芯片。In one example, the preset trigger condition is that the first chip receives preset trigger information. The preset trigger message can be set according to actual needs, and the trigger information can carry the switching time point and the target working mode. When the target working mode is Mode 1, the trigger information can also carry the number of the designated channel. Those skilled in the art can call the above-mentioned API, customize the switching time point and the target working mode according to actual needs, carry the customized switching time point and the target working mode in the trigger message and send it to the first chip.
可选的,触发信息可以为按键信息,触摸信息等。下面以按键信息为例进行说明:比如,第一芯片设置于主设备中,第一芯片接收的按键信息可以由主设备上设置的按键触发。再比如,第一芯片接收的按键信息还可以来自从设备,从设备检测到从设备上的按键被按压时,从设备向第一芯片发送按键信息。可选的,第一芯片接收的按键信息还可以来自除了主设备和从设备之外的第三方设备,第三方设备检测到第三方设备上的按键被按压时,向第一芯片发送按键信息。Optionally, the trigger information may be key information, touch information, and the like. The following description takes the key information as an example: for example, the first chip is set in the main device, and the key information received by the first chip can be triggered by a key set on the main device. For another example, the key information received by the first chip may also come from a slave device, and when the slave device detects that a key on the slave device is pressed, the slave device sends key information to the first chip. Optionally, the key information received by the first chip may also come from a third-party device other than the master device and the slave device. When the third-party device detects that a key on the third-party device is pressed, the key information is sent to the first chip.
在一个例子中,预设的触发条件可以为:第一芯片检测到当前处于低功 耗蓝牙网络高密度的传输场景。第一芯片检测到当前处于低功耗蓝牙网络高密度的传输场景的方式可以为:第一芯片检测到当前通信的过程中,接收信号强度指示(Received signal strength indicator,RSSI)大于预设强度阈值的持续时长大于预设时长阈值,且在该预设时长阈值内的丢包率大于预设丢包率阈值。其中,预设强度阈值、预设时长阈值和预设丢包率阈值可以根据实际需要进行设定,旨在表明第一芯片在当前的通信过程中RSSI一直比较强但却总是出现丢包的情况。在这一触发条件下,目标工作模式为适用于低功耗蓝牙网络高密度的传输场景下的第四工作模式。In one example, the preset trigger condition may be: the first chip detects that it is currently in a high-density low-power Bluetooth network transmission scenario. The manner in which the first chip detects a current high-density low-power Bluetooth network transmission scenario may be: in the process of the first chip detecting the current communication, the received signal strength indicator (Received signal strength indicator, RSSI) is greater than a preset strength threshold. The duration is greater than the preset duration threshold, and the packet loss rate within the preset duration threshold is greater than the preset packet loss rate threshold. Among them, the preset intensity threshold, preset duration threshold and preset packet loss rate threshold can be set according to actual needs, which are intended to indicate that the RSSI of the first chip is always strong in the current communication process, but packet loss always occurs. Happening. Under this trigger condition, the target working mode is the fourth working mode suitable for the high-density transmission scenario of the Bluetooth low energy network.
需要说明的是,本实施例中的上述各示例均为为方便理解进行的举例说明,并不对本发明的技术方案构成限定。It should be noted that the above examples in this embodiment are all examples for the convenience of understanding, and do not limit the technical solutions of the present invention.
本申请实施例,针对第一芯片和第二芯片提供了可切换的工作模式,有利于满足不同场景下的数据传输需求。由于标准工作模式为基于标准蓝牙协议的标准信道之间以跳频方式与第二芯片传输数据的工作模式,即第一芯片和第二芯片能够在兼容现有的标准蓝牙协议的同时,支持其他非标准工作模式,有利于在满足不同场景下的数据传输需求的同时扩大第一芯片和第二芯片的适用范围,使得第一芯片和第二芯片的受众更广。The embodiments of the present application provide switchable working modes for the first chip and the second chip, which is beneficial to meet data transmission requirements in different scenarios. Since the standard working mode is a working mode in which data is transmitted between the standard channels based on the standard Bluetooth protocol and the second chip in a frequency hopping manner, that is, the first chip and the second chip can be compatible with the existing standard Bluetooth protocol while supporting other The non-standard working mode is beneficial to expand the scope of application of the first chip and the second chip while meeting the data transmission requirements in different scenarios, so that the audience of the first chip and the second chip is wider.
在一个例子中,在上述内容的基础上,第一芯片为发送切换指令的芯片,则第二芯片为接收切换指令的芯片。应用于第一芯片的的数据传输方法的流程图可以如图6所示,包括:In an example, based on the above content, the first chip is the chip that sends the switching instruction, and the second chip is the chip that receives the switching instruction. The flowchart of the data transmission method applied to the first chip may be shown in FIG. 6 , including:
步骤601:确定第一芯片处于已与第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态,向第二芯片发送切换指令。Step 601: It is determined that the first chip is in a state in which a Bluetooth connection has been established with the second chip and the Bluetooth pairing has not been performed, and a switching instruction is sent to the second chip.
步骤602:在切换时间点将第一芯片的当前工作模式切换为目标工作模 式。Step 602: Switch the current working mode of the first chip to the target working mode at the switching time point.
在另一个例子中,在上述内容的基础上,第一芯片为接收切换指令的芯片,则第二芯片为发送切换指令的芯片。应用于第一芯片的的数据传输方法的流程图可以如图7所示,包括:In another example, based on the above content, the first chip is the chip that receives the switching instruction, and the second chip is the chip that sends the switching instruction. The flowchart of the data transmission method applied to the first chip may be shown in FIG. 7 , including:
步骤701:接收第二芯片在确定第二芯片处于已与第一芯片建立蓝牙连接且尚未进行蓝牙配对的状态时发送切换指令。Step 701: Receive a switching instruction sent by the second chip when it is determined that the second chip is in a state in which a Bluetooth connection has been established with the first chip and a Bluetooth pairing has not been performed.
步骤702:在切换时间点将第一芯片的当前工作模式切换为目标工作模式。Step 702: Switch the current working mode of the first chip to the target working mode at the switching time point.
其中,步骤602和步骤702中提到的目标工作模式为第二工作模式或第三工作模式。The target working mode mentioned in step 602 and step 702 is the second working mode or the third working mode.
在步骤601和步骤701中,第一芯片与第二芯片建立的蓝牙连接可以为基于模式0,建立的低功耗蓝牙连接后。基于现有的标准蓝牙协议,在建立低功耗蓝牙连接后,第一芯片和第二芯片会进入蓝牙配对的流程,蓝牙配对的流程中,配对双方会进行秘钥交换。本实施例中考虑到,目前的监听设备大部分支持标准蓝牙协议,容易监听到标准蓝牙协议规定的标准频段,因此容易窃取蓝牙配对的过程中的秘钥,因此,本实施例中如果发送切换指令的芯片(第一芯片或第二芯片)确定第一芯片处于已与第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态,则发送切换指令的芯片向接收切换指令的芯片发送切换指令,避免第一芯片和第二芯片在蓝牙配对的过程中基于标准蓝牙协议的标准频段交换秘钥,从而避免秘钥被盗。In step 601 and step 701, the Bluetooth connection established between the first chip and the second chip may be a low-power Bluetooth connection established based on mode 0. Based on the existing standard Bluetooth protocol, after the low-power Bluetooth connection is established, the first chip and the second chip will enter the Bluetooth pairing process. During the Bluetooth pairing process, the pairing parties will exchange secret keys. In this embodiment, it is considered that most of the current monitoring devices support the standard Bluetooth protocol, and it is easy to monitor the standard frequency band specified by the standard Bluetooth protocol, so it is easy to steal the secret key in the process of Bluetooth pairing. Therefore, in this embodiment, if the sending switch The chip that sends the instruction (the first chip or the second chip) determines that the first chip is in a state where the Bluetooth connection has been established with the second chip and the Bluetooth pairing has not yet been performed. In the process of Bluetooth pairing, the first chip and the second chip exchange secret keys based on the standard frequency band of the standard Bluetooth protocol, thereby preventing the secret keys from being stolen.
在一个例子中,确定第一芯片处于已与第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态,可以理解为:第一芯片向第二芯片发送了安全请求Security  request之后,且第一芯片尚未接收到第二芯片发送的配对请求Pairing request。In an example, it is determined that the first chip is in a state in which a Bluetooth connection has been established with the second chip and the Bluetooth pairing has not yet been performed, which can be understood as: after the first chip sends a security request to the second chip The pairing request sent by the second chip is received.
在另一个例子中,确定第一芯片处于已与第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态,还可以理解为:第一芯片接收到第二芯片发送的安全请求Security request之后,且第一芯片尚未向第二芯片发送配对请求Pairing request。也就是说,第一芯片在接收Security request之后和发送Pairing request之间,第一芯片向第二芯片发送切换指令,使得第一芯片和第二芯片可以在合理的时机将工作模式切换为目标工作模式。In another example, it is determined that the first chip is in a state where the Bluetooth connection has been established with the second chip and the Bluetooth pairing has not been performed, which can also be understood as: after the first chip receives the security request sent by the second chip, the A chip has not sent a pairing request to the second chip. That is to say, after the first chip receives the Security request and sends the Pairing request, the first chip sends a switching instruction to the second chip, so that the first chip and the second chip can switch the working mode to the target operation at a reasonable time. model.
下面以扩展后得到上述表1中的80个信道为例,对目标工作模式为第二工作模式(模式2)或是第三工作模式(模式3)的情况分别进行说明:Taking the 80 channels obtained in Table 1 after expansion as an example, the following describes the case where the target operating mode is the second operating mode (mode 2) or the third operating mode (mode 3):
目标工作模式为模式2时,第一芯片和第二芯片在第一固定信道中进行数据传输是指第一芯片和第二芯片在第一固定信道中进行蓝牙配对的密钥交换,避免在编号为0~39的信道中进行密钥交换,从而避开第三方监听设备可以监听到的标准蓝牙协议的工作频段,来提高配对过程中的安全性。When the target working mode is mode 2, the first chip and the second chip perform data transmission in the first fixed channel, which means that the first chip and the second chip perform the key exchange of Bluetooth pairing in the first fixed channel. The key exchange is performed in the channels 0 to 39, so as to avoid the working frequency band of the standard Bluetooth protocol that can be monitored by the third-party monitoring device, so as to improve the security in the pairing process.
目标工作模式为模式3时,第一芯片和第二芯片在扩展信道以自适应跳频的方式进行蓝牙配对的密钥交换,从而使得即使是自适应跳频的方式也能避开第三方监听设备可以监听到的标准蓝牙协议的工作频段,来提高配对过程中的安全性。When the target working mode is mode 3, the first chip and the second chip perform the key exchange of Bluetooth pairing in an adaptive frequency hopping mode on the extended channel, so that even the adaptive frequency hopping method can avoid third-party monitoring The device can monitor the working frequency band of the standard Bluetooth protocol to improve the security during the pairing process.
在一个例子中,若第一芯片为发送切换指令的芯片,在第一芯片向第二芯片发送切换指令之后,还包括:若第一芯片确定与第二芯片完成蓝牙配对,向第二芯片发送还原指令;其中,还原指令携带还原时间点,还原指令用于指示第二芯片在还原时间点将第二芯片的目标工作模式还原为切换之前的工作模 式;第一芯片在还原时间点将第一芯片的目标工作模式还原为切换之前的工作模式。In an example, if the first chip is the chip that sends the switching instruction, after the first chip sends the switching instruction to the second chip, the method further includes: if the first chip determines to complete the Bluetooth pairing with the second chip, sending the switching instruction to the second chip. a restoration instruction; wherein, the restoration instruction carries a restoration time point, and the restoration instruction is used to instruct the second chip to restore the target working mode of the second chip to the working mode before switching at the restoration time point; the first chip restores the first chip at the restoration time point The target working mode of the chip is restored to the working mode before the switch.
在另一个例子中,若第一芯片为接收切换指令的芯片,在第一芯片接收第二芯片在满足预设的触发条件时发送的切换指令之后,还包括:第一芯片接收第二芯片在确定与第一芯片完成蓝牙配对后发送的还原指令;其中,还原指令携带还原时间点;第一芯片在还原时间点将第一芯片的目标工作模式还原为切换之前的工作模式;其中,第二芯片在还原时间点将第二芯片的目标工作模式还原为切换之前的工作模式。In another example, if the first chip is the chip that receives the switching instruction, after the first chip receives the switching instruction sent by the second chip when the preset trigger condition is met, the method further includes: the first chip receiving the second chip in Determine the restoration instruction sent after completing the Bluetooth pairing with the first chip; wherein, the restoration instruction carries the restoration time point; the first chip restores the target working mode of the first chip to the working mode before the switch at the restoration time point; wherein, the second The chip restores the target working mode of the second chip to the working mode before switching at the restoration time point.
即本实施例中第一芯片和第二芯片在蓝牙配对完成后,在同一还原时间点将当前的目标工作模式,还原为切换之前的工作模式。在一个例子中,切换之前的工作模式为标准工作模式或第一工作模式,考虑到扩展频段不是国际通信联盟无线电通信局开放给工业、科学、医学三个主要机构使用的无需授权的ISM频段,长期占用,可能造成资源的浪费,因此配对完成后恢复为标准工作模式或第一工作模式,即不占用扩展频段的工作模式,可以在提高配对安全性的同时,减少资源浪费。在另一个例子中,如果步骤602和步骤702中提到的目标工作模式和当前工作模式这两种不同工作模式中的其中一种为标准工作模式,则当前工作模式为标准工作模式,即切换之前的工作模式为标准工作模式。That is, in this embodiment, after the Bluetooth pairing is completed, the first chip and the second chip restore the current target working mode to the working mode before switching at the same restoration time point. In one example, the working mode before switching is the standard working mode or the first working mode, considering that the extended frequency band is not an unlicensed ISM frequency band that is open to three major institutions of industry, science and medicine by the Radiocommunication Bureau of the International Communications Union, Long-term occupation may cause waste of resources. Therefore, after the pairing is completed, it returns to the standard working mode or the first working mode, that is, the working mode that does not occupy the extended frequency band, which can improve the pairing security and reduce the waste of resources. In another example, if one of the two different working modes, the target working mode and the current working mode mentioned in step 602 and step 702 is the standard working mode, the current working mode is the standard working mode, that is, switching The previous working mode is the standard working mode.
在一个例子中,第一芯片和第二芯片之间的交互流程可以参考图8,包括:In an example, the interaction flow between the first chip and the second chip can refer to FIG. 8 , including:
步骤801:第一芯片和第二芯片基于模式0建立低功耗蓝牙连接。Step 801 : The first chip and the second chip establish a Bluetooth low energy connection based on mode 0.
在一个例子中,非标准工作模式仅包括模式1,即不存在扩展信道。第一芯片和第二芯片在建立低功耗蓝牙连接时,编号为37~39的信道的使用状态 均被设置为disable,即用于广播的信道的使用状态被设置为disable,编号为0~36的信道的使用状态均被设置为enable。In one example, the non-standard operating modes include only mode 1, ie, no extension channels are present. When the first chip and the second chip establish a low-power Bluetooth connection, the usage states of the channels numbered 37 to 39 are set to disable, that is, the usage states of the channels used for broadcasting are set to disable, numbered 0 to 0. The usage status of 36 channels are all set to enable.
在另一个例子中,非标准工作模式至少包括:模式2、模式3、模式4中任意一个,即标准信道和扩展信道同时存在。第一芯片和第二芯片在建立低功耗蓝牙连接时,编号为-20~-1以及37~59的信道的使用状态均被设置为disable,即用于广播的信道和扩展信道的使用状态均被设置为disable,编号为0~36的信道的使用状态均被设置为enable。In another example, the non-standard working mode includes at least any one of mode 2, mode 3, and mode 4, that is, the standard channel and the extended channel coexist. When the first chip and the second chip establish a low-power Bluetooth connection, the usage status of the channels numbered -20 to -1 and 37 to 59 are set to disable, that is, the usage status of the channel used for broadcasting and the extended channel All are set to disable, and the usage status of channels numbered 0 to 36 are all set to enable.
步骤802:发起安全请求。Step 802: Initiate a security request.
其中,可以是第一芯片发起安全请求,也可以是第二芯片发起安全请求。Wherein, the first chip may initiate the security request, or the second chip may initiate the security request.
步骤803:第一芯片向第二芯片发送切换指令。Step 803: The first chip sends a switching instruction to the second chip.
在具体实现中,也可以是第二芯片向第一芯片发送切换指令。In a specific implementation, the second chip may also send a switching instruction to the first chip.
步骤804:第一芯片和第二芯片在同一切换时间点将模式0切换为目标工作模式。Step 804: The first chip and the second chip switch the mode 0 to the target operating mode at the same switching time point.
其中,目标工作模式为模式2或是模式3。Wherein, the target working mode is mode 2 or mode 3.
步骤805:发起配对请求,基于安全管理协议(Security Manager Protocol,简称:SMP)进行配对。Step 805: Initiate a pairing request, and perform pairing based on a security management protocol (Security Manager Protocol, SMP for short).
步骤806:第一芯片与第二芯片之间进行秘钥分发,完成秘钥交换。Step 806: Key distribution is performed between the first chip and the second chip to complete the key exchange.
其中,基于SMP进行配对的方式为传统配对或安全连接。步骤805和步骤806中第一芯片和第二芯片基于模式2或是模式3进行数据传输,可以理解为在标准蓝牙协议规定的标准频段之外的其他频段进行数据传输。如果将标准蓝牙协议规定的标准频段称为BLE带内频段,则扩展频段可以称为BLE带外频段,即步骤805和步骤806中第一芯片和第二芯片在BLE带外频段中进行数 据传输。The method of pairing based on SMP is traditional pairing or secure connection. In step 805 and step 806, the first chip and the second chip perform data transmission based on mode 2 or mode 3, which can be understood as performing data transmission in other frequency bands than the standard frequency band specified by the standard Bluetooth protocol. If the standard frequency band specified by the standard Bluetooth protocol is called the BLE in-band frequency band, the extended frequency band can be called the BLE out-of-band frequency band, that is, the first chip and the second chip in steps 805 and 806 perform data transmission in the BLE out-of-band frequency band .
步骤807:第一芯片向第二芯片发送还原指令。Step 807: The first chip sends a restore instruction to the second chip.
步骤808:第一芯片和第二芯片在同一还原时间点将目标工作模式还原为模式0。Step 808: The first chip and the second chip restore the target working mode to mode 0 at the same restoration time point.
第一芯片和第二芯片相当于在完成秘钥交换后恢复为基于标准蓝牙协议的工作模式。The first chip and the second chip are equivalent to returning to the working mode based on the standard Bluetooth protocol after completing the key exchange.
通过图8可以看出,本实施例中,相比现有的蓝牙配对流程,在配对前和配对后分别插入切换指令和还原指令。其中,切换指令和还原指令均可以基于本申请中新增的链路控制协议(上述提到的自定义的私有协议)进行发送。通过在配对前和配对后分别插入切换指令和还原指令,可以在提高配对安全性的同时,兼容现有的基于标准蓝牙协议的工作模式。考虑到扩展的频段不是ISM规定的频段,长期占用,可能造成资源的浪费,因此配对完成后恢复为基于标准蓝牙协议的工作模式,可以在提高配对安全性的同时,减少资源浪费。As can be seen from FIG. 8 , in this embodiment, compared with the existing Bluetooth pairing process, a switching instruction and a restoring instruction are inserted before pairing and after pairing, respectively. Wherein, both the handover instruction and the restoration instruction may be sent based on the link control protocol newly added in this application (the above-mentioned self-defined private protocol). By inserting a switching instruction and a restoring instruction before pairing and after pairing, respectively, the pairing security can be improved while being compatible with the existing working mode based on the standard Bluetooth protocol. Considering that the extended frequency band is not the frequency band specified by ISM, long-term occupation may cause waste of resources. Therefore, after the pairing is completed, it returns to the working mode based on the standard Bluetooth protocol, which can improve the pairing security and reduce the waste of resources.
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above various methods are divided only for the purpose of describing clearly. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent. ;Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
本申请的实施例涉及一种第一芯片,如图9所示,第一芯片901位于电子设备内且与电子设备内的存储器902连接,存储器902存储有可被第一芯片901执行的指令,指令被第一芯片901执行,以使第一芯片901能够执行上述的应用于第一芯片的数据传输方法。The embodiment of the present application relates to a first chip. As shown in FIG. 9 , the first chip 901 is located in an electronic device and is connected to a memory 902 in the electronic device. The memory 902 stores instructions that can be executed by the first chip 901 , The instructions are executed by the first chip 901, so that the first chip 901 can execute the above-mentioned data transmission method applied to the first chip.
其中,存储器902和第一芯片901采用总线方式连接,总线可以包括任 意数量的互联的总线和桥,总线将一个或多个第一芯片901和存储器902的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经第一芯片901处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给第一芯片901。The memory 902 and the first chip 901 are connected by a bus, the bus may include any number of interconnected buses and bridges, and the bus connects one or more first chips 901 and various circuits of the memory 902 together. The bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. The data processed by the first chip 901 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the first chip 901 .
第一芯片901负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器902可以被用于存储第一芯片901在执行操作时所使用的数据。The first chip 901 is responsible for managing the bus and general processing, and may also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And the memory 902 may be used to store data used by the first chip 901 when performing operations.
本申请的实施例涉及一种电子设备,如图9所示,包括:第三实施例中的第一芯片901,以及与第一芯片901连接的存储器902。The embodiment of the present application relates to an electronic device, as shown in FIG. 9 , including: a first chip 901 in the third embodiment, and a memory 902 connected to the first chip 901 .
本申请的实施例涉及一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述方法实施例。The embodiments of the present application relate to a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the foregoing method embodiments are implemented.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
本领域的普通技术人员可以理解,上述各实施例是实现本发明的具体实 施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for realizing the present invention, and in practical applications, various changes can be made in form and details without departing from the spirit and the spirit of the present invention. scope.

Claims (20)

  1. 一种数据传输方法,其特征在于,应用于第一芯片,所述第一芯片和第二芯片进行数据传输的过程中支持的工作模式包括标准工作模式和非标准工作模式;A data transmission method, characterized in that it is applied to a first chip, and the working modes supported by the first chip and the second chip during the data transmission process include a standard working mode and a non-standard working mode;
    所述标准工作模式为基于标准蓝牙协议的标准信道之间以跳频方式与第二芯片传输数据的工作模式;The standard working mode is a working mode in which data is transmitted with the second chip in a frequency hopping manner between standard channels based on the standard Bluetooth protocol;
    所述非标准工作模式包括以下任意之一或其组合:The non-standard working mode includes any one of the following or a combination thereof:
    在指定的第一固定信道中与所述第二芯片传输数据的第一工作模式;其中,所述第一固定信道为所述标准信道中的一个信道;A first working mode in which data is transmitted with the second chip in a designated first fixed channel; wherein, the first fixed channel is one of the standard channels;
    在扩展的扩展信道之间以跳频方式与所述第二芯片传输数据的第二工作模式;A second working mode for transmitting data with the second chip in a frequency hopping manner between the extended extension channels;
    在指定的第二固定信道中与所述第二芯片传输数据的第三工作模式;其中,所述第二固定信道为扩展的扩展信道中的一个信道;A third working mode for transmitting data with the second chip in a designated second fixed channel; wherein the second fixed channel is one of the extended extended channels;
    在基于标准蓝牙协议的标准信道和扩展的扩展信道之间以跳频方式与所述第二芯片传输数据的第四工作模式。A fourth working mode for transmitting data with the second chip in a frequency hopping manner between a standard channel based on a standard Bluetooth protocol and an extended extended channel.
  2. 如权利要求1所述的数据传输方法,其特征在于,若所述第一芯片为发送切换指令的芯片,所述方法包括:The data transmission method according to claim 1, wherein, if the first chip is a chip that sends a switching instruction, the method comprises:
    若满足预设的触发条件,向所述第二芯片发送切换指令;其中,所述切换指令携带切换时间点和目标工作模式,所述切换指令用于指示所述第二芯片在所述切换时间点将所述第二芯片的当前工作模式切换为所述目标工作模式;If a preset trigger condition is met, a switching instruction is sent to the second chip; wherein, the switching instruction carries a switching time point and a target working mode, and the switching instruction is used to instruct the second chip at the switching time Click to switch the current working mode of the second chip to the target working mode;
    在所述切换时间点将所述第一芯片的当前工作模式切换为所述目标工作模式;Switching the current working mode of the first chip to the target working mode at the switching time point;
    其中,所述当前工作模式和所述目标工作模式为所述标准工作模式和所述非标准工作模式中的两种不同工作模式。Wherein, the current working mode and the target working mode are two different working modes among the standard working mode and the non-standard working mode.
  3. 如权利要求1所述的数据传输方法,其特征在于,若所述第一芯片为接收切换指令的芯片,所述方法包括:The data transmission method according to claim 1, wherein if the first chip is a chip that receives a switching instruction, the method comprises:
    接收第二芯片在满足预设的触发条件时发送的切换指令;其中,所述切换指令携带切换时间点和目标工作模式;receiving a switching instruction sent by the second chip when a preset trigger condition is met; wherein, the switching instruction carries a switching time point and a target working mode;
    在所述切换时间点将所述第一芯片的当前工作模式切换为所述目标工作模式;Switching the current working mode of the first chip to the target working mode at the switching time point;
    其中,所述第二芯片在所述切换时间点将所述第二芯片的当前工作模式切换为所述目标工作模式;Wherein, the second chip switches the current working mode of the second chip to the target working mode at the switching time point;
    所述当前工作模式和所述目标工作模式为所述标准工作模式和所述非标准工作模式中的两种不同工作模式。The current working mode and the target working mode are two different working modes among the standard working mode and the non-standard working mode.
  4. 如权利要求2或3所述的数据传输方法,其特征在于,所述两种不同工作模式中的其中一种为所述标准工作模式。The data transmission method according to claim 2 or 3, wherein one of the two different working modes is the standard working mode.
  5. 如权利要求2至4任一项所述的数据传输方法,其特征在于,所述标准信道设置有编号,所述非标准工作模式包括所述第一工作模式和/或所述第三工作模式;The data transmission method according to any one of claims 2 to 4, wherein the standard channel is set with a number, and the non-standard working mode includes the first working mode and/or the third working mode ;
    若所述目标工作模式为所述第一工作模式,所述切换指令还携带所述第一固定信道的编号;If the target working mode is the first working mode, the switching instruction further carries the number of the first fixed channel;
    若所述目标工作模式为所述第三工作模式,所述切换指令还携带所述第二固定信道的编号;其中,所述扩展信道设置有编号。If the target working mode is the third working mode, the switching instruction further carries the serial number of the second fixed channel; wherein, the extended channel is set with a serial number.
  6. 如权利要求2至4任一项所述的数据传输方法,其特征在于,所述非标准工作模式包括所述第二工作模式和/或所述第三工作模式,所述触发条件包括:确定所述第一芯片处于已与所述第二芯片建立蓝牙连接且尚未进行蓝牙配对的状态;The data transmission method according to any one of claims 2 to 4, wherein the non-standard working mode includes the second working mode and/or the third working mode, and the triggering condition includes: determining The first chip is in a state in which a Bluetooth connection has been established with the second chip and a Bluetooth pairing has not been performed;
    所述目标工作模式为所述第二工作模式或所述第三工作模式。The target working mode is the second working mode or the third working mode.
  7. 如权利要求6所述的数据传输方法,其特征在于,所述确定所述第一芯片处于已与所述二芯片建立蓝牙连接且尚未进行蓝牙配对的状态,包括:The data transmission method according to claim 6, wherein the determining that the first chip is in a state in which a Bluetooth connection has been established with the second chip and has not yet been paired with Bluetooth comprises:
    向所述第二芯片发送安全请求之后,且尚未接收到所述第二芯片发送的配对请求;或者,After the security request is sent to the second chip, and the pairing request sent by the second chip has not been received; or,
    接收到所述第二芯片发送的安全请求之后,且尚未向所述第二芯片发送配对请求。After receiving the security request sent by the second chip, a pairing request has not been sent to the second chip.
  8. 如权利要求6或7所述的数据传输方法,其特征在于,若所述第一芯片为发送切换指令的芯片,在所述向所述第二芯片发送切换指令之后,还包括:The data transmission method according to claim 6 or 7, wherein, if the first chip is a chip that sends a switching instruction, after the sending of the switching instruction to the second chip, the method further comprises:
    若确定与所述第二芯片完成蓝牙配对,向所述第二芯片发送还原指令;其中,所述还原指令携带还原时间点,所述还原指令用于指示所述第二芯片在所述还原时间点将所述第二芯片的所述目标工作模式还原为切换之前的工作模式;If it is determined that the Bluetooth pairing with the second chip is completed, a restoration instruction is sent to the second chip; wherein, the restoration instruction carries a restoration time point, and the restoration instruction is used to instruct the second chip at the restoration time Click to restore the target working mode of the second chip to the working mode before switching;
    在所述还原时间点将所述第一芯片的所述目标工作模式还原为所述切换之前的工作模式。At the restoration time point, the target working mode of the first chip is restored to the working mode before the switching.
  9. 如权利要求6或7所述的数据传输方法,其特征在于,若所述第一芯片为接收切换指令的芯片,在所述接收第二芯片在满足预设的触发条件时发送的切换指令之后,还包括:The data transmission method according to claim 6 or 7, wherein, if the first chip is a chip that receives a switching instruction, after the receiving of the switching instruction sent by the second chip when a preset trigger condition is satisfied ,Also includes:
    接收所述第二芯片在确定与所述第一芯片完成蓝牙配对后发送的还原指令;其中,所述还原指令携带还原时间点;Receive a restoration instruction sent by the second chip after determining that the Bluetooth pairing with the first chip is completed; wherein, the restoration instruction carries a restoration time point;
    在所述还原时间点将所述第一芯片的目标工作模式还原为切换之前的工作模式;restoring the target working mode of the first chip to the working mode before switching at the restoring time point;
    其中,所述第二芯片在所述还原时间点将所述第二芯片的目标工作模式还原为所述切换之前的工作模式。Wherein, the second chip restores the target working mode of the second chip to the working mode before the switching at the restoration time point.
  10. 如权利要求至2至9任一项所述的数据传输方法,其特征在于,所述非标准工作模式包括所述第四工作模式;所述触发条件包括:检测到与所述第二芯片传输数据的过程中,接收信号强度指示RSSI大于预设强度阈值的持续时长大于预设时长阈值,且在所述预设时长阈值内的丢包率大于预设丢包率阈值;The data transmission method according to any one of claims 2 to 9, wherein the non-standard operation mode includes the fourth operation mode; and the trigger condition includes: detecting a transmission with the second chip In the process of data processing, the duration of the RSSI indication RSSI greater than the preset strength threshold is greater than the preset duration threshold, and the packet loss rate within the preset duration threshold is greater than the preset packet loss rate threshold;
    所述目标工作模式为所述第四工作模式。The target working mode is the fourth working mode.
  11. 如权利要求1至10任一项所述的数据传输方法,其特征在于,所述非标准工作模式包括所述第二工作模式和/或所述第四工作模式,在所述第二工作模式或所述第四工作模式下,跳频后的信道通过以下方式确定:The data transmission method according to any one of claims 1 to 10, wherein the non-standard working mode includes the second working mode and/or the fourth working mode, and in the second working mode Or in the fourth working mode, the channel after frequency hopping is determined in the following manner:
    根据所述第一芯片为所述第二芯片分配的接入地址,确定跳频阶跃值;determining a frequency hopping step value according to the access address allocated by the first chip to the second chip;
    根据所述跳频阶跃值和信道总数量,确定所述跳频后的信道;其中,所述信道总数量为所述标准信道的数量和所述扩展信道的数量之和。The frequency-hopping channel is determined according to the frequency hopping step value and the total number of channels; wherein, the total number of channels is the sum of the number of the standard channels and the number of the extension channels.
  12. 如权利要求1至11任一项所述的数据传输方法,其特征在于,所述非标准工作模式包括以下任意之一或其组合:所述第二工作模式、所述第三工作模式、所述第四工作模式;所述标准信道基于标准频段划分得到,所述扩展信道基于扩展的扩展频段划分得到;所述标准频段对应有上限频率和 下限频率,所述扩展频段包括第一频段和第二频段,所述第一频段中的频率均小于所述下限频率,所述第二频段中的频率均大于所述上限频率。The data transmission method according to any one of claims 1 to 11, wherein the non-standard working mode comprises any one of the following or a combination thereof: the second working mode, the third working mode, all the the fourth working mode; the standard channel is obtained by dividing the standard frequency band, and the extended channel is obtained by dividing the extended frequency band; the standard frequency band corresponds to an upper limit frequency and a lower limit frequency, and the extended frequency band includes the first frequency band and the third frequency band. Two frequency bands, the frequencies in the first frequency band are all lower than the lower limit frequency, and the frequencies in the second frequency band are all greater than the upper limit frequency.
  13. 如权利要求12所述的数据传输方法,其特征在于,所述第一频段为2360Mhz至2400Mhz,所述第二频段为2480Mhz至2520Mhz。The data transmission method of claim 12, wherein the first frequency band is 2360Mhz to 2400Mhz, and the second frequency band is 2480Mhz to 2520Mhz.
  14. 如权利要求12或13所述的数据传输方法,其特征在于,基于所述标准频段划分的各标准信道的编号为连续编号,所述连续编号中包括初始编号和终止编号;The data transmission method according to claim 12 or 13, wherein the number of each standard channel divided based on the standard frequency band is a continuous number, and the continuous number includes an initial number and a termination number;
    基于所述第一频段划分的信道的编号,随着频率的降低以所述初始编号为基准依次递减;The numbers of the channels divided based on the first frequency band, decrease sequentially with the initial number as a reference as the frequency decreases;
    基于所述第二频段划分的信道的编号,随着频率的增大以所述终止编号为基准依次递增。The number of the channel divided based on the second frequency band increases sequentially with the increase of the frequency based on the termination number.
  15. 如权利要求14所述的数据传输方法,其特征在于,所述各标准信道的编号,随着频率的增加依次为0~39,所述基于所述第一频段划分的信道的编号,随着频率的降低依次为-1~-20,所述基于所述第二频段划分的信道的编号,随着频率的增大依次为40~59。The data transmission method according to claim 14, wherein the number of each standard channel is 0 to 39 in sequence with the increase of the frequency, and the number of the channel divided based on the first frequency band increases as the frequency increases. The decreasing order of the frequency is -1 to -20, and the number of the channel divided based on the second frequency band is 40 to 59 in order as the frequency increases.
  16. 如权利要求1至15任一项所述的数据传输方法,其特征在于,所述非标准工作模式包括所述第一工作模式和/或所述第三工作模式;The data transmission method according to any one of claims 1 to 15, wherein the non-standard working mode comprises the first working mode and/or the third working mode;
    若所述第一芯片工作在所述第一工作模式,所述第一固定信道的使用状态被设置为允许使用,所述标准信道中除所述第一固定信道之外的其他信道的使用状态被设置为禁止使用;If the first chip works in the first working mode, the use status of the first fixed channel is set to allow use, and the use status of other channels in the standard channel except the first fixed channel is set to be disabled;
    若所述第一芯片工作在所述第三工作模式,所述第二固定信道的使用状态被设置为允许使用,所述扩展信道中除所述第二固定信道之外的其他信道的使用状态被设置为禁止使用。If the first chip operates in the third working mode, the use status of the second fixed channel is set to allow use, and the use status of other channels in the extended channel except the second fixed channel is set to be disabled.
  17. 如权利要求1至16任一项所述的数据传输方法,其特征在于,The data transmission method according to any one of claims 1 to 16, wherein,
    所述第一芯片设置于主设备中,所述第二芯片设置于从设备中;或者,The first chip is arranged in the master device, and the second chip is arranged in the slave device; or,
    所述第一芯片设置于从设备中,所述第二芯片设置于主设备中。The first chip is arranged in the slave device, and the second chip is arranged in the master device.
  18. 一种第一芯片,其特征在于,所述第一芯片位于电子设备内且与所述电子设备内的存储器连接,所述存储器存储有可被所述第一芯片执行的指令,所述指令被所述第一芯片执行,以使所述第一芯片能够执行如权利要求1至17中任一所述的数据传输方法。A first chip, characterized in that the first chip is located in an electronic device and is connected to a memory in the electronic device, the memory stores an instruction that can be executed by the first chip, and the instruction is executed by the first chip. The first chip executes to enable the first chip to execute the data transmission method as claimed in any one of claims 1 to 17.
  19. 一种电子设备,其特征在于,包括:如权利要求18所述的第一芯片,以及与所述第一芯片连接的存储器。An electronic device, comprising: the first chip according to claim 18, and a memory connected to the first chip.
  20. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至17中任一项所述的数据传输方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 17 is implemented.
PCT/CN2021/072627 2021-01-19 2021-01-19 Data transmission method, first chip, electronic device and storage medium WO2022155769A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/072627 WO2022155769A1 (en) 2021-01-19 2021-01-19 Data transmission method, first chip, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/072627 WO2022155769A1 (en) 2021-01-19 2021-01-19 Data transmission method, first chip, electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2022155769A1 true WO2022155769A1 (en) 2022-07-28

Family

ID=82548247

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/072627 WO2022155769A1 (en) 2021-01-19 2021-01-19 Data transmission method, first chip, electronic device and storage medium

Country Status (1)

Country Link
WO (1) WO2022155769A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888891A (en) * 2014-04-09 2014-06-25 北京安奇智联科技有限公司 Method and system for achieving data resource sharing on mobile terminal
CN204859208U (en) * 2015-08-06 2015-12-09 国网山东节能服务有限公司 A intelligent gateway that is used for office buildings power consumption information acquisition and energy -saving control system
CN205040032U (en) * 2015-09-30 2016-02-17 群光电子股份有限公司 Man -machine interface device and man -machine interface device group
US20170215213A1 (en) * 2014-05-30 2017-07-27 Lg Electronics Inc. Bluetooth connection method and apparatus
WO2018054372A1 (en) * 2016-09-26 2018-03-29 Suzhou Daweier Wulianwang Technology Co., Ltd. Connection of mobile devices to networks
US20180199214A1 (en) * 2015-07-03 2018-07-12 Zte Corporation Self-adaptive bluetooth performance adjustment communication terminal and method
CN110677807A (en) * 2019-09-29 2020-01-10 歌尔股份有限公司 TWS double-wireless earphone searching method and system and TWS double-wireless earphone

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888891A (en) * 2014-04-09 2014-06-25 北京安奇智联科技有限公司 Method and system for achieving data resource sharing on mobile terminal
US20170215213A1 (en) * 2014-05-30 2017-07-27 Lg Electronics Inc. Bluetooth connection method and apparatus
US20180199214A1 (en) * 2015-07-03 2018-07-12 Zte Corporation Self-adaptive bluetooth performance adjustment communication terminal and method
CN204859208U (en) * 2015-08-06 2015-12-09 国网山东节能服务有限公司 A intelligent gateway that is used for office buildings power consumption information acquisition and energy -saving control system
CN205040032U (en) * 2015-09-30 2016-02-17 群光电子股份有限公司 Man -machine interface device and man -machine interface device group
WO2018054372A1 (en) * 2016-09-26 2018-03-29 Suzhou Daweier Wulianwang Technology Co., Ltd. Connection of mobile devices to networks
CN110677807A (en) * 2019-09-29 2020-01-10 歌尔股份有限公司 TWS double-wireless earphone searching method and system and TWS double-wireless earphone

Similar Documents

Publication Publication Date Title
CN113365256B (en) Data transmission method, first chip, electronic device and storage medium
EP2484173B1 (en) Wlan peer-to-peer group owner negotiation
JP4549395B2 (en) Interference reduction technology in wireless communication networks
RU2337491C2 (en) Adaptation period of radio beacon signals in spread network
RU2330383C1 (en) Adaptive beacon period in distributed network
US20070149123A1 (en) Multiple radio usage in a wireless communications device
US11722425B2 (en) Data packet deleting method, device and storage medium
US8559338B2 (en) Method for managing the power in the wireless network
JP2002185474A (en) Method of changing 802.11 standard parameter of ieee 802.11 standard wlan
US10588163B2 (en) Wireless backhaul connection establishment method and apparatus
US9173235B2 (en) Apparatus and method for self-scheduling in a wireless communication system
US20220346166A1 (en) Multi-link communication method, apparatus, and system
CN115943679A (en) Method and apparatus for power saving in a communication system supporting multiple links
US20210029716A1 (en) Wireless communication method and apparatus
Shah et al. DDH-MAC: a novel dynamic de-centralized hybrid mac protocol for cognitive radio networks
US20190045540A1 (en) Communication device and communication method
Kalil et al. SWITCH: A multichannel MAC protocol for cognitive radio ad hoc networks
WO2019015445A1 (en) Communication method and apparatus
US10708110B2 (en) Super-frame realignment mechanism to enable inter-wireless sensor network communications
US20060176860A1 (en) Techniques for stream handling in wireless communications networks
WO2022155769A1 (en) Data transmission method, first chip, electronic device and storage medium
KR20210157873A (en) Method and apparatus for transmitting and receiving frame in communication system supporting multi-link
CN115669195A (en) Method and apparatus for communication based on low power operation in a communication system supporting multiple links
Xin et al. A cognitive radio network architecture without control channel
CN112583511A (en) Networking method, device, equipment and storage medium based on same time slot transmission

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: 21920174

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21920174

Country of ref document: EP

Kind code of ref document: A1