Device unlocking method and apparatus, electronic device, and computer-readable storage medium

CN116521275BActive Publication Date: 2026-09-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210067340.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2026-09-15
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

[0003]在对现有技术的研究和实践过程中,本发明的发明人发现对于设备解锁方法来说,往往需要通过用户触发解锁应用,使得解锁应用处于运行状态才可以解锁待解锁设备,而且解锁应用后台在运行一段时间后会被自动清理,当在后台运行的这段时间内未检测到待解锁设备时,就会导致设备解锁失败,从而无法保证设备解锁的可靠性,因此,导致设备解锁的解锁效率降低

Benefits of technology

[0046]In this embodiment of the invention, after acquiring at least one currently detected Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is invoked. Then, a Bluetooth connection is established between the unlocking application and the target Bluetooth component, and the device to be unlocked is unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the device to be unlocked is detected, and invokes the unlocking application corresponding to the device to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking application is invoked only after the device to be unlocked is detected, thereby ensuring that the unlocking application is running when the device to be unlocked is unlocked, which greatly increases the reliability of device unlocking. Therefore, the unlocking efficiency of device unlocking can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521275B_ABST
    Figure CN116521275B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a device unlocking method and device, electronic equipment and computer readable storage medium; after obtaining at least one detected Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated, then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is called, then, the Bluetooth connection between the unlocking application and the target Bluetooth component is constructed, and based on the Bluetooth connection, the device to be unlocked is unlocked; the scheme can improve the unlocking efficiency of device unlocking, and the embodiments of the present application can be applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation, auxiliary driving and vehicle-mounted devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and more specifically to a device unlocking method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] In recent years, with the rapid development of internet technology, devices have become increasingly intelligent. For device security, unlocking these devices is often necessary when using them. To improve unlocking efficiency, existing methods typically involve triggering the corresponding unlocking application on the device to be unlocked.

[0003] In the process of researching and practicing existing technologies, the inventors of this invention discovered that for device unlocking methods, it is often necessary for the user to trigger the unlocking application so that the unlocking application is running in order to unlock the device to be unlocked. Moreover, the unlocking application is automatically cleaned up after running in the background for a period of time. If the device to be unlocked is not detected during the period of background operation, the device unlocking will fail, thus failing to guarantee the reliability of device unlocking and resulting in a reduction in the unlocking efficiency. Summary of the Invention

[0004] This invention provides a device unlocking method, apparatus, electronic device, and computer-readable storage medium, which can improve the unlocking efficiency of devices.

[0005] A device unlocking method, comprising:

[0006] Obtain at least one currently detected Bluetooth component to be connected;

[0007] When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated;

[0008] Based on the device discovery event, the unlocking application corresponding to the device to be unlocked is invoked;

[0009] Establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection.

[0010] Optionally, embodiments of the present invention may also provide an application launch method, including:

[0011] When a device discovery event is received, the current running status of the target application corresponding to the target device is obtained;

[0012] When the current running state is not running, the target application is started to run in the background based on the device discovery event;

[0013] When the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event;

[0014] The target application, running in the background, performs the target operation on the target device.

[0015] Accordingly, embodiments of the present invention provide a device unlocking device, comprising:

[0016] The first acquisition unit is used to acquire at least one Bluetooth component currently detected to be connected;

[0017] A generation unit is configured to generate a device discovery event when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked.

[0018] The invocation unit is used to invoke the unlocking application corresponding to the device to be unlocked based on the device discovery event.

[0019] The unlocking unit is used to establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and to unlock the device to be unlocked based on the Bluetooth connection.

[0020] Optionally, embodiments of the present invention may also provide an application launch device, comprising:

[0021] The second acquisition unit is used to acquire the current running status of the target application corresponding to the target device when a device discovery event is received;

[0022] The startup unit is used to start the target application to run in the background based on the device discovery event when the current running state is an inactive state.

[0023] An adjustment unit is used to adjust the current running state to a background running state based on the device discovery event when the current running state is a suspended state.

[0024] An operation unit is used to perform target operations on the target device based on the target application running in the background.

[0025] Optionally, in some embodiments, the calling unit may be specifically used to obtain the current startup status of the unlocking application corresponding to the device to be unlocked; when the current startup status is not started, the unlocking application is started in the background based on the device discovery event; when the current startup status is started, the running status of the unlocking application is adjusted to run in the background according to the device discovery event.

[0026] Optionally, in some embodiments, the calling unit may be specifically used to obtain the logic resource package and developer code required for the unlocking application to start in the background based on the device discovery event; initialize the logic layer of the unlocking application, and load the logic resource package in the initialized logic layer to start the unlocking application; inject the developer code into the unlocking application to obtain the unlocking application running in the background.

[0027] Optionally, in some embodiments, the calling unit may be specifically used to obtain the current running status of the unlocking application;

[0028] When the current running state is a foreground running state, the foreground running state is switched to a background running state based on the device discovery event; when the current running state is a suspended state, the suspended state is switched to a background running state based on the device discovery event; when the current running state is a background running state, the background running time of the unlocking application is reset based on the device discovery event to maintain the background running state of the unlocking application.

[0029] Optionally, in some embodiments, the unlocking unit may be specifically used to send the device discovery event to the unlocking server corresponding to the unlocking application, and receive Bluetooth interface information returned by the unlocking server; based on the Bluetooth interface information, call the Bluetooth connection interface through the unlocking application; and establish a Bluetooth connection between the unlocking application and the target Bluetooth component through the Bluetooth connection interface.

[0030] Optionally, in some embodiments, the unlocking unit may specifically be used to display a Bluetooth authorization page corresponding to the Bluetooth connection interface, the Bluetooth authorization page including at least two Bluetooth authorization type selection controls; in response to a selection operation on the Bluetooth authorization type selection controls, determining the authorization information of the Bluetooth connection interface; the step of calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information includes: calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information and the authorization information.

[0031] Optionally, in some embodiments, the unlocking unit may be specifically used to call the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information when the authorization information is allowed or always allowed; when the authorization information is allowed only during use, the running state of the unlocking application is switched to foreground running, and the Bluetooth connection interface is called through the foreground running unlocking application based on the Bluetooth interface information.

[0032] Optionally, in some embodiments, the unlocking unit may specifically be used to identify the setting information of the Bluetooth hold interface in the Bluetooth interface information, the Bluetooth hold interface being used to maintain the background running state of the unlocking application; based on the setting information, the unlocking application calls the Bluetooth hold interface, and adjusts the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application; based on the Bluetooth connection, the unlocking application running in the background sends unlocking information to the device to be unlocked to unlock the device to be unlocked.

[0033] Optionally, in some embodiments, the unlocking unit may be specifically used to query the flag information of the Bluetooth keep-alive interface in the settings information; when the flag information exists, obtain the connection status of the Bluetooth connection; when the connection status is connected, call the Bluetooth keep-alive interface through the unlocking application.

[0034] Optionally, in some embodiments, the unlocking unit may be specifically used to call the Bluetooth settings interface through the unlocking application, the Bluetooth settings interface being used to set the flag bit of the Bluetooth hold interface; based on the Bluetooth settings interface, querying the current application corresponding to the flag bit of the Bluetooth hold interface; when the current application does not exist, setting the flag bit of the Bluetooth hold interface to the unlocking application, obtaining the flag bit information, and using the flag bit information as the setting information of the Bluetooth hold interface.

[0035] Optionally, in some embodiments, the unlocking unit may be specifically used to enable the persistent background running permission of the unlocking application according to the Bluetooth keep-alive interface; based on the persistent background running permission, the background running cycle of the unlocking application is adjusted to long-term running, so as to maintain the background running state of the unlocking application.

[0036] Optionally, in some embodiments, the unlocking unit may be specifically used to reclaim the view information of the unlocking application when it is detected that the running time of the unlocking application exceeds a preset time threshold; and to reset the flag bit of the Bluetooth hold interface and stop the continuous background running permission of the unlocking application when it is detected that the Bluetooth connection is disconnected or when a stop unlocking request is received.

[0037] Optionally, in some embodiments, the generating unit may be specifically used to obtain a set of Bluetooth registration identifiers and the device discovery permissions corresponding to the Bluetooth registration identifiers in the set of Bluetooth registration identifiers, and identify the corresponding Bluetooth identifier in the Bluetooth component to be connected; when the Bluetooth identifier matches the Bluetooth registration identifier in the set of Bluetooth registration identifiers, determine that the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked; construct a basic Bluetooth connection with the target Bluetooth component, and generate a device discovery event based on the basic Bluetooth connection and the device discovery permissions.

[0038] Optionally, in some embodiments, the device unlocking device may further include a registration unit, which is specifically used to establish a registered Bluetooth connection with the target Bluetooth component of the device to be unlocked, and through the registered Bluetooth connection, receive device information of the device to be unlocked and the target Bluetooth identifier of the target Bluetooth component; generate verification information of the device to be unlocked based on the device information and the target Bluetooth identifier, and send the verification information to the unlocking application corresponding to the device to be unlocked; register the device to be unlocked in the unlocking application to obtain a target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier.

[0039] Optionally, in some embodiments, the registration unit may be specifically used to call the Bluetooth registration interface and the device discovery permission start interface through the unlocking application; register the device to be unlocked in the unlocking application according to the Bluetooth registration interface to obtain the device registration information of the device to be unlocked; add the target Bluetooth identifier as a target Bluetooth registration identifier to the Bluetooth registration identifier set based on the device registration information; and start the device discovery permission corresponding to the target Bluetooth registration identifier according to the device discovery permission start interface.

[0040] Optionally, in some embodiments, the registration unit may be specifically used to obtain the current Bluetooth identifier of the current Bluetooth connection when it is detected that the unlocking application is connected to the current Bluetooth component; when the current Bluetooth identifier does not exist in the Bluetooth registration identifier set, obtain the component information of the target Bluetooth component; filter out the current Bluetooth registration identifier corresponding to the component information from the Bluetooth registration identifier set, and replace the current Bluetooth registration identifier with the current Bluetooth identifier.

[0041] Optionally, in some embodiments, the startup unit may be specifically used to obtain the device registration information and developer code of the target device in the target application based on the device discovery event; extract the identification information of the target logical resource package required for background startup from the device registration information, and obtain the target logical resource package based on the identification information; load the target logical resource package to start the target application in the background, and inject the developer code into the target application started in the background to obtain the target application running in the background.

[0042] Optionally, in some embodiments, the adjustment unit may be specifically used to generate background running state state switching information based on the device discovery event; switch the suspended state of the target application to the background running state according to the state switching information; and set a runtime limit for the target application in the background running state to obtain the target application running in the background.

[0043] Optionally, in some embodiments, the operation unit may be specifically used to establish a Bluetooth connection between the background-running target application and the target Bluetooth component of the target device; to call the Bluetooth hold interface through the target application and maintain the background running state of the target application based on the Bluetooth hold interface; and to perform target operations on the target device through the background-running target application based on the Bluetooth connection.

[0044] Furthermore, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the device unlocking method provided in embodiments of the present invention.

[0045] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the device unlocking methods provided in embodiments of the present invention.

[0046] In this embodiment of the invention, after acquiring at least one currently detected Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is invoked. Then, a Bluetooth connection is established between the unlocking application and the target Bluetooth component, and the device to be unlocked is unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the device to be unlocked is detected, and invokes the unlocking application corresponding to the device to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking application is invoked only after the device to be unlocked is detected, thereby ensuring that the unlocking application is running when the device to be unlocked is unlocked, which greatly increases the reliability of device unlocking. Therefore, the unlocking efficiency of device unlocking can be improved. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a schematic diagram of a scenario for the device unlocking method provided in an embodiment of the present invention;

[0049] Figure 2 This is a flowchart illustrating the device unlocking method provided in an embodiment of the present invention;

[0050] Figure 3 This is a schematic diagram illustrating the lifecycle changes of the unlocking application provided in this embodiment of the invention;

[0051] Figure 4 This is a schematic diagram illustrating the state changes during the startup and operation of a mini-program, as provided in an embodiment of the present invention.

[0052] Figure 5 This is another schematic diagram of the device unlocking method provided in the embodiment of the present invention;

[0053] Figure 6 This is a flowchart illustrating the application startup method provided in an embodiment of the present invention;

[0054] Figure 7 This is another flowchart illustrating the application startup method provided in this embodiment of the invention;

[0055] Figure 8 This is a schematic diagram of the device unlocking device provided in an embodiment of the present invention;

[0056] Figure 9This is another structural schematic diagram of the device unlocking device provided in an embodiment of the present invention;

[0057] Figure 10 This is a schematic diagram of the application launch device provided in an embodiment of the present invention;

[0058] Figure 11 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0060] This invention provides a device unlocking method, apparatus, electronic device, and computer-readable storage medium. The device unlocking apparatus can be integrated into an electronic device, which may be a server, a terminal, or other similar device.

[0061] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. The terminal includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. This invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0062] For example, see Figure 1 Taking the device unlocking device integrated into an electronic device as an example, after the electronic device obtains at least one Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is called. Then, a Bluetooth connection is established between the unlocking application and the target Bluetooth component, and the device to be unlocked is unlocked based on the Bluetooth connection, thereby improving the unlocking efficiency of the device.

[0063] The unlocking application can be a sub-application or sub-program within the application platform used to unlock the device to be unlocked; it can also be called a mini-program. A mini-program is an application that can be used without downloading or installing it. To provide users with more diversified business services, developers can develop corresponding mini-programs for terminal applications (such as instant messaging applications, shopping applications, email applications, etc.). This mini-program can be embedded as a sub-application within the terminal application, and by running the sub-application (i.e., the corresponding mini-program) within the application, it can provide users with corresponding business services.

[0064] It is understood that, in the specific embodiments of this application, the relevant data involving user information such as the target Bluetooth identifier of the target Bluetooth component of the device to be unlocked, the registered Bluetooth information of the device to be unlocked, and the information of the device to be unlocked in the unlocking application, when the following embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0065] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0066] This embodiment will be described from the perspective of a device unlocking device, which can be integrated into an electronic device, such as a server or a terminal. The terminal can include tablet computers, laptops, personal computers (PCs), wearable devices, virtual reality devices, or other smart devices that can unlock devices.

[0067] A device unlocking method, comprising:

[0068] Get at least one Bluetooth component that is currently detected to be connected. When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, generate a device discovery event. Based on the device discovery event, call the unlocking application corresponding to the device to be unlocked, build a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection.

[0069] like Figure 2 As shown, the specific process for unlocking this device is as follows:

[0070] 101. Obtain at least one currently detected Bluetooth component to be connected.

[0071] The Bluetooth component to be connected can be understood as a Bluetooth component waiting to be connected. This Bluetooth component is usually integrated into the device. A Bluetooth connection is established with this Bluetooth component, and then data communication is carried out with the device integrated with the Bluetooth component through this Bluetooth connection.

[0072] There are several ways to obtain at least one currently detected Bluetooth component to be connected, as follows:

[0073] For example, the local Bluetooth component of the device unlocking device is activated, and the permission of the local Bluetooth component to discover Bluetooth devices is enabled. Based on this permission, Bluetooth signals within a preset range are detected. When at least one Bluetooth signal is detected, the Bluetooth component to be connected corresponding to the Bluetooth signal is obtained. Alternatively, the local Bluetooth component of the device unlocking device is activated, and a Bluetooth connection request is sent to the outside through the local Bluetooth component. When the return information corresponding to the Bluetooth connection request is received, at least one Bluetooth component to be connected is identified in the return information.

[0074] 102. When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated.

[0075] The device discovery event (wx.onMonitoredBluetoothDeviceFound event) can be understood as the event that detects the target Bluetooth component of the device to be unlocked. This device discovery event is used to launch or wake up the background running of the unlocking application corresponding to the device to be unlocked.

[0076] When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, there are several ways to generate a device discovery event, as follows:

[0077] For example, it can obtain the set of Bluetooth registration identifiers and the device discovery permissions corresponding to the Bluetooth registration identifiers in the set of Bluetooth registration identifiers, and identify the corresponding Bluetooth identifier in the Bluetooth component to be connected. When the Bluetooth identifier matches the Bluetooth registration identifier in the set of Bluetooth registration identifiers, it determines that the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, establishes a basic Bluetooth connection with the target Bluetooth component, and generates a device discovery event based on the basic Bluetooth connection and device discovery permissions.

[0078] The basic Bluetooth connection can be understood as the Bluetooth connection between a device unlocking device built through a local Bluetooth component, or an application platform integrated within the device unlocking device, and the target Bluetooth component. The established basic Bluetooth connection is primarily used to generate device events and can also be used to detect whether the target Bluetooth component is nearby. Because disconnection may occur, after establishing the basic Bluetooth connection, it will not continue to detect the Bluetooth component to be connected, nor will it continue to generate device discovery events for other Bluetooth components. When the basic Bluetooth connection is lost, it will re-attempt to detect the Bluetooth component to be connected.

[0079] Optionally, before obtaining the Bluetooth registration identifier set and the device discovery permission corresponding to the Bluetooth registration identifier in the Bluetooth registration identifier set, the target Bluetooth component of the device to be unlocked and the target Bluetooth component of the device to be unlocked can be registered. This allows the Bluetooth identifier of the target Bluetooth component to be added to the Bluetooth registration identifier set as the target Bluetooth registration identifier, and the device discovery permission of the target Bluetooth registration identifier to be set. For example, a registered Bluetooth connection can be established with the target Bluetooth component of the device to be unlocked. By registering the Bluetooth connection, the device information to be unlocked and the target Bluetooth identifier of the target Bluetooth component can be received. Based on the device information and the target Bluetooth identifier, verification information of the device to be unlocked can be generated and sent to the unlocking application corresponding to the device to be unlocked. In the unlocking application, the device to be unlocked is registered to obtain the target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier.

[0080] Registering a Bluetooth connection can be understood as registering the Bluetooth connection of the target Bluetooth component of the device to be unlocked within the unlocking application. For the target Bluetooth component of the device to be unlocked to register, it must first establish a Bluetooth connection with the local Bluetooth component of the device unlocking device. Therefore, this established Bluetooth connection is considered the registered Bluetooth connection. After establishing the registered Bluetooth connection, the device information of the device to be unlocked and the target Bluetooth identifier of the target Bluetooth component can be received. Upon receiving the device information and the target Bluetooth identifier, verification information for the device to be unlocked can be generated. This verification information can be a device information credential issued by the application platform. This credential may include the device's unique serial number, a device ticket (valid for a certain time range, such as 5 minutes or other time ranges), and a device model ID. The unique serial number and device model ID can be obtained from the device information. The verification information is then sent to the unlocking application corresponding to the device to be unlocked.

[0081] There are several ways to register the device to be unlocked in the unlocking application. For example, the unlocking application can call the Bluetooth registration interface and the device discovery permission start interface. According to the Bluetooth registration interface, the device to be unlocked is registered in the unlocking application to obtain the device registration information of the device to be unlocked. Based on the device registration information, the target Bluetooth identifier is added to the Bluetooth registration identifier set as the target Bluetooth component. According to the device discovery permission start interface, the device discovery permission corresponding to the target Bluetooth registration identifier is started.

[0082] The Bluetooth registration interface can be wx.openBluetoothAdapterBackground, and the device discovery permission startup interface can be wx.startMonitoringBluetoothDevice. When calling the Bluetooth registration and device discovery permission startup interfaces, an authorization page can also be displayed. The Bluetooth registration and device discovery interfaces can only be called after the user's authorization information has been received.

[0083] Specifically, based on the Bluetooth registration interface, the device to be unlocked is registered in the unlocking application to obtain device registration information. This device registration information may include the target Bluetooth identifier of the target Bluetooth component of the device to be unlocked, the device's unique serial number, the device model ID, the version of the unlocking application's mini-program that is launched in the background, and the name of the resource sub-package that needs to be loaded when the unlocking application is running in the background. The corresponding sub-package will be loaded when the unlocking application is running in the background.

[0084] Optionally, after registering the device to be unlocked in the unlocking application and obtaining the target Bluetooth registration identifier and the corresponding device discovery permission, the registered devices to be unlocked can also be managed. There are several management methods. For example, when the unlocking application detects that the current Bluetooth component is in a connected state, it obtains the current Bluetooth identifier of the current Bluetooth connection. If the current Bluetooth identifier does not exist in the Bluetooth registration identifier set, it obtains the component information of the target Bluetooth component, filters out the current Bluetooth registration identifier corresponding to the component information from the Bluetooth registration identifier set, and replaces the current Bluetooth registration identifier with the current Bluetooth identifier. The management of registered devices to be unlocked mainly addresses the possibility that the Bluetooth identifier of the Bluetooth component of the device to be unlocked may change. Therefore, after the user uses the unlocking application and connects to the device to be unlocked, the Bluetooth identifier (bluetoothDeviceId) can be verified through the previously registered device information to see if it has changed. If it has changed, the registered device information needs to be re-bound or updated.

[0085] Optionally, during the management of devices to be unlocked, the registration of the devices to be unlocked can also be removed. There are several ways to remove the registration, such as clearing the registration list when the user cancels scope authorization, thereby removing the devices to be unlocked; or clearing the registration list when the user actively deletes the mini program, thereby unlocking the devices to be unlocked; or, the devices can be actively removed using JSAPI based on the unique device identifier of the devices to be unlocked.

[0086] There are several ways to clear the registration list and unlock the device when a user cancels scope authorization. For example, the unlock application settings page can be displayed, which includes a device discovery permission disable control. In response to the disabling of the device discovery permission disable control, the device registration information of the device to be unlocked in the unlock application can be cleared.

[0087] Wherein, "responding to" is used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0088] 103. Based on the device discovery event, invoke the unlocking application corresponding to the device to be unlocked.

[0089] The unlocking application can be the application that unlocks the device to be unlocked. This unlocking application can be a mini-program under the application platform. Calling the unlocking application can be understood as launching the unlocking application to run in the background or waking it up to run in the background.

[0090] There are several ways to invoke the unlocking application corresponding to the device to be unlocked based on the device discovery event, as follows:

[0091] For example, obtain the current startup status of the unlocking application corresponding to the device to be unlocked. When the current startup status is not started, start the unlocking application in the background based on the device discovery event. When the current startup status is started, adjust the running status of the unlocking application to run in the background based on the device discovery event.

[0092] The current startup status can indicate whether the unlocking application corresponding to the device to be unlocked is running. When the current startup status is not started, it means that the unlocking application is not running. When the current startup status is started, it means that the unlocking application is running. In the started state, it can also include various running states, such as foreground running state, background running state, and suspended state. The foreground running state is used to indicate that the unlocking application is running in the foreground of the device unlocking device. The background running state is used to indicate that the unlocking application is running in the background of the device unlocking device. The suspended state is used to indicate that the unlocking application is not running in the device unlocking device. When the suspended state exceeds a certain time, the unlocking application can be destroyed.

[0093] When the current startup state is not started, the unlocking application is launched in the background based on the device discovery event. Background launch can be understood as directly changing the unlocking application from a never-running state to a background running state without going through a foreground running state; this can also be called unlocking application background self-start (cold start). There are several ways to launch the unlocking application in the background. For example, based on the device discovery event, the logic resource package and developer code required for the unlocking application to start in the background can be obtained, the logic layer of the unlocking application can be initialized, and the logic resource package can be loaded into the initialized logic layer to start the unlocking application. Then, the developer code can be injected into the unlocking application to obtain the unlocking application running in the background.

[0094] Taking the unlocking application as an example, the unlocking application's background operation mainly relies on the architecture of separating the logic layer (appservice) and the view layer (webview) in the mini program. When the page stack of the mini program is empty, the webview can be either not created or completely destroyed. Therefore, the logic process corresponding to the logic layer of the mini program can run independently of the webview, and the lifecycles of the two can also be made independent of each other.

[0095] There are several ways to obtain the logic resource package and developer code that the unlocking application needs to start in the background based on the device discovery event. For example, the device registration information of the device to be unlocked can be obtained based on the device discovery event, and the name of the sub-package to be started in the background can be extracted from the device registration information. Based on the sub-package name, the logic resource package and developer code can be obtained, so that ordinary sub-packages and independent sub-packages can be loaded, reducing the resource consumption of background operation.

[0096] Initializing the logic layer of the unlocking application means triggering the lifecycle of the mini-program's logic layer. It's important to note that this does not involve initializing the UI-related content of the unlocking application, including the WebView, or sending the onAppRoute event. This will trigger the app's lifecycle but not the lifecycle of any page.

[0097] After the unlocking application is successfully launched in the background, it runs for a period of time, such as 5 seconds or other reused background runtime limits. If persistent background operation permissions are not enabled in the unlocking application (e.g., background Bluetooth activation or background geolocation requiring a floating window), and the unlocking application has not yet experienced a foreground running state, it is directly destroyed without switching to a suspended state or displaying a floating window. The unlocking application launched in the background does not load any WebView pages, effectively saving memory usage and resulting in better performance.

[0098] Specifically, when the current startup state is "started", the running state of the unlocking application is adjusted to background running based on the device discovery event. There are several ways to adjust it, such as obtaining the current running state of the unlocking application, and when the current running state is in the foreground running state, switching the foreground running state to the background running state based on the device discovery event; when the current running state is in the suspended state, switching the suspended state to the background running state based on the device discovery event; when the current running state is in the background running state, resetting the background running time of the unlocking application based on the device discovery event to maintain the background running state of the unlocking application.

[0099] When the current running state is in the foreground running state, there are several ways to switch the foreground running state to the background running state based on the device discovery event. For example, the device registration information of the device to be unlocked can be obtained based on the device discovery event, the name of the background startup sub-package can be extracted from the device registration information, and the corresponding sub-package can be loaded based on the sub-package name, thereby switching the unlocking application from the foreground running state to the background running state.

[0100] When the current running state is suspended, there are several ways to switch the suspended state to the background running state based on the device discovery event. For example, the device registration information of the device to be unlocked can be obtained based on the device discovery event, the name of the background running sub-package can be extracted from the device registration information, and the corresponding sub-package can be loaded based on the sub-package name, thereby switching the unlocking application from the foreground running state to the background running state and reusing the duration limit of the background running state.

[0101] When the current running state is background running state, there are several ways to reset the background running time of the unlocking application based on the device discovery event. For example, the timer for the background running time of the unlocking application can be reset based on the device discovery event, so that the unlocking application can continue to maintain the background running state.

[0102] Specifically, adjusting the unlocking application to run in the background requires different adjustments based on the application's lifecycle. Taking a mini-program as an example, the lifecycle of the unlocking application changes as follows: Figure 3 As shown, under normal circumstances, a mini-program's cold start typically involves a foreground launch, followed by switching between foreground and background operation. If the mini-program doesn't maintain background operation capability (permission) after 5 seconds of background operation, it will be switched to a suspended state. Then, after 30 minutes, if the mini-program still doesn't maintain background operation capability (permission), it will be destroyed. This solution significantly adds the ability to automatically start the mini-program in the background based on device discovery events, eliminating the need for a foreground transition. Furthermore, even when the mini-program is in a suspended state, it can be woken up (switched to background) based on device discovery events, switching from a suspended state to a background running state. The state changes during the startup and running process of a mini-program can be as follows: Figure 4 As shown, compared to the existing state changes during the startup and runtime of mini programs, this solution adds the option of launching directly in the background from the AppLaunch state.

[0103] During the background auto-start and background wake-up processes of the unlocking application, the unlocking device can query the actioncode (run code) from the backend port. If it is blocked, it will fail silently and either destroy or continue to suspend the unlocking application.

[0104] 104. Establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection.

[0105] There are several ways to establish a Bluetooth connection between the unlocking application and the target Bluetooth component, as follows:

[0106] For example, a device discovery event can be sent to the unlocking server corresponding to the unlocking application, and the Bluetooth interface information returned by the unlocking server can be received. Based on the Bluetooth interface information, the unlocking application can call the Bluetooth connection interface, and a Bluetooth connection can be established between the unlocking application and the target Bluetooth component through the Bluetooth connection interface.

[0107] The Bluetooth interface information indicates the interface address and connection settings of the Bluetooth connection interface, which is used to establish a Bluetooth connection between the unlocking application and the target Bluetooth component. Before the unlocking application can invoke the Bluetooth connection interface based on the Bluetooth interface information, user authorization is required. Based on the user's authorization information, the Bluetooth connection interface is invoked. For example, a Bluetooth authorization page corresponding to the Bluetooth interface can be displayed. This Bluetooth authorization page includes at least two Bluetooth authorization type selection controls. In response to the selection operation of the Bluetooth authorization type selection controls, the authorization information of the Bluetooth connection interface is determined. Based on the Bluetooth interface information and the Bluetooth authorization information, the unlocking application invokes the Bluetooth connection interface.

[0108] Depending on the type of Bluetooth connection interface, the type of Bluetooth authorization type selection control also varies. For example, when the Bluetooth connection interface is wx.openBluetoothAdapter (a type of Bluetooth interface), the Bluetooth authorization type selection control can include two options: "Deny" and "Allow". When the Bluetooth connection interface is wx.openBluetoothAdapterBackground (a type of Bluetooth interface), the Bluetooth authorization type selection control can include three options: "Allow only during use", "Always allow", and "Disallow".

[0109] There are several ways the unlocking application can invoke the Bluetooth connection interface based on the Bluetooth interface information and authorization information. For example, when the authorization information is "allowed" or "always allowed," the unlocking application invokes the Bluetooth connection interface based on the Bluetooth interface information. When the authorization information is "allowed only during use," the unlocking application is switched to foreground mode, and the Bluetooth connection interface is invoked through the foreground-running unlocking application based on the Bluetooth interface information. When the authorization information is "disallowed" or "rejected," invoking the Bluetooth connection interface is stopped.

[0110] After calling the Bluetooth connection interface, a Bluetooth connection can be established between the unlocking application and the target Bluetooth component.

[0111] After establishing a Bluetooth connection between the unlocking application and the target Bluetooth component, the device to be unlocked can be unlocked based on this Bluetooth connection. There are several ways to unlock the device to be unlocked. For example, the Bluetooth hold interface settings can be identified in the Bluetooth interface information. Based on the settings, the unlocking application can call the Bluetooth hold interface and adjust the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application. Based on the Bluetooth connection, the unlocking application running in the background can send unlocking information to the device to be unlocked to unlock the device.

[0112] The Bluetooth keep-alive interface is used to maintain the background running state of the unlocking application. It can also be understood as setting the Bluetooth keep-alive capability of the unlocking application. During device unlocking, the unlocking application needs to maintain a background running state to ensure a continuous Bluetooth connection. However, the background running cycle of the unlocking application is only 5 seconds. If no trigger information is received within 5 seconds, it needs to switch to a suspended state. This Bluetooth keep-alive interface enables the unlocking application to have persistent background running permissions, allowing it to run indefinitely. Based on the settings, there are several ways to call the Bluetooth keep-alive interface through the unlocking application. For example, you can query the Bluetooth keep-alive interface's flag information in the settings. If the flag information exists, you can obtain the Bluetooth connection status. If the connection status is "connected," you can call the Bluetooth keep-alive interface through the unlocking application.

[0113] The Bluetooth keep-alive interface's flag information is used to identify the application setting up background Bluetooth keep-alive. When the unlocking application sets the Bluetooth keep-alive interface (bluetoothBackgroundMode) flag to true, it indicates that the unlocking application can call the Bluetooth keep-alive interface, while other applications will return failure when calling it. Therefore, before calling the Bluetooth keep-alive interface based on the settings information, the Bluetooth keep-alive interface's flag can be set. There are several ways to set it. For example, the unlocking application can call the Bluetooth settings interface, which is used to set the Bluetooth interface's flag. Based on the Bluetooth settings interface, the current application corresponding to the Bluetooth keep-alive decoding flag is queried. If no current application exists, the Bluetooth keep-alive interface's flag is set to the unlocking application, the flag information is obtained, and this flag information is used as the Bluetooth keep-alive interface's settings information.

[0114] The Bluetooth settings interface can be wx.setBluetoothBackgroundMode. When the unlocking application calls this Bluetooth settings interface, an authorization page can also be displayed. After receiving the user's authorization consent, the Bluetooth settings interface can be called to make settings. After the settings are completed, the Bluetooth settings page can also be displayed. This Bluetooth settings page can include a "Background Bluetooth Keep Alive" capability entry, which is used to control whether the persistent background running permission of the unlocking application is enabled.

[0115] Specifically, when the unlocking application sets the Bluetooth Keep-Alive (bluetoothBackgroundMode) flag to True, it means that the unlocking application has background Bluetooth keep-alive capability. This means only the unlocking application is allowed to display the Bluetooth pop-up window; other applications are not permitted to display it. The Bluetooth Keep-Alive (bluetoothBackgroundMode) setting is based on the "bluetoothBackgroundMode" flag, on a first-come, first-served basis. When the Bluetooth Keep-Alive flag is reset, the slot can be released again.

[0116] After calling the Bluetooth hold interface, you can adjust the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application. There are several ways to adjust the background running cycle of the unlocking application. For example, you can enable the persistent background running permission of the unlocking application according to the Bluetooth hold interface. Based on the persistent background running permission, the background running cycle of the unlocking application can be adjusted to long-term running to maintain the background running state of the unlocking application.

[0117] The permission to enable the unlock application to run continuously in the background can be understood as enabling the unlock application to communicate with Bluetooth data in the background, allowing the unlock application to run continuously in the background in order to complete data communication operations with the target Bluetooth component, thus helping to support many IoT scenarios that require persistent communication with Bluetooth devices.

[0118] Optionally, after adjusting the background running cycle of the unlocking application to maintain its background running state, you can also stop the persistent background permissions of the unlocking application, or reclaim the view information of the unlocking application. For example, when it is detected that the running time of the unlocking application exceeds a preset time threshold, the view information of the unlocking application is reclaimed. When it is detected that the Bluetooth connection is disconnected, or when a stop unlocking request is received, the flag bit of the Bluetooth hold interface is reset and the persistent background running permissions of the unlocking application are stopped.

[0119] The "reclaiming the view information of the unlocking application" can be understood as follows: when the unlocking application has been running in the background for more than 30 minutes after being granted persistent background access, all webviews should be forcibly reclaimed to prevent it from switching to the foreground running state, thus allowing the unlocking application to remain in the background running state.

[0120] Resetting the Bluetooth keep-alive interface flag and stopping the persistent background running permission of the unlocking application can be understood as disabling the background Bluetooth keep-alive capability of the unlocking application. There are several ways to stop this background Bluetooth keep-alive capability, such as calling wx.closeBluetoothAdapter to turn off the Bluetooth module, the system Bluetooth switch being turned off, no active Bluetooth connection when the unlocking application is switched to the background, the unlocking application developer calling wx.setBluetoothBackgroundMode({enable:false}) to actively end it, the user clicking the Bluetooth floating window to disable the background Bluetooth keep-alive capability, connection disconnection timeout, the unlocking application being destroyed by the system, the background Bluetooth keep-alive capability being blocked in the background, or the user disabling the "background Bluetooth keep-alive" capability in the unlocking application's settings page, etc.

[0121] After adjusting the background running cycle of the unlocking app, it can send unlocking information to the device to be unlocked via Bluetooth connection. There are several ways to unlock the device. For example, the unlocking app can generate unlocking information for the device to be unlocked. This unlocking information can include the unlocking command and unlocking verification information of the device to be unlocked. The unlocking information is sent to the device to be unlocked via Bluetooth connection. When the device to be unlocked receives the unlocking information, it verifies the unlocking verification information. Once the unlocking verification information is successful, the device to be unlocked can be unlocked.

[0122] Optionally, when the device to be unlocked is a vehicle, vehicle security must be ensured during unlocking. Therefore, the vehicle is unlocked when the unlock verification information is successfully verified. The vehicle is only truly unlocked when the user opens the door or performs other actions that trigger the vehicle. This effectively prevents the device from mistakenly locking the vehicle when the user has no intention of unlocking it, thus increasing vehicle unlocking security. Furthermore, if no user is detected entering or starting the vehicle within a certain timeframe after the vehicle has been unlocked by receiving the unlock information from the device, the vehicle can be relocked. Additionally, when the vehicle is unlocked, a notification message or sound can be generated to inform the user that the vehicle has been unlocked.

[0123] As can be seen from the above, in this embodiment of the application, after obtaining at least one currently detected Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is called. Then, a Bluetooth connection is established between the unlocking application and the target Bluetooth component, and the device to be unlocked is unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the device to be unlocked is detected, and calls the unlocking application corresponding to the device to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking application is called only after the device to be unlocked is detected, thereby ensuring that the unlocking application is running when unlocking the device to be unlocked, which greatly increases the reliability of device unlocking. Therefore, the unlocking efficiency of device unlocking can be improved.

[0124] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0125] In this embodiment, the device unlocking device is specifically integrated into an electronic device, the electronic device is the terminal, the device to be unlocked is the vehicle to be unlocked, and the unlocking application is the unlocking mini-program, as an example for explanation.

[0126] like Figure 5 As shown, a device unlocking method is described below:

[0127] 201. The terminal registers the target Bluetooth component of the vehicle to be unlocked and the vehicle to be unlocked.

[0128] For example, the terminal can establish a registered Bluetooth connection with the target Bluetooth component of the vehicle to be unlocked. Through the registered Bluetooth connection, it can receive the device information to be unlocked and the target Bluetooth identifier of the target Bluetooth component. Based on the device information and the target Bluetooth identifier, it generates a device information credential for the vehicle to be unlocked and sends the verification information to the unlocking mini-program corresponding to the vehicle to be unlocked, displaying the authorization page. After receiving the user's authorization information, it calls the Bluetooth registration interface and the device discovery permission start interface through the unlocking mini-program. According to the Bluetooth registration interface, it registers the vehicle to be unlocked in the unlocking mini-program to obtain the device registration information of the vehicle to be unlocked. Based on the device registration information, it adds the target Bluetooth identifier as the target Bluetooth registration identifier of the target Bluetooth component to the Bluetooth registration identifier set. According to the device discovery permission start interface, it starts the device discovery permission corresponding to the target Bluetooth registration identifier.

[0129] The device registration information may include the target Bluetooth identifier of the target Bluetooth component of the vehicle to be unlocked, the device's unique serial number, the device model ID, the version of the unlocking mini-program launched in the background, and the name of the resource sub-package that needs to be loaded when the unlocking mini-program runs in the background. The corresponding sub-package will be loaded when the unlocking mini-program runs in the background. The code for registering the vehicle to be unlocked can be as follows:

[0130]

[0131] Optionally, after registering the vehicle to be unlocked in the unlocking mini-program and obtaining the target Bluetooth registration identifier and the corresponding device discovery permission, the registered vehicle to be unlocked can also be managed. There are several management methods. For example, when the unlocking mini-program is detected to be connected to the current Bluetooth component, the current Bluetooth identifier of the current connection is obtained. If the current Bluetooth identifier does not exist in the Bluetooth registration identifier set, the component information of the target Bluetooth component is obtained, the current Bluetooth registration identifier corresponding to the component information is filtered from the Bluetooth registration identifier set, and the current Bluetooth registration identifier is replaced with the current Bluetooth identifier. After the user uses the unlocking mini-program and connects to the vehicle to be unlocked, the Bluetooth identifier (bluetoothDeviceId) can be verified through the previously registered device information to see if it has changed. If it has changed, the device information needs to be re-bound or updated. The specific code can be as follows:

[0132]

[0133] Optionally, during the management of vehicles to be unlocked, the registration of the vehicles to be unlocked can also be deregistered. There are several ways to deregister, such as clearing the registration list when the user cancels scope authorization, thereby deregistering the vehicle to be unlocked; or clearing the registration list when the user actively deletes the mini-program, thereby unlocking the device to be unlocked; or, it can be actively deregistered using JSAPI based on the unique device identifier of the vehicle to be unlocked. The specific code is as follows:

[0134]

[0135] 202. The terminal acquires at least one Bluetooth component currently detected that needs to be connected.

[0136] For example, the terminal activates its local Bluetooth component and enables the local Bluetooth component to discover Bluetooth devices. Based on this permission, it detects Bluetooth signals within a preset range. When at least one Bluetooth signal is detected, it obtains the Bluetooth component to be connected corresponding to that Bluetooth signal. Alternatively, the terminal activates its local Bluetooth component and sends a Bluetooth connection request to the outside through the local Bluetooth component. When it receives the return information corresponding to the Bluetooth connection request, it identifies at least one Bluetooth component to be connected in the return information.

[0137] 203. When the Bluetooth component to be connected is the target Bluetooth component of the vehicle to be unlocked, generate a device discovery event.

[0138] For example, the terminal can obtain the Bluetooth registration identifier set and the device discovery permission corresponding to the Bluetooth registration identifier in the Bluetooth registration identifier set, and identify the corresponding Bluetooth identifier in the Bluetooth component to be connected. When the Bluetooth identifier matches the Bluetooth registration identifier in the Bluetooth registration identifier set, the terminal determines that the Bluetooth component to be connected is the target Bluetooth component of the vehicle to be unlocked, establishes a basic Bluetooth connection with the target Bluetooth component, and generates a device discovery event based on the basic Bluetooth connection and device discovery permission.

[0139] 204. The terminal, based on the device discovery event, calls the unlocking mini-program corresponding to the vehicle to be unlocked.

[0140] For example, the terminal obtains the current startup status of the unlocking mini-program corresponding to the vehicle to be unlocked. When the current startup status is not started, it obtains the device registration information of the vehicle to be unlocked based on the device discovery event, extracts the sub-package name for background startup from the device registration information, obtains the logic resource package and developer code based on the sub-package name, initializes the logic layer of the unlocking mini-program, loads the logic resource package in the initialized logic layer to start the unlocking mini-program, injects the developer code into the unlocking mini-program, and obtains the unlocking mini-program running in the background.

[0141] When the current startup state is "launched," the terminal obtains the current running state of the unlocking mini-program. If the current running state is in the foreground, based on the device discovery event, it obtains the device registration information of the vehicle to be unlocked, extracts the name of the background-launched subpackage from the device registration information, and loads the corresponding subpackage based on this subpackage name, thereby switching the unlocking mini-program from the foreground running state to the background running state. When the current running state is "suspended," based on the device discovery event, it obtains the device registration information of the vehicle to be unlocked, extracts the name of the background-launched subpackage from the device registration information, loads the corresponding subpackage based on this subpackage name, thereby switching the unlocking mini-program from the foreground running state to the background running state, and reusing the background running time limit. When the current running state is in the background, based on the device discovery event, it resets the timer for the unlocking mini-program's background running time, allowing the unlocking mini-program to continue running in the background.

[0142] 205. The terminal builds and unlocks the Bluetooth connection between the mini-program and the target Bluetooth component.

[0143] For example, the terminal sends a device discovery event to the unlocking server corresponding to the unlocking mini-program and receives the Bluetooth interface information returned by the unlocking server. Based on the Bluetooth interface information, the unlocking mini-program calls the Bluetooth connection interface and establishes a Bluetooth connection between the unlocking mini-program and the target Bluetooth component. The specific code can be as follows:

[0144]

[0145] Optionally, before calling the Bluetooth connection interface through the unlocking mini-program based on the Bluetooth interface information, it is also necessary to obtain the user's authorization. Based on the user's authorization information, the Bluetooth connection interface is called. For example, the Bluetooth authorization page corresponding to the Bluetooth interface can be displayed. This Bluetooth authorization page includes at least two Bluetooth authorization type selection controls. In response to the selection operation of the Bluetooth authorization type selection control, the authorization information of the Bluetooth connection interface is determined. Based on the Bluetooth interface information and the Bluetooth authorization information, the Bluetooth connection interface is called through the unlocking mini-program.

[0146] Specifically, when the Bluetooth connection interface is wx.openBluetoothAdapter, the Bluetooth authorization type selection control can include both "Deny" and "Allow". When the Bluetooth connection interface is wx.openBluetoothAdapterBackground, the Bluetooth authorization type selection control can include three options: "Allow only during use", "Always allow", and "Disallow". Based on the Bluetooth interface information and authorization information, there are multiple ways to call the Bluetooth connection interface through the unlocking mini-program. For example, when the authorization information is "Allow" or "Always allow", the unlocking mini-program calls the Bluetooth connection interface based on the Bluetooth interface information. When the authorization information is "Allow only during use", the unlocking mini-program is switched to foreground running, and the Bluetooth connection interface is called through the foreground running unlocking mini-program based on the Bluetooth interface information. When the authorization information is "Disallow" or "Deny", calling the Bluetooth connection interface stops.

[0147] 206. The terminal unlocks the vehicle to be unlocked via Bluetooth connection.

[0148] For example, the terminal identifies the Bluetooth hold interface settings in the Bluetooth interface information, queries the Bluetooth hold interface flag information in the settings, and if the flag information exists, obtains the Bluetooth connection status. If the connection status is connected, the unlocking mini-program calls the Bluetooth hold interface. Based on the Bluetooth hold interface, the unlocking mini-program is granted persistent background running permission. Based on this persistent background running permission, the background running cycle of the unlocking mini-program is adjusted to long-term running to maintain the background running state of the unlocking mini-program.

[0149] The permission to continuously run the unlock mini-program in the background can be understood as enabling the unlock mini-program's ability to communicate via Bluetooth in the background. This allows the unlock mini-program to run continuously in the background to complete data communication operations with the target Bluetooth component. The specific code is as follows:

[0150]

[0151]

[0152] After adjusting the background running cycle of the unlocking mini-program, the terminal can generate unlocking information for the vehicle to be unlocked. This unlocking information can include the unlocking command and unlocking verification information for the vehicle. The unlocking information is sent to the vehicle via Bluetooth. When the vehicle receives the unlocking information, it verifies the unlocking verification information. Once the verification is successful, the vehicle can be unlocked. Vehicle security must be ensured during unlocking. Therefore, the vehicle is in an unlocked state when the unlocking verification information is successful. The unlocking process is only truly completed when the vehicle detects the user opening the door or other triggering operations. This effectively prevents the device from mistakenly locking the vehicle when the user has no intention of unlocking it, thus increasing vehicle unlocking security. Furthermore, if no user enters or starts the vehicle within the time frame after the vehicle is unlocked by receiving the unlocking information from the device, the vehicle can be relocked. Additionally, when the vehicle is in an unlocked state, a notification message or sound can be generated to inform the user that the vehicle has been unlocked.

[0153] Optionally, the terminal can also set the flag bit of the Bluetooth hold interface (wx.setBluetoothBackgroundMode). For example, the unlocking mini-program can call the Bluetooth settings interface, which is used to set the flag bit of the Bluetooth interface. Based on the Bluetooth settings interface, it queries the current application corresponding to the flag bit of the Bluetooth hold decoding. If no current application exists, the flag bit of the Bluetooth hold interface is set to the unlocking mini-program, and the flag bit information is used as the setting information of the Bluetooth hold interface. When the unlocking mini-program calls the Bluetooth settings interface, an authorization page can also be displayed. After receiving the user's authorization consent, the Bluetooth settings interface can be called to perform the settings. After the settings are completed, the Bluetooth settings page can also be displayed. This Bluetooth settings page can include a "Background Bluetooth Keep-Alive" capability entry, which is used to control whether the persistent background running permission of the unlocking mini-program is enabled.

[0154] Optionally, the terminal can adjust the background running cycle of the unlocking mini-program to maintain its background running state, and then stop the persistent background permission of the unlocking mini-program, or reclaim the view information of the unlocking mini-program. For example, when it is detected that the running time of the unlocking mini-program exceeds a preset time threshold, the view information of the unlocking mini-program can be reclaimed. When it is detected that the Bluetooth connection is disconnected, or when a stop unlocking request is received, the flag bit of the Bluetooth hold interface can be reset and the persistent background running permission of the unlocking mini-program can be stopped.

[0155] There are several conditions under which a terminal can stop the persistent background permission of an unlocking mini-program. For example, the terminal can call wx.closeBluetoothAdapter to turn off the Bluetooth module, the system Bluetooth switch is turned off, there is no active Bluetooth connection when the unlocking mini-program is switched to the background, the developer of the unlocking mini-program actively terminates it by calling wx.setBluetoothBackgroundMode({enable:false}), the user clicks the Bluetooth floating window to turn off the background Bluetooth keep-alive capability, the connection disconnects and times out, the unlocking mini-program is destroyed by the system, the background Bluetooth keep-alive capability is blocked in the background, or the user turns off the "background Bluetooth keep-alive" capability in the settings page of the unlocking mini-program, etc.

[0156] As can be seen from the above, in this embodiment, after the terminal obtains at least one Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the vehicle to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking applet corresponding to the vehicle to be unlocked is called. Then, a Bluetooth connection is established between the unlocking applet and the target Bluetooth component, and the vehicle to be unlocked is unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the vehicle to be unlocked is detected, and calls the unlocking applet corresponding to the vehicle to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking applet is called only after the vehicle to be unlocked is detected, which can ensure that the unlocking applet is running when the vehicle to be unlocked is unlocked, greatly increasing the reliability of vehicle unlocking. Therefore, the unlocking efficiency of vehicle unlocking can be improved.

[0157] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0158] In this embodiment, an application launch method is also provided, including:

[0159] When a device discovery event is received, the current running state of the target application corresponding to the target device is obtained. If the current running state is not running, the target application is started to run in the background based on the device discovery event. If the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event. Based on the target application running in the background, the target operation is performed on the target device.

[0160] like Figure 6 As shown, the specific process of launching this application is as follows:

[0161] 301. When a device discovery event is received, obtain the current running status of the target application corresponding to the target device.

[0162] For example, at least one Bluetooth component to be connected can be detected. When the Bluetooth component to be connected is the target Bluetooth component of the target device, a device discovery event is generated and sent to the application platform corresponding to the target application. When the application platform receives the device discovery event, it can obtain the current running status of the target application corresponding to the target device.

[0163] There are several ways to obtain the current running state of the target application corresponding to the target device. One method is to obtain the current process information of the application platform. If the current process information contains the process corresponding to the target application, it can be determined that the target application is in a running state. Another method is to obtain the target child process corresponding to the target application from the current process information and identify the current running state of the target application within the target child process. The current running state can include foreground running state, background running state, and suspended state. If the current process does not contain the process corresponding to the target application, the current running state of the target application can be determined as a non-running state.

[0164] 302. When the current running state is not running, start the target application to run in the background based on the device discovery event.

[0165] For example, when the current running state is "not running," the device registration information and developer code of the target device in the target application are obtained based on the device discovery event. The identification information of the target logic resource package required for background startup is extracted from the device registration information, and the target logic resource package is obtained based on this identification information. The target logic resource package is loaded to start the target application in the background, and the developer code is registered with the background-running target application, thus obtaining the target application running in the background.

[0166] There are several ways to extract the identifier information of the target logical resource package required for background startup from the device registration information. For example, the entryPackage field can be extracted from the device registration information and used as the identifier information of the target logical resource package required for background startup. Based on this identifier information, the target logical resource package can be extracted from the resource package of the target application stored offline.

[0167] After obtaining the target logic resource package, the target application can be started in the background. There are several ways to start the target application in the background. For example, the logic layer of the target application can be initialized, and the logic resource package can be loaded in the initialized logic layer before starting the target application in the background.

[0168] 303. When the current state is suspended, adjust the suspended state to background running state based on the device discovery event.

[0169] For example, when the current state is suspended, based on the device discovery event, state switching information for background running state is generated. According to the state switching information, the suspended state of the target application is switched to the background running state, and a runtime limit is set for the target application in the background running state to obtain the target application running in the background.

[0170] Among them, state transition information can be understood as the information of the resource package that needs to be loaded after the target application switches to the background running state. There are multiple ways to generate state transition information. For example, based on the device discovery event, the device registration information of the target device can be obtained, the name of the background running sub-package can be extracted from the device registration information, and the sub-package name can be used as the state transition information.

[0171] After generating the state switching information, the target application can be switched from a suspended state to a background running state based on the state switching information. There are several ways to switch, such as loading the resource subpackage corresponding to the subpackage name, thereby switching the target application from a suspended state to a background running state.

[0172] After switching the target application from a suspended state to a background running state, you can also set a runtime limit for the background running state. There are several ways to set this limit. For example, you can reuse the runtime limit of the current background running state. This runtime limit can be set based on the actual application. For example, it can be set to 5 minutes or other durations.

[0173] 304. Based on the target application running in the background, perform target operations on the target device.

[0174] For example, a Bluetooth connection is established between the target application running in the background and the target Bluetooth component of the target device. The target application calls the Bluetooth hold interface and maintains the background running state of the target application based on the Bluetooth hold interface. Based on the Bluetooth connection, the target device is unlocked through the target application running in the background.

[0175] There are several ways to establish a Bluetooth connection between the target application running in the background and the target Bluetooth component of the target device. For example, the device discovery event can be sent to the target server corresponding to the target application, and the Bluetooth interface information returned by the target server can be received. Based on the Bluetooth interface information, the target application can call the Bluetooth connection interface to establish a Bluetooth connection between the target application and the target Bluetooth component. The specific steps can be found above and will not be repeated here.

[0176] There are several ways to maintain the background running state of a target application based on the Bluetooth hold interface. For example, the setting information of the Bluetooth hold interface can be identified in the Bluetooth interface information. Based on the setting information, the target application can call the Bluetooth hold interface and adjust the background running cycle of the target application according to the Bluetooth hold interface to maintain the background running state of the target application. For specific steps, please refer to the above text, which will not be repeated here.

[0177] There are several ways to perform target operations on a target device through a target application running in the background based on Bluetooth connection. For example, the target application can generate operation information for the target device, which may include operation instructions and operation verification information for the target device. The operation information can be sent to the target device via Bluetooth connection. When the target device receives the operation information, it can verify the operation verification information. Once the operation verification information is successful, the target device can be operated.

[0178] There are various types of operations that can be performed on the target device, such as unlocking, starting up, and performing other operations.

[0179] As can be seen from the above, in this embodiment of the application, when a device discovery event is received, after obtaining the current running state of the target application corresponding to the target device, if the current running state is not running, the target application is started to run in the background based on the device discovery event; if the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event. Then, the target operation is performed on the target device based on the target application running in the background. Since this solution uses the method of automatically starting or waking up the target application in the background based on the device discovery event, no user triggering operation is required, and it can also ensure that the target application is running when the target operation is performed on the target device. Therefore, the startup efficiency of the application can be improved.

[0180] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0181] In this embodiment, the application launch device will be specifically integrated into an electronic device, with the electronic device serving as the terminal, the target device being the vehicle to be unlocked, and the target application being the unlocking mini-program, as an example for explanation.

[0182] like Figure 7 As shown, one application startup method has the following specific process:

[0183] 401. When the terminal receives a device discovery event, it obtains the current running status of the unlocking mini-program corresponding to the vehicle to be unlocked.

[0184] For example, the terminal can acquire at least one Bluetooth component currently detected as a potential connection target. When the Bluetooth component to be connected is the target Bluetooth component of the vehicle to be unlocked, a device discovery event is generated and sent to the application platform corresponding to the unlocking mini-program. When the application platform receives the device discovery event, it acquires the current process information of the application platform. If the current process information contains the process corresponding to the unlocking mini-program, it can be determined that the unlocking mini-program is in a running state. The target sub-process corresponding to the unlocking mini-program is then acquired from the current process information, and the current running state of the unlocking mini-program is identified within the target sub-process. The current running state can include a foreground running state, a background running state, and a suspended state. If the current process does not contain the unlocking mini-program's corresponding process, it can be determined that the current running state of the unlocking mini-program is a non-running state.

[0185] 402. When the terminal is currently in an inactive state, it will launch the unlocking mini-program to run in the background based on the device discovery event.

[0186] For example, when the terminal is currently in a non-running state, it obtains the device registration information and developer code of the vehicle to be unlocked in the unlocking mini-program based on the device discovery event. The `entryPackage` field is extracted from the device registration information and used as the identifier for the target logic resource package required for background startup. Based on this identifier, the target logic resource package can be extracted from the offline stored resource package of the unlocking mini-program. The logic layer of the unlocking mini-program is initialized, and the logic resource package is loaded into the initialized logic layer, then the unlocking mini-program is started in the background. The developer code is registered with the background-running unlocking mini-program, resulting in the unlocking mini-program running in the background.

[0187] 403. When the terminal is currently in a suspended state, it will change the suspended state to a background running state based on the device discovery event.

[0188] For example, when the terminal is currently in a suspended state, it obtains the device registration information of the vehicle to be unlocked based on the device discovery event. It then extracts the name of the background running subpackage from the device registration information and uses this subpackage name as the state switching information. The resource subpackage corresponding to the subpackage name is loaded, thereby switching the unlocking mini-program from a suspended state to a background running state, reusing the runtime limit of the current background running state.

[0189] 404. The terminal unlocks the vehicle to be unlocked based on the unlocking applet running in the background.

[0190] For example, the terminal can send the device discovery event to the unlocking server corresponding to the unlocking mini-program, and receive the Bluetooth interface information returned by the unlocking server. Based on the Bluetooth interface information, the unlocking mini-program calls the Bluetooth connection interface, and establishes a Bluetooth connection between the unlocking mini-program and the target Bluetooth component through the Bluetooth connection interface.

[0191] The terminal calls the Bluetooth hold interface through the unlocking mini-program, identifies the Bluetooth hold interface settings in the Bluetooth interface information, and based on the settings, calls the Bluetooth hold interface through the unlocking mini-program and adjusts the background running cycle of the unlocking mini-program according to the Bluetooth hold interface to maintain the background running state of the unlocking mini-program.

[0192] The terminal generates unlocking information for the vehicle to be unlocked through an unlocking mini-program. This unlocking information may include the unlocking command and unlocking verification information for the vehicle to be unlocked. The unlocking information is sent to the vehicle to be unlocked via Bluetooth. When the vehicle to be unlocked receives the unlocking information, it verifies the unlocking verification information. Once the unlocking verification information is successful, the vehicle to be unlocked can be unlocked.

[0193] As can be seen from the above, in this embodiment, when the terminal receives a device discovery event, it obtains the current running state of the unlocking mini-program corresponding to the vehicle to be unlocked. When the current running state is not running, the unlocking mini-program is started to run in the background based on the device discovery event. When the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event. Then, the vehicle to be unlocked is unlocked based on the unlocking mini-program running in the background. Since this solution uses the method of automatically starting or waking up the unlocking mini-program in the background based on the device discovery event, no user triggering operation is required. It can also ensure that the unlocking mini-program is running when unlocking the vehicle to be unlocked. Therefore, the startup efficiency of the application can be improved.

[0194] To better implement the above methods, embodiments of the present invention also provide a device unlocking device, which can be integrated into electronic devices, such as servers or terminals, and the terminal may include tablet computers, laptop computers and / or personal computers.

[0195] For example, such as Figure 8 As shown, the device unlocking device may include a first acquisition unit 501, a generation unit 502, a recall unit 503, and an unlocking unit 504, as follows:

[0196] (1) First acquisition unit 501;

[0197] The first acquisition unit 501 is used to acquire at least one Bluetooth component currently detected to be connected.

[0198] For example, the first acquisition unit 501 can be specifically used to activate the local Bluetooth component of the device unlocking device and enable the permission of the local Bluetooth component to discover Bluetooth devices. Based on the permission, it can detect Bluetooth signals within a preset range. When at least one Bluetooth signal is detected, it can acquire the Bluetooth component to be connected corresponding to the Bluetooth signal. Alternatively, it can activate the local Bluetooth component of the device unlocking device and send a Bluetooth connection request to the outside through the local Bluetooth component. When it receives the return information corresponding to the Bluetooth connection request, it can identify at least one Bluetooth component to be connected in the return information.

[0199] (2) Generation unit 502;

[0200] The generation unit 502 is used to generate a device discovery event when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked.

[0201] For example, the generation unit 502 can be used to obtain the Bluetooth registration identifier set and the device discovery permission corresponding to the Bluetooth registration identifier in the Bluetooth registration identifier set, and identify the corresponding Bluetooth identifier in the Bluetooth component to be connected. When the Bluetooth identifier matches the Bluetooth registration identifier in the Bluetooth registration identifier set, the Bluetooth component to be connected is determined to be the target Bluetooth component of the device to be unlocked, a basic Bluetooth connection with the target Bluetooth component is established, and a device discovery event is generated based on the basic Bluetooth connection and the device discovery permission.

[0202] (3) Call unit 503;

[0203] Calling unit 503 is used to call the unlocking application corresponding to the device to be unlocked based on the device discovery event.

[0204] For example, calling unit 503 can be used to obtain the current startup status of the unlocking application corresponding to the device to be unlocked. When the current startup status is not started, the unlocking application is started in the background based on the device discovery event. When the current startup status is started, the running status of the unlocking application is adjusted to run in the background based on the device discovery event.

[0205] (4) Unlocking unit 504;

[0206] The unlocking unit 504 is used to establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and to unlock the device to be unlocked based on the Bluetooth connection.

[0207] For example, the unlocking unit 504 can specifically be used to send a device discovery event to the unlocking server corresponding to the unlocking application, and receive Bluetooth interface information returned by the unlocking server. Based on the Bluetooth interface information, the unlocking application calls the Bluetooth connection interface to establish a Bluetooth connection between the unlocking application and the target Bluetooth component. The Bluetooth hold interface settings are identified in the Bluetooth interface information. Based on these settings, the unlocking application calls the Bluetooth hold interface and adjusts the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application. Based on the Bluetooth connection, the unlocking application, running in the background, sends unlocking information to the device to be unlocked to unlock the device.

[0208] Optionally, the device unlocking device may also include a registration unit 505, such as Figure 9 As shown, the specific details are as follows:

[0209] Registration unit 505 is used to register the unlocking device in the unlocking application.

[0210] For example, the registration unit 505 can be used to establish a registered Bluetooth connection with the target Bluetooth component of the device to be unlocked, and through the registered Bluetooth connection, receive the device information to be unlocked and the target Bluetooth identifier of the target Bluetooth component, generate verification information for the device to be unlocked based on the device information and the target Bluetooth identifier, and send the verification information to the unlocking application corresponding to the device to be unlocked. In the unlocking application, the device to be unlocked is registered to obtain the target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier.

[0211] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0212] As can be seen from the above, in this embodiment, after the first acquisition unit 501 acquires at least one currently detected Bluetooth component to be connected, the generation unit 502 generates a device discovery event when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked. Then, the calling unit 503 calls the unlocking application corresponding to the device to be unlocked based on the device discovery event. Then, the unlocking unit 504 establishes a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlocks the device to be unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the device to be unlocked is detected, and calls the unlocking application corresponding to the device to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking application is called only after the device to be unlocked is detected, which can ensure that the unlocking application is running when unlocking the device to be unlocked, greatly increasing the reliability of device unlocking. Therefore, the unlocking efficiency of device unlocking can be improved.

[0213] To better implement the above methods, embodiments of the present invention also provide an application launch device, which can be integrated into an electronic device, such as a server or terminal, and the terminal may include a tablet computer, a laptop computer, and / or a personal computer.

[0214] For example, such as Figure 10 As shown, the application launch device may include a second acquisition unit 601, a launch unit 602, an adjustment unit 603, and an operation unit 604, as follows:

[0215] (1) Second acquisition unit 601;

[0216] The second acquisition unit 601 is used to acquire the current running status of the target application corresponding to the target device when a device discovery event is received.

[0217] For example, the second acquisition unit 601 can be used to acquire at least one Bluetooth component to be connected that is currently detected. When the Bluetooth component to be connected is the target Bluetooth component of the target device, a device discovery event is generated and the device discovery event is sent to the application platform corresponding to the target application. When the application platform receives the device discovery event, it can acquire the current running status of the target application corresponding to the target device.

[0218] (2) Start-up unit 602;

[0219] The startup unit 602 is used to start the target application to run in the background based on the device discovery event when the current running state is non-running state.

[0220] For example, the startup unit 602 can be used to, when the current running state is non-running, obtain the device registration information and developer code of the target device in the target application based on the device discovery event. It extracts the identification information of the target logical resource package required for background startup from the device registration information, and obtains the target logical resource package based on the identification information. It loads the target logical resource package to start the target application in the background, and registers the developer code with the background-running target application, thus obtaining the target application running in the background.

[0221] (3) Adjustment unit 603;

[0222] The adjustment unit 603 is used to adjust the suspended state to the background running state based on the device discovery event when the current running state is suspended.

[0223] For example, the adjustment unit 603 can be used to generate background running state switching information based on the device discovery event when the current state is suspended, switch the suspended state of the target application to the background running state according to the state switching information, set the runtime limit for the target application in the background running state, and obtain the target application running in the background.

[0224] (4) Operation unit 604;

[0225] The operation unit 604 is used to perform target operations on the target device based on the target application running in the background.

[0226] For example, the target operation unit 604 can be used to establish a Bluetooth connection between a target application running in the background and a target Bluetooth component of a target device. The target application calls the Bluetooth hold interface and maintains the background running state of the target application based on the Bluetooth hold interface. Based on the Bluetooth connection, the target application running in the background performs target operations on the target device.

[0227] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0228] As can be seen from the above, in this embodiment, when the second acquisition unit 601 receives a device discovery event, it acquires the current running state of the target application corresponding to the target device. When the current running state is not running, the startup unit 602 starts the target application to run in the background based on the device discovery event. When the current running state is suspended, the adjustment unit 603 adjusts the suspended state to the background running state based on the device discovery event. Then, the operation unit 604 performs target operations on the target device based on the target application running in the background. Since this scheme uses the method of automatically starting or waking up the target application in the background based on the device discovery event, no user triggering operation is required, and it can also ensure that the target application is running when the target device is operated. Therefore, the startup efficiency of application startup can be improved.

[0229] This invention also provides an electronic device, such as... Figure 11 As shown, it illustrates a structural schematic diagram of the electronic device involved in an embodiment of the present invention, specifically:

[0230] The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will understand that... Figure 11The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0231] The processor 701 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 702, and calls data stored in the memory 702 to perform various functions and process data. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701.

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

[0233] The electronic device also includes a power supply 703 that supplies power to the various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0234] The electronic device may also include an input unit 704, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0235] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application programs stored in the memory 702 to realize various functions, as follows:

[0236] Get at least one Bluetooth component that is currently detected to be connected. When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, generate a device discovery event. Based on the device discovery event, call the unlocking application corresponding to the device to be unlocked, build a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection.

[0237] or

[0238] When a device discovery event is received, the current running state of the target application corresponding to the target device is obtained. If the current running state is not running, the target application is started to run in the background based on the device discovery event. If the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event. Based on the target application running in the background, the target operation is performed on the target device.

[0239] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0240] As can be seen from the above, in this embodiment of the invention, after obtaining at least one currently detected Bluetooth component to be connected, when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated. Then, based on the device discovery event, the unlocking application corresponding to the device to be unlocked is invoked. Then, a Bluetooth connection is established between the unlocking application and the target Bluetooth component, and the device to be unlocked is unlocked based on the Bluetooth connection. Since this scheme generates a device discovery event when the target Bluetooth component of the device to be unlocked is detected, and invokes the unlocking application corresponding to the device to be unlocked based on the device discovery event, no user triggering operation is required. Moreover, the unlocking application is invoked only after the device to be unlocked is detected, thereby ensuring that the unlocking application is running when unlocking the device to be unlocked, greatly increasing the reliability of device unlocking. Therefore, the unlocking efficiency of device unlocking can be improved.

[0241] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0242] To this end, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the device unlocking methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:

[0243] Get at least one Bluetooth component that is currently detected to be connected. When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, generate a device discovery event. Based on the device discovery event, call the unlocking application corresponding to the device to be unlocked, build a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection.

[0244] or

[0245] When a device discovery event is received, the current running state of the target application corresponding to the target device is obtained. If the current running state is not running, the target application is started to run in the background based on the device discovery event. If the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event. Based on the target application running in the background, the target operation is performed on the target device.

[0246] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0247] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0248] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the device unlocking methods provided in the embodiments of the present invention, the beneficial effects that any of the device unlocking methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0249] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations of the device unlocking or vehicle unlocking aspects described above.

[0250] The foregoing has provided a detailed description of a device unlocking method, apparatus, electronic device, and computer-readable storage medium provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A device unlocking method, characterized in that, include: Obtain at least one currently detected Bluetooth component to be connected; When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated; Based on the device discovery event, the unlocking application corresponding to the device to be unlocked is invoked; Establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection; The step of establishing a Bluetooth connection between the unlocking application and the target Bluetooth component includes: sending the device discovery event to the unlocking server corresponding to the unlocking application and receiving Bluetooth interface information returned by the unlocking server; calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information; and establishing a Bluetooth connection between the unlocking application and the target Bluetooth component through the Bluetooth connection interface. The step of unlocking the device to be unlocked based on the Bluetooth connection includes: identifying the setting information of the Bluetooth hold interface in the Bluetooth interface information, the Bluetooth hold interface being used to maintain the background running state of the unlocking application; calling the Bluetooth setting interface through the unlocking application, the Bluetooth setting interface being used to set the flag bit of the Bluetooth hold interface; querying the current application corresponding to the flag bit of the Bluetooth hold interface based on the Bluetooth setting interface; when the current application does not exist, setting the flag bit of the Bluetooth hold interface to the unlocking application, obtaining the flag bit information, and using the flag bit information as the setting information of the Bluetooth hold interface; calling the Bluetooth hold interface through the unlocking application based on the setting information, and adjusting the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application; and sending unlocking information to the device to be unlocked through the background running unlocking application based on the Bluetooth connection to unlock the device to be unlocked.

2. The device unlocking method according to claim 1, characterized in that, The step of invoking the unlocking application corresponding to the device to be unlocked based on the device discovery event includes: Obtain the current startup status of the unlocking application corresponding to the device to be unlocked; When the current startup state is not started, the unlocking application is started in the background based on the device discovery event; When the current startup state is "started", the running state of the unlocking application is adjusted to run in the background based on the device discovery event.

3. The device unlocking method according to claim 2, characterized in that, The step of launching the unlocking application in the background based on the device discovery event includes: Based on the device discovery event, obtain the logic resource package and developer code required for the unlocking application to start in the background; The logic layer of the unlocking application is initialized, and the logic resource package is loaded in the initialized logic layer to start the unlocking application; The developer code is injected into the unlocking application to obtain the unlocking application running in the background.

4. The device unlocking method according to claim 3, characterized in that, The step of adjusting the running state of the unlocking application to run in the background based on the device discovery event includes: Obtain the current running status of the unlocking application; When the current running state is the foreground running state, the foreground running state is switched to the background running state based on the device discovery event; When the current running state is suspended, the suspended state is switched to background running state based on the device discovery event; When the current running state is background running state, the background running time of the unlocking application is reset based on the device discovery event to maintain the background running state of the unlocking application.

5. The device unlocking method according to claim 1, characterized in that, Before calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information, the process also includes: Display the Bluetooth authorization page corresponding to the Bluetooth connection interface, the Bluetooth authorization page including at least two Bluetooth authorization type selection controls; In response to a selection operation of the Bluetooth authorization type selection control, the authorization information of the Bluetooth connection interface is determined; The step of calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information includes: calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information and authorization information.

6. The device unlocking method according to claim 5, characterized in that, The step of calling the Bluetooth connection interface through the unlocking application based on the Bluetooth interface information and authorization information includes: When the authorization information is allowed or always allowed, the Bluetooth connection interface is invoked through the unlocking application based on the Bluetooth interface information; When the authorization information indicates that it is only allowed during use, the running state of the unlocking application is switched to foreground running, and the Bluetooth connection interface is called through the foreground running unlocking application based on the Bluetooth interface information.

7. The device unlocking method according to claim 1, characterized in that, The step of calling the Bluetooth hold interface through the unlocking application based on the settings information includes: Query the flag information of the Bluetooth hold interface in the settings information; When the flag information is present, the connection status of the Bluetooth connection is obtained; When the connection status is "connected", the Bluetooth hold interface is invoked through the unlocking application.

8. The device unlocking method according to claim 7, characterized in that, The step of adjusting the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application includes: Based on the Bluetooth hold interface, the persistent background running permission of the unlocking application is activated; Based on the persistent background running permission, the background running cycle of the unlocking application is adjusted to long-term running in order to maintain the background running state of the unlocking application.

9. The device unlocking method according to claim 8, characterized in that, After adjusting the background running cycle of the unlocking application to long-term running based on the persistent background running permission to maintain the background running state of the unlocking application, the method further includes: When the running time of the unlocking application is detected to exceed a preset time threshold, the view information of the unlocking application is reclaimed; When a Bluetooth connection is detected to be disconnected, or when a stop unlock request is received, the flag bit of the Bluetooth hold interface is reset, and the persistent background running permission of the unlock application is stopped.

10. The device unlocking method according to any one of claims 1 to 4, characterized in that, When the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked, a device discovery event is generated, including: Obtain the set of Bluetooth registration identifiers and the device discovery permissions corresponding to the Bluetooth registration identifiers in the set of Bluetooth registration identifiers, and identify the corresponding Bluetooth identifiers in the Bluetooth components to be connected; When the Bluetooth identifier matches a Bluetooth registration identifier in the Bluetooth registration identifier set, the Bluetooth component to be connected is determined to be the target Bluetooth component of the device to be unlocked; Establish a basic Bluetooth connection with the target Bluetooth component, and generate a device discovery event based on the basic Bluetooth connection and device discovery permissions.

11. The device unlocking method according to claim 10, characterized in that, Before obtaining the Bluetooth registration identifier set and the device discovery permission corresponding to the Bluetooth registration identifier in the Bluetooth registration identifier set, the method further includes: Establish a registered Bluetooth connection with the target Bluetooth component of the device to be unlocked, and receive the device information of the device to be unlocked and the target Bluetooth identifier of the target Bluetooth component through the registered Bluetooth connection; Based on the device information and the target Bluetooth identifier, verification information for the device to be unlocked is generated, and the verification information is sent to the unlocking application corresponding to the device to be unlocked. The device to be unlocked is registered in the unlocking application to obtain the target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier.

12. The device unlocking method according to claim 11, characterized in that, The step of registering the device to be unlocked in the unlocking application to obtain a target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier includes: The unlocking application calls the Bluetooth registration interface and the device discovery permission startup interface; According to the Bluetooth registration interface, the device to be unlocked is registered in the unlocking application to obtain the device registration information of the device to be unlocked; Based on the device registration information, the target Bluetooth identifier is added to the Bluetooth registration identifier set as a target Bluetooth registration identifier; The device discovery permission corresponding to the target Bluetooth registration identifier is activated according to the device discovery permission activation interface.

13. The device unlocking method according to claim 11, characterized in that, After registering the device to be unlocked in the unlocking application and obtaining the target Bluetooth registration identifier and the device discovery permission corresponding to the target Bluetooth registration identifier, the process further includes: When it is detected that the unlocking application is connected to the current Bluetooth component, the current Bluetooth identifier connected to the current Bluetooth component is obtained; When the current Bluetooth identifier does not exist in the Bluetooth registration identifier set, obtain the component information of the target Bluetooth component; The current Bluetooth registration identifier corresponding to the component information is selected from the set of Bluetooth registration identifiers, and the current Bluetooth registration identifier is replaced with the current Bluetooth identifier.

14. An application launch method, characterized in that, include: When a device discovery event is received, the current running status of the target application corresponding to the target device is obtained; When the current running state is not running, the target application is started to run in the background based on the device discovery event; When the current running state is suspended, the suspended state is adjusted to the background running state based on the device discovery event; The device discovery event is sent to the target server corresponding to the target application, and the Bluetooth interface information returned by the target server is received. Based on the Bluetooth interface information, the target application calls the Bluetooth connection interface; through the Bluetooth connection interface, a Bluetooth connection is established between the target application and the target Bluetooth component of the target device; The target application calls the Bluetooth settings interface, which is used to set the flag bit of the Bluetooth hold interface; based on the Bluetooth settings interface, the current application corresponding to the flag bit of the Bluetooth hold interface is queried; when the current application does not exist, the flag bit of the Bluetooth hold interface is set to the target application to obtain the flag bit information, and the flag bit information is used as the setting information of the Bluetooth hold interface; The Bluetooth keep-alive interface settings are identified in the Bluetooth interface information. The Bluetooth keep-alive interface is used to maintain the background running state of the target application. The flag information of the Bluetooth keep-alive interface is queried in the settings information. When the flag information exists, the connection status of the Bluetooth connection is obtained. When the connection status is connected, the target application calls the Bluetooth keep-alive interface, and the background running cycle of the target application is adjusted according to the Bluetooth keep-alive interface to maintain the background running state of the target application. Based on the Bluetooth connection, the target application running in the background performs target operations on the target device.

15. The application launch method according to claim 14, characterized in that, The step of launching the target application to run in the background based on the device discovery event includes: Based on the device discovery event, obtain the device registration information and developer code of the target device in the target application; Extract the identifier information of the target logical resource package required for background startup from the device registration information, and obtain the target logical resource package based on the identifier information; The target logic resource package is loaded to start the target application in the background, and the developer code is injected into the target application started in the background to obtain the target application running in the background.

16. The application launch method according to claim 14, characterized in that, The step of adjusting the suspended state to a background running state based on the device discovery event includes: Based on the device discovery event, generate background running status switching information; Based on the state switching information, the suspended state of the target application is switched to the background running state; A runtime limit is set for the target application running in the background to obtain the target application running in the background.

17. The application launch method according to claim 14, characterized in that, The operation on the target device based on the Bluetooth connection and through the target application running in the background includes: Establish a Bluetooth connection between the target application running in the background and the target Bluetooth component of the target device; The target application calls the Bluetooth hold interface, and based on the Bluetooth hold interface, maintains the background running state of the target application; Based on the Bluetooth connection, the target application running in the background performs target operations on the target device.

18. A device unlocking device, characterized in that, include: The first acquisition unit is used to acquire at least one Bluetooth component currently detected to be connected; A generation unit is configured to generate a device discovery event when the Bluetooth component to be connected is the target Bluetooth component of the device to be unlocked. The invocation unit is used to invoke the unlocking application corresponding to the device to be unlocked based on the device discovery event. An unlocking unit is configured to establish a Bluetooth connection between the unlocking application and the target Bluetooth component, and unlock the device to be unlocked based on the Bluetooth connection. Specifically, the unlocking unit is configured to: send the device discovery event to the unlocking server corresponding to the unlocking application, and receive Bluetooth interface information returned by the unlocking server; based on the Bluetooth interface information, invoke the Bluetooth connection interface through the unlocking application; establish a Bluetooth connection between the unlocking application and the target Bluetooth component through the Bluetooth connection interface; identify the setting information of the Bluetooth hold interface in the Bluetooth interface information, the Bluetooth hold interface being used to maintain the background running state of the unlocking application; invoke the Bluetooth setting interface through the unlocking application, the Bluetooth setting interface being used to set the flag bit of the Bluetooth hold interface; query the current application corresponding to the flag bit of the Bluetooth hold interface based on the Bluetooth setting interface; when the current application does not exist, set the flag bit of the Bluetooth hold interface to the unlocking application, obtain the flag bit information, and use the flag bit information as the setting information of the Bluetooth hold interface; and based on the setting information, invoke the Bluetooth hold interface through the unlocking application, and adjust the background running cycle of the unlocking application according to the Bluetooth hold interface to maintain the background running state of the unlocking application. Based on the Bluetooth connection, the unlocking application running in the background sends unlocking information to the device to be unlocked in order to unlock the device.

19. An application activation device, characterized in that, include: The second acquisition unit is used to acquire the current running status of the target application corresponding to the target device when a device discovery event is received; The startup unit is used to start the target application to run in the background based on the device discovery event when the current running state is an inactive state. An adjustment unit is used to adjust the current running state to a background running state based on the device discovery event when the current running state is a suspended state. The device is used to send the device discovery event to the target server corresponding to the target application, and to receive Bluetooth interface information returned by the target server; Based on the Bluetooth interface information, the target application calls the Bluetooth connection interface; through the Bluetooth connection interface, a Bluetooth connection is established between the target application and the target Bluetooth component of the target device; The target application calls the Bluetooth settings interface, which is used to set the flag bit of the Bluetooth hold interface; based on the Bluetooth settings interface, the current application corresponding to the flag bit of the Bluetooth hold interface is queried; when the current application does not exist, the flag bit of the Bluetooth hold interface is set to the target application to obtain the flag bit information, and the flag bit information is used as the setting information of the Bluetooth hold interface; The Bluetooth keep-alive interface settings are identified in the Bluetooth interface information. The Bluetooth keep-alive interface is used to maintain the background running state of the target application. The flag information of the Bluetooth keep-alive interface is queried in the settings information. When the flag information exists, the connection status of the Bluetooth connection is obtained. When the connection status is connected, the target application calls the Bluetooth keep-alive interface, and the background running cycle of the target application is adjusted according to the Bluetooth keep-alive interface to maintain the background running state of the target application. An operation unit is used to perform target operations on the target device through the target application running in the background, based on the Bluetooth connection.

20. An electronic device, characterized in that, It includes a processor and a memory, the memory storing an application program, and the processor running the application program within the memory to perform the steps of the device unlocking method according to any one of claims 1 to 13 or the application launching method according to any one of claims 14 to 17.

21. A computer program product comprising computer programs / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the device unlocking method according to any one of claims 1 to 13 or the application launching method according to any one of claims 14 to 17.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform steps in the device unlocking method of any one of claims 1 to 13 or the application launching method of any one of claims 14 to 17.

Citation Information

Patent Citations

  • Novel scene content pushing system and device

    CN106599137A

  • Unlocking method, mobile terminal, intelligent door lock, unlocking system and storage medium

    CN112419543A

  • Communication method and device, electronic equipment and computer storage medium

    CN113825123A