Wireless communication connection method and device, terminal, storage medium and product
After the disconnection event, whether to establish a wireless communication connection based on the connection exception type and stable information is determined, the problems of unstable connection and high power consumption in weak signal scenarios are solved, and more stable connection and lower power consumption are achieved.
Patent Information
- Application Number
- CN202510162970.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-05-13
AI Technical Summary
In weak signal scenarios, frequent connection events and disconnection events will increase the power consumption of the terminal and lead to unstable wireless communication connections.
When the disconnection event occurs, the connection exception type is determined. If it is the target exception type (that is, the exception caused by unstable connection), a scanning operation is performed to determine the connection stability information of the second terminal. Only if the stable connection condition is met can a wireless communication connection be established with the second terminal.
Improves the stability of wireless communication connections, reduces the power consumption of the terminal, and reduces the waste of power consumption due to frequent connections.
Smart Images

Figure CN119996983A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of wireless communication technology, and in particular to a connection method, device, terminal, storage medium and product for wireless communication. Background Art
[0002] The Bluetooth connection method includes background connection (Background connect, BG connet), and the process of BG connet is as follows: for the second terminal that the first terminal has historically connected to, the first terminal will add the terminal identification of the second terminal to the white list of the first terminal; when the Bluetooth function of the first terminal is turned on and the first terminal is not connected to a Bluetooth device, the first terminal performs a scanning operation. When the first terminal scans the terminal identification of the second terminal, since the terminal identification of the second terminal is stored in the white list of the first terminal; therefore, the first terminal saves the process of asking the user to enter the pairing password, but directly connects with the second terminal through Bluetooth communication. After the first terminal establishes a wireless Bluetooth connection with the second terminal, the first terminal will remove the terminal identification of the second terminal from the white list of the first terminal; when the wireless Bluetooth connection is disconnected, the first terminal will re-add the terminal identification of the second terminal to the white list of the first terminal, and then perform the scanning operation again.
[0003] When the first terminal establishes a Bluetooth communication connection with the second terminal, and when the wireless Bluetooth connection between the first terminal and the second terminal is disconnected, the first terminal will wake up the application to use the Bluetooth function in the first terminal, and notify the application of the Bluetooth status of the first terminal. For example, the first terminal is a mobile phone, the second terminal is a Bluetooth headset, and the application to use the Bluetooth function is a music player application. When the mobile phone establishes a Bluetooth communication connection with the Bluetooth headset, the mobile phone wakes up the music player application, etc., and notifies the music player application that the Bluetooth status of the mobile phone is connected, so that the music player application can play music through the Bluetooth headset, etc. Summary of the invention
[0004] The embodiments of the present application provide a method, device, terminal, storage medium and product for establishing a wireless communication connection. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a method for establishing a wireless communication connection, the method being used for a first terminal, the method comprising:
[0006] When there is a disconnection event of the wireless communication connection with the second terminal, determining a connection abnormality type between the second terminal and the first terminal;
[0007] In the case where the connection abnormality type is a target abnormality type, performing a scanning operation, the target abnormality type being a type of connection abnormality caused by unstable connection;
[0008] In a case where the terminal identifier of the second terminal is scanned, determining connection stability information of the second terminal, where the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal;
[0009] When the connection stability information satisfies a stable connection condition, a wireless communication connection is established with the second terminal based on the terminal identifier of the second terminal.
[0010] On the other hand, an embodiment of the present application provides a device for establishing a wireless communication connection, the device being applied to a first terminal, the device comprising:
[0011] A first determining module, configured to determine a connection abnormality type between the second terminal and the first terminal when there is a disconnection event of the wireless communication connection with the second terminal;
[0012] A first execution module, configured to execute a scanning operation when the connection abnormality type is a target abnormality type, wherein the target abnormality type is a type of connection abnormality caused by unstable connection;
[0013] A second determining module, configured to determine, when a terminal identifier of the second terminal is scanned, connection stability information of the second terminal, wherein the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal;
[0014] An establishing module is used to establish a wireless communication connection with the second terminal based on the terminal identifier of the second terminal when the connection stability information meets the stable connection condition.
[0015] On the other hand, an embodiment of the present application provides a terminal, which includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the method for establishing a wireless communication connection as described in the above aspects.
[0016] On the other hand, an embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal device, the chip is used to implement the method for establishing a wireless communication connection as described in the above aspects.
[0017] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for establishing a wireless communication connection as described in the above aspects.
[0018] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for establishing a wireless communication connection as described in the above aspects.
[0019] In an embodiment of the present application, if the connection abnormality type between the first terminal and the second terminal is a target abnormality type, it means that the first terminal is in a weak signal scenario, and in a weak signal scenario, connection events and disconnection events may be frequently triggered; and the frequent triggering of connection events and disconnection events will increase the power consumption of the first terminal; therefore, a scanning operation is performed first, and a wireless communication connection is established with the second terminal only when the terminal identifier of the second terminal is scanned and the connection stability information of the second terminal meets the stable connection conditions, thereby not only ensuring the stability of the wireless communication connection, but also reducing the power consumption of the first terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram of an implementation environment of a method for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a method for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0023] Figure 4 is a flow chart of a method for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0024] Figure 5 is a flow chart of a method for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0025] Figure 6 is a structural block diagram of a device for establishing a wireless communication connection shown in an exemplary embodiment of the present application;
[0026] Figure 7 It is a structural block diagram of a terminal shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0028] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0029] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the connection abnormality type, connection stability information and the whitelist of the first terminal involved in this application are all obtained with full authorization.
[0030] Please refer to Figure 1 , which shows a schematic diagram of the implementation environment of the method for establishing a wireless communication connection provided by an exemplary embodiment of the present application. The implementation environment includes: a first terminal 101 and a second terminal 102, both of which have wireless communication functions, and the first terminal 101 and the second terminal 102 establish a wireless communication connection through the wireless communication function, and then transmit data through the wireless communication connection. The wireless communication function includes but is not limited to the Bluetooth function and the Wifi function. The Bluetooth function can be a low-power Bluetooth Low Energy (BLE) function or a classic Bluetooth function.
[0031] In the embodiment of the present application, the wireless communication function is described by taking the Bluetooth function as an example. There are two connection modes of the Bluetooth communication connection between the first terminal 101 and the second terminal 102, namely direct connection (Direct connect) and background connection (Background connect, Bg connect). The process of Direct Connect is as follows: when the first terminal 101 has been connected to the second terminal 102 through the Bluetooth function in the past, the first terminal 101 adds the terminal identifier of the second terminal 102 to the white list of the first terminal 101; when the first terminal 101 scans the terminal identifier of the second terminal 102 through the Bluetooth function, since the terminal identifier of the second terminal 102 is in the white list of the first terminal 101; therefore, the first terminal 101 saves the process of asking the user to enter the pairing password, but directly calls the stored configuration file, the configuration file stores the terminal identifier and pairing password of the historically connected terminal, obtains the pairing password of the second terminal 102 from the configuration file based on the terminal identifier of the second terminal 102, verifies the second terminal 102 based on the pairing password of the second terminal 102, and establishes a Bluetooth communication connection with the second terminal 102 based on the terminal identifier of the second terminal 102 if the verification is successful. In addition, after the first terminal 101 establishes a Bluetooth communication connection with the second terminal 102, the first terminal 101 removes the terminal identifier of the second terminal 102 from the white list of the first terminal 101. When the Bluetooth communication connection between the first terminal 101 and the second terminal 102 is disconnected, the first terminal 101 does not perform other operations on the terminal identification of the second terminal 102, that is, the first terminal 101 does not add the terminal identification of the second terminal 102 to the whitelist of the first terminal 101 again.
[0032] In some embodiments, when the Bluetooth communication connection established between the first terminal 101 and the second terminal 102 times out, the first terminal 101 automatically switches from Direct connect to Bg connect. Bg connect is different from Direct connect in that when the Bluetooth communication connection between the first terminal 101 and the second terminal 102 is disconnected, the first terminal 101 re-adds the terminal identifier of the second terminal 102 to the whitelist of the first terminal 101. Correspondingly, the process of Bg connect may be: when the first terminal 101 has been historically connected to the second terminal 102 through the Bluetooth function, the first terminal 101 adds the terminal identifier of the second terminal 102 to the white list of the first terminal 101; when the first terminal 101 scans the terminal identifier of the second terminal 102 through the Bluetooth function, since the terminal identifier of the second terminal 102 is in the white list of the first terminal 101; therefore, the first terminal 101 saves the process of asking the user to enter the pairing password, but directly calls the stored configuration file, the configuration file stores the terminal identifier and pairing password of the historically connected terminal, based on the terminal identifier of the second terminal 102, obtains the pairing password of the second terminal 102 from the configuration file, based on the pairing password of the second terminal 102, verifies the second terminal 102, and if the verification is passed, establishes a Bluetooth communication connection with the second terminal 102 based on the terminal identifier of the second terminal 102. In addition, after the first terminal 101 establishes a Bluetooth communication connection with the second terminal 102, the first terminal 101 removes the terminal identifier of the second terminal 102 from the white list of the first terminal 101. When the Bluetooth communication connection between the first terminal 101 and the second terminal 102 is disconnected, the first terminal 101 re-adds the terminal identifier of the second terminal 102 to the whitelist of the first terminal 101, and then performs the scanning operation again. When the terminal identifier of the second terminal 102 is scanned again, the Bluetooth communication connection is established with the second terminal 102 again.
[0033] After the first terminal 101 establishes a Bluetooth communication connection with the second terminal 102, the first terminal 101 will wake up the second target application in the first terminal 101 that is to use the Bluetooth function, and notify the second target application to switch the Bluetooth state of the first terminal 101 to connected, so that the target application uses the Bluetooth function to transmit data with the second terminal 102. In addition, when the Bluetooth communication connection between the first terminal 101 and the second terminal 102 is disconnected, the first terminal 101 will also wake up the first target application in the first terminal 101, and notify the first target application to switch the Bluetooth state of the first terminal 101 to unconnected, so that the target application stops using the Bluetooth function to transmit data with the second terminal 102.
[0034] When the distance between the first terminal 101 and the second terminal 102 is far, the first terminal 101 may scan the terminal identifier of the second terminal 102, but when establishing a Bluetooth communication connection with the second terminal 102, the received signal strength indicator (RSSI) of the second terminal 102 is relatively weak, resulting in failure to establish the Bluetooth communication connection with the second terminal 102; or after establishing the Bluetooth communication connection with the second terminal 102, the Bluetooth communication connection is unstable and disconnected because the RSSI of the second terminal 102 is too low, resulting in frequent wake-up of the target application (the first target application or the second target application), thereby increasing the power consumption of the first terminal 101 and causing abnormal power consumption of the first terminal 101.
[0035] In an embodiment of the present application, for a weak signal scenario, when the wireless communication connection between the first terminal 101 and the second terminal 102 is disconnected, the terminal identifier of the second terminal 102 is not directly added to the whitelist of the first terminal 101, but a scanning operation is performed first to ensure that the RSSI of the scanned second terminal 102 meets the stable connection conditions before establishing a wireless communication connection with the second terminal 102, thereby not only improving the stability of the wireless communication connection, but also reducing the waste of power consumption of the first terminal 101 due to frequent connections.
[0036] The first terminal 101 may be a smart phone, a tablet computer, or a wearable device with a wireless communication function. The second terminal 102 may be a wearable device or a vehicle-mounted terminal with a wireless communication function. In the embodiment of the present application, the second terminal 102 is taken as an example of an external device of the first terminal 101; for example, the first terminal 101 is a smart phone, and the second terminal 102 is a Bluetooth headset or a Bluetooth microphone.
[0037] Please refer to Figure 2 , which shows a flow chart of a method for establishing a wireless communication connection provided by an exemplary embodiment of the present application. The method may include the following steps:
[0038] Step 201: When there is a disconnection event of the wireless communication connection with the second terminal, the first terminal determines the abnormal type of the connection between the second terminal and the first terminal.
[0039] The connection abnormality type is used to characterize the type of abnormal connection, and the connection abnormality type is classified based on the disconnection cause of the disconnection event. For example, the connection abnormality type between the second terminal and the first terminal can be a target abnormality type or a non-target abnormality type. The target abnormality type is the type of connection abnormality caused by unstable connection; the non-target abnormality type is the type of connection abnormality not caused by unstable connection; for example, the non-target abnormality type is the type of connection abnormality caused by normal user disconnection or the type of connection abnormality caused by normal distance. The type of connection abnormality caused by normal user disconnection refers to the type of connection abnormality caused by the user manually triggering the disconnection instruction, which is used to instruct the first terminal to disconnect the wireless communication connection between the first terminal and the second terminal. Normal distance disconnection refers to the type of connection abnormality caused by the distance between the first terminal and the second terminal exceeding the preset distance. The preset distance refers to the distance threshold for the two terminals to establish a wireless communication connection, that is, when the distance between the two terminals does not exceed the preset distance, the two terminals can establish a wireless communication connection through the wireless communication function, and when the distance between the two terminals exceeds the preset distance, the wireless communication connection between the two terminals will be disconnected, that is, the disconnection event of the wireless communication connection will be triggered at this time.
[0040] In a possible implementation manner, the first terminal stores an event detection model, where the event detection model is used to detect a disconnect event, and the disconnect event may be a disconnect event.
[0041] In a possible implementation, when a wireless communication connection between a first terminal and a second terminal is disconnected, the connection state of the wireless communication function of the first terminal will change. At this time, it is necessary to notify a target application in the first terminal, where the target application is an application that is to use the wireless communication function. Accordingly, the process may be: the first terminal wakes up a first target application in the first terminal, where the first target application is an application that is in a running state and is to use the wireless communication function when the disconnection event is triggered, and sends a first notification message to the first target application, where the first notification message is used to notify the target application that the connection state of the wireless communication function of the first terminal is disconnected.
[0042] In the embodiment of the present application, the wireless communication function is described by taking the Bluetooth function as an example. Figure 3The first terminal includes a Bluetooth chip controller, a host, a Bluetooth protocol stack (BluetoothGatt GattService) and a target application. When the Bluetooth chip controller triggers a disconnect event (Le disconnect) to the host, the host receives Le disconnect, and based on Le disconnect, triggers a disconnect callback event (Disconnect callback) to the Bluetooth protocol stack, the Bluetooth protocol stack receives the Disconnect callback, and based on the Disconnect callback, sends a first notification message (Ondisconnected) to the first target application; the first target application receives Ondisconnected, and based on Ondisconnected, determines that the Bluetooth connection state of the first terminal is disconnected.
[0043] In a possible implementation, after the first terminal establishes a wireless communication connection with the second terminal, the terminal identifier of the second terminal is removed from the whitelist of the first terminal. This process may be: Please continue to refer to Figure 3 The host includes a whitelist adding module (re-add device to accept list) and a connection management module (bta_gattc_actconnection_manager le_impl); when the Bluetooth connection between the first terminal and the second terminal is disconnected, the Bluetooth chip controller triggers Le disconnect to re-add device to accept list, re-add device to accept list receives Le disconnect, and sends a removal instruction (Remove accept list) to bta_gattc_act connection_manager le_impl based on Le disconnect, and Remove accept list carries the terminal identifier of the second terminal; bta_gattc_act connection_manager le_impl receives Remove accept list, and based on Remove accept list, triggers a removal event (GATT_ConnectAddDeviceToFilterAcceptList) to the Bluetooth chip controller; based on GATT_ConnectAddDeviceToFilterAcceptList, the Bluetooth chip controller removes the terminal identifier of the second terminal from the whitelist (AcceptList) of the first terminal.
[0044] Before this step, the first terminal establishes a wireless communication connection with the second terminal based on Direct Connect. The process may be: if the first terminal has been connected to the second terminal in the past, the first terminal will add the terminal identifier of the second terminal to the whitelist of the first terminal; if the wireless communication function of the first terminal is turned on, the first terminal performs a scanning operation, and if the terminal identifier of the second terminal is scanned based on the scanning operation, the first terminal establishes a wireless communication connection with the second terminal based on the terminal identifier of the second terminal in the whitelist of the first terminal. For example, please refer to Figure 4 When the wireless communication connection is successfully established, the first terminal removes the terminal identifier of the second terminal from the whitelist of the first terminal; when the wireless communication connection fails to be established, the first terminal switches the connection mode from Direct connect to BG connect, and then establishes a wireless communication connection with the second terminal based on BG connect.
[0045] Step 202: When the connection abnormality type is a target abnormality type, the first terminal performs a scanning operation, and the target abnormality type is a type of connection abnormality caused by unstable connection.
[0046] The first terminal determines the state of the wireless communication function of the first terminal, and when the state of the wireless communication function is turned on, the first terminal performs a scanning operation. The scanning operation is an operation of scanning based on a preset scanning period, and the preset scanning period can be set and changed as needed. In the embodiment of the present application, the preset scanning period is not specifically limited.
[0047] When there is a disconnection event of the wireless communication connection with the second terminal, the first terminal adds the terminal identification of the second terminal to the whitelist of the first terminal, and the whitelist of the first terminal is used to store the terminal identifications of the terminals that the first terminal has historically connected to; when the connection abnormality type is the target abnormality type, the terminal identification of the second terminal is removed from the whitelist of the first terminal. When the connection abnormality type is not the target abnormality type, the terminal identification of the second terminal is not removed from the whitelist of the first terminal, that is, the terminal identification of the second terminal continues to be stored in the whitelist of the first terminal, and the first terminal performs a scanning operation at this time; when the terminal identification of the second terminal is scanned, a wireless communication connection is established with the second terminal based on the terminal identification of the second terminal in the whitelist of the first terminal, thereby improving the efficiency of establishing the wireless communication connection.
[0048] Step 203: When the terminal identifier of the second terminal is scanned, the first terminal determines connection stability information of the second terminal, where the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal.
[0049] The connection stability information can be represented by RSSI; accordingly, the first terminal determines the RSSI of the second terminal, determines whether the RSSI of the second terminal is greater than the preset RSSI, and when the RSSI of the second terminal is greater than the preset RSSI, determines that the connection stability information of the second terminal meets the stable connection condition; when the RSSI of the second terminal is not greater than the preset RSSI, determines that the connection stability information of the second terminal does not meet the stable connection condition. The preset RSSI can be set and changed as needed. In the embodiment of the present application, the preset RSSI is not specifically limited; for example, the preset RSSI can be -70db.
[0050] In some embodiments, when the connection stability information satisfies the stable connection condition, step 204 is performed; when the connection stability information does not satisfy the stable connection condition, the first terminal continues to perform the scanning operation.
[0051] In an embodiment of the present application, before establishing a wireless communication connection with the second terminal, the connection stability information of the second terminal is first determined. When the connection stability information meets the stable connection conditions, step 204 (establishing a wireless communication connection) is executed, thereby improving the stability of the wireless communication connection.
[0052] Step 204: When the connection stability information satisfies the stable connection condition, the first terminal establishes a wireless communication connection with the second terminal based on the terminal identifier of the second terminal.
[0053] The first terminal adds the terminal identification of the second terminal to the whitelist of the first terminal, and the whitelist of the first terminal is used to store the terminal identifications of the terminals that the first terminal has historically connected to; based on the terminal identification of the second terminal in the whitelist of the first terminal, a wireless communication connection is established with the second terminal. For example, please continue to refer to Figure 4 The first terminal determines whether the RSSI of the second terminal is greater than -70db. If the RSSI of the second terminal is greater than -70db, the terminal identifier of the second terminal is added to the whitelist of the first terminal. If the RSSI of the second terminal is not greater than -70db, the first terminal returns to execute the step 202 in which the first terminal performs the first scanning operation.
[0054] The first terminal stores a configuration file in advance, and the configuration file stores the terminal identification and pairing password of the historically connected terminal; accordingly, the step of the first terminal establishing a wireless communication connection with the second terminal based on the terminal identification of the second terminal in the white list of the first terminal may be: the first terminal obtains the pairing password of the second terminal from the configuration file based on the terminal identification of the second terminal, verifies the second terminal based on the pairing password of the second terminal, and establishes a wireless communication connection with the second terminal based on the terminal identification of the second terminal if the verification is successful. If the verification fails, continue to perform the first scanning operation.
[0055] For example, the wireless communication connection is a Bluetooth communication connection; accordingly, the step of establishing a wireless communication connection between the first terminal and the second terminal based on the terminal identifier of the second terminal may be: the first terminal establishes a Bluetooth communication connection with the second terminal based on the terminal identifier of the second terminal through the Bluetooth function of the first terminal and the Bluetooth function of the second terminal.
[0056] In one possible implementation, after a first terminal establishes a wireless communication connection with a second terminal, the connection state of the wireless communication function of the first terminal will change. At this time, it is necessary to notify a target application in the first terminal, where the target application is an application that is to use the wireless communication function. Accordingly, the process may be: the first terminal wakes up a second target application in the first terminal, where the second target application is an application that is in a running state and is to use the wireless communication function when the wireless communication connection is established; and sends a second notification message to the second target application, where the second notification message is used to notify the second target application that the connection state of the wireless communication function of the first terminal is connected.
[0057] For example, please refer to Figure 3 When the Bluetooth chip controller triggers a connection event (Connect complete) to the host, the host receives Connect complete and, based on Connect complete, sends a connection callback event (Complete callback) to the Bluetooth protocol stack. The Bluetooth protocol stack receives Complete callback and, based on Complete callback, sends a second notification message (OnConnectComplete) to the target application. The target application receives OnConnectComplete and, based on OnConnectComplete, determines that the Bluetooth connection state of the first terminal is connected. After receiving OnConnectComplete, the target application sends a notification response message (clientConnect) to the Bluetooth protocol stack. The Bluetooth protocol stack receives clientConnect and, based on clientConnect, sends a callback response message (gattClientConnectNative) to the host. The host receives gattClientConnectNative and, based on gattClientConnectNative, determines that the target application has received the second notification message.
[0058] In an embodiment of the present application, if the connection abnormality type between the first terminal and the second terminal is a target abnormality type, it means that the first terminal is in a weak signal scenario, and in a weak signal scenario, connection events and disconnection events may be frequently triggered; and the frequent triggering of connection events and disconnection events will increase the power consumption of the first terminal; therefore, a scanning operation is performed first, and a wireless communication connection is established with the second terminal only when the terminal identifier of the second terminal is scanned and the connection stability information of the second terminal meets the stable connection conditions, thereby not only ensuring the stability of the wireless communication connection, but also reducing the power consumption of the first terminal.
[0059] Please refer to Figure 5 , which shows a flow chart of a method for establishing a wireless communication connection provided by an exemplary embodiment of the present application. The method may include the following steps:
[0060] Step 501: When there is a disconnection event of the wireless communication connection with the second terminal, the first terminal determines the screen state.
[0061] The screen state can be on or off; for example, please continue to refer to Figure 4 , when the screen status is off, execute step 502; when the screen status is on, the first terminal adds the terminal identification of the second terminal to the white list of the first terminal, and then performs a scanning operation; when the terminal identification of the second terminal is scanned, a wireless communication connection is established with the second terminal based on the terminal identification of the second terminal in the white list of the first terminal.
[0062] In one possible implementation, when there is a disconnection event of the wireless communication connection with the second terminal, the first terminal first adds the terminal identifier of the second terminal to the whitelist of the first terminal, and then determines the screen status; when the screen status is off, execute step 502; when the screen status is on, perform a scanning operation.
[0063] In a possible implementation, when the screen switching state of the first terminal is switched from the screen-on state to the screen-off state, the wireless connection mode of the first terminal is set to the target mode, and the target mode is to first determine the connection stability information of the scanned terminal after scanning the terminal identifier, and only establish a wireless communication connection with the scanned terminal when the connection stability information meets the stable connection condition. When the screen state of the first terminal is switched from the screen-off state to the screen-on state, the wireless connection mode of the first terminal exits the target mode. Accordingly, this step can be replaced by: when there is a disconnection event of the wireless communication connection with the second terminal, determine the wireless connection mode; when the wireless connection mode is the target mode, execute the first terminal in step 502 to determine the disconnection reason of the disconnection event.
[0064] In an embodiment of the present application, when the screen state of the first terminal is switched from the off state to the bright state, the wireless communication mode of the first terminal exits the target mode. At this time, the process of establishing the wireless communication connection of the first terminal can be: when there is a disconnection event, the terminal identifier of the second terminal is added to the whitelist of the first terminal, thereby improving the connection efficiency of the first terminal connecting to the second terminal.
[0065] In another possible implementation, when the remaining power of the first terminal is small, the user will be more concerned about the power consumption of the first terminal; therefore, in this step, the remaining power can also be combined to comprehensively determine whether to use the target mode to establish a wireless communication connection; accordingly, the process can be: when the screen state is off, determine the remaining power of the first terminal; when the remaining power is less than the preset power, execute the first terminal determining the disconnection reason of the disconnection event in step 502. When the remaining power is not less than the preset power, the first terminal adds the terminal identifier of the second terminal to the whitelist of the first terminal.
[0066] In another possible implementation, when the first terminal is charging, the user may not pay attention to the power consumption of the first terminal; therefore, in this step, the charging state can also be combined to comprehensively determine whether to use the target mode to establish the wireless communication connection; accordingly, the process can be: when the screen state is the off state, determine the charging state of the first terminal, and when the charging state is charging, perform the first terminal determining the disconnection reason of the disconnection event in step 502. When the charging state is charging, the first terminal adds the terminal identifier of the second terminal to the whitelist of the first terminal.
[0067] In another possible implementation, at night, the probability of the user using the first terminal to transmit data with the second terminal is low; therefore, in this step, it is also possible to comprehensively determine whether to use the target mode to establish a wireless communication connection in combination with the current time period; accordingly, the process may be: when the screen state is the screen-off state, determine the time period to which the current time belongs; when the time period to which the current time belongs is the target time period, execute the first terminal determining the disconnection reason of the disconnection event in step 502. When the time period to which the current time belongs is not the target time period, the first terminal adds the terminal identifier of the second terminal to the whitelist of the first terminal, and the target time period is a time period in which the probability of using the wireless communication function is lower than the preset probability.
[0068] The target time period may be a time period based on big data statistics; for example, the target time period may be a night time period (0:00-4:00), etc.; the target time period may also be a time period determined by the first terminal based on historical usage records, that is, the target time period is a time period when the probability of users of the first terminal using the Bluetooth function is low.
[0069] Step 502: When the screen state is off, the first terminal determines the disconnection reason of the disconnection event and the corresponding disconnection times of the second terminal within a preset time period before the current time.
[0070] When a disconnect event occurs, the first terminal obtains the event code of the disconnect event, and determines the event cause of the disconnect event based on the event code of the disconnect event; different event codes correspond to different event causes; for example, if the event code of the disconnect event is 0x3e, then the disconnect cause of the disconnect event is determined to be an abnormal disconnection caused by unstable connection.
[0071] In one possible implementation, if the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication, it means that the disconnection abnormality type is the target abnormality type; accordingly, step 503 can be replaced by: when the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication, the first terminal determines that the connection abnormality type between the second terminal and the first terminal is the target abnormality type. In another possible implementation, if there are multiple abnormal disconnections due to unstable connection in the recent period of time, it means that the disconnection abnormality type is the target abnormality type; accordingly, after executing step 502, execute step 503.
[0072] In another possible implementation, the method provided in the embodiment of the present application can also be applied to the scenario of bright screen and weak signal; accordingly, steps 501-502 can be understood as: when there is a disconnection event of the wireless communication connection with the second terminal, the first terminal determines the screen status, and when the screen status is the bright screen status, the first terminal determines the disconnection reason of the disconnection event.
[0073] Step 503: When the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication and the number of disconnections corresponding to the second terminal is greater than the preset number, the first terminal determines that the connection abnormality type between the second terminal and the first terminal is the target abnormality type.
[0074] When the first terminal determines for the first time that the disconnection reason of the disconnection event of the wireless communication connection between the first terminal and the second terminal is that the received signal strength indication of the second terminal is lower than the preset strength indication, the first terminal sets a timer, the timing duration of the timer is the preset duration, and the number of disconnections corresponding to the second terminal is updated from 0 to 1. When the first terminal determines again that the disconnection reason of the disconnection event of the wireless communication connection between the first terminal and the second terminal is that the received signal strength indication of the second terminal is lower than the preset strength indication, the number of disconnections corresponding to the second terminal is updated from 1 to 2, and so on. Before the timer times out, if the number of disconnections corresponding to the second terminal reaches the preset number, the first terminal determines that the connection abnormality type between the second terminal and the first terminal is the target abnormality type; before the timer times out, if the number of disconnections corresponding to the second terminal does not reach the preset number, it is determined that the connection abnormality type between the second terminal and the first terminal is not the target abnormality type, and the timer is deleted. Both the preset duration and the preset number can be set and changed as needed. In the embodiment of the present application, the preset duration and the preset number are not specifically limited; for example, the preset duration can be 10 minutes, and the preset number can be 3 times.
[0075] For example, please refer to Figure 3 and Figure 4 , when there is a disconnection event of the wireless communication connection with the second terminal, determine whether the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication (whether the event code is 0x3e); when the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication (that is, the event code is 0x3e), count the number of disconnections of the second terminal, that is, add 1 to the number of disconnections corresponding to the second terminal. If the number of disconnections corresponding to the second terminal reaches 3 times within 10 minutes before the current time, the first terminal determines that the connection abnormality type between the second terminal and the first terminal is the target abnormality type. If the number of disconnections corresponding to the second terminal does not reach 3 times within 10 minutes before the current time, the first terminal adds the terminal identifier of the second terminal to the whitelist of the first terminal (that is, trigger an add instruction to the connection management module, and the connection pipeline module adds the terminal identifier of the second terminal to the whitelist of the first terminal based on the add instruction).
[0076] When the screen state is the bright screen state, the first terminal clears the number of disconnections corresponding to the second terminal.
[0077] Step 504: When the connection abnormality type is a target abnormality type, the first terminal performs a scanning operation, and the target abnormality type is a type of connection abnormality caused by unstable connection.
[0078] In some embodiments, this step is the same as step 202 and will not be repeated here.
[0079] Step 505: When the terminal identifier of the second terminal is scanned, the first terminal determines connection stability information of the second terminal, where the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal.
[0080] In some embodiments, this step is the same as step 203 and will not be repeated here.
[0081] For example, please refer to Figure 4 , if the number of disconnections exceeds 3 times within 10 minutes, the connection event is limited (limitMap.put), and the terminal identifier of the second terminal is not added to the whitelist of the first terminal, and then the first scanning operation is performed; when the terminal identifier of the second terminal is scanned, a connection callback event is triggered; then it is determined whether the RSSI of the second terminal is greater than -70db; when the RSSI of the second terminal is greater than -70db, the terminal identifier of the second terminal is added to the whitelist of the first terminal, and then the second scanning operation is performed by the Bluetooth chip controller.
[0082] Step 506: When the connection stability information satisfies the stable connection condition, the first terminal establishes a wireless communication connection with the second terminal based on the terminal identifier of the second terminal.
[0083] In some embodiments, this step is the same as step 204 and will not be described again herein.
[0084] In an embodiment of the present application, if the screen state of the first terminal is the screen-off state and the connection abnormality type between the first terminal and the second terminal is the target abnormality type, it means that the first terminal is in a weak signal standby scenario, and in the weak signal standby scenario, connection events and disconnection events may be frequently triggered; and the frequent triggering of connection events and disconnection events will increase the power consumption of the first terminal; therefore, a scanning operation is performed first, and a wireless communication connection is established with the second terminal only when the terminal identifier of the second terminal is scanned and the connection stability information of the second terminal meets the stable connection conditions, thereby not only ensuring the stability of the wireless communication connection, but also reducing the power consumption of the first terminal.
[0085] Please refer to Figure 6 , which shows a structural block diagram of a device for establishing a wireless communication connection provided by an exemplary embodiment of the present application. The device is applied to a first terminal, and the device includes:
[0086] A first determining module 601 is configured to determine a connection abnormality type between the second terminal and the first terminal when there is a disconnection event of the wireless communication connection with the second terminal;
[0087] A first execution module 602 is used to perform a scanning operation when the connection abnormality type is a target abnormality type, and the target abnormality type is a type of connection abnormality caused by unstable connection;
[0088] A second determining module 603 is used to determine connection stability information of the second terminal when the terminal identifier of the second terminal is scanned, where the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal;
[0089] The establishing module 604 is configured to establish a wireless communication connection with the second terminal based on the terminal identifier of the second terminal when the connection stability information satisfies a stable connection condition.
[0090] In a possible implementation, the first determination module 601 is used to determine the disconnection cause of the disconnection event; when the disconnection cause is that the received signal strength indication of the second terminal is lower than a preset strength indication, determine that the connection abnormality type between the second terminal and the first terminal is the target abnormality type.
[0091] In another possible implementation, the first determination module 601 is used to determine the disconnection cause of the disconnection event and the corresponding disconnection number of the second terminal within a preset time period before the current time; when the disconnection cause is that the received signal strength indication of the second terminal is lower than the preset strength indication and the corresponding disconnection number of the second terminal is greater than the preset number, determine that the connection abnormality type between the second terminal and the first terminal is the target abnormality type.
[0092] In another possible implementation, the first determination module 601 is used to determine the screen state of the first terminal when there is a disconnection event of the wireless communication connection with the second terminal; when the screen state is the off state, determine the type of connection abnormality between the second terminal and the first terminal.
[0093] In another possible implementation, the device further includes:
[0094] A first adding module, configured to add the terminal identifier of the second terminal to the whitelist of the first terminal when the screen-off state is changed to the screen-on state;
[0095] The establishing module 604 is further configured to perform a scanning operation, and when the terminal identification of the second terminal is scanned, establish a wireless communication connection with the second terminal based on the terminal identification of the second terminal in the whitelist of the first terminal.
[0096] In another possible implementation, the device further includes:
[0097] The clearing module is used to clear the number of disconnections corresponding to the second terminal when the screen state is the bright screen state.
[0098] In another possible implementation, the first determining module 601 is configured to determine the remaining power of the first terminal when the screen state is the off state; and determine the type of abnormal connection between the second terminal and the first terminal when the remaining power is less than a preset power;
[0099] The first determination module 601 is used to determine the charging state of the first terminal when the screen state is the off state; and determine the type of abnormal connection between the second terminal and the first terminal when the charging state is charging;
[0100] The first determination module 601 is used to determine the time period to which the current time belongs when the screen state is the off state, and to determine the type of connection abnormality between the second terminal and the first terminal when the time period is a target time period, and the target time period is a time period in which the probability of using the wireless communication function is lower than a preset probability.
[0101] In another possible implementation, the device further includes:
[0102] A second adding module is used to add the terminal identification of the second terminal to the white list of the first terminal when there is a disconnection event of the wireless communication connection with the second terminal, where the white list of the first terminal is used to store the terminal identifications of terminals that the first terminal has historically connected to;
[0103] The removing module is used to remove the terminal identifier of the second terminal from the whitelist of the first terminal when the connection abnormality type is the target abnormality type.
[0104] In another possible implementation, the device further includes:
[0105] A second execution module, configured to execute a scanning operation when the connection abnormality type is not the target abnormality type;
[0106] The establishing module 604 is further configured to establish a wireless communication connection with the second terminal based on the terminal identification of the second terminal in the whitelist of the first terminal when the terminal identification of the second terminal is scanned.
[0107] In another possible implementation, it is characterized in that the establishment module 604 is used to add the terminal identifier of the second terminal to the whitelist of the first terminal when the connection stability information meets the stable connection condition, and the whitelist of the first terminal is used to store the terminal identifiers of terminals that have been historically connected to the first terminal; based on the terminal identifier of the second terminal in the whitelist of the first terminal, establish a wireless communication connection with the second terminal.
[0108] In another possible implementation, the first terminal includes a host and a controller;
[0109] The establishing module 604 is used to send an adding instruction to the controller through the host, the adding instruction carries the terminal identification of the second terminal, and the adding instruction is used to instruct the controller to add the terminal identification of the second terminal to the whitelist of the first terminal stored in it.
[0110] In another possible implementation, the device further includes:
[0111] A first wake-up notification module is configured to wake up a first target application of the first terminal when there is a disconnection event of the wireless communication connection with the second terminal, the first target application being in a running state and ready to use a wireless communication function when the disconnection event is triggered; and send a first notification message to the target application, the first notification message being used to notify the first target application that the connection state of the wireless communication function of the first terminal is disconnected;
[0112] A second wake-up notification module is used to wake up a second target application of the first terminal after establishing a wireless communication connection with the second terminal based on the terminal identification of the second terminal, the second target application being an application whose running state is running and whose wireless communication function is ready to be used when the wireless communication connection is established; and send a second notification message to the second target application, the second notification message being used to notify the second target application that the connection state of the wireless communication function of the first terminal is connected.
[0113] In another possible implementation, the first execution module is further configured to continue to execute the scanning operation when the connection stability information does not meet a stable connection condition.
[0114] In another possible implementation, the wireless communication connection is a Bluetooth communication connection; the establishment module 604 is used to establish the Bluetooth communication connection with the second terminal based on the terminal identification of the second terminal through the Bluetooth function of the first terminal and the Bluetooth function of the second terminal.
[0115] In an embodiment of the present application, if the connection abnormality type between the first terminal and the second terminal is a target abnormality type, it means that the first terminal is in a weak signal scenario, and in a weak signal scenario, connection events and disconnection events may be frequently triggered; and the frequent triggering of connection events and disconnection events will increase the power consumption of the first terminal; therefore, a scanning operation is performed first, and a wireless communication connection is established with the second terminal only when the terminal identifier of the second terminal is scanned and the connection stability information of the second terminal meets the stable connection conditions, thereby not only ensuring the stability of the wireless communication connection, but also reducing the power consumption of the first terminal.
[0116] It should be noted that the wireless communication connection establishment device provided in the above embodiment only uses the division of the above functional modules as an example when establishing a wireless communication connection. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the wireless communication connection establishment device provided in the above embodiment and the wireless communication connection establishment method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0117] See also Figure 7 , Figure 7 The terminal 700 may also include one or more of the following components: a processor 710 , a memory 720 , and a display screen 730 .
[0118] The processor 710 uses various interfaces and lines to connect the various parts of the entire terminal 700, and executes various functions and processes data of the terminal 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 720, and calling data stored in the memory 720. Optionally, the processor 710 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 710 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural wireless communication connection builder (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen 730; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 710, but may be implemented separately through a computer program product.
[0119] The memory 720 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 720 includes a non-transitory computer-readable storage medium. The memory 720 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book), etc., created according to the use of the terminal 700.
[0120] The display screen 730 is a display component for displaying a user interface. Optionally, the display screen 730 is a display screen with a touch function, through which the user can use any suitable object such as a finger, a touch pen, etc. to perform touch operations on the display screen 730.
[0121] The display screen 730 is usually arranged on the front panel of the terminal 700. The display screen 730 can be designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. The display screen 730 can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.
[0122] In addition, those skilled in the art can understand that the structure of the terminal 700 shown in the above drawings does not constitute a limitation on the terminal 700, and the terminal 700 may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the terminal 700 also includes a WiFi module, an audio acquisition device, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a Bluetooth module, a power supply and other components, which will not be described in detail here.
[0123] The embodiment of the present application provides a chip, the chip includes a programmable logic circuit and / or a program instruction, when the chip runs on a terminal device, the chip is used to implement the method for establishing a wireless communication connection as described in the above embodiment. For example, the chip is applied to a Bluetooth chip in a terminal.
[0124] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for establishing a wireless communication connection as described in the above embodiment.
[0125] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for establishing a wireless communication connection as described in the above embodiment.
[0126] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0127] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for establishing a wireless communication connection, characterized in that: The method is used for a first terminal, and the method includes: When there is a disconnection event of the wireless communication connection with the second terminal, determining a connection abnormality type between the second terminal and the first terminal; In the case where the connection abnormality type is a target abnormality type, performing a scanning operation, the target abnormality type being a type of connection abnormality caused by unstable connection; In a case where the terminal identifier of the second terminal is scanned, determining connection stability information of the second terminal, where the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal; When the connection stability information satisfies a stable connection condition, a wireless communication connection is established with the second terminal based on the terminal identifier of the second terminal.
2. The method according to claim 1, characterized in that: The determining the type of abnormal connection between the second terminal and the first terminal includes: determining a disconnection reason for the disconnection event; In a case where the disconnection reason is that the received signal strength indication of the second terminal is lower than a preset strength indication, determining that the connection abnormality type between the second terminal and the first terminal is the target abnormality type.
3. The method according to claim 1, characterized in that: The determining the type of abnormal connection between the second terminal and the first terminal includes: Determine a disconnection reason of the disconnection event and a corresponding disconnection count of the second terminal within a preset time period before a current time; When the disconnection reason is that the received signal strength indication of the second terminal is lower than the preset strength indication and the number of disconnections corresponding to the second terminal is greater than the preset number, it is determined that the connection abnormality type between the second terminal and the first terminal is the target abnormality type.
4. The method according to claim 3, characterized in that The step of determining the abnormal connection type between the second terminal and the first terminal when there is a disconnection event of the wireless communication connection with the second terminal includes: When there is a disconnection event of the wireless communication connection with the second terminal, determining a screen state of the first terminal; When the screen state is the screen-off state, a connection abnormality type between the second terminal and the first terminal is determined.
5. The method according to claim 4, characterized in that The method further comprises: When the screen-off state is changed to the screen-on state, adding the terminal identifier of the second terminal to the whitelist of the first terminal; A scanning operation is performed, and when the terminal identification of the second terminal is scanned, a wireless communication connection is established with the second terminal based on the terminal identification of the second terminal in the white list of the first terminal.
6. The method according to claim 4, characterized in that Said also includes: When the screen state is the bright screen state, the number of disconnections corresponding to the second terminal is cleared.
7. The method according to claim 4, characterized in that The determining, when the screen state is the screen-off state, the type of abnormal connection between the second terminal and the first terminal includes at least one of the following implementations: When the screen state is off, determining the remaining power of the first terminal; when the remaining power is less than a preset power, determining the type of abnormal connection between the second terminal and the first terminal; When the screen state is the off state, determining the charging state of the first terminal; when the charging state is charging, determining the type of abnormal connection between the second terminal and the first terminal; When the screen state is off, determine the time period to which the current time belongs, and when the time period is a target time period, determine the type of connection abnormality between the second terminal and the first terminal, and the target time period is a time period in which the probability of using the wireless communication function is lower than a preset probability.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When there is a disconnection event of the wireless communication connection with the second terminal, adding the terminal identifier of the second terminal to a whitelist of the first terminal, where the whitelist of the first terminal is used to store terminal identifiers of terminals that have been historically connected by the first terminal; When the connection exception type is the target exception type, the terminal identifier of the second terminal is removed from the whitelist of the first terminal.
9. The method according to claim 8, characterized in that The method further comprises: In a case where the connection exception type is not the target exception type, performing a scanning operation; In the case where the terminal identification of the second terminal is scanned, a wireless communication connection is established with the second terminal based on the terminal identification of the second terminal in the white list of the first terminal.
10. The method according to any one of claims 1 to 7, characterized in that: The establishing a wireless communication connection with the second terminal based on the terminal identifier of the second terminal when the connection stability information satisfies the stable connection condition includes: If the connection stability information satisfies a stable connection condition, adding the terminal identifier of the second terminal to a whitelist of the first terminal, where the whitelist of the first terminal is used to store terminal identifiers of terminals that have been historically connected to the first terminal; A wireless communication connection is established with the second terminal based on the terminal identification of the second terminal in the whitelist of the first terminal.
11. The method according to claim 10, characterized in that The first terminal includes a host and a controller; The adding the terminal identification of the second terminal to the whitelist of the first terminal includes: An adding instruction is sent to the controller through the host, the adding instruction carries the terminal identification of the second terminal, and the adding instruction is used to instruct the controller to add the terminal identification of the second terminal to the whitelist of the first terminal stored in the controller.
12. The method according to any one of claims 1 to 7, characterized in that: The method also includes at least one of the following implementations: When there is a disconnection event of the wireless communication connection with the second terminal, waking up a first target application of the first terminal, the first target application being in a running state and ready to use a wireless communication function when the disconnection event is triggered; sending a first notification message to the target application, the first notification message being used to notify the first target application that the connection state of the wireless communication function of the first terminal is disconnected; After establishing a wireless communication connection with the second terminal, based on the terminal identifier of the second terminal, waking up a second target application of the first terminal, where the second target application is an application in a running state and ready to use a wireless communication function when the wireless communication connection is established; A second notification message is sent to the second target application, where the second notification message is used to notify the second target application that the connection status of the wireless communication function of the first terminal is connected.
13. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the connection stability information does not satisfy the stable connection condition, the scanning operation continues to be performed.
14. The method according to any one of claims 1 to 7, characterized in that: The wireless communication connection is a Bluetooth communication connection; The establishing a wireless communication connection with the second terminal based on the terminal identification of the second terminal includes: Based on the terminal identification of the second terminal, the Bluetooth communication connection is established with the second terminal through the Bluetooth function of the first terminal and the Bluetooth function of the second terminal.
15. A device for establishing a wireless communication connection, characterized in that: The device is used for a first terminal, and the device includes: A first determining module, configured to determine a connection abnormality type between the second terminal and the first terminal when there is a disconnection event of the wireless communication connection with the second terminal; A first execution module, configured to execute a scanning operation when the connection abnormality type is a target abnormality type, wherein the target abnormality type is a type of connection abnormality caused by unstable connection; A second determining module, configured to determine, when a terminal identifier of the second terminal is scanned, connection stability information of the second terminal, wherein the connection stability information is used to characterize the stability of establishing a wireless communication connection between the second terminal and the first terminal; An establishing module is used to establish a wireless communication connection with the second terminal based on the terminal identifier of the second terminal when the connection stability information meets the stable connection condition.
16. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the method for establishing a wireless communication connection according to any one of claims 1 to 14.
17. A chip, characterized in that: The chip includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal device, the chip is used to implement the method for establishing a wireless communication connection as described in any one of claims 1 to 14.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for establishing a wireless communication connection according to any one of claims 1 to 14.
19. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for establishing a wireless communication connection as described in any one of claims 1 to 14.