Mode switching method and device, terminal equipment and computer readable storage medium

By dynamically adjusting the link mode and data packet transmission method in the terminal device according to the operating status of the Bluetooth device, the problem of lagging and delay caused by insufficient bandwidth resources in multi-channel Bluetooth scenarios is solved, and the user experience of the device is improved.

CN118540685APending Publication Date: 2024-08-23SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410745119.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In a multi-channel Bluetooth scenario, due to insufficient bandwidth resources, Bluetooth devices are prone to lagging and delays, which affects the user experience.

Method used

By adopting the mode switching method in the terminal device, the link mode and the transmission mode of the data packet are dynamically adjusted according to the operating status of the first Bluetooth device to ensure reasonable allocation of bandwidth resources. The specific method includes optimizing the response speed of the first Bluetooth device when it is in a high operating state, and optimizing the resource allocation of the second Bluetooth device when it is not in a high operating state.

Benefits of technology

It effectively alleviates the lagging and delay problems caused by insufficient bandwidth resources in multi-channel Bluetooth scenarios, and improves the user experience of each Bluetooth device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540685A
    Figure CN118540685A
Patent Text Reader

Abstract

The invention discloses a mode switching method and device, terminal equipment and a computer readable storage medium, and the method comprises the steps: transmitting a first data packet to first Bluetooth equipment based on a first interval time, and receiving a plurality of second data packets returned by the first Bluetooth equipment based on the first data packet; determining an operation state of the first Bluetooth device based on the plurality of second data packets; and if the operation state of the first Bluetooth device is a first operation state, sending a first request to a second Bluetooth device, so that a link mode of the terminal device and the second Bluetooth device is switched from an activation mode to a breathing mode. By adopting the method provided by the invention, the phenomena of jamming, delay and the like caused by insufficient bandwidth resources of the Bluetooth equipment in a multi-path Bluetooth scene can be relieved, and the use experience of the Bluetooth equipment in the multi-path Bluetooth scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a mode switching method, apparatus, terminal equipment and computer-readable storage medium. Background Art

[0002] With the popularization of Bluetooth devices, multi-channel Bluetooth scenarios are being used more and more. For example, a mobile phone is connected to a Bluetooth headset and a Bluetooth watch at the same time, a computer is connected to a Bluetooth mouse and a Bluetooth keyboard at the same time, and a TV is connected to a Bluetooth controller and a Bluetooth headset or Bluetooth speaker at the same time.

[0003] In order to meet the needs of a Bluetooth device to respond quickly in a multi-channel Bluetooth scenario, more bandwidth resources are usually reserved for the Bluetooth device. Other Bluetooth devices in the multi-channel Bluetooth scenario may experience freezes and delays due to insufficient bandwidth resources, thus affecting the user experience of other Bluetooth devices. For example, in order to meet the needs of a Bluetooth controller to respond quickly, a mobile phone usually reserves more bandwidth resources for the Bluetooth controller to cope with the controller operation signals that may arrive at any time, causing the Bluetooth speaker to experience audio freezes due to insufficient bandwidth resources. Summary of the invention

[0004] The embodiments of the present application provide a mode switching method, apparatus, terminal device and computer-readable storage medium, which can alleviate the phenomenon of freeze and delay caused by insufficient bandwidth resources of Bluetooth devices in multi-channel Bluetooth scenarios, and improve the user experience of each Bluetooth device in multi-channel Bluetooth scenarios.

[0005] The technical solution adopted by the present invention to solve the problem is as follows:

[0006] On the one hand, the present application provides a mode switching method, which is applied to a terminal device, wherein the terminal device is connected to a first Bluetooth device and a second Bluetooth device in communication, the link mode between the terminal device and the first Bluetooth device is a breathing mode, the link mode between the terminal device and the second Bluetooth device is an activation mode, and the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is a first interval time, and the mode switching method includes:

[0007] Sending a first data packet to a first Bluetooth device based on a first interval time, and receiving a plurality of second data packets returned by the first Bluetooth device based on the first data packet;

[0008] determining an operating state of the first Bluetooth device based on the plurality of second data packets;

[0009] If the operation state of the first Bluetooth device is the first operation state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0010] In some embodiments of the present application, before or after sending the first request to the second Bluetooth device, the method further includes:

[0011] A second request is sent to the first Bluetooth device, so that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is adjusted from the first interval time to the second interval time; wherein the second interval time is smaller than the first interval time.

[0012] In some embodiments of the present application, after sending the first request to the second Bluetooth device, the method further includes:

[0013] Sending a third data packet to the first Bluetooth device based on a second interval time, and receiving a plurality of fourth data packets returned by the first Bluetooth device based on the third data packet;

[0014] Based on the plurality of fourth data packets, determining whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state;

[0015] If the operation state of the first Bluetooth device is switched from the first operation state to the second operation state, a third request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the sniffing mode to the active mode.

[0016] In some embodiments of the present application, the plurality of second data packets include valid data packets and / or empty data packets, and determining the operating state of the first Bluetooth device based on the plurality of second data packets includes:

[0017] Based on the plurality of second data packets, determining a first quantity and a second quantity; the first quantity is the quantity of valid data packets in the plurality of second data packets, and the second quantity is the quantity of the plurality of second data packets;

[0018] If the ratio of the first number to the second number is greater than or equal to a preset first threshold, determining that the operating state of the first Bluetooth device is a first operating state;

[0019] If the ratio of the first number to the second number is less than the first threshold, it is determined that the operating state of the first Bluetooth device is the second operating state.

[0020] In some embodiments of the present application, the plurality of fourth data packets include valid data packets and / or empty data packets, and determining whether the operating state of the first Bluetooth device is switched from the first operating state to the second operating state based on the plurality of fourth data packets includes:

[0021] Based on the plurality of fourth data packets, determine a third quantity and a fourth quantity; the third quantity is the quantity of empty data packets in the plurality of fourth data packets, and the fourth quantity is the quantity of the plurality of fourth data packets;

[0022] If the ratio of the third number to the fourth number is greater than or equal to a preset second threshold, determining whether key information of the first Bluetooth device is received within a preset time;

[0023] If no key information is received within the preset time, it is determined that the operation state of the first Bluetooth device is switched from the first operation state to the second operation state.

[0024] In some implementation schemes of the present application, the maximum length of a data packet transmitted between the terminal device and the second Bluetooth device is the first length, and after sending the first request to the second Bluetooth device, the following is further included:

[0025] A fourth request is sent to the second Bluetooth device, so that the maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is adjusted from the first length to the second length; wherein the second length is smaller than the first length.

[0026] In some implementation schemes of the present application, the maximum length of a data packet transmitted between the terminal device and the first Bluetooth device is a third length, and the mode switching method further includes:

[0027] Monitoring the communication connection status between the target device and the second Bluetooth device;

[0028] If the communication connection state is switched from the communication state to the disconnected state, a fifth request is sent to the first Bluetooth device so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the third length to the fourth length; wherein the fourth length is greater than the third length;

[0029] If the communication connection state is restored from the disconnected state to the communication state, a sixth request is sent to the first Bluetooth device so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the fourth length to the third length.

[0030] In a second aspect, an embodiment of the present invention further provides a mode switching device, which is applied to a terminal device, wherein the terminal device is connected to a first Bluetooth device and a second Bluetooth device in communication, wherein the link mode between the terminal device and the first Bluetooth device is a breathing mode, and the link mode between the terminal device and the second Bluetooth device is an activation mode, wherein the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is a first interval time, and the mode switching device comprises:

[0031] A first sending module, configured to send a first data packet to a first Bluetooth device based on a first interval time, and receive a plurality of second data packets returned by the first Bluetooth device based on the first data packet;

[0032] a state determination module, configured to determine an operation state of the first Bluetooth device based on the plurality of second data packets;

[0033] The second sending module is used to send a first request to the second Bluetooth device if the operating state of the first Bluetooth device is the first operating state, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0034] In a third aspect, the present application further provides a terminal device, the terminal device comprising:

[0035] one or more processors;

[0036] Memory; and

[0037] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to implement any mode switching method in the first aspect.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the mode switching methods in the first aspect.

[0039] The beneficial effects of the present invention are as follows: the operating state of the first Bluetooth device is determined by multiple second data packets, and when the operating state of the first Bluetooth device is the first operating state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the activation mode to the breathing mode. When the first Bluetooth device is not in the first operating state, as many bandwidth resources as possible are reserved for the second Bluetooth device. When the first Bluetooth device is in the first operating state, more bandwidth resources are used for the operation response of the first Bluetooth device. This can alleviate the freeze, delay and other phenomena caused by insufficient bandwidth resources of Bluetooth devices in multi-channel Bluetooth scenarios, and improve the user experience of each Bluetooth device in multi-channel Bluetooth scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 is a schematic diagram of a scenario of a mode switching system provided by an embodiment of the present invention;

[0042] Figure 2 is a flow chart of a mode switching method provided by an embodiment of the present invention;

[0043] Figure 3is a schematic diagram of a link mode between a terminal device and a Bluetooth device provided by an embodiment of the present invention;

[0044] Figure 4 is a schematic diagram of a link mode between a terminal device and a Bluetooth device provided by another embodiment of the present invention;

[0045] Figure 5 is a schematic diagram of a link mode between a terminal device and a Bluetooth device provided by another embodiment of the present invention;

[0046] Figure 6 is a schematic diagram of a specific process of determining the operating state of a first Bluetooth device provided by an embodiment of the present invention;

[0047] Figure 7 is a flow chart of a mode switching method provided by another embodiment of the present invention;

[0048] Figure 8 is a principle block diagram of a mode switching device provided by an embodiment of the present invention;

[0049] Fig. 9 It is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0051] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third" and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", "third" and the like may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0052] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0053] The embodiments of the present application provide a mode switching method, apparatus, terminal device, and computer-readable storage medium, which are described in detail below.

[0054] See also Figure 1 , Figure 1 A scenario diagram of a mode switching system provided in an embodiment of the present application, the mode switching system may include a terminal device and a first Bluetooth device and a second Bluetooth device communicatively connected to the terminal device, the link mode between the terminal device and the first Bluetooth device is a breathing mode (sniff mode), the link mode between the terminal device and the second Bluetooth device is an activation mode (active mode), and the breathing interval (sniffinterval) of the breathing mode between the terminal device and the first Bluetooth device is a first interval time.

[0055] Specifically, active mode is the normal working state of the Bluetooth device, sniff mode refers to the working state in which the master device sends data packets to the slave device according to the sniff interval, and the slave device listens to the data packets of the master device at every sniff interval. The sniff interval (sniffinterval) of the breathing mode of the terminal device and the first Bluetooth device is the first interval time, which means that the terminal device sends data packets to the first Bluetooth device according to the first interval time, and the first Bluetooth device listens to the data packets sent by the terminal device according to the first interval time.

[0056] In the embodiment of the present application, the terminal device is mainly used to send a first data packet to a first Bluetooth device based on a first interval time, and receive multiple second data packets returned by the first Bluetooth device based on the first data packet; based on the multiple second data packets, determine the operating state of the first Bluetooth device; if the operating state of the first Bluetooth device is the first operating state, send a first request to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from an activation mode to a breathing mode, which can alleviate the freeze, delay and other phenomena caused by insufficient bandwidth resources of Bluetooth devices in multi-channel Bluetooth scenarios, and improve the user experience of each Bluetooth device in multi-channel Bluetooth scenarios.

[0057] The terminal device used in the embodiments of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The terminal may be a smart phone, a tablet computer, a laptop, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), and the like.

[0058] The first Bluetooth device and the second Bluetooth device refer to devices that can perform Bluetooth communication with the terminal device, and the first Bluetooth device and the second Bluetooth device include but are not limited to Bluetooth headsets, Bluetooth watches, Bluetooth mice, Bluetooth keyboards, Bluetooth handles, Bluetooth speakers, etc. For example, the terminal device is a mobile phone, the first Bluetooth device is a Bluetooth headset, and the second Bluetooth device is a Bluetooth watch; for another example, the terminal device is a computer, the first Bluetooth device is a Bluetooth mouse, and the second Bluetooth device is a Bluetooth keyboard; for another example, the terminal device is a TV, the first Bluetooth device is a Bluetooth handle, and the second Bluetooth device is a Bluetooth headset or a Bluetooth speaker.

[0059] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. For example, Figure 1 Only one terminal device and two Bluetooth devices are shown. It can be understood that the mode switching system can also include one terminal device and more Bluetooth devices (such as one mobile phone, two Bluetooth controllers and one Bluetooth speaker), which is not specifically limited here.

[0060] In addition, the mode switching system may further include a memory for storing data, such as operating state information, such as a first operating state, a second operating state, etc., such as data packets, such as a first data packet, a second data packet, etc.

[0061] It should be noted that Figure 1The scenario diagram of the mode switching system shown is merely an example. The mode switching system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the mode switching system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0062] First, a mode switching method is provided in an embodiment of the present application, and the executor of the mode switching method is a mode switching device, and the mode switching device is applied to a terminal device. The mode switching method includes: sending a first data packet to a first Bluetooth device based on a first interval time, and receiving multiple second data packets returned by the first Bluetooth device based on the first data packet; based on the multiple second data packets, determining the operating state of the first Bluetooth device; if the operating state of the first Bluetooth device is the first operating state, sending a first request to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from an activation mode to a breathing mode.

[0063] like Figure 2 FIG. 2 is a flow chart of an embodiment of a mode switching method in an embodiment of the present application. The mode switching method may include the following steps S201 to S203, which are as follows:

[0064] Step S201: Send a first data packet to a first Bluetooth device based on a first interval time, and receive a plurality of second data packets returned by the first Bluetooth device based on the first data packet.

[0065] Specifically, the link mode between the terminal device and the first Bluetooth device is a breathing mode (sniff mode). The sniff mode means that the terminal device sends data packets to the first Bluetooth device according to a breathing interval (sniff interval), and the first Bluetooth device monitors the working status of the data packets of the terminal device according to the breathing interval (sniff interval). The breathing interval refers to the interval time when the terminal device sends data packets to the first Bluetooth device in the breathing mode.

[0066] When the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is the first interval time, the terminal device sends a data packet to the first Bluetooth device according to the first interval time. The first interval time can be set according to actual needs, for example, referring to Figure 3 As shown, the first interval time is set to 24 slots, then the terminal device sends a data packet to the Bluetooth controller every 24 slots, and the Bluetooth controller monitors the data packet of the terminal device every 24 slots.

[0067] The first data packet is a data packet sent by the terminal device to the first Bluetooth device at the first interval time, and the second data packet is a data packet returned by the first Bluetooth device to the terminal device based on the first data packet. After the terminal device sends multiple first data packets to the first Bluetooth device at the first interval time, the first Bluetooth device will return multiple second data packets to the terminal device based on the multiple first data packets. For example, the first interval time is represented by D1, the terminal device sends the first first data packet to the first Bluetooth device at time T1, and the first Bluetooth device returns a second data packet based on the first data packet. The terminal device sends the second first data packet to the first Bluetooth device at time T1+D1, and the first Bluetooth device returns the second second data packet based on the first data packet. And so on, the terminal device sends the M+1th first data packet to the first Bluetooth device at time T1+M*D1, and the first Bluetooth device returns the M+1th second data packet based on the first data packet.

[0068] Step S202: Determine the operating state of the first Bluetooth device based on the multiple second data packets.

[0069] The operation state of the first Bluetooth device includes a first operation state and a second operation state, wherein the first operation state indicates that the first Bluetooth device is being frequently operated by the user, and the second operation state indicates that the first Bluetooth device is not being frequently operated by the user. For example, the first Bluetooth device is a Bluetooth handle, and when the operation state of the Bluetooth handle is the first operation state, it indicates that the user is frequently operating the Bluetooth handle, and when the operation state of the Bluetooth handle is the second operation state, it indicates that the user is not operating the Bluetooth handle or the user occasionally operates the Bluetooth handle.

[0070] The multiple second data packets are data packets returned by the first Bluetooth device to the terminal device based on the first data packet. When the user operates the first Bluetooth device, the second data packet returned by the first Bluetooth device to the terminal device is a valid data packet (non-NULL data packet). When the user does not operate the first Bluetooth device, the second data packet returned by the first Bluetooth device to the terminal device is an empty data packet (NULL data packet). Therefore, based on whether the multiple second data packets are empty data packets or valid data packets, it can be determined whether the user is frequently operating the first Bluetooth device.

[0071] Step S203: If the operation state of the first Bluetooth device is the first operation state, send a first request to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0072] The first request is a link mode switching instruction sent by the terminal device to the second Bluetooth device. The first request can switch the link mode between the terminal device and the second Bluetooth device from the activation mode to the breathing mode. In this embodiment, if the terminal device determines that the operating state of the first Bluetooth device is the first operating state, that is, the user is frequently operating the first Bluetooth device, the terminal device sends a first request to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the activation mode to the breathing mode. In this way, when the user does not frequently operate the first Bluetooth device, as many bandwidth resources as possible can be reserved for the second Bluetooth device. When the user frequently operates the first Bluetooth device, more bandwidth resources can be used for the operation response of the first Bluetooth device, thereby avoiding delays, freezes, and other phenomena in the operation of the first Bluetooth device due to insufficient bandwidth resources. For example, refer to Figure 4 As shown, if the operating state of the Bluetooth handle is the first operating state, the terminal device sends a first request to the Bluetooth speaker. The first request stipulates that the breathing interval between the terminal device and the Bluetooth speaker in the breathing mode is 10 slots. The terminal device sends a data packet to the Bluetooth speaker every 10 slots, and the Bluetooth speaker monitors the data packet of the terminal device every 10 slots.

[0073] It should be noted that, in addition to two Bluetooth devices, the multi-channel Bluetooth scenario may also include more Bluetooth devices, and the mode switching method thereof may refer to the discussion of the aforementioned steps S201 to S203. Figure 5 As shown, the multi-channel Bluetooth scenario includes a terminal device, a Bluetooth speaker, a Bluetooth handle 1 and a Bluetooth handle 2. If the operating state of the Bluetooth handle 1 or the Bluetooth handle 2 is the first operating state, the terminal device sends a first request to the Bluetooth speaker. The first request stipulates that the breathing interval between the terminal device and the Bluetooth speaker in the breathing mode is 10 slots. The terminal device sends a data packet to the Bluetooth speaker every 10 slots, and the Bluetooth speaker listens to the data packet of the terminal device every 10 slots.

[0074] In a specific implementation, the plurality of second data packets include valid data packets and / or empty data packets. Figure 6 As shown, the above step S202 determines the operation state of the first Bluetooth device based on the multiple second data packets, which may include the following steps S301 to S303, which are as follows:

[0075] Step S301: determine a first quantity and a second quantity based on multiple second data packets; the first quantity is the quantity of valid data packets in the multiple second data packets, and the second quantity is the quantity of the multiple second data packets.

[0076] The first number is the number of valid data packets in the plurality of second data packets, and the second number is the number of the plurality of second data packets. For example, if there are 10 second data packets and 8 of the 10 second data packets are valid data packets, then the first number is 8 and the second number is 10.

[0077] Step S302: If the ratio of the first number to the second number is greater than or equal to a preset first threshold, determine that the operating state of the first Bluetooth device is a first operating state.

[0078] The first threshold is a preset ratio threshold used to measure whether the user frequently operates the first Bluetooth device. The first threshold can be set according to actual needs. For example, the first threshold is set to 0.8, 0.9, 1, etc. If the ratio of the first number to the second number is greater than or equal to the preset first threshold, it means that the number of valid data packets in the multiple first data packets is large, that is, the user operates the first Bluetooth device frequently, and it is determined that the operating state of the first Bluetooth device is the first operating state.

[0079] Step S303: If the ratio of the first number to the second number is less than the first threshold, determine that the operating state of the first Bluetooth device is the second operating state.

[0080] If the ratio of the first number to the second number is less than the preset first threshold, it means that the number of valid data packets in the multiple first data packets is small, that is, the user operates the first Bluetooth device less frequently, and the operating state of the first Bluetooth device is determined to be the second operating state.

[0081] In a specific implementation, before or after sending the first request to the second Bluetooth device in step S203, the following further includes:

[0082] A second request is sent to the first Bluetooth device, so that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is adjusted from the first interval time to the second interval time; wherein the second interval time is smaller than the first interval time.

[0083] If the operation state of the first Bluetooth device is the first operation state, that is, the user is frequently operating the first Bluetooth device, in order to improve the response speed of the first Bluetooth device, this embodiment also sends a second request to the first Bluetooth device, and the second request stipulates that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is the second interval time, so that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode can be adjusted from the first interval time to the second interval time. Among them, the second interval time is less than the first interval time, for example, combined with Figure 3 and Figure 4As shown, the first interval time is 24 slots. If the operating state of the Bluetooth handle is the first state, the terminal device sends a second request to the Bluetooth handle. The second request stipulates that the breathing interval between the terminal device and the Bluetooth handle in the breathing mode is 10 slots.

[0084] It should be noted that, in this embodiment, when the user does not frequently operate the first Bluetooth device, the breathing interval of the terminal device and the first Bluetooth device in the breathing mode is set to a larger value (for example, 24 slots), which can reduce the occupation of bandwidth resources by the first Bluetooth device. When it is detected that the user frequently operates the first Bluetooth device, the breathing interval of the terminal device and the first Bluetooth device in the breathing mode is set to a smaller value (for example, 10 slots), ensuring that more bandwidth resources are used for the operation response of the first Bluetooth device, thereby avoiding delays, freezes, and the like in the operation of the first Bluetooth device due to insufficient bandwidth resources.

[0085] In a specific implementation, before or after sending the first request to the second Bluetooth device in the above step S203, it may also include: sending a seventh request to the first Bluetooth device to switch the link mode between the terminal device and the first Bluetooth device from the breathing mode to the activation mode.

[0086] The seventh request is a link mode switching instruction sent by the terminal device to the first Bluetooth device. The link mode between the terminal device and the first Bluetooth device can be switched from the breathing mode to the activation mode through the seventh request. If the operating state of the first Bluetooth device is the first operating state, in addition to shortening the breathing interval between the terminal device and the first Bluetooth device in the breathing mode to ensure that there are more bandwidth resources for the operation response of the first Bluetooth device, the seventh request can also be sent to the first Bluetooth device to switch the link mode between the terminal device and the first Bluetooth device from the breathing mode to the activation mode. In this way, as many bandwidth resources as possible can be used for the operation response of the first Bluetooth device, avoiding delays, freezes, etc. in the operation of the first Bluetooth device due to insufficient bandwidth resources.

[0087] In a specific implementation, referring to Figure 7 As shown, after sending the first request to the second Bluetooth device in the above step S203, the following steps S401 to S403 may be included, which are specifically as follows:

[0088] Step S401: Send a third data packet to a first Bluetooth device based on a second interval time, and receive a plurality of fourth data packets returned by the first Bluetooth device based on the third data packet.

[0089] The third data packet is a data packet sent by the terminal device to the first Bluetooth device at the second interval time. The third data packet may be the same as or different from the first data packet. The fourth data packet is a data packet returned by the first Bluetooth device to the terminal device based on the third data packet. After the terminal device sends multiple third data packets to the first Bluetooth device at the second interval time, the first Bluetooth device returns multiple fourth data packets to the terminal device based on the multiple third data packets. For example, the second interval time is represented by D2, the terminal device sends the first third data packet to the first Bluetooth device at time T2, and the first Bluetooth device returns a fourth data packet based on the third data packet. The terminal device sends the second third data packet to the first Bluetooth device at time T2+D2, and the first Bluetooth device returns the second fourth data packet based on the third data packet. And so on, the terminal device sends the N+1th third data packet to the first Bluetooth device at time T2+N*D2, and the first Bluetooth device returns the N+1th fourth data packet based on the third data packet.

[0090] Step S402: Based on a plurality of fourth data packets, determine whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state.

[0091] The multiple fourth data packets are data packets returned by the first Bluetooth device to the terminal device based on the third data packet. When the user operates the first Bluetooth device, the fourth data packet sent by the first Bluetooth device to the terminal device is a valid data packet (non-NULL data packet). When the user does not operate the first Bluetooth device, the fourth data packet sent by the first Bluetooth device to the terminal device is an empty data packet (NULL data packet). Therefore, based on whether the multiple fourth data packets are empty data packets or valid data packets, it can be determined whether the operating state of the first Bluetooth device is switched from the first operating state to the second operating state.

[0092] In a specific implementation example, determining whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state based on the plurality of fourth data packets in the above step S402 may include the following steps:

[0093] (1) Based on multiple fourth data packets, determine a third quantity and a fourth quantity; the third quantity is the number of empty data packets in the multiple fourth data packets, and the fourth quantity is the number of the multiple fourth data packets.

[0094] The third quantity is the number of empty data packets among multiple fourth data packets, and the fourth quantity is the number of multiple fourth data packets. For example, there are 10 fourth data packets, and 8 of the 10 fourth data packets are empty data packets, then the third quantity is 8, and the fourth quantity is 10.

[0095] (2) If the ratio of the third number to the fourth number is greater than or equal to a preset second threshold, determine whether the key information of the first Bluetooth device is received within a preset time.

[0096] The second threshold is a preset ratio threshold used to measure whether the user frequently operates the first Bluetooth device. The second threshold can be set according to actual needs. For example, the second threshold is set to 0.8, 0.9, 1, etc. If the ratio of the third number to the fourth number is greater than or equal to the preset second threshold, it means that the number of empty data packets in the multiple first data packets is large, and then it is further determined whether the key information of the first Bluetooth device is received within the preset time. For example, if the second threshold is 0.8, if the ratio of the third number to the fourth number is 0.8, it is further determined whether the key information of the first Bluetooth device is received within 1 minute.

[0097] (3) If no key information is received within a preset time, determine that the operation state of the first Bluetooth device is switched from the first operation state to the second operation state.

[0098] If the ratio of the third number to the fourth number is greater than or equal to the preset second threshold value, and the key information is not received within the preset time, it is determined that the operation state of the first Bluetooth device is switched from the first operation state to the second operation state. Conversely, if the ratio of the third number to the fourth number is less than the preset second threshold value or the key information is received within the preset time, it is determined that the operation state of the first Bluetooth device is not switched from the first operation state to the second operation state.

[0099] This embodiment combines the ratio of the third number to the fourth number and whether the key information of the first Bluetooth device is received within the preset time to determine whether the operating state of the first Bluetooth device is switched from the first operating state to the second operating state. While ensuring that the user basically does not control the first Bluetooth device, the bandwidth resources occupied by the first Bluetooth device are reduced, thereby avoiding delays, freezes, and other phenomena in the operation of the first Bluetooth device due to insufficient bandwidth resources.

[0100] Step S403: If the operation state of the first Bluetooth device is switched from the first operation state to the second operation state, a third request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the sniffing mode to the active mode.

[0101] If the operating state of the first Bluetooth device switches from the first operating state to the second operating state, a third request is sent to the second Bluetooth device to switch the link mode between the terminal device and the second Bluetooth device from the breathing mode to the activation mode. This allows the user to exit frequent operation of the first Bluetooth device and reserve as much bandwidth resources as possible for the second Bluetooth device.

[0102] In a specific implementation, the maximum length of a data packet transmitted between the terminal device and the second Bluetooth device is the first length. After sending the first request to the second Bluetooth device in the above step S203, the method further includes:

[0103] A fourth request is sent to the second Bluetooth device, so that the maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is adjusted from the first length to the second length; wherein the second length is smaller than the first length.

[0104] The maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is the first length, and the first length can be set according to actual needs, for example, the first length is set to 5 slots. The second length is less than the first length, for example, the second length is set to 3 slots. If the operating state of the first Bluetooth device is the first operating state, that is, the user frequently operates the first Bluetooth device, and sends a fourth request to the second Bluetooth device, the fourth request stipulates that the maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is the second length, which can reduce the bandwidth resources occupied by the second Bluetooth device, thereby using more bandwidth resources for the operation response of the first Bluetooth device and improving the response speed of the first Bluetooth device.

[0105] In a specific implementation, the maximum length of a data packet transmitted between the terminal device and the first Bluetooth device is a third length, and the mode switching method further includes:

[0106] (1) Monitor the communication connection status between the target device and the second Bluetooth device.

[0107] The communication connection state of the second Bluetooth device includes a disconnected state and a communication state. When the communication connection state between the target device and the second Bluetooth device is a disconnected state, the second Bluetooth device will not occupy bandwidth resources, and the bandwidth resources are sufficient. When the communication connection state between the target device and the second Bluetooth device is a communication state, the bandwidth resources are less.

[0108] (2) If the communication connection state switches from the communication state to the disconnected state, a fifth request is sent to the first Bluetooth device so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the third length to the fourth length; wherein the fourth length is greater than the third length.

[0109] The maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is the third length, and the third length can be set according to actual needs, for example, the third length is set to 1 slot. The fourth length is greater than the third length, for example, the fourth length is set to 5 slots. If the communication connection state between the target device and the second Bluetooth device switches from the communication state to the disconnected state, that is, the bandwidth resources are sufficient, a fifth request is sent to the first Bluetooth device. The fifth request stipulates that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is the fourth length. In this way, as much bandwidth resources as possible can be used for the first Bluetooth device to respond to operations, thereby improving the response speed of the first Bluetooth device.

[0110] (3) If the communication connection state is restored from the disconnected state to the communication state, a sixth request is sent to the first Bluetooth device, so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the fourth length to the third length.

[0111] If the communication connection state between the target device and the second Bluetooth device is restored from the disconnected state to the communication state, that is, the bandwidth resources are less, a sixth request is sent to the first Bluetooth device. The sixth request stipulates that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is the third length, thereby avoiding the first Bluetooth device occupying more bandwidth resources, causing the second Bluetooth device to experience freezes, delays, etc. due to insufficient bandwidth resources.

[0112] In order to better implement the mode switching method in the embodiment of the present application, based on the mode switching method, a mode switching device is also provided in the embodiment of the present application. The mode switching device is applied to a terminal device, the terminal device is connected to a first Bluetooth device and a second Bluetooth device for communication, the link mode between the terminal device and the first Bluetooth device is a breathing mode, the link mode between the terminal device and the second Bluetooth device is an activation mode, and the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is a first interval time, such as Figure 8 As shown, the mode switching device 700 includes:

[0113] A first sending module 710, configured to send a first data packet to a first Bluetooth device based on a first interval, and receive a plurality of second data packets returned by the first Bluetooth device based on the first data packet;

[0114] A state determination module 720, configured to determine an operation state of the first Bluetooth device based on the plurality of second data packets;

[0115] The second sending module 730 is used to send a first request to the second Bluetooth device if the operating state of the first Bluetooth device is the first operating state, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0116] In an embodiment of the present application, the operating state of the first Bluetooth device is determined by multiple second data packets, and when the operating state of the first Bluetooth device is the first operating state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the activation mode to the breathing mode. When the first Bluetooth device is not in the first operating state, as many bandwidth resources as possible are reserved for the second Bluetooth device. When the first Bluetooth device is in the first operating state, more bandwidth resources are used for the operation response of the first Bluetooth device. This can alleviate the freeze, delay and other phenomena caused by insufficient bandwidth resources of Bluetooth devices in multi-channel Bluetooth scenarios, and improve the user experience of each Bluetooth device in multi-channel Bluetooth scenarios.

[0117] In some embodiments of the present application, the plurality of second data packets include valid data packets and / or empty data packets, and the state determination module 720 is specifically configured to:

[0118] Based on the plurality of second data packets, determining a first quantity and a second quantity; the first quantity is the quantity of valid data packets in the plurality of second data packets, and the second quantity is the quantity of the plurality of second data packets;

[0119] If the ratio of the first number to the second number is greater than or equal to a preset first threshold, determining that the operating state of the first Bluetooth device is a first operating state;

[0120] If the ratio of the first number to the second number is less than the first threshold, it is determined that the operating state of the first Bluetooth device is the second operating state.

[0121] In some embodiments of the present application, before or after the second sending module 730 sends the first request to the second Bluetooth device, the second sending module 730 is further configured to:

[0122] A second request is sent to the first Bluetooth device, so that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is adjusted from the first interval time to the second interval time; wherein the second interval time is smaller than the first interval time.

[0123] In some embodiments of the present application, after the second sending module 730 sends the first request to the second Bluetooth device, the second sending module 730 is further configured to:

[0124] Sending a third data packet to the first Bluetooth device based on a second interval time, and receiving a plurality of fourth data packets returned by the first Bluetooth device based on the third data packet;

[0125] Based on the plurality of fourth data packets, determining whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state;

[0126] If the operation state of the first Bluetooth device is switched from the first operation state to the second operation state, a third request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the sniffing mode to the active mode.

[0127] In some embodiments of the present application, the plurality of fourth data packets include valid data packets and / or empty data packets, and the second sending module 730 is specifically configured to:

[0128] Based on the plurality of fourth data packets, determine a third quantity and a fourth quantity; the third quantity is the quantity of empty data packets in the plurality of fourth data packets, and the fourth quantity is the quantity of the plurality of fourth data packets;

[0129] If the ratio of the third number to the fourth number is greater than or equal to a preset second threshold, determining whether key information of the first Bluetooth device is received within a preset time;

[0130] If no key information is received within the preset time, it is determined that the operation state of the first Bluetooth device is switched from the first operation state to the second operation state.

[0131] In some embodiments of the present application, the maximum length of a data packet transmitted between the terminal device and the second Bluetooth device is the first length. After the second sending module 730 sends the first request to the second Bluetooth device, the second sending module 730 is further used to:

[0132] A fourth request is sent to the second Bluetooth device, so that the maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is adjusted from the first length to the second length; wherein the second length is smaller than the first length.

[0133] In some embodiments of the present application, the maximum length of a data packet transmitted between the terminal device and the first Bluetooth device is a third length, and the mode switching device 700 further includes:

[0134] A status monitoring module, used to monitor the communication connection status between the target device and the second Bluetooth device;

[0135] a third sending module, configured to send a fifth request to the first Bluetooth device if the communication connection state is switched from the communication state to the disconnected state, so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the third length to the fourth length; wherein the fourth length is greater than the third length;

[0136] The fourth sending module is used to send a sixth request to the first Bluetooth device if the communication connection state is restored from the disconnected state to the communication state, so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the fourth length to the third length.

[0137] The embodiment of the present application further provides a terminal device, which integrates any one of the mode switching devices provided in the embodiment of the present application, and the terminal device includes:

[0138] one or more processors;

[0139] Memory; and

[0140] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to execute the steps of the mode switching method in any of the above-mentioned mode switching method embodiments.

[0141] The present application also provides a terminal device, which integrates any mode switching device provided in the present application. Fig. 9 As shown, it shows a schematic diagram of the structure of the terminal device involved in the embodiment of the present application, specifically:

[0142] The terminal device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Fig. 9 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0143] The processor 801 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.

[0144] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0145] The terminal device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0146] The terminal device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0147] Although not shown, the terminal device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the terminal device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:

[0148] Sending a first data packet to a first Bluetooth device based on a first interval time, and receiving a plurality of second data packets returned by the first Bluetooth device based on the first data packet;

[0149] determining an operating state of the first Bluetooth device based on the plurality of second data packets;

[0150] If the operation state of the first Bluetooth device is the first operation state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0151] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0152] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any mode switching method provided in the embodiment of the present application. For example, the computer program is loaded by a processor to execute the following steps:

[0153] Sending a first data packet to a first Bluetooth device based on a first interval time, and receiving a plurality of second data packets returned by the first Bluetooth device based on the first data packet;

[0154] determining an operating state of the first Bluetooth device based on the plurality of second data packets;

[0155] If the operation state of the first Bluetooth device is the first operation state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the active mode to the breathing mode.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0157] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0158] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0159] The above is a detailed introduction to a mode switching method, device, terminal device and computer-readable storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A mode switching method, characterized in that: Applied to a terminal device, the terminal device is connected to a first Bluetooth device and a second Bluetooth device in communication, the link mode between the terminal device and the first Bluetooth device is a breathing mode, the link mode between the terminal device and the second Bluetooth device is an activation mode, the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is a first interval time, and the mode switching method includes: Sending a first data packet to the first Bluetooth device based on the first interval time, and receiving a plurality of second data packets returned by the first Bluetooth device based on the first data packet; determining an operation state of the first Bluetooth device based on a plurality of the second data packets; If the operation state of the first Bluetooth device is the first operation state, a first request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the activation mode to the breathing mode.

2. The method according to claim 1, characterized in that Before or after sending the first request to the second Bluetooth device, the method further includes: A second request is sent to the first Bluetooth device so that the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is adjusted from the first interval time to a second interval time; wherein the second interval time is smaller than the first interval time.

3. The method according to claim 2, characterized in that After sending the first request to the second Bluetooth device, the method further includes: Sending a third data packet to the first Bluetooth device based on the second interval time, and receiving a plurality of fourth data packets returned by the first Bluetooth device based on the third data packet; Based on the plurality of fourth data packets, determining whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state; If the operating state of the first Bluetooth device is switched from the first operating state to the second operating state, a third request is sent to the second Bluetooth device, so that the link mode between the terminal device and the second Bluetooth device is switched from the breathing mode to the activation mode.

4. The method according to claim 1, characterized in that: The plurality of second data packets include valid data packets and / or empty data packets, and determining the operation state of the first Bluetooth device based on the plurality of second data packets includes: Based on the plurality of the second data packets, determine a first quantity and a second quantity; the first quantity is the quantity of the valid data packets in the plurality of the second data packets, and the second quantity is the quantity of the plurality of the second data packets; If the ratio of the first number to the second number is greater than or equal to a preset first threshold, determining that the operating state of the first Bluetooth device is the first operating state; If the ratio of the first number to the second number is less than the first threshold, it is determined that the operating state of the first Bluetooth device is a second operating state.

5. The method according to claim 3, characterized in that: The plurality of fourth data packets include valid data packets and / or empty data packets, and determining whether the operation state of the first Bluetooth device is switched from the first operation state to the second operation state based on the plurality of fourth data packets includes: Based on the plurality of the fourth data packets, determine a third quantity and a fourth quantity; the third quantity is the quantity of the empty data packets in the plurality of the fourth data packets, and the fourth quantity is the quantity of the plurality of the fourth data packets; If the ratio of the third number to the fourth number is greater than or equal to a preset second threshold, determining whether key information of the first Bluetooth device is received within a preset time; If the key information is not received within the preset time, it is determined that the operation state of the first Bluetooth device is switched from the first operation state to the second operation state.

6. The method according to any one of claims 1 to 5, characterized in that: The maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is the first length, and after sending the first request to the second Bluetooth device, the method further includes: A fourth request is sent to the second Bluetooth device so that the maximum length of the data packet transmitted between the terminal device and the second Bluetooth device is adjusted from the first length to a second length; wherein the second length is smaller than the first length.

7. The method according to any one of claims 1 to 5, characterized in that: The maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is a third length, and the mode switching method further includes: Monitoring the communication connection status between the target device and the second Bluetooth device; If the communication connection state is switched from the communication state to the disconnected state, a fifth request is sent to the first Bluetooth device, so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the third length to a fourth length; wherein the fourth length is greater than the third length; If the communication connection state is restored from the disconnected state to the communication state, a sixth request is sent to the first Bluetooth device so that the maximum length of the data packet transmitted between the terminal device and the first Bluetooth device is adjusted from the fourth length to the third length.

8. A mode switching device, characterized in that: Applied to a terminal device, the terminal device is connected to a first Bluetooth device and a second Bluetooth device in communication, the link mode between the terminal device and the first Bluetooth device is a breathing mode, the link mode between the terminal device and the second Bluetooth device is an activation mode, the breathing interval between the terminal device and the first Bluetooth device in the breathing mode is a first interval time, and the mode switching device includes: A first sending module, configured to send a first data packet to the first Bluetooth device based on the first interval time, and receive a plurality of second data packets returned by the first Bluetooth device based on the first data packet; a state determination module, configured to determine an operation state of the first Bluetooth device based on a plurality of the second data packets; The second sending module is used to send a first request to the second Bluetooth device if the operating state of the first Bluetooth device is the first operating state, so that the link mode between the terminal device and the second Bluetooth device is switched from the activation mode to the breathing mode.

9. A terminal device, characterized in that: The terminal device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the mode switching method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the mode switching method according to any one of claims 1 to 7.