An application unique identification acquisition and application method and device based on a honkong system

By using SDK to judge user parameters and using the Harmony system device identifier to generate a unique application identifier, the problem of obtaining application uniqueness on the Harmony system is solved, replay attacks are prevented, and interaction security is improved.

CN120456030BActive Publication Date: 2025-10-10FEITIAN TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

On the HarmonyOS system, how to obtain the unique identifier of the application to ensure the uniqueness of the application, especially to defend against replay attacks and improve security during the interaction process.

Method used

The SDK is used to determine whether user parameters are passed in. If so, the application's unique identifier is obtained or generated. If not, the unique identifier is generated using the Hongmeng system device identification information, and the device identification information is combined with the generation process to ensure uniqueness.

Benefits of technology

When the system has no storage permission, it can still generate a reliable unique identifier for the application, defend against replay attacks, and improve the security of the interaction between the application and the security device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120456030B_ABST
    Figure CN120456030B_ABST
Patent Text Reader

Abstract

The application provides an application unique identifier acquisition and application method and device based on a Hongmeng system. When a first interface of an SDK is called by an application in a smart device, the SDK determines whether a user parameter is input. If the user parameter is input, an application unique identifier saved or generated according to the user parameter is acquired. If the user parameter is not input, Hongmeng system device identifier information is acquired, and an application unique identifier is generated according to the Hongmeng system device identifier information. The method can generate a reliable application unique identifier when the application has no system storage permission. The uniqueness of the application unique identifier is ensured in combination with the device identifier information, replay attacks on the smart device are effectively prevented, meanwhile, the unique identifier information of the security guarantee service / device also participates in the generation of the application unique identifier, and therefore the security when the application interacts with the security guarantee service / device 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:

[0005] 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.

[0006] 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.

[0007] Step S3: The SDK obtains the saved application unique identifier;

[0008] 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;

[0009] 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.

[0010] 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:

[0011] 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.

[0012] 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.

[0013] Step P3: The SDK obtains the unique identifier of the application and executes step P6;

[0014] 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;

[0015] 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;

[0016] Step P6: The SDK obtains factory information of the smart device;

[0017] Step P7: The SDK sends the smart device factory information and the application unique identifier to the Bluetooth device;

[0018] 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.

[0019] 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.

[0020] Step P10, the SDK pops up an input box, receives a pairing code input by the user according to the random code displayed on the Bluetooth device, and sends the pairing code to the Bluetooth device for verification.

[0021] Step P11, the SDK receives the verification result returned by the Bluetooth device, determines whether the Bluetooth device and the application are successfully bound according to the verification result, executes a corresponding operation according to the first operation request if yes, returns an operation result to the application, and prompts an error if no, and ends.

[0022] According to a third aspect of the present application, an application unique identifier acquisition device based on a Hongmeng system is provided, and the device comprises:

[0023] A first judgment module is configured to, when a first interface is called by an application, judge whether a user parameter is input, trigger a first finding module if the user parameter is input, and trigger a second generation module if the user parameter is not input.

[0024] The first finding module is configured to find a preference file corresponding to the application or an application-internal pre-defined file according to the user parameter.

[0025] A second judgment module is configured to judge whether an application unique identifier exists in the file found by the first finding module, trigger a first acquisition module if the application unique identifier exists, and trigger a first generation module if the application unique identifier does not exist.

[0026] The first acquisition module is configured to acquire the saved application unique identifier.

[0027] The first generation module is configured to generate an application unique identifier of a specified length through a first preset algorithm, and save the generated application unique identifier into the preference file corresponding to the application or the application-internal pre-defined file according to the user parameter.

[0028] The second generation module is configured to acquire device identification information of the smart device, and generate an application unique identifier of a specified length through a second preset algorithm according to the device identification information.

[0029] According to a fourth aspect of the present application, an application unique identifier application device based on a Hongmeng system is provided, and the device comprises:

[0030] A fourth judgment module is configured to, when a first interface is called by an application to request execution of a first operation request, judge whether a user parameter is input in the first operation request, trigger a second finding module if the user parameter is input, and trigger a fourth generation module if the user parameter is not input.

[0031] 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;

[0032] 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;

[0033] The third acquisition module is used to acquire the saved application unique identifier and trigger the fourth acquisition module;

[0034] 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;

[0035] 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;

[0036] The fourth acquisition module is used to obtain factory information of the smart device;

[0037] 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;

[0038] A second sending module, configured to send an instruction to obtain Bluetooth device information to the Bluetooth device;

[0039] 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;

[0040] 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;

[0041] 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;

[0042] 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;

[0043] 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;

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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.

[0048] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0049] 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

[0050] 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.

[0051] Figure 1 This is a flowchart of a method for obtaining a unique identifier of an application based on the Hongmeng system provided in the first embodiment of the present invention;

[0052] Figure 2This 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

[0053] 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.

[0054] 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.

[0055] Example 1

[0056] 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.

[0057] 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:

[0058] 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.

[0059] 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;

[0060] 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.

[0061] For example, the user parameter may also include length, specifically the length of generating the application unique identifier;

[0062] Step 102: Search the preference file or predefined file in the application corresponding to the application according to the user parameters, and determine whether the application unique identifier exists in the found file. If so, execute step 103; otherwise, execute step 104;

[0063] In this embodiment, the preference file corresponding to the application is specifically preferences;

[0064] 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;

[0065] 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,'');

[0066] 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;

[0067] 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.

[0068] Step 103: Obtain the saved application unique identifier;

[0069] For example, the obtained application unique identifier is: ac53db60a58450dc;

[0070] 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;

[0071] 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;

[0072] 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;

[0073] 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;

[0074] The first preset algorithm is the SHA-1 hash algorithm;

[0075] 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;

[0076] For example, the Hongmeng system interface called to save the application unique identifier is: put(this.mContext,this.applicationUUID, '1234567890ABCDEFGHIJK');

[0077] 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.

[0078] 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;

[0079] 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;

[0080] In this embodiment, the second preset algorithm is specifically: hash operation; the preset length is 16 bytes;

[0081] Specifically, the information with the application unique identifier attribute in the device identifier information is specifically: an ODID (Chinese: Open Device Identifier, English full name: Open Device Identifier) or an AAID (Chinese: Anonymous Application Identifier, English full name: Anonymous Application Identifier);

[0082] For example, the ODID is: 72c3fe8c-52db-ef13-b39a-e3d924e6f845;

[0083] The AAID is: c98a891f-e480-4c57-9924-81a1b0e817db;

[0084] The ODID is a non-permanent device identifier provided by HUAWEI Push Kit at the developer level, and the ODID is regenerated in the following scenarios: factory reset of the mobile phone, reinstallation of all applications of the same developer on the same device after uninstallation, uninstallation and reinstallation of HMS Core (APK); the ODIDs of the applications of the same developer running on the same device are the same, the ODIDs of the applications of different developers running on the same device are different, the ODIDs of the applications of the same developer running on different devices are different, and the ODIDs of the applications of different developers running on different devices are different.

[0085] Specifically, the ODID information is obtained by calling the OpenDeviceClient.getOdid() method in the HarmonyOS system.

[0086] The AAID identifies the application running on the device, and only the application can access the identifier. The AAID exists only in the installation period of the application, has better privacy attribute compared with the device-level hardware ID that cannot be reset, is anonymized and has no privacy risk, is not associated with any existing identifier, and each application can only access its own AAID. The AAID changes in the following scenarios including but not limited to: application uninstallation and reinstallation, calling of the AAID deletion interface, user factory reset, and user clearing of application data; the AAIDs of multiple applications of the same developer on the same device are different, the AAIDs of the applications of different developers on the same device are different, the AAIDs of the applications of the same developer on different devices are different, and the AAIDs of the applications of different developers on different devices are different.

[0087] Specifically, the AAID information is obtained by calling the HmsInstanceId.getAAID method in the HarmonyOS system.

[0088] In an implementable manner, the device identifier information includes first identifier information and second identifier information.

[0089] 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;

[0090] 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;

[0091] 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;

[0092] 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;

[0093] 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;

[0094] 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;

[0095] 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;

[0096] 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;

[0097] 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;

[0098] 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;

[0099] 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;

[0100] 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.

[0101] 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.

[0102] Example 2

[0103] 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.

[0104] 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;

[0105] 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:

[0106] 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.

[0107] Specifically, the first operation request includes a signature request, login authentication, transaction signature, certificate update, password verification, password change, and other requests;

[0108] 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;

[0109] 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;

[0110] Specifically, the SDK calls the Hongmeng system interface to establish a Bluetooth connection with the Bluetooth device, including:

[0111] 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.

[0112] Specifically, starting to scan for Bluetooth devices specifically includes: SDK scanning for Bluetooth devices through the HarmonyOS Bluetooth scanning interface;

[0113] For example, the Bluetooth scanning interface of Hongmeng system is: ble.startBLEScan([scanFilter],scanOptions);

[0114] 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;

[0115] For example, the interface is set to: ble.on('BLEDeviceFind', this.bleDeviceFindCallback), and the callback function is: this.bleDeviceFindCallback;

[0116] Step 2012: The SDK calls the Bluetooth pairing interface of the Hongmeng system to pair with the scanned Bluetooth device;

[0117] 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;

[0118] For example, the check interface is: connection.getPairedDevices;

[0119] In one practicable manner, the Bluetooth device generates key information during the pairing process;

[0120] Specifically, the key information is LTK (Long-Term Key), which is a 128-bit (16-byte) key generated during the Bluetooth pairing process.

[0121] For example, the key information is: 1F2E3D4C5B6A798897A6B5C4D3E2F100;

[0122] Step 2013: The SDK calls the Bluetooth connection interface of the Hongmeng system to establish a Bluetooth connection with the Bluetooth device;

[0123] 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;

[0124] 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.

[0125] In this embodiment, the preference file corresponding to the application is specifically preferences;

[0126] Step 203: Get the saved application unique identifier and execute step 206;

[0127] For example, the unique application identifier is: ac53db60a58450dc;

[0128] 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;

[0129] 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;

[0130] Specifically, the application unique identifier of the specified length is a 16-byte character string;

[0131] 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;

[0132] 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;

[0133] 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;

[0134] In this embodiment, the second preset algorithm is specifically a hash operation.

[0135] Specifically, the information with the application unique identifier attribute in the device identifier information is specifically an ODID (Chinese: Open Device Identifier, English full name: Open Device Identifier) and an AAID (Chinese: Anonymous Application Identifier, English full name: Anonymous Application Identifier).

[0136] For example, the ODID is 72c3fe8c-52db-ef13-b39a-e3d924e6f845.

[0137] The AAID is c98a891f-e480-4c57-9924-81a1b0e817db.

[0138] Specifically, the ODID information is obtained by calling an OpenDeviceClient.getOdid() method in the HarmonyOS.

[0139] Specifically, the AAID information is obtained by calling an HmsInstanceId.getAAID method in the HarmonyOS.

[0140] In an implementable manner, the device identifier information includes first identifier information and second identifier information.

[0141] According to the device identifier information, the application unique identifier of the specified length is generated by the second preset algorithm. Specifically, the SDK obtains the first identifier information, and generates data of a specified length as the application unique identifier by the second preset algorithm according to the first identifier information.

[0142] Alternatively, according to the device identifier information, the application unique identifier of the specified length is generated by the second preset algorithm, specifically including: the SDK obtains the second identifier information, and generates data of a specified length as the application unique identifier by the second preset algorithm according to the second identifier information.

[0143] Specifically, after the SDK obtains the first identifier information, the SDK further includes: the SDK judges whether the first identifier information is obtained, if yes, generates data of a specified length as the application unique identifier by the second preset algorithm according to the first identifier information, and if not, obtains the second identifier information, and generates data of a specified length as the application unique identifier by the second preset algorithm according to the second identifier information.

[0144] 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;

[0145] 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;

[0146] 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;

[0147] 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;

[0148] 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;

[0149] 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;

[0150] 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;

[0151] 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;

[0152] 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.

[0153] 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.

[0154] 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;

[0155] 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.

[0156] Step 206: SDK obtains factory information of the smart device;

[0157] In one feasible way, obtaining the factory information of the smart device specifically includes obtaining the model and manufacturer information of the smart device;

[0158] Step 207: The SDK sends the smart device factory information and the application unique identifier to the Bluetooth device.

[0159] 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;

[0160] Specifically, the command format sent by the SDK to the Bluetooth device is: CCID protocol header + plain text;

[0161] For example, the command sent by the SDK to the Bluetooth device is: 61160000000100000000 313233343536373839300000000000000000000000000000;

[0162] The initial key response data returned by the Bluetooth device received by the SDK is: 828100000001000000012c4ab0e380e84756e09bfcf9d9502042864e2bcf8f4e100d509b572s5f4728b8a3a5be63d900197692eb83ee9db999acf9ab7070cb 14e500227212588ef1b039b9cb5a4e8356b210e8a089ba8f2840d4c0304b9be12daff9b5348e bca45172a30291a20c0a029b53b624be4eb7219r3f733e7e2460a1015be317460a8daf199795;

[0163] 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.

[0164] 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;

[0165] Specifically, the command format sent by the SDK to the Bluetooth device is: CCID protocol header + ciphertext;

[0166] 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.

[0167] For example, the obtained data ciphertext is: 1048496D424C904E37DE53079C64F4EB4C63B25D5D68FA2451A90391EB39B09A183C9C691289B00363CB4ACC723E91C3D6;

[0168] The data sent by the SDK to the Bluetooth device is: 613100000000010100001048496D424C904E37DE53079C64F4EB4C63B25D5D68FA2451A90391EB39B09A183C9C691289B00363CB4ACC723E91C3D6;

[0169] 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.

[0170] 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.

[0171] In one practicable manner, the Bluetooth device performs binding authentication on the application based on the received verification data;

[0172] In one practicable manner, the Bluetooth device information includes Bluetooth MAC data and Bluetooth key information;

[0173] The Bluetooth key information is specifically the LTK generated by the Bluetooth device during the pairing process;

[0174] For example, the command sent by the SDK to obtain Bluetooth device information is: 61110000000002020000 7A294C12307BBED66B22C50E140846C442;

[0175] The data returned by the Bluetooth device is: 8221000000010200000d 44e8be7a2fc928c5b3d7ee051985f1212ec2adbaf82e6cb3d566002b3244ab5303;

[0176] 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.

[0177] 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;

[0178] For example, the verification data generated by the SDK is: 61310000000003030000 989C355BF1A914AF4E5DB805CB141719B1F40DF8E0F0664051143D47809BCFF939A31DD6A5E4ED9B790C9D96DEF09123B6;

[0179] In an implementable manner, after receiving the verification data, the Bluetooth device decrypts the verification data, verifies the decrypted data, returns an application binding success response to the SDK if the verification is successful, and returns an application binding failure response to the SDK if the verification is unsuccessful.

[0180] Specifically, verifying the decrypted data specifically includes: the Bluetooth device hashes the application unique identifier, the smart device factory information, and the Bluetooth device information to obtain a second hash value, and compares the second hash value with a first hash value in the decrypted data, and if the comparison is consistent, the verification is successful, and if the comparison is inconsistent, the verification is unsuccessful.

[0181] For example, the response data returned by the Bluetooth device to the SDK is: 8201000000010310000d 76.

[0182] In an implementable manner, when the Bluetooth device verification is unsuccessful, it further includes: generating and displaying a random code.

[0183] Step 209, the SDK receives the response data returned by the Bluetooth device, determines whether the Bluetooth device and the application have been successfully bound according to the response data, and if so, performs a corresponding operation according to the first operation request, returns the operation result to the application, and ends, otherwise, executes step 210.

[0184] In this embodiment, performing a corresponding operation according to the first operation request specifically includes performing a signature operation according to a signature operation request, and specifically, performing the signature operation specifically includes: the SDK sends the signature data to the Bluetooth device to perform the signature operation.

[0185] Step 210, the SDK pops up an input box, receives a pairing code input by the user according to the random code displayed on the Bluetooth device, and sends the pairing code to the Bluetooth device for verification.

[0186] In an implementable manner, the SDK sends the pairing code to the Bluetooth device for verification specifically includes: the SDK encrypts the pairing code through a communication key and sends it to the Bluetooth device, and waits to receive the response returned by the Bluetooth device.

[0187] In an implementable manner, receiving the pairing code input by the user according to the random code displayed on the Bluetooth device specifically includes: the SDK receives the pairing code input by the user, which is consistent with the random code generated and displayed by the Bluetooth device.

[0188] For example, the encrypted pairing code sent by the SDK to the Bluetooth device is: 61110000000004040000 DDF271B00C7C44D0DC33453EB03C8D4DA2.

[0189] 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;

[0190] 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;

[0191] 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;

[0192] Specifically, if the comparison is inconsistent, the method further includes: the Bluetooth device generates and displays a new random code;

[0193] 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;

[0194] 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;

[0195] 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.

[0196] 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.

[0197] In this embodiment, after returning the operation result to the application, the process further includes: disconnecting the SDK from the Bluetooth device;

[0198] 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.

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

[0200] 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.

[0201] 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.

[0202] An exemplary embodiment of the present invention provides a device for obtaining an application unique identifier based on the Hongmeng system, the device comprising:

[0203] 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;

[0204] 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;

[0205] 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;

[0206] A first acquisition module is used to acquire a saved application unique identifier;

[0207] 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;

[0208] 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.

[0209] 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.

[0210] 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.

[0211] In one practicable manner, the device identification information includes first identification information and second identification information;

[0212] 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;

[0213] The second generating module is used to generate an application unique identifier of a specified length using a second preset algorithm according to 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 according to the second identification information;

[0214] 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.

[0215] 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;

[0216] In one practicable manner, the device further includes a second acquisition module for acquiring unique identification information of a 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.

[0217] 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:

[0218] 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;

[0219] 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;

[0220] 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;

[0221] A third acquisition module is used to obtain the saved application unique identifier and trigger the fourth acquisition module;

[0222] 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;

[0223] 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;

[0224] The fourth acquisition module is used to obtain the factory information of the smart device;

[0225] The first sending module is used to send the factory information of the smart device and the unique application identifier to the Bluetooth device;

[0226] The second sending module is used to send a Bluetooth device information acquisition instruction to the Bluetooth device;

[0227] A fifth generating module, configured to generate verification data based on the received Bluetooth device information, smart device factory information, and application unique identifier;

[0228] A third sending module, configured to send the verification data to the Bluetooth device;

[0229] The Bluetooth device uses the verification data to authenticate and bind the application;

[0230] 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;

[0231] 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;

[0232] 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;

[0233] 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.

[0234] 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;

[0235] 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;

[0236] 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.

[0237] 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.

[0238] 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.

[0239] The embodiment of the present application further provides a computer readable storage medium, which stores computer programs / instructions, and the programs / instructions are executed by a processor to realize the steps of the method of any of the foregoing embodiments. The computer readable storage medium can include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nano system (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0240] The embodiment of the present application provides a computer program product, which includes computer programs / instructions, and the computer programs / instructions are executed by a processor to realize the steps of the method of any of the foregoing embodiments.

[0241] In the present application, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or sequence; the term "multiple" refers to two or more, unless otherwise explicitly limited. The term "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A existing alone, A and B existing together, and B existing alone. The character " / " generally represents a "or" relationship between the front and rear associated objects. The terms "mounting", "connecting", "connecting", "fixing", and the like should be understood in a broad sense, for example, "connecting" can be fixed connection, or detachable connection, or integral connection; "connecting" can be direct connection, or indirect connection through an intermediate medium. For those skilled in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0242] In the description of the present application, it should be understood that the positions or location relationships indicated by the terms "upper", "lower", and the like are based on the positions or location relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or units referred to must have a particular direction, be constructed and operated in a particular orientation, therefore, cannot be understood as a limitation on the present application.

[0243] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any skilled person in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.< / string>

Claims

1. 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.

2. The unique application identification method based on the Hongmeng system according to claim 1 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 P5, 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.

3. The unique application identification method based on the Hongmeng system according to claim 1 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.

4. The unique application identification method based on the Hongmeng system according to claim 1 is characterized in that: 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 unique application identification method based on the Hongmeng system according to claim 1 is characterized in that: Before executing step P2, the SDK also includes: determining whether the input user parameters are valid parameters, and if so, executing step P2; otherwise, executing step P5.

6. The unique application identification method based on the Hongmeng system according to claim 1 is characterized in that: Before executing step P5, the SDK also includes: 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. 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 1 to 6, 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.

8. 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 6.

9. 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 6 is implemented.

10. 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 6 is implemented.

Citation Information

Patent Citations

  • Data acquisition software identification method and device

    CN106648913A