Application unique identifier acquisition and application method and device based on swan gap system

By judging user parameters in the Hongmeng system and generating application-unique identifiers, combined with device identification information, the problem of obtaining application-unique identifiers on the Hongmeng system is solved, and security guarantees are achieved without storage permissions.

CN120456030AActive Publication Date: 2025-08-08FEITIAN TECHNOLOGIES CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510940806.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-08-08
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

How to obtain the unique identity of the application on the Hongmeng system to ensure the uniqueness of the application, defend against replay attacks and improve interaction security.

Method used

Use the SDK to determine whether user parameters are passed in. If there is, obtain the saved application unique identifier or generate it based on user parameters. If there is no, obtain the Hongmeng system device identification information to generate an application unique identifier, and generate a reliable application unique identifier based on the device identification information.

Benefits of technology

When the system does not have storage permissions, it can still generate a reliable application-unique identifier to defend against replay attacks and improve the security of application-security services or device interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120456030A_ABST
    Figure CN120456030A_ABST
Patent Text Reader

Abstract

According to the application unique identifier acquisition and application method and device based on the swan gap system provided by the invention, when the first interface of the SDK is called by the application in the intelligent equipment, the SDK determines whether the user parameters are introduced or not, if the user parameters are introduced, the stored application unique identifier is acquired or the application unique identifier is generated according to the user parameters, and the application unique identifier is applied to the SDK; if no user parameter is transmitted in, the identification information of the device of the swan monk system is obtained, the unique identification of the application is generated according to the identification information of the device of the swan monk system, the reliable unique identification of the application can still be generated when the application has no system storage authority, and the uniqueness of the unique identification of the application is guaranteed by combining the identification information of the device; according to the method and the device, the replay attack on the intelligent equipment is effectively defended, and meanwhile, the unique identifier information of the security guarantee service / equipment also participates in the generation of the unique identifier of the application, so that the security when the application interacts with the security guarantee service / equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security technology, and in particular relates to a method and device for obtaining and applying a unique application identifier based on the Hongmeng system. Background Art

[0002] With the rapid development of the Internet of Things, modern people's lives are increasingly inseparable from various smart devices and smart applications, and corresponding information security issues are also frequently arising. In order to protect the security of smart devices and user information, a variety of security protection services or devices have been launched on the market, such as Bluetooth key devices, FIDO devices, mobile phone tokens, etc. Users can interact with these security protection services or devices through smart applications on smart devices. At present, during the interaction between applications on Hongmeng system devices and security protection devices or services, it is necessary to obtain the unique identification of the application to ensure the uniqueness of the application. Therefore, how to obtain the unique identification of applications on Hongmeng system is a problem that needs to be solved urgently. Summary of the Invention

[0003] In order to solve the above technical problems, the present invention provides a method and device for obtaining and applying an application unique identifier based on the Hongmeng system.

[0004] To this end, according to a first aspect of the present invention, a method for obtaining a unique identifier of an application based on the Hongmeng system is provided, which is applicable to a smart device equipped with the Hongmeng system. The method includes the SDK of the application on the smart device performing the following steps: Step S1: When the first interface of the SDK is called by the application, the SDK determines whether user parameters are passed in. If so, step S2 is executed; otherwise, step S5 is executed. Step S2, the SDK searches for a preference file corresponding to the application or a predefined file within the application according to the user parameters, and determines whether the application unique identifier exists in the found file. If so, step S3 is executed; otherwise, step S4 is executed. Step S3: The SDK obtains the saved application unique identifier; Step S4: The SDK generates an application unique identifier of a specified length using a first preset algorithm, and saves the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameter; Step S5: The SDK obtains the device identification information of the smart device, and generates an application unique identifier of a specified length using a second preset algorithm according to the device identification information.

[0005] According to a second aspect of the present invention, a method for uniquely identifying an application based on the Hongmeng system is provided. The method is applicable to a system including a smart device and a Bluetooth device of the Hongmeng system. The method includes the SDK of the application on the smart device performing the following steps: Step P1: When the first interface of the SDK is called by the application to execute a first operation request, the SDK determines whether there are user parameters passed in the first operation request. If so, step P2 is executed; otherwise, step P5 is executed. Step P2: The SDK searches for a preference file corresponding to the application or a predefined file within the application according to the user parameters, and determines whether the application unique identifier exists in the found file. If so, step P3 is executed; otherwise, step P4 is executed. Step P3: The SDK obtains the unique identifier of the application and executes step P6; Step P4: The SDK generates an application unique identifier of a specified length using a first preset algorithm, and saves the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameters, and then executes step P6; Step P5: The SDK obtains the device identification information of the smart device, generates an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and then executes step P6; Step P6: The SDK obtains factory information of the smart device; Step P7: The SDK sends the factory information of the smart device and the unique identifier of the application to the Bluetooth device; Step P8: The SDK sends a Bluetooth device information acquisition instruction to the Bluetooth device, generates verification data based on the received Bluetooth device information, the smart device factory information, and the application unique identifier, and sends the verification data to the Bluetooth device. The Bluetooth device performs binding authentication on the application based on the verification data. Step P9: The SDK receives authentication response data returned by the Bluetooth device, and determines whether the Bluetooth device and the application are successfully bound based on the authentication response data. If so, the SDK performs a corresponding operation based on the first operation request and returns the operation result to the application. The process ends; if not, the SDK performs step P10. Step P10: The SDK pops up an input box to receive the pairing code entered by the user based on the random code displayed on the Bluetooth device, and sends the pairing code to the Bluetooth device for verification; Step P11, the SDK receives the verification result returned by the Bluetooth device, and determines whether the Bluetooth device and the application are successfully bound based on the verification result. If so, the SDK performs the corresponding operation according to the first operation request and returns the operation result to the application. If not, the SDK prompts an error and ends.

[0006] According to a third aspect of the present invention, a device for obtaining an application unique identifier based on the Hongmeng system is provided, the device comprising: A first judgment module is used to judge whether there are user parameters passed in when the first interface is called by the application, and trigger the first search module if the user parameters are passed in, and trigger the second generation module if the user parameters are not passed in; The first search module is configured to search for a preference file or a predefined file within the application corresponding to the application according to the user parameters; a second determining module, configured to determine whether an application unique identifier exists in the file found by the first searching module, and triggering the first acquiring module if the application unique identifier exists; and triggering the first generating module if the application unique identifier does not exist; The first acquisition module is used to acquire the saved application unique identifier; The first generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameters; The second generating module is configured to obtain device identification information of the smart device, and generate an application unique identifier of a specified length using a second preset algorithm according to the device identification information.

[0007] According to a fourth aspect of the present invention, there is provided an application unique identification device based on the Hongmeng system, the device comprising: a fourth determining module, configured to determine whether a user parameter is passed in the first operation request when the first interface is called by the application to execute the first operation request, trigger the second searching module if the user parameter is passed in, and trigger the fourth generating module if the user parameter is not passed in; The second search module is used to search for a preference file corresponding to the application or a predefined file within the application according to the user parameters; a fifth determination module, configured to determine whether an application unique identifier exists in the file found by the second search module, and trigger the third acquisition module if the application unique identifier exists; and trigger the third generation module if the application unique identifier does not exist; The third acquisition module is used to acquire the saved application unique identifier and trigger the fourth acquisition module; The third generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameter, thereby triggering the fourth acquiring module; The fourth generating module is configured to obtain device identification information of the smart device, generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and trigger the fourth obtaining module; The fourth acquisition module is used to obtain factory information of the smart device; A first sending module, configured to send the factory information of the smart device and the unique identifier of the application to the Bluetooth device; A second sending module, configured to send an instruction to obtain Bluetooth device information to the Bluetooth device; a fifth generating module, configured to generate verification data based on the received Bluetooth device information, the factory information of the smart device, and the unique identifier of the application; A third sending module is used to send the verification data to the Bluetooth device, so that the Bluetooth device performs binding authentication on the application; a first determining module, configured to receive authentication response data returned by the Bluetooth device, determine whether the Bluetooth device and the application have been successfully bound based on the authentication response data, trigger the first operating module if the binding is determined to be successful, and trigger the fourth sending module if the binding is determined to be unsuccessful; The first operation module is configured to perform a corresponding operation according to the first operation request and return an operation result to the application; The fourth sending module is configured to pop up an input box, receive a pairing code input by the user according to the random code displayed on the Bluetooth device, and send the pairing code to the Bluetooth device for verification; The second determination module is used to receive the verification result returned by the Bluetooth device, determine whether the Bluetooth device and the application are successfully bound according to the verification result, trigger the first operation module if the binding is successful, and prompt an error if the binding is unsuccessful.

[0008] According to a fifth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the above method.

[0009] According to a sixth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program / instruction is stored, which implements the steps of the above method when executed by a processor.

[0010] According to a seventh aspect of the present invention, there is provided a computer program product comprising a computer program / instructions for implementing the steps of the above method when the computer program / instructions are executed by a processor.

[0011] The beneficial effects brought about by the technical solution provided by the present invention include at least: The present invention provides a method and device for obtaining and applying an application unique identifier based on the Harmony system. When the first interface of the SDK is called, the SDK determines whether any user parameters are passed in. If any parameters are passed in, the saved application unique identifier is obtained or an application unique identifier is generated based on the user parameters. If no parameters are passed in, the Harmony system device identification information is obtained, and the application unique identifier is generated based on the Harmony system device identification information. This method can still generate a reliable application unique identifier when the application has no system storage permission. Combined with the device identification information, the uniqueness of the application unique identifier is guaranteed, and replay attacks on smart devices are effectively defended. At the same time, the unique identification information of the security assurance service or device also participates in the generation of the application unique identifier, thereby improving the security of the application when interacting with the security assurance service or device. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] For a clearer explanation, the embodiments of the present invention or the prior art are briefly introduced below in conjunction with the accompanying drawings. Obviously, the 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 work.

[0013] Figure 1 This is a flowchart of a method for obtaining a unique identifier of an application based on the Hongmeng system provided in Example 1 of the present invention; Figure 2 This is a flowchart of a method for uniquely identifying an application based on the Hongmeng system provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0014] To make the objectives, technical solutions and advantages of the present invention more clear, embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0015] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0016] Example 1 Embodiment 1 of the present invention provides a method for obtaining an application unique identifier based on the HarmonyOS system, which is applicable to smart devices equipped with the HarmonyOS system. The obtained application unique identifier can be used to authenticate and bind the application on the smart device with a security assurance service / device to ensure the security of information transmission when the application on the smart device interacts with the security assurance device. The security assurance service / device includes but is not limited to Bluetooth devices (such as Bluetooth keys), FIDO, and mobile phone tokens.

[0017] The method is specifically executed by the SDK (Chinese name: Software Development Kit, English full name: Software Development Kit, abbreviated as: SDK) of the application on the smart device, such as Figure 1 As shown, a method for obtaining a unique identifier of an application based on the Hongmeng system specifically includes: Step 101: When the first interface of the SDK is called by the application, the SDK determines whether user parameters are passed in. If so, it executes step 102; otherwise, it executes step 105. In one practicable manner, the application initiates an operation request by calling a first interface of the SDK, wherein the execution of the operation request needs to be implemented through interaction with the security assurance device; For example, the user parameter is: Context / UIContext. Specifically, Context provides the ability or application context. Context is the context of objects in the application, which provides some basic information of the application, such as resourceManager (resource management), applicationInfo (current application information), dir (application file path), area (file partition), etc., as well as some basic methods of the application; UIContext is used to process UI-related contexts. It is associated with a specific UI instance and can obtain information about the current UI instance and perform operations on it.

[0018] For example, the user parameter may also include length, specifically the length of generating the application unique identifier; Step 102: Search the preference file or predefined file in the application according to the user parameters, and determine whether the application unique identifier exists in the found file. If so, proceed to step 103; otherwise, proceed to step 104. In this embodiment, the preference file corresponding to the application is specifically preferences; Specifically, the SDK searches for the preference file corresponding to the application or the predefined file within the application according to the user parameters: the SDK calls the Hongmeng system interface according to the user parameters to search for the preference file corresponding to the application or the predefined file within the application; For example, if the user parameter is Context, the Hongmeng system interface called to find the preference file corresponding to the application is: get(this.mContext, this.applicationUUID,''); In one practicable manner, before executing step 102, the SDK further includes: determining whether the input user parameter is a valid parameter, and if so, executing step 102; otherwise, executing step 105; Through the solution of this embodiment, a reliable application unique identifier can still be generated even when the application does not have system storage permissions, effectively preventing replay attacks on smart devices. At the same time, if the parameters entered by the user are not valid parameters, the SDK can also generate an application unique identifier to authenticate and bind with the security assurance device / service, thereby improving the security of the interaction. Step 103: Obtain the saved application unique identifier; For example, the obtained application unique identifier is: ac53db60a58450dc; Step 104: Generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to user parameters; In one practicable manner, generating an application unique identifier of a specified length by using a first preset algorithm specifically includes: an SDK generating a random number of the first preset length, obtaining a timestamp, and generating data of the specified length as the application unique identifier by using the first preset algorithm based on the random number and the timestamp; Specifically, the specified length is a preset length or a length of the generated application unique identifier specified by a user parameter, for example, the specified length is 16 bytes; For example, the first preset length is specifically 12 bytes, and the random number is specifically: 07 47 A9 AD 46 7D 4D C2 9CE7 03 44; The first preset algorithm is the SHA-1 hash algorithm; Specifically, the generated application unique identifier is saved to the preference file corresponding to the application or the predefined file within the application according to the user parameters: the SDK calls the Hongmeng system interface according to the user parameters to save the generated application unique identifier to the preference file corresponding to the application or the predefined file within the application; For example, the Hongmeng system interface called to save the application unique identifier is: put(this.mContext,this.applicationUUID, '1234567890ABCDEFGHIJK'); Step 105: Obtain device identification information of the smart device, and generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information.

[0019] In one practicable manner, obtaining the device identification information of the smart device specifically includes: obtaining information having an application unique identification attribute in the device identification information of the smart device; One feasible way to obtain the device identification information of the smart device is to call a Hongmeng system method to obtain the device identification information of the smart device; In this embodiment, the second preset algorithm is specifically: hash operation; the preset length is 16 bytes; Specifically, the information with the application unique identification attribute in the device identification information is: ODID (Open Device Identifier) or AAID (Anonymous Application Identifier). For example, the ODID is: 72c3fe8c-52db-ef13-b39a-e3d924e6f845; AAID is: c98a891f-e480-4c57-9924-81a1b0e817db; ODID is a developer-level, non-permanent device identifier provided by the HUAWEI Push Kit. ODID will be regenerated in the following scenarios: restoring the phone to factory settings, uninstalling and then reinstalling all apps from the same developer on the same device, or uninstalling and reinstalling HMS Core (APK). Apps from the same developer running on the same device have the same ODID, but apps from different developers on the same device have different ODIDs. Apps from the same developer on different devices have different ODIDs, and apps from different developers on different devices have different ODIDs. Specifically, call the OpenDeviceClient.getOdid() method in the Hongmeng system to obtain the ODID information; Among them, AAID identifies the application running on the device. Only the application can access the identifier, which only exists during the installation period of the application. Compared with the device-level hardware ID that cannot be reset, AAID has better privacy attributes. AAID is anonymized and has no privacy risks. It is not associated with any existing identifiers, and each application can only access its own AAID. AAID will change in the following scenarios, including but not limited to: uninstalling and reinstalling the application, calling the AAID deletion interface, user restoring factory settings, and user clearing application data; multiple applications from the same developer on the same device have different AAIDs, applications from different developers on the same device have different AAIDs, applications from the same developer on different devices have different AAIDs, and applications from different developers on different devices have different AAIDs. Specifically, call the HmsInstanceId.getAAID method in the Hongmeng system to obtain the AAID information; In one practicable manner, the device identification information includes first identification information and second identification information; Generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically comprises: the SDK obtains the first identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information; Alternatively, generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK obtains the second identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the second identification information; Specifically, after the SDK obtains the first identification information, the SDK further includes: determining whether the first identification information is obtained, and if so, generating data of a specified length as the application unique identifier according to the first identification information by using a second preset algorithm; if not, obtaining the second identification information, and generating data of a specified length as the application unique identifier according to the second identification information by using a second preset algorithm; Alternatively, after the SDK obtains the second identification information, the SDK further includes: determining whether the second identification information is obtained, and if so, generating data of a specified length as the application unique identifier based on the second identification information by using a second preset algorithm; if not, obtaining the first identification information, and generating data of a specified length as the application unique identifier based on the first identification information by using a second preset algorithm; Alternatively, generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK obtains the first identification information and the second identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information and the second identification information; Specifically, the first identification information is AAID, and the second identification information is ODID, or the first identification information is ODID, and the second identification information is AAID; In one practicable manner, generating data of a specified length as the application unique identifier using a second preset algorithm according to the first identification information specifically includes: generating data of a preset byte using the second preset algorithm according to the first identification information, and intercepting data of the specified length from the generated data of the preset byte as the application unique identifier; For example, generating data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information specifically includes: performing a hash operation on the first identification information by using a hash algorithm to obtain result data, and intercepting 16 bytes of data from the result data as the application unique identifier; In one practicable manner, generating data of a specified length as the application unique identifier using a second preset algorithm according to the second identification information specifically includes: generating data of a preset byte using a second preset algorithm according to the second identification information, and intercepting data of a specified length from the generated data of the preset byte as the application unique identifier; For example, generating data of a specified length as the application unique identifier according to the second identification information by using a second preset algorithm specifically includes: performing a hash operation on the second identification information by using a hash algorithm to obtain result data, and intercepting 16 bytes of data from the result data as the application unique identifier; In one practicable manner, before executing step 105, the step further includes: the SDK obtaining unique identification information of the security assurance service or device; Specifically, generating an application unique identifier of a specified length using a second preset algorithm according to the device identification information specifically includes: the SDK generates an application unique identifier of a specified length using a second preset algorithm according to the device identification information and the acquired unique identification information of the security assurance service or device.

[0020] The present invention provides a method for obtaining an application unique identifier based on the Hongmeng system. When the first interface of the SDK is called by an application in a smart device, the SDK determines whether any user parameters are passed in. If so, the saved application unique identifier is obtained or an application unique identifier is generated based on the user parameters. If no parameters are passed in, the Hongmeng system device identification information is obtained, and an application unique identifier is generated based on the Hongmeng system device identification information. This method can still generate a reliable application unique identifier when the system has no storage permission. Combined with the device identification information, the uniqueness of the application unique identifier is guaranteed, and replay attacks on smart devices are effectively defended.

[0021] Example 2 A second embodiment of the present invention provides a method for applying a unique application identifier based on the Hongmeng system, which is applicable to a system including a smart device equipped with the Hongmeng system and a security assurance service / device. Specifically, the unique application identifier is used to authenticate and bind the application on the smart device with the security assurance device / service, thereby ensuring the security of information transmission when the application on the smart device interacts with the security assurance device / service. In this implementation, the security assurance service / device specifically takes a Bluetooth device (such as a Bluetooth key) as an example to explain the method provided by this application in detail; The method of this embodiment is specifically executed by the SDK of the application on the smart device, such as Figure 2 The method for uniquely identifying an application based on the Hongmeng system specifically includes: Step 201: When the first interface of the SDK is called by the application to execute the first operation request, the SDK determines whether user parameters are passed in. If so, step 202 is executed; otherwise, step 205 is executed. Specifically, the first operation request includes a signature request, login authentication, transaction signature, certificate update, password verification, password change, and other requests; For example, when the first operation request is a signature request, the first interface is: sign(Context:Object, cert: FTUserCertInfo, hash: FTUserSignAlg, plain: string, type:FTSignResultType, callback: ResultCallback <string>): void; In one practicable manner, before the SDK determines whether the user parameter is passed in the first operation request, the SDK further includes: calling the HarmonyOS system interface to establish a Bluetooth connection with the Bluetooth device; Specifically, the SDK calls the Hongmeng system interface to establish a Bluetooth connection with the Bluetooth device, including: Step 2011: The SDK calls the Bluetooth scanning interface of the Hongmeng system to start scanning for Bluetooth devices. When a Bluetooth device is found, execute step 2012. Specifically, starting to scan for Bluetooth devices specifically includes: SDK scanning for Bluetooth devices through the HarmonyOS Bluetooth scanning interface; For example, the Bluetooth scanning interface of Hongmeng system is: ble.startBLEScan([scanFilter],scanOptions); In one practicable manner, before the SDK calls the Bluetooth scanning interface of the Hongmeng system, the SDK further includes: setting a callback function through the setting interface of the Hongmeng system to determine the Bluetooth device scanning result; For example, the interface is set to: ble.on('BLEDeviceFind', this.bleDeviceFindCallback), and the callback function is: this.bleDeviceFindCallback; Step 2012: The SDK calls the Bluetooth pairing interface of the Hongmeng system to pair with the scanned Bluetooth device; In one practicable manner, before pairing with the scanned Bluetooth device, the SDK further includes: checking whether the Bluetooth has been paired through a checking interface in the Bluetooth pairing interface; For example, the check interface is: connection.getPairedDevices; In one practicable manner, the Bluetooth device generates key information during the pairing process; Specifically, the key information is LTK (Long-Term Key), which is a 128-bit (16-byte) key generated during the Bluetooth pairing process. For example, the key information is: 1F2E3D4C5B6A798897A6B5C4D3E2F100; Step 2013: The SDK calls the Bluetooth connection interface of the Hongmeng system to establish a Bluetooth connection with the Bluetooth device; In one practicable manner, the SDK determines whether a user parameter is passed in as follows: when the first interface is called by the application, the SDK determines whether a parameter Context is passed in; Step 202: The SDK searches for the application's corresponding preference file or predefined file within the application based on the user parameters, and determines whether the application's unique identifier exists in the found file. If so, the SDK executes step 203; otherwise, the SDK executes step 204. In this embodiment, the preference file corresponding to the application is specifically preferences; Step 203: Get the saved application unique identifier and execute step 206; For example, the unique application identifier is: ac53db60a58450dc; Step 204: Generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to user parameters, and then execute step 206; In one practicable manner, generating an application unique identifier of a specified length by using a first preset algorithm specifically includes: the SDK generates a random number of the first preset length, obtains a timestamp, and generates data of the specified length as the application unique identifier by using the first preset algorithm based on the random number and the timestamp; Specifically, the application unique identifier of the specified length is a 16-byte character string; Step 205: Obtain device identification information of the smart device, generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and execute step 206; In one practicable manner, obtaining the device identification information of the smart device specifically includes: obtaining information having an application unique identification attribute in the device identification information of the smart device; One feasible way to obtain the device identification information of the smart device is to call a Hongmeng system method to obtain the device identification information of the smart device; In this embodiment, the second preset algorithm is specifically: hash operation; Specifically, the information with application unique identification attributes in the device identification information is: ODID (Open Device Identifier in Chinese, full name in English: Open Device Identifier) and AAID (Anonymous Application Identifier in Chinese, full name in English: Anonymous Application Identifier); For example, the ODID is: 72c3fe8c-52db-ef13-b39a-e3d924e6f845; AAID is: c98a891f-e480-4c57-9924-81a1b0e817db; Specifically, call the OpenDeviceClient.getOdid() method in the Hongmeng system to obtain the ODID information; Specifically, call the HmsInstanceId.getAAID method in the Hongmeng system to obtain the AAID information; In one practicable manner, the device identification information includes first identification information and second identification information; Generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically comprises: the SDK obtains the first identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information; Alternatively, generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK obtains the second identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the second identification information; Specifically, after the SDK obtains the first identification information, the SDK further includes: determining whether the first identification information is obtained, and if so, generating data of a specified length as the application unique identifier according to the first identification information by using a second preset algorithm; if not, obtaining the second identification information, and generating data of a specified length as the application unique identifier according to the second identification information by using a second preset algorithm; Alternatively, after the SDK obtains the second identification information, the SDK further includes: determining whether the second identification information is obtained, and if so, generating data of a specified length as the application unique identifier based on the second identification information by using a second preset algorithm; if not, obtaining the first identification information, and generating data of a specified length as the application unique identifier based on the first identification information by using a second preset algorithm; Alternatively, generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK obtains the first identification information and the second identification information, and generates data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information and the second identification information; Specifically, the first identification information is AAID, and the second identification information is ODID, or the first identification information is ODID, and the second identification information is AAID; In one practicable manner, generating data of a specified length as the application unique identifier using a second preset algorithm according to the first identification information specifically includes: generating data of a preset byte using the second preset algorithm according to the first identification information, and intercepting data of the specified length from the generated data of the preset byte as the application unique identifier; For example, generating data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information specifically includes: performing a hash operation on the first identification information by using a hash algorithm to obtain result data, and intercepting 16 bytes of data from the result data as the application unique identifier; In one practicable manner, generating data of a specified length as the application unique identifier using a second preset algorithm according to the second identification information specifically includes: generating data of a preset byte using a second preset algorithm according to the second identification information, and intercepting data of a specified length from the generated data of the preset byte as the application unique identifier; For example, generating data of a specified length as the application unique identifier according to the second identification information by using a second preset algorithm specifically includes: performing a hash operation on the second identification information by using a hash algorithm to obtain result data, and intercepting 16 bytes of data from the result data as the application unique identifier; In one practicable manner, when the SDK calls the Hongmeng system interface to establish a Bluetooth connection with the Bluetooth device, the SDK further includes: obtaining unique identification information of the Bluetooth device; In this embodiment, by incorporating device identification information into the generation of an application unique identifier, the uniqueness of the application can be guaranteed. Even if the application is uninstalled and then reinstalled on the device, the uniqueness of the application can be guaranteed through the device identification, thereby improving the security of application use.

[0022] Specifically, generating the application unique identifier of the specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK generates the application unique identifier of the specified length by using a second preset algorithm according to the acquired unique identification information of the Bluetooth device and the device identification information.

[0023] In this embodiment, the unique identification information of the Bluetooth device also participates in the generation of the application unique identification, thereby improving the security of the interaction between the application and the Bluetooth device; For example, the unique identification information of a Bluetooth device specifically includes a UUID (Chinese name: Universally Unique Identifier, English full name: Universally Unique Identifier), a Bluetooth MAC address, and a Bluetooth device serial number.

[0024] Step 206: SDK obtains factory information of the smart device; In one feasible way, obtaining the factory information of the smart device specifically includes obtaining the model and manufacturer information of the smart device; Step 207: The SDK sends the smart device factory information and the application unique identifier to the Bluetooth device. In one practicable manner, between step 206 and step 207, the SDK further includes: sending an instruction to obtain an initial key to the Bluetooth device, receiving the initial key returned by the Bluetooth device, generating a communication key based on the received initial key and saving the key, and all subsequent communication data between the SDK and the Bluetooth device are encrypted using the communication key; Specifically, the command format sent by the SDK to the Bluetooth device is: CCID protocol header + plain text; For example, the command sent by the SDK to the Bluetooth device is: 61160000000100000000 313233343536373839300000000000000000000000000000; The initial key response data returned by the Bluetooth device received by the SDK is: 828100000001000000012c4ab0e380e84756e09bfcf9d9502042864e2bcf8f4e100d509b572s5f4728b8a3a5be63d900197692eb83ee9db999acf9ab7070cb 14e500227212588ef1b039b9cb5a4e8356b210e8a089ba8f2840d4c0304b9be12daff9b5348e bca45172a30291a20c0a029b53b624be4eb7219r3f733e7e2460a1015be317460a8daf199795; In one practicable manner, the SDK generates a communication key based on the received initial key as follows: the SDK calculates the received initial key using a preset algorithm to obtain the communication key.

[0025] In this embodiment, the SDK sends the factory information of the smart device and the unique identifier of the application to the Bluetooth device specifically including: the SDK encrypts the factory information of the smart device and the unique identifier of the application using the communication key, and sends the encrypted data to the Bluetooth device; Specifically, the command format sent by the SDK to the Bluetooth device is: CCID protocol header + ciphertext; In one practicable method, the SDK encrypts the factory information of the smart device and the unique identifier of the application using the communication key. Specifically, the SDK uses the communication key to calculate the unique identifier of the application and the smart device information using a preset algorithm to obtain a data ciphertext. For example, the obtained data ciphertext is: 1048496D424C904E37DE53079C64F4EB4C63B25D5D68FA2451A90391EB39B09A183C9C691289B00363CB4ACC723E91C3D6; The data sent by the SDK to the Bluetooth device is: 613100000000010100001048496D424C904E37DE53079C64F4EB4C63B25D5D68FA2451A90391EB39B09A183C9C691289B00363CB4ACC723E91C3D6; In one practicable manner, after receiving the data, the Bluetooth device returns a response to the SDK. For example, the response data is: 82010000000101000001 64.

[0026] Step 208: The SDK sends a command to obtain Bluetooth device information to the Bluetooth device, generates verification data based on the received Bluetooth device information, smart device factory information, and application unique identifier, and sends the verification data to the Bluetooth device. In one practicable manner, the Bluetooth device performs binding authentication on the application based on the received verification data; In one practicable manner, the Bluetooth device information includes Bluetooth MAC data and Bluetooth key information; The Bluetooth key information is specifically the LTK generated by the Bluetooth device during the pairing process; For example, the command sent by the SDK to obtain Bluetooth device information is: 61110000000002020000 7A294C12307BBED66B22C50E140846C442; The data returned by the Bluetooth device is: 8221000000010200000d 44e8be7a2fc928c5b3d7ee051985f1212ec2adbaf82e6cb3d566002b3244ab5303; Specifically, the data in the Get Bluetooth Device Information command sent by the SDK to the Bluetooth device is encrypted using the generated communication key. Similarly, the data returned by the Bluetooth device is also encrypted using the communication key. In one practicable manner, the SDK generates verification data based on the received Bluetooth device information, smart device factory information, and application unique identifier, specifically including: the SDK performs a hash operation on the application unique identifier, the smart device factory information, and the Bluetooth device information to obtain a first hash value, and encrypts the application unique identifier, the smart device factory information, the Bluetooth device information, and the first hash value using a communication key to generate verification data; For example, the verification data generated by the SDK is: 61310000000003030000 989C355BF1A914AF4E5DB805CB141719B1F40DF8E0F0664051143D47809BCFF939A31DD6A5E4ED9B790C9D96DEF09123B6; In one practicable manner, after receiving the verification data, the Bluetooth device decrypts the verification data and verifies the decrypted data. If the verification is successful, a response indicating that the application has been successfully bound is returned to the SDK. If the verification is unsuccessful, a response indicating that the application has not been bound is returned to the SDK. Specifically, verifying the decrypted data includes: the Bluetooth device hashing the application unique identifier, the smart device factory information, and the Bluetooth device information to obtain a second hash value, and comparing the second hash value with the first hash value in the decrypted data. If the comparison is consistent, the verification is successful; if the comparison is inconsistent, the verification is unsuccessful; For example, the response data returned by the Bluetooth device to the SDK is: 8201000000010310000d 76; In one practicable manner, when the Bluetooth device authentication fails, the method further includes: generating and displaying a random code.

[0027] Step 209: The SDK receives the response data returned by the Bluetooth device and determines whether the Bluetooth device and the application have been successfully bound based on the response data. If so, the SDK performs the corresponding operation according to the first operation request and returns the operation result to the application. The process ends. Otherwise, the SDK executes step 210. In this embodiment, performing the corresponding operation according to the first operation request is specifically performing a signature operation according to the signature operation request. Specifically, performing the signature operation is specifically: the SDK sends the signature data to the Bluetooth device to perform the signature operation; Step 210: The SDK pops up an input box to receive the pairing code entered by the user based on the random code displayed on the Bluetooth device, and sends the pairing code to the Bluetooth device for verification; In one practicable manner, the SDK sends the pairing code to the Bluetooth device for verification, specifically including: the SDK encrypts the pairing code using a communication key and sends the code to the Bluetooth device, and waits for a response returned by the Bluetooth device; In one practicable manner, receiving the pairing code input by the user according to the random code displayed on the Bluetooth device is specifically that the SDK receives the pairing code input by the user that is consistent with the random code generated and displayed by the Bluetooth device; For example, the encrypted pairing code sent by the SDK to the Bluetooth device is: 61110000000004040000 DDF271B00C7C44D0DC33453EB03C8D4DA2; In one practicable manner, if the SDK does not receive the pairing code input by the user within a preset time period, an error message is displayed and the process ends; In one practicable manner, after the Bluetooth device receives the pairing code sent by the SDK, the Bluetooth device compares the pairing code with the generated random code, and returns a success response to the SDK if the comparison is consistent, or returns a failure response to the SDK if the comparison is inconsistent; In one practicable manner, after the Bluetooth device receives the encrypted pairing code sent by the SDK, the Bluetooth device decrypts the encrypted pairing code using a communication key, compares the decrypted pairing code with a generated random code, and returns a success response to the SDK if the comparison is consistent; otherwise, the Bluetooth device returns a failure response to the SDK; Specifically, if the comparison is inconsistent, the method further includes: the Bluetooth device generates and displays a new random code; In one practicable manner, after the Bluetooth devices are compared and found to be consistent, the method further includes: saving the application unique identifier, the factory information of the smart device, and the first hash value in a flash memory; In one practicable manner, after the Bluetooth device comparison is inconsistent, the further step includes: the Bluetooth device determining whether a preset number of verifications has been exceeded, and if so, shutting down, otherwise generating and displaying a new random code; Step 211: The SDK receives the response data returned by the Bluetooth device and determines whether the Bluetooth device and the application are successfully bound based on the response data. If so, the SDK performs the corresponding operation according to the first operation request and returns the operation result to the application. The process ends. Otherwise, the SDK prompts an error and ends. In one practicable manner, the error prompt may be replaced by: the SDK determines whether the preset number of verifications is exceeded, and if not, executes step 210 , and if yes, prompts an error.

[0028] In this embodiment, after returning the operation result to the application, the process further includes: disconnecting the SDK from the Bluetooth device; In this embodiment, after step 206, the data or data in the instruction sent by the SDK to the Bluetooth device are all encrypted with the generated communication key.

[0029] For specific implementations not limited in this embodiment 2, reference may be made to the description of embodiment 1.

[0030] The present invention provides a method for applying an application unique identifier based on the Hongmeng system. When the first interface of the SDK is called by the application, the SDK determines whether there are user parameters passed in. If there are parameters passed in, the SDK obtains the saved application unique identifier or generates an application unique identifier based on the user parameters. If there are no parameters passed in, the Hongmeng system device identification information is obtained, and the application unique identifier is generated based on the Hongmeng system device identification information. The generated application unique identifier is used to authenticate and bind with the Bluetooth device, effectively preventing replay attacks on smart devices. At the same time, the Bluetooth device information also participates in the generation of the application unique identifier, improving the security of the application when interacting with the security assurance device. This solution applies the generated application unique identifier to the binding between the application and the Bluetooth device. The Bluetooth device can authenticate through the previously saved application information. Each time the application is used, only the bound application can be used smoothly, effectively preventing the problem of unsafe information transmission when others use the same application on a new device to interact with the same Bluetooth device.

[0031] The following are embodiments of the apparatus of the present invention, which can be used to implement the embodiments of the method of the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, reference can be made to the embodiments of the method of the present invention.

[0032] An exemplary embodiment of the present invention provides a device for obtaining an application unique identifier based on the Hongmeng system, the device comprising: A first judgment module is used to judge whether there is a user parameter passed in when the first interface is called by the application, and trigger the first search module if the user parameter is passed in, and trigger the second generation module if the user parameter is passed in; A first search module is used to search for a preference file corresponding to an application or a predefined file within the application according to user parameters; A second judgment module is used to judge whether there is an application unique identifier in the file found by the first search module, and trigger the first acquisition module if the application unique identifier exists, and trigger the first generation module if the application unique identifier does not exist; A first acquisition module is used to acquire a saved application unique identifier; A first generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to user parameters; The second generating module is configured to obtain device identification information of the smart device and generate an application unique identifier of a specified length using a second preset algorithm according to the device identification information.

[0033] In one practicable manner, when the first generation module is used to generate an application unique identifier of a specified length through a first preset algorithm, it is specifically used to generate a random number of the first preset length, obtain a timestamp, and generate data of the specified length as the application unique identifier through the first preset algorithm based on the random number and the timestamp.

[0034] In one practicable manner, when the second generating module is used to obtain the device identification information of the smart device, it is specifically used to obtain information having an application unique identification attribute in the device information of the smart device.

[0035] In one practicable manner, the device identification information includes first identification information and second identification information; The second generating module is used to generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, specifically for obtaining the first identification information, and generating data of a specified length as the application unique identifier using the second preset algorithm based on the first identification information; The second generating module is used to generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, specifically to obtain the second identification information, and generate data of a specified length as the application unique identifier using a second preset algorithm based on the second identification information; The second generation module is used to generate an application unique identifier of a specified length according to the device identification information through a second preset algorithm, specifically to obtain the first identification information and the second identification information, and to generate data of a specified length as the application unique identifier according to the first identification information and the second identification information through a second preset algorithm.

[0036] In one practicable manner, the device further includes a third judgment module, configured to judge whether the input user parameter is a valid parameter, and if the user parameter is judged to be a valid parameter, trigger the first search module; if the user parameter is judged not to be a valid parameter, trigger the second generation module; In one practicable manner, the device also includes a second acquisition module for acquiring unique identification information of the security assurance service or device; the second generation module is specifically used to generate an application unique identification of a specified length through a second preset algorithm based on the device identification information and the acquired unique identification information of the security assurance service or device.

[0037] In another aspect, an exemplary embodiment of the present invention provides an application unique identification application device based on the Hongmeng system, the device comprising: A fourth determination module is configured to determine whether a user parameter is passed in the first operation request when the first interface is called by the application to request the execution of the first operation, and trigger the second search module if the user parameter is passed in; otherwise, trigger the fourth generation module; A second search module is used to search for a preference file corresponding to the application or a predefined file within the application according to user parameters; a fifth determination module, configured to determine whether the file found by the second search module contains an application unique identifier, and trigger the third acquisition module if the application unique identifier exists; and trigger the third generation module if the application unique identifier does not exist; A third acquisition module is used to obtain the saved application unique identifier and trigger the fourth acquisition module; A third generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to user parameters, thereby triggering a fourth acquiring module; A fourth generating module is configured to obtain device identification information of the smart device, generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and trigger the fourth acquiring module; The fourth acquisition module is used to obtain the factory information of the smart device; The first sending module is used to send the factory information of the smart device and the unique application identifier to the Bluetooth device; The second sending module is used to send a Bluetooth device information acquisition instruction to the Bluetooth device; A fifth generating module, configured to generate verification data based on the received Bluetooth device information, smart device factory information, and application unique identifier; A third sending module, configured to send the verification data to the Bluetooth device; The Bluetooth device uses the verification data to authenticate and bind the application; A first determining module is configured to receive authentication response data returned by the Bluetooth device, determine whether the Bluetooth device and the application are successfully bound based on the authentication response data, trigger the first operating module if the binding is successful, and trigger the fourth sending module if the binding is unsuccessful; A first operation module is configured to perform a corresponding operation according to the first operation request and return the operation result to the application; A fourth sending module is used to pop up an input box, receive the pairing code entered by the user through the random code displayed on the Bluetooth device, and send the pairing code to the Bluetooth device for verification; The second determination module is used to receive the verification result returned by the Bluetooth device, and determine whether the Bluetooth device and the application are successfully bound according to the verification result. If the binding is successful, the first operation module is triggered; if the binding is unsuccessful, an error message is prompted.

[0038] In one practicable manner, the device further includes a Bluetooth connection module, specifically configured to call a Bluetooth connection interface of the Hongmeng system to establish a Bluetooth connection with a Bluetooth device; In one practicable manner, the apparatus further includes a fifth acquisition module for acquiring unique identification information of a Bluetooth device; when the fourth generation module is configured to generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, the fourth generation module is configured to generate an application unique identifier of a specified length using the second preset algorithm based on the acquired unique identification information of the Bluetooth device and the device identification information; It should be noted that the application unique identifier acquisition device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the application unique identifier acquisition and application method. In actual application, the above-mentioned functions can be distributed as needed and completed by different functional modules, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the application unique identifier acquisition and application device provided in the above embodiment and the application unique identifier acquisition and application method embodiment are based on the same concept. The specific implementation process can be found in the method embodiment and will not be repeated here.

[0039] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0040] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the aforementioned method embodiments.

[0041] An embodiment of the present invention further provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned method embodiments. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic or optical card, a nanosystem (including a molecular memory IC), or any other type of medium or device suitable for storing instructions and / or data.

[0042] An embodiment of the present invention provides a computer program product, including a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of any of the aforementioned method embodiments.

[0043] In the present invention, the terms "first", "second", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or order; the term "plurality" refers to two or more, unless otherwise clearly defined. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. Terms such as "install", "connect", "connect", and "fix" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; "connection" can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0044] In the description of the present invention, it should be understood that the terms "upper" and "lower" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only used to facilitate the description of the present invention and simplify the description, rather than to indicate or imply that the device or unit referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they should not be understood as limiting the present invention.

[0045] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be readily conceived by a person skilled in the art within the technical scope disclosed in the present invention are intended to be covered by the scope of protection of the present invention. Therefore, equivalent modifications made according to the claims of the present invention are still within the scope of protection of the present invention.< / string>

Claims

1. A method for obtaining a unique identifier of an application based on the Hongmeng system, applicable to a smart device equipped with the Hongmeng system, characterized in that: The method includes the SDK of the application on the smart device executing the following steps: Step S1: When the first interface of the SDK is called by the application, the SDK determines whether user parameters are passed in. If so, step S2 is executed; otherwise, step S5 is executed. Step S2, the SDK searches for a preference file corresponding to the application or a predefined file within the application according to the user parameters, and determines whether the application unique identifier exists in the found file. If so, step S3 is executed; otherwise, step S4 is executed. Step S3: The SDK obtains the saved application unique identifier; Step S4: The SDK generates an application unique identifier of a specified length using a first preset algorithm, and saves the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameter; Step S5: The SDK obtains the device identification information of the smart device, and generates an application unique identifier of a specified length using a second preset algorithm according to the device identification information.

2. The method for obtaining a unique identifier of an application based on the Hongmeng system according to claim 1, wherein: The SDK generates an application unique identifier of a specified length through a first preset algorithm, specifically including: the SDK generates a random number of the first preset length, obtains a timestamp, and generates data of the specified length as the application unique identifier through the first preset algorithm according to the random number and the timestamp.

3. The method for obtaining a unique identifier of an application based on the Hongmeng system according to claim 1, wherein: The SDK acquiring the device identification information of the smart device specifically includes: the SDK acquiring information having an application unique identification attribute in the device information of the smart device.

4. The method for obtaining a unique identifier of an application based on the Hongmeng system according to claim 1, wherein: The device identification information includes first identification information and second identification information; Generating an application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: obtaining, by the SDK, the first identification information, and generating data of a specified length as the application unique identifier by using a second preset algorithm according to the first identification information; Alternatively, the generating of the application unique identifier of a specified length by using a second preset algorithm according to the device identification information specifically includes: the SDK obtaining the second identification information, and generating data of a specified length as the application unique identifier by using a second preset algorithm according to the second identification information; Or, the generating of an application unique identifier of a specified length through a second preset algorithm based on the device identification information specifically includes: the SDK obtaining the first identification information and the second identification information, and generating data of a specified length as an application unique identifier through a second preset algorithm based on the first identification information and the second identification information.

5. The method for obtaining a unique identifier of an application based on the Hongmeng system according to claim 1, wherein: Before executing step S2, the SDK also includes: determining whether the input user parameters are valid parameters, and if so, executing step S2; otherwise, executing step S5.

6. The method for obtaining a unique identifier of an application based on the Hongmeng system according to claim 1, wherein: Before executing step S5, the step further includes: the SDK obtaining unique identification information of the security assurance service or device; Generating an application unique identifier of a specified length using a second preset algorithm based on the device identification information specifically includes: the SDK generating an application unique identifier of a specified length using a second preset algorithm based on the device identification information and the acquired unique identification information of the security assurance service or device.

7. A method for uniquely identifying an application based on the Hongmeng system, which is applicable to a system including smart devices and Bluetooth devices of the Hongmeng system, and is characterized in that: The method includes the SDK of the application on the smart device executing the following steps: Step P1: When the first interface of the SDK is called by the application to execute a first operation request, the SDK determines whether there are user parameters passed in the first operation request. If so, step P2 is executed; otherwise, step P5 is executed. Step P2: The SDK searches for a preference file corresponding to the application or a predefined file within the application according to the user parameters, and determines whether the application unique identifier exists in the found file. If so, step P3 is executed; otherwise, step P4 is executed. Step P3: The SDK obtains the unique identifier of the application and executes step P6; Step P4: The SDK generates an application unique identifier of a specified length using a first preset algorithm, and saves the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameters, and then executes step P6; Step P5: The SDK obtains the device identification information of the smart device, generates an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and then executes step P6; Step P6: The SDK obtains factory information of the smart device; Step P7: The SDK sends the smart device factory information and the application unique identifier to the Bluetooth device; Step P8: The SDK sends a Bluetooth device information acquisition instruction to the Bluetooth device, generates verification data based on the received Bluetooth device information, the smart device factory information, and the application unique identifier, and sends the verification data to the Bluetooth device. The Bluetooth device performs binding authentication on the application based on the verification data. Step P9: The SDK receives authentication response data returned by the Bluetooth device, and determines whether the Bluetooth device and the application are successfully bound based on the authentication response data. If so, the SDK performs a corresponding operation based on the first operation request and returns the operation result to the application. The process ends; if not, the SDK performs step P10. Step P10: The SDK pops up an input box to receive the pairing code entered by the user based on the random code displayed on the Bluetooth device, and sends the pairing code to the Bluetooth device for verification; Step P11, the SDK receives the verification result returned by the Bluetooth device, and determines whether the Bluetooth device is successfully bound to the application based on the verification result. If so, the SDK performs the corresponding operation according to the first operation request and returns the operation result to the application. If not, the SDK prompts an error and ends.

8. The unique application identification method based on the Hongmeng system according to claim 7 is characterized in that: When the SDK calls the Hongmeng system interface to establish a Bluetooth connection with the Bluetooth device, the SDK also includes: obtaining unique identification information of the Bluetooth device; In step P6, generating an application unique identifier of a specified length using a second preset algorithm based on the device identification information specifically includes: the SDK generating an application unique identifier of a specified length using a second preset algorithm based on the acquired unique identification information of the Bluetooth device and the device identification information.

9. The unique application identification method based on the Hongmeng system according to claim 7 is characterized in that: Before the SDK determines whether there are user parameters passed in the first operation request, it also includes: the SDK calls the Hongmeng system interface to establish a Bluetooth connection with the Bluetooth device.

10. A device for obtaining an application unique identifier based on the Hongmeng system, characterized in that: The device is implemented by the method for obtaining the unique identifier of an application based on the Hongmeng system according to any one of claims 1 to 6, and the device includes: A first judgment module is used to judge whether there are user parameters passed in when the first interface is called by the application, and trigger the first search module if the user parameters are passed in, and trigger the second generation module if the user parameters are not passed in; The first search module is configured to search for a preference file or a predefined file within the application corresponding to the application according to the user parameters; a second determining module, configured to determine whether an application unique identifier exists in the file found by the first searching module, and triggering the first acquiring module if the application unique identifier exists; and triggering the first generating module if the application unique identifier does not exist; The first acquisition module is used to acquire the saved application unique identifier; The first generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameters; The second generating module is configured to obtain device identification information of the smart device, and generate an application unique identifier of a specified length using a second preset algorithm according to the device identification information.

11. An application unique identification application device based on Hongmeng system, characterized in that: The device is implemented using the unique application identification application method based on the Hongmeng system according to any one of claims 7 to 9, and the device includes: a fourth determining module, configured to determine, when the first interface is called by the application to execute the first operation request, whether a user parameter is passed in the first operation request, trigger the second searching module if a user parameter is passed in, and trigger the fourth generating module if no user parameter is passed in; The second search module is used to search for a preference file corresponding to the application or a predefined file within the application according to the user parameters; a fifth determination module, configured to determine whether an application unique identifier exists in the file found by the second search module, and trigger the third acquisition module if the application unique identifier exists; and trigger the third generation module if the application unique identifier does not exist; The third acquisition module is used to acquire the saved application unique identifier and trigger the fourth acquisition module; The third generating module is configured to generate an application unique identifier of a specified length using a first preset algorithm, and save the generated application unique identifier to a preference file corresponding to the application or a predefined file within the application according to the user parameter, thereby triggering the fourth acquiring module; The fourth generating module is configured to obtain device identification information of the smart device, generate an application unique identifier of a specified length using a second preset algorithm based on the device identification information, and trigger the fourth obtaining module; The fourth acquisition module is used to obtain factory information of the smart device; A first sending module, configured to send the factory information of the smart device and the unique identifier of the application to the Bluetooth device; A second sending module, configured to send an instruction to obtain Bluetooth device information to the Bluetooth device; a fifth generating module, configured to generate verification data based on the received Bluetooth device information, the factory information of the smart device, and the unique identifier of the application; A third sending module is used to send the verification data to the Bluetooth device, so that the Bluetooth device performs binding authentication on the application; a first determining module, configured to receive authentication response data returned by the Bluetooth device, determine whether the Bluetooth device and the application have been successfully bound based on the authentication response data, trigger the first operating module if the binding is determined to be successful, and trigger the fourth sending module if the binding is determined to be unsuccessful; The first operation module is configured to perform a corresponding operation according to the first operation request and return an operation result to the application; The fourth sending module is configured to pop up an input box, receive a pairing code input by a user according to a random code displayed on the Bluetooth device, and send the pairing code to the Bluetooth device for verification; The second determination module is used to receive the verification result returned by the Bluetooth device, determine whether the Bluetooth device and the application are successfully bound according to the verification result, trigger the first operation module if the binding is successful, and prompt an error if the binding is unsuccessful.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the method according to any one of claims 1 to 9.

13. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data acquisition software identification method and device

    CN106648913A

  • Binding method of intelligent equipment, identity authentication platform and storage medium

    CN108768970A

  • Uniqueness identification method and device of application, storage medium and terminal

    CN116232610A

  • Identity authentication method and device for swan application

    CN119475317A

  • Method and device for communication between swan gap system equipment and Bluetooth equipment

    CN120111465A