Bluetooth control method, device, terminal equipment and computer-readable storage medium

By obtaining Bluetooth abnormal information in the terminal device and restarting the Bluetooth process when the preset conditions are met, the problem of high processor occupancy and running lag caused by abnormal Bluetooth processes in the existing technology is solved, and a lower processor is achieved. occupancy rate and more stable equipment operation.

CN112612593BActive Publication Date: 2024-09-17SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011600437.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2024-09-17
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

When the Bluetooth process of the terminal device is abnormal, the existing Bluetooth control method leads to high processor occupancy and running lag, and cannot effectively reduce the number of restarts.

Method used

Start the Bluetooth process when receiving the Bluetooth start signal. If there is an abnormality, obtain the exception information and only restart the process when the preset conditions are met. Control the process by judging the Bluetooth module access status, driver firmware loading, protocol stack initialization status and other information. Restart until the preset number of times is reached to shut down the process and output a fault prompt.

Benefits of technology

It reduces the number of restarts of the Bluetooth process, reduces the processor occupancy of the terminal device, avoids running lags, and improves the performance of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112612593B
    Figure CN112612593B
Patent Text Reader

Abstract

The present invention discloses a Bluetooth control method, which comprises the following steps: upon receiving a Bluetooth start signal, starting a Bluetooth process based on the Bluetooth start signal; if the Bluetooth process is abnormal, obtaining Bluetooth abnormal information; and restarting the Bluetooth process when the Bluetooth abnormal information meets a preset condition. The present invention also discloses a Bluetooth control device, a terminal device, and a computer-readable storage medium. By using the Bluetooth control method of the present application, the restart times of the Bluetooth process are reduced, the processor occupancy rate of the terminal device is low, and the terminal device does not freeze, thereby solving the technical problem of freezing of the terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication control technology, and in particular to a Bluetooth control method, device, terminal equipment and computer-readable storage medium. Background Art

[0002] With the continuous update and development of Bluetooth technology, Bluetooth has become a standard configuration for various electronic products, such as Bluetooth remote controls, Bluetooth speakers, and Bluetooth headsets. Multiple terminals use Bluetooth to realize data transmission and command transmission between terminal devices. When the Bluetooth process of a terminal device is abnormal, the terminal device will not be able to transmit data and commands to other terminal devices via Bluetooth.

[0003] In the related art, a Bluetooth control method is disclosed. When the Bluetooth process of a terminal device is abnormal, the Bluetooth process is restarted to solve the technical problem that when the Bluetooth process is abnormal, the terminal device will be unable to transmit data and instructions with other terminal devices via Bluetooth.

[0004] However, with the existing Bluetooth control method, the processor occupancy rate of the terminal device is high, and the terminal device runs laggy. Summary of the invention

[0005] The main purpose of the present invention is to provide a Bluetooth control method, device, terminal device and computer-readable storage medium, aiming to solve the technical problems in the prior art of using the existing Bluetooth control method, the high processor occupancy rate of the terminal device and the lag in the operation of the terminal device.

[0006] To achieve the above object, the present invention proposes a Bluetooth control method, which comprises the following steps:

[0007] When a Bluetooth activation signal is received, starting a Bluetooth process based on the Bluetooth activation signal;

[0008] If the Bluetooth process is abnormal, obtaining Bluetooth abnormal information;

[0009] When the Bluetooth abnormal information meets a preset condition, restart the Bluetooth process.

[0010] Optionally, after the step of restarting the Bluetooth process when the Bluetooth abnormal information meets a preset condition, the method further includes:

[0011] Determine whether the Bluetooth process after restart is abnormal;

[0012] When the Bluetooth process is abnormal after the restart, new Bluetooth abnormality information is obtained to update the Bluetooth abnormality information, and the step of restarting the Bluetooth process when the Bluetooth abnormality information meets the preset conditions is returned to be executed until the number of restarts is greater than the preset number, the Bluetooth process is closed, and Bluetooth fault prompt information is output.

[0013] Optionally, the Bluetooth abnormality information includes access status information of the Bluetooth module; if the Bluetooth process is abnormal, the step of obtaining the Bluetooth abnormality information includes:

[0014] If the Bluetooth process is abnormal, determining whether the Bluetooth module is connected to obtain the access status information;

[0015] When the Bluetooth abnormal information meets a preset condition, the step of restarting the Bluetooth process includes:

[0016] When the Bluetooth abnormal information indicates that the Bluetooth module is connected, restart the Bluetooth process.

[0017] Optionally, the Bluetooth abnormal information further includes preset driver firmware loading information of the Bluetooth module; when the Bluetooth abnormal information indicates that the Bluetooth module is connected, the step of restarting the Bluetooth process includes:

[0018] When the Bluetooth abnormal information is that the Bluetooth module is connected, determining whether the preset driver firmware is loaded successfully to obtain the preset driver firmware loading information;

[0019] When the preset driver firmware is loaded successfully, restart the Bluetooth process.

[0020] Optionally, the Bluetooth abnormal information further includes operation command status information of the Bluetooth module; when the preset driver firmware is loaded successfully, the step of restarting the Bluetooth process includes:

[0021] When the preset driver firmware is loaded successfully, determining whether the operation command is abnormal;

[0022] When the operation command is abnormal, restart the Bluetooth process.

[0023] Optionally, the Bluetooth abnormality information further includes Bluetooth protocol stack initialization status information of the Bluetooth module; after the step of determining whether the operation command is abnormal when the preset driver firmware is loaded successfully, the method further includes:

[0024] When the operation command is normal, determining whether the Bluetooth protocol stack is initialized successfully;

[0025] When the Bluetooth protocol stack fails to be initialized, restart the Bluetooth process.

[0026] Optionally, when the Bluetooth abnormal information indicates that the Bluetooth module is connected, after determining whether the preset driver firmware of the Bluetooth module is loaded successfully to obtain the driver firmware loading information, the method further includes:

[0027] When the preset driver firmware fails to load, resetting the Bluetooth module;

[0028] After the Bluetooth module is reset, the Bluetooth process is restarted.

[0029] In addition, to achieve the above object, the present invention also proposes a Bluetooth control device, the Bluetooth control device comprising:

[0030] A starting module, configured to start a Bluetooth process based on a Bluetooth starting signal when a Bluetooth starting signal is received;

[0031] An acquisition module, used for acquiring Bluetooth abnormality information if the Bluetooth process is abnormal;

[0032] The restart module is used to restart the Bluetooth process when the Bluetooth abnormal information meets a preset condition.

[0033] In addition, to achieve the above-mentioned purpose, the present invention also proposes a terminal device, which includes: a Bluetooth module, a memory, a processor, and a Bluetooth control program stored in the memory and running on the processor, and when the Bluetooth control program is executed by the processor, the steps of the Bluetooth control method described in any one of the above items are implemented.

[0034] In addition, to achieve the above objectives, the present invention also proposes a computer-readable storage medium, on which a Bluetooth control program is stored, and when the Bluetooth control program is executed by a processor, the steps of the Bluetooth control method as described in any one of the above items are implemented.

[0035] The technical solution of the present invention proposes a Bluetooth control method, which starts a Bluetooth process based on a Bluetooth start signal when a Bluetooth start signal is received; obtains Bluetooth abnormality information if the Bluetooth process is abnormal; and restarts the Bluetooth process using the preset start strategy when the Bluetooth abnormality information meets a preset condition. In the existing Bluetooth control method, when the Bluetooth process is abnormal, the terminal device directly controls the Bluetooth process to restart, resulting in a large number of restarts of the Bluetooth process and a high processor occupancy rate of the terminal device. However, in the present application, when the Bluetooth process is abnormal, the Bluetooth abnormality information is obtained, and only when the Bluetooth abnormality information meets a preset condition, the terminal device controls the Bluetooth process to restart, which reduces the number of restarts of the Bluetooth process, reduces the processor occupancy rate of the terminal device, and does not freeze when the terminal device runs. Therefore, the Bluetooth control method of the present application reduces the processor occupancy rate and solves the technical problem of freezing when the terminal device runs. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] 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 of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0037] Figure 1 A schematic diagram of the structure of a terminal device in a hardware operating environment involved in an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a flow chart of a first embodiment of a Bluetooth control method of the present invention;

[0039] Figure 3 This is a flow chart of the second embodiment of the Bluetooth control method of the present invention after step S13;

[0040] Figure 4 FIG. 1 is a structural block diagram of a first embodiment of a Bluetooth control device according to the present invention.

[0041] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0043] Reference Figure 1 , Figure 1 A schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiment of the present invention.

[0044] The terminal device may be a user equipment (UE) such as a mobile phone, a smart phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a mobile station (MS), etc. The terminal device may be called a user terminal, a portable terminal, a desktop terminal, etc.

[0045] Typically, the terminal device includes: a Bluetooth module 307, at least one processor 301, a memory 302, and a Bluetooth control program stored in the memory and executable on the processor, wherein the Bluetooth control program is configured to implement the steps of the Bluetooth control method as described above.

[0046] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. The processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process the relevant Bluetooth control method operations, so that the Bluetooth control method model can be trained and learned autonomously to improve efficiency and accuracy.

[0047] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the Bluetooth control method provided in the method embodiment of the present application.

[0048] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.

[0049] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0050] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0051] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on the surface or above the surface of the display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 305 can be one, on the front panel of the terminal device; in other embodiments, the display screen 305 can be at least two, respectively arranged on different surfaces of the terminal device or in a folding design; in some further embodiments, the display screen 305 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal device. Even, the display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.

[0052] The power supply 306 is used to power various components in the terminal device. The power supply 306 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 306 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the terminal device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0054] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a Bluetooth control program is stored, and when the Bluetooth control program is executed by a processor, the steps of the Bluetooth control method described above are implemented. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed to be executed on a terminal device, or on multiple terminal devices located at one location, or on multiple terminal devices distributed at multiple locations and interconnected by a communication network.

[0055] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0056] Based on the above hardware structure, an embodiment of the Bluetooth control method of the present invention is proposed.

[0057] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a Bluetooth control method of the present invention, the method is used for a terminal device, and includes the following steps:

[0058] Step S11: when a Bluetooth activation signal is received, the Bluetooth process is activated based on the Bluetooth activation signal.

[0059] It should be noted that the execution subject of the present invention is a terminal device, and the terminal device has a Bluetooth module. The structure of the terminal device refers to the above description, and the present invention will not repeat it. Usually the terminal device has a Bluetooth control switch (physical button or virtual button), and the Bluetooth control switch is used to control the start or shutdown of the Bluetooth module of the terminal device. It is understandable that the Bluetooth start signal can be triggered by the user pressing the start key of the Bluetooth control switch, and the terminal device starts the Bluetooth process based on the Bluetooth start signal to turn on the relevant functions of the Bluetooth module.

[0060] In another embodiment, the Bluetooth start signal may also be sent by the running program of the terminal device. When the running program of the terminal device requires the Bluetooth module to implement certain functions, the Bluetooth start signal is sent to enable the terminal device to start the Bluetooth process based on the Bluetooth start signal.

[0061] Step S12: If the Bluetooth process is abnormal, obtain Bluetooth abnormal information.

[0062] Step S13: When the Bluetooth abnormal information meets a preset condition, restart the Bluetooth process.

[0063] It should be noted that the Bluetooth process abnormality of the present invention may be based on a Bluetooth start signal, which makes it impossible to start the Bluetooth process. The Bluetooth process abnormality may also be that certain Bluetooth functions cannot be implemented or other running programs cannot interact with the Bluetooth process, etc., and the present invention does not limit this.

[0064] It should be noted that obtaining the Bluetooth abnormality information may be executing a Bluetooth detection program, and obtaining the Bluetooth abnormality information based on a specific running state of the Bluetooth detection program.

[0065] In addition, the Bluetooth detection program of the present application is also a Bluetooth process starting program. If the Bluetooth process is normal when running the Bluetooth detection program, the Bluetooth process is started successfully and the Bluetooth process is normal; if the Bluetooth process is abnormal when running the Bluetooth detection program, the Bluetooth abnormality information is obtained based on the specific running status of the Bluetooth detection program.

[0066] Specifically, the Bluetooth abnormality information includes the access status information of the Bluetooth module; if the Bluetooth process is abnormal, the step of obtaining the Bluetooth abnormality information includes: if the Bluetooth process is abnormal, determining whether the Bluetooth module is connected to obtain the access status information; correspondingly, step S13 includes: when the Bluetooth abnormality information is that the Bluetooth module is connected, restarting the Bluetooth process.

[0067] It is understandable that this step is only the first step of the Bluetooth detection program, and the Bluetooth abnormal information of this step may be that the Bluetooth module is not connected. When the Bluetooth module is not connected to the terminal device, it belongs to the Bluetooth module (hardware) disconnected, and the Bluetooth module is equivalent to the state of being separated from the terminal device, then the Bluetooth process of the terminal device is bound to be abnormal, and the Bluetooth process cannot implement any function of Bluetooth. At this time, based on the Bluetooth abnormal information including the Bluetooth module not being connected, the Bluetooth process is terminated, and the first prompt information is output, so that the user can perform fault processing on the terminal device based on the first prompt information to connect the Bluetooth module to the terminal device.

[0068] When the Bluetooth module is connected, the Bluetooth process restart step may be performed, or the following detailed steps may be continued. The detailed steps are as follows:

[0069] The Bluetooth exception information also includes the preset driver firmware loading information of the Bluetooth module; when the Bluetooth exception information is the Bluetooth module access, the step of restarting the Bluetooth process includes: when the Bluetooth exception information is the Bluetooth module access, judging whether the preset driver firmware is loaded successfully to obtain the preset driver firmware loading information; when the preset driver firmware is loaded successfully, restarting the Bluetooth process.

[0070] It should be noted that this step is the second step of the Bluetooth detection program, which is a refinement of the first detection step, that is, the Bluetooth detection program includes multiple steps, and the specific running state of each step of the Bluetooth detection program corresponds to different Bluetooth abnormal information. The Bluetooth abnormal information of the second step can be that the Bluetooth module is connected and the preset driver firmware fails to load. When the Bluetooth module is connected, the preset driver firmware is loaded to the Bluetooth module (the preset driver firmware can be pre-stored with the terminal device, or it can be downloaded from the network in real time when the Bluetooth control method of this application is executed), and it is judged whether the preset driver firmware of the Bluetooth module is loaded successfully. When the preset driver firmware of the Bluetooth module fails to load, the USB communication is confirmed to be abnormal, and the Bluetooth abnormal information including the firmware loading failure is obtained. At this time, based on the Bluetooth abnormal information including the firmware loading failure, the Bluetooth process is terminated, and the second prompt information is output, so that the user can perform fault processing on the terminal device based on the second prompt information, so that the firmware of the Bluetooth module is loaded successfully and the USB communication is normal.

[0071] In addition, after the step of determining whether the preset driver firmware of the Bluetooth module is loaded successfully to obtain the driver firmware loading information when the Bluetooth abnormal information is the access of the Bluetooth module, the method also includes: when the preset driver firmware fails to load, resetting the Bluetooth module; and restarting the Bluetooth process after the Bluetooth module is reset.

[0072] It should be noted that the reset of the Bluetooth module can be to reset the Bluetooth module control program (Bluetooth software) or the Bluetooth module (Bluetooth hardware), and continue to restart the Bluetooth process. The Bluetooth process can be restarted by using the Bluetooth detection method of the present invention, or by using other Bluetooth process restart methods. When the Bluetooth detection program of the present invention is used to restart the Bluetooth process, the method and steps refer to the above description and the following description (not repeated here, refer to the following description); after the Bluetooth process is restarted, when Bluetooth abnormal information including Bluetooth module not connected or Bluetooth abnormal information including the Bluetooth module connected and the preset driver firmware failed to load is obtained, the Bluetooth process is terminated and the corresponding prompt information is output.

[0073] When the preset driver firmware is loaded successfully, the step of restarting the Bluetooth process may be performed, or the following detailed steps may be continued. The detailed steps are as follows:

[0074] Furthermore, the Bluetooth abnormality information also includes operation command status information of the Bluetooth module; the step of restarting the Bluetooth process when the preset driver firmware is loaded successfully includes: when the preset driver firmware is loaded successfully, determining whether the operation command is abnormal; when the operation command is abnormal, restarting the Bluetooth process.

[0075] It should be noted that this step is the third step of the Bluetooth detection program. At this time, the Bluetooth abnormal information can be that the Bluetooth module is connected, the preset driver firmware is loaded successfully, and the operation command is abnormal. When the preset driver firmware of the Bluetooth module is loaded successfully, the operation instruction detection continues to be performed; the operation instruction is obtained from the Bluetooth module control program, and the operation instruction detection is performed, that is, it is determined whether the operation command of the Bluetooth module is abnormal. It can be understood that when the operation instruction sent by the Bluetooth module control program is abnormal, the Bluetooth module cannot recognize the operation instruction, thereby making the Bluetooth process abnormal. At this time, it is necessary to detect the operation instruction sent by the Bluetooth module control program. When the operation command of the Bluetooth module is abnormal, Bluetooth abnormal information including the abnormal operation command is obtained, and based on the Bluetooth abnormal information including the abnormal operation command, a third prompt information is output to prompt the user that the operation instruction of the Bluetooth module control program is abnormal, so that the user can perform repair operations based on the third prompt information.

[0076] When the operation command is normal, the following detailed steps may be continued. The detailed steps are as follows:

[0077] The Bluetooth exception information also includes the Bluetooth protocol stack initialization status information of the Bluetooth module; after the step of judging whether the operation command is abnormal when the preset driver firmware is loaded successfully, the method also includes: judging whether the initialization of the Bluetooth protocol stack is successful when the operation command is normal; and restarting the Bluetooth process when the Bluetooth protocol stack initialization fails.

[0078] It should be noted that this step is the fourth step of the Bluetooth detection program. At this time, the Bluetooth abnormal information can be that the Bluetooth module is accessed, the preset driver firmware is loaded successfully, the operation command is normal, and the Bluetooth protocol stack fails to initialize. When the operation command of the Bluetooth module is normal, it is necessary to continue to execute the detection step of the Bluetooth protocol stack, that is, initialize the Bluetooth protocol stack of the Bluetooth module, and judge whether the Bluetooth protocol stack of the Bluetooth module is successfully initialized; it can be understood that when the Bluetooth protocol stack of the Bluetooth module is abnormal (when the initialization fails), the Bluetooth module cannot interact with other running programs of the terminal device, resulting in abnormal Bluetooth process. When the Bluetooth protocol stack of the Bluetooth module fails to initialize, obtain Bluetooth abnormal information including the failure of protocol stack initialization, and output the fourth prompt information based on the Bluetooth abnormal information including the failure of protocol stack initialization, which is used to prompt the user that the Bluetooth protocol stack of the Bluetooth module fails to initialize, so that the user can perform repair operations based on the fourth prompt information.

[0079] In addition, when the Bluetooth protocol stack of the Bluetooth module is successfully initialized, the Bluetooth process is normal and the Bluetooth process is successfully started. At this time, the Bluetooth process can realize various functions of the Bluetooth module. There is no need to restart the Bluetooth process, and only the normal operation of the Bluetooth process is required.

[0080] It should be noted that the Bluetooth detection program of the present invention includes the above-mentioned four main steps. The specific status information of each step of the Bluetooth detection program corresponds to a Bluetooth abnormality information. Different Bluetooth abnormality information requires different repair operations. Among them, for the Bluetooth abnormality information of the first step and the Bluetooth abnormality information of the second step, it can be determined that the Bluetooth process abnormality is caused by the abnormality of the Bluetooth module (firmware), which can be solved by restarting the Bluetooth process usually. Therefore, there is no need to restart the Bluetooth process (except for the above-mentioned restart of the Bluetooth process after obtaining the Bluetooth abnormality information including the failure of firmware loading and resetting the Bluetooth module); for the Bluetooth abnormality information of the third step and the Bluetooth abnormality information of the fourth step, it can be determined that the Bluetooth process abnormality is caused by the abnormality of the software corresponding to the Bluetooth module (Bluetooth module control program and the interactive program between Bluetooth and other running programs), which can be repaired by restarting the Bluetooth process.

[0081] When executing the complete program of the Bluetooth detection program of the present application, the four steps directly correspond to four different Bluetooth exception information respectively. Whether it is necessary to restart the Bluetooth process can be determined directly according to the different Bluetooth exception information. That is, when the Bluetooth exception information of the first step and the second step is obtained, there is no need to restart the Bluetooth process, that is, it can be understood that the Bluetooth exception information of the first step and the second step does not meet the preset conditions; when the Bluetooth exception information of the third step and the fourth step is obtained, it is necessary to restart the Bluetooth process, that is, it can be understood that the Bluetooth exception information of the first step and the second step meets the preset conditions, and the Bluetooth process can be restarted.

[0082] In specific applications, users can choose to implement all or part of the steps of the Bluetooth detection program of this application according to their needs. Correspondingly, the preset conditions will also change. Please refer to the above description for details, which will not be repeated here.

[0083] In addition, when restarting the Bluetooth process, the Bluetooth detection program of the present application can be used to restart the Bluetooth process. Based on the specific running state of the Bluetooth detection program, the Bluetooth abnormality information can be obtained, so that when the Bluetooth process is abnormal, the Bluetooth abnormality information can be directly obtained, and it is not necessary to perform the Bluetooth detection program of the present invention again when the Bluetooth process is abnormal. At the same time, when the Bluetooth detection program of the present invention runs to the end and no Bluetooth abnormality information is obtained (that is, when the Bluetooth protocol stack of the Bluetooth module is successfully initialized), it indicates that the Bluetooth process abnormality has been repaired and the Bluetooth process is normal, and the operation of the Bluetooth process can continue to enable the Bluetooth process to perform related tasks.

[0084] In addition, when executing step S11, the Bluetooth detection program of the present invention can also be used to start the Bluetooth process, and based on the specific running status of the Bluetooth detection program, obtain Bluetooth abnormality information, so that when the Bluetooth process is abnormal, the obtained Bluetooth abnormality information can be directly obtained. There is no need to run the Bluetooth detection program of the present application when the Bluetooth process is abnormal to obtain the Bluetooth abnormality information, thereby saving operating steps.

[0085] In another embodiment, when executing step S11, the existing Bluetooth process startup method can also be used to start the Bluetooth process, and when the Bluetooth process is abnormal, the Bluetooth detection program of the present application is run to obtain Bluetooth abnormality information. Preferably, when executing step S11, the Bluetooth process is started by the Bluetooth detection program of the present application.

[0086] The technical solution of this embodiment proposes a Bluetooth control method, which starts a Bluetooth process based on a Bluetooth start signal when a Bluetooth start signal is received; obtains Bluetooth abnormality information if the Bluetooth process is abnormal; and restarts the Bluetooth process using the preset start strategy when the Bluetooth abnormality information meets a preset condition. In the existing Bluetooth control method, when the Bluetooth process is abnormal, the terminal device directly controls the Bluetooth process to restart, resulting in a large number of restarts of the Bluetooth process and a high processor occupancy rate of the terminal device. However, in this application, when the Bluetooth process is abnormal, Bluetooth abnormality information is obtained, and only when the Bluetooth abnormality information meets a preset condition, the terminal device controls the Bluetooth process to restart, which reduces the number of restarts of the Bluetooth process, reduces the processor occupancy rate of the terminal device, and does not cause the terminal device to run stuck. Therefore, using the Bluetooth control method of this application, the processor occupancy rate is reduced, and the technical problem of terminal device running stuck is solved.

[0087] Reference Figure 3 , Figure 3 This is a flow chart after step S13 of the second embodiment of the Bluetooth control method of the present invention; the method is used for a terminal device, and the method includes the following steps:

[0088] Step S21: determining whether the Bluetooth process after restart is abnormal;

[0089] Step S22: When the Bluetooth process after the restart is abnormal, new Bluetooth abnormality information is obtained to update the Bluetooth abnormality information, and the step of restarting the Bluetooth process when the Bluetooth abnormality information meets the preset conditions is returned to execute until the number of restarts is greater than the preset number, the Bluetooth process is closed, and a Bluetooth fault prompt information is output.

[0090] It should be noted that after the Bluetooth process is restarted, when the restarted Bluetooth process is abnormal, continue to obtain new Bluetooth abnormality information (the Bluetooth abnormality information corresponding to the restarted Bluetooth process), use the new Bluetooth abnormality information as the Bluetooth abnormality information, and return to execute the step of restarting the Bluetooth process when the Bluetooth abnormality information meets the preset conditions, that is, execute the step of cyclically restarting the Bluetooth process.

[0091] It is understandable that when the Bluetooth abnormality information meets the preset conditions, the Bluetooth process abnormality is usually caused by the abnormality of the software (Bluetooth module control program and the interactive program between Bluetooth and other running programs), and the abnormal Bluetooth process can be repaired by repeatedly restarting the Bluetooth process. However, if the abnormal Bluetooth process cannot be repaired, it may not be caused by software abnormality, but may be caused by other faults of the terminal device. At this time, it is not necessary to restart the Bluetooth process indefinitely, and when the number of restarts is greater than the preset number, the Bluetooth process is closed, and the Bluetooth fault prompt information is output at the same time, so that the user can repair it according to the Bluetooth fault prompt information. It is understandable that the Bluetooth fault prompt information here is different from the four types of prompt information described above. The Bluetooth fault prompt information does not include specific Bluetooth abnormality information, and the Bluetooth fault information may be used to prompt the user to perform a full range of software and hardware fault repairs on the terminal device.

[0092] In addition, the restart number of the present application is set to 1 in step S13, and the restart number is accumulated when executing step S22.

[0093] Specifically, the preset number of times can be set by the user according to the needs, and the present invention is preferably 50 times. In addition, when the Bluetooth process is restarted, the Bluetooth detection program of the present invention is used to restart the Bluetooth process.

[0094] In this embodiment, after the Bluetooth process is restarted, and when the obtained Bluetooth abnormality information meets the preset conditions, the terminal device restarts the Bluetooth process a limited number of times to repair the abnormal Bluetooth process fault. After the Bluetooth process is restarted a limited number of times, if the abnormal Bluetooth process cannot be repaired, the Bluetooth process is terminated and Bluetooth fault prompt information is output. In the existing Bluetooth control method, when the abnormal Bluetooth process cannot be repaired, the Bluetooth process is restarted an unlimited number of times until the abnormal Bluetooth process is repaired or the user manually terminates the Bluetooth process, which makes the processor occupancy rate of the terminal device higher. Compared with the existing Bluetooth control method, which only applies for a limited number of Bluetooth process restarts, the processor occupancy rate of the terminal device is lower.

[0095] Reference Figure 4 , Figure 4 This is a structural block diagram of a first embodiment of a Bluetooth control device of the present invention, the device is used in a terminal device, and the device includes:

[0096] A starting module 10, configured to start a Bluetooth process based on a Bluetooth starting signal when the Bluetooth starting signal is received;

[0097] The acquisition module 20 is used to acquire Bluetooth abnormality information if the Bluetooth process is abnormal;

[0098] The restart module 30 is used to restart the Bluetooth process when the Bluetooth abnormal information meets a preset condition.

[0099] The above descriptions are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.

Claims

1. A Bluetooth control method, It is characterized in that The Bluetooth control method comprises the following steps: When a Bluetooth activation signal is received, the Bluetooth process is activated based on the Bluetooth activation signal; If the Bluetooth process is abnormal, obtaining Bluetooth abnormal information; When the Bluetooth abnormal information meets a preset condition, restarting the Bluetooth process; When the Bluetooth abnormal information does not meet the preset condition, the restart operation of the Bluetooth process is not performed; The Bluetooth abnormal information includes access status information of the Bluetooth module; if the Bluetooth process is abnormal, the step of obtaining the Bluetooth abnormal information includes: If the Bluetooth process is abnormal, determining whether the Bluetooth module is connected to obtain the access status information; When the Bluetooth abnormal information meets a preset condition, the step of restarting the Bluetooth process includes: When the Bluetooth abnormal information indicates that the Bluetooth module is connected, restarting the Bluetooth process; The Bluetooth abnormal information also includes preset driver firmware loading information of the Bluetooth module; when the Bluetooth abnormal information is the Bluetooth module access, the step of restarting the Bluetooth process includes: When the Bluetooth abnormal information is that the Bluetooth module is connected, determining whether the preset driver firmware is loaded successfully to obtain the preset driver firmware loading information; When the preset driver firmware is loaded successfully, restart the Bluetooth process.

2. The Bluetooth control method according to claim 1, It is characterized in that After the step of restarting the Bluetooth process when the Bluetooth abnormal information meets a preset condition, the method further includes: Determine whether the Bluetooth process after restart is abnormal; When the Bluetooth process is abnormal after the restart, new Bluetooth abnormality information is obtained to update the Bluetooth abnormality information, and the step of restarting the Bluetooth process when the Bluetooth abnormality information meets the preset conditions is returned to be executed until the number of restarts is greater than the preset number, the Bluetooth process is closed, and Bluetooth fault prompt information is output.

3. The Bluetooth control method according to claim 1, It is characterized in that The Bluetooth abnormal information also includes the operation command status information of the Bluetooth module; when the preset driver firmware is loaded successfully, the step of restarting the Bluetooth process includes: When the preset driver firmware is loaded successfully, determining whether the operation command is abnormal; When the operation command is abnormal, restart the Bluetooth process.

4. The Bluetooth control method according to claim 3, It is characterized in that The Bluetooth abnormal information also includes the Bluetooth protocol stack initialization status information of the Bluetooth module; after the step of determining whether the operation command is abnormal when the preset driver firmware is loaded successfully, the method further includes: When the operation command is normal, determining whether the Bluetooth protocol stack is initialized successfully; When the Bluetooth protocol stack fails to be initialized, restart the Bluetooth process.

5. The Bluetooth control method according to claim 4, It is characterized in that After the step of determining whether the preset driver firmware of the Bluetooth module is loaded successfully when the Bluetooth abnormal information indicates that the Bluetooth module is connected to obtain the driver firmware loading information, the method further includes: When the preset driver firmware fails to load, resetting the Bluetooth module; After the Bluetooth module is reset, the Bluetooth process is restarted.

6. A Bluetooth control device, It is characterized in that The bluetooth control device comprises: A starting module, configured to start a Bluetooth process based on a Bluetooth starting signal when a Bluetooth starting signal is received; An acquisition module, used for acquiring Bluetooth abnormality information if the Bluetooth process is abnormal; A restart module, used for restarting the Bluetooth process when the Bluetooth abnormal information meets a preset condition; The restart module is also used for not restarting the Bluetooth process when the Bluetooth abnormal information does not meet the preset condition; The Bluetooth abnormal information includes the access status information of the Bluetooth module; the acquisition module is further used to determine whether the Bluetooth module is connected if the Bluetooth process is abnormal, so as to obtain the access status information; the restart module is also used to restart the Bluetooth process when the Bluetooth abnormal information is that the Bluetooth module is connected; The Bluetooth abnormal information also includes the preset driver firmware loading information of the Bluetooth module; the restart module is also used to determine whether the preset driver firmware is loaded successfully when the Bluetooth abnormal information is the access of the Bluetooth module, so as to obtain the preset driver firmware loading information; When the preset driver firmware is loaded successfully, restart the Bluetooth process.

7. A terminal device, It is characterized in that The terminal device comprises: a Bluetooth module, a memory, a processor, and a Bluetooth control program stored in the memory and running on the processor, wherein the Bluetooth control program implements the steps of the Bluetooth control method as described in any one of claims 1 to 5 when executed by the processor.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a Bluetooth control program, and when the Bluetooth control program is executed by the processor, the steps of the Bluetooth control method according to any one of claims 1 to 5 are implemented.