OpenHarmony platform-based offline component anti-piracy method
By generating and binding the activation code of the device's hardware unique code, and implementing component registration and activation code verification on the OpenHarmony platform, the complexity and security of equipment offline activation are solved, and the rapid, secure activation and intellectual property rights of components are achieved. Protection improves the security of user experience and activation code.
Patent Information
- Application Number
- CN202411160310.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-03
AI Technical Summary
In the development of OpenHarmony product, the component activation of the device is complicated when offline, data is easily lost, activation code query efficiency, poor scalability and poor security. In particular, the activation code cannot be bound to the device, resulting in the inability to effectively prevent it. Pirated version.
By generating an activation code based on the device hardware unique code and binding it with components, using encrypted transmission and storage, setting up SA services for component registration and activation code verification, providing component list query interface, realizing offline activation and activation of components Code updated.
It realizes no sense, fast and secure offline activation of device components, protects the intellectual property rights of developers, ensures the security and recoverability of activation codes, simplifies the pre-factory activation code preset process, and improves user experience.
Smart Images

Figure CN119066637A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an anti-piracy method for offline components based on an OpenHarmony platform. Background Art
[0002] During the development of OpenHarmony products, devices sometimes need to solve the use authorization problem. In most cases, the device can solve the component use authorization problem by connecting to the network. For devices that restrict access to the network during use, the problem of offline component activation can be solved by presetting the component activation code once before leaving the factory, or by manually importing the activation code by the user. However, these two methods have the following defects: 1) Complex operation: Whether the activation code is preset once at the factory or the user manually imports the activation code, it will increase the usage process and lead to a poor experience; 2) Data is easy to lose: The activation code data stored in the user area will be lost when the system is reset or user data is cleared, and needs to be manually imported again; 3) Low efficiency in querying activation codes: The query or reading efficiency of batch device activation codes stored in the device's non-volatile memory (such as EEPROM or special system partition) is low; 4) Poor scalability: The offline activation code has a single function, cannot expand the sub-function module control, and has poor portability; 5) Poor security: Components cannot be bound to devices, and any activation code within the range can be used. Summary of the invention
[0003] In view of the above problems, the present invention proposes an anti-piracy method for offline components based on the OpenHarmony platform.
[0004] The method for preventing piracy of offline components based on the OpenHarmony platform of the present invention is characterized in that the component management platform adopts the OpenHarmony architecture, and the method includes the following processes: 1) Generate activation code: The unique hardware code of the device is a combination of the motherboard serial number, CPU serial number and FlashID. In the component management platform, each component is bound to the unique hardware code of the device, and an activation code is generated based on the unique hardware code of the device. The activation code also includes: component ID, component version, running system version, component activation code type, validity period, function code, and the activation code is stored in text form; 2) Storing activation codes: Export activation code files in batches from the component management platform and pre-populate them in the specified partition of the system as the component activation code dictionary; 3) Component identification: The activation code is stored in the non-volatile memory of the device. The device sets up an SA service for component registration, activation code verification, and component statistics. The SA service has the authority to access the component activation code dictionary. When the component is enabled, the OpenHarmony system receives component registration information, activation code verification information, and component statistics. 4) Component activation: Each time a component is used, the component activation code needs to be verified; the component registration SA service provides a register registration interface for components to use, and also provides a component list query interface for other processes to use Specifically, in step 1) or step 2), the component activation code is transmitted and stored in encrypted form, and the device uses the same encryption and decryption algorithm and key.
[0005] Specifically, in step 3), the default function code is 0. When the component starts, the SA service interface is first called to register the component information to the SA service, and the function code parsed by the service is assigned to the function code inside the component.
[0006] Specifically, step 4) component activation provides c / c++ and NAPI interfaces, and is compatible with component online activation and activation code update.
[0007] This method realizes the seamless, rapid and safe activation of offline device components by presetting batch device activation codes, and its beneficial effects are: No network authentication: Even if there is no Internet access, each component can be authenticated offline through the preset activation code to ensure normal use of the component; Intellectual property protection: Components are bound to devices through activation codes. Only activated components can be used, preventing components from being used by unauthorized devices and protecting the developer's intellectual property rights. Activation code presetting: Before the equipment leaves the factory, presetting the activation code of batch equipment components reduces the process and complexity of chip burning and resetting; Automatic identification and verification: The device can automatically identify the activation code file, and the component activation and identification is fast, occupying very few system resources. The user is unaware of the whole process, and the experience is friendly; The activation code can be restored: the component activation code will not be affected by system reset, system upgrade, or clearing user data; Encrypted storage: Component activation code information is stored in encrypted form to prevent unauthorized reading or tampering. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a flowchart of the activation code recognition process of the present invention.
[0009] Figure 2 It is a flowchart of the activation process of the present invention. DETAILED DESCRIPTION
[0010] Embodiment 1: A method for preventing piracy of offline components based on the OpenHarmony platform, characterized in that the component management platform adopts the OpenHarmony architecture, and the method includes the following process: 1) Generate activation code: The unique hardware code of the device is a combination of the motherboard serial number, CPU serial number and FlashID. In the component management platform, each component is bound to the unique hardware code of the device, and an activation code is generated based on the unique hardware code of the device. One component has one activation code, and components do not affect each other. The activation code also includes: component ID, component version, running system version, component activation code type, validity period, function code, and the activation code is stored in text format. In order to achieve fast search, the activation code is named: encrypted device unique code_encrypted component ID.
[0011] 2) Storing activation codes: Export activation code files in batches from the component management platform and pre-prepare them in the system-specified partition, that is, put them in the sys_chk partition as the component activation code dictionary; component activation codes are transmitted and stored in an encrypted manner, and the device side uses the same encryption and decryption algorithms and keys.
[0012] 3) Component identification: The activation code is stored in the non-volatile memory of the device. The device sets up an SA service for component registration, activation code verification, and component statistics. The SA service has the authority to access the component activation code dictionary. When the component is enabled, the OpenHarmony system receives component registration information, activation code verification information, and component statistics. Component registration prototype: uint32 register(component name, component ID, component version, returns a 4-byte verification result, presets the component control item enable by bit, that is, the component function code, which is parsed from the function control item of the component activation code and reorganized in the following format: Bit1 Bit0 Value Description { 00: ID is duplicated 01: Expired 10: Normally available 11: The device unique code does not match } Bit2~Bit31 value description: 0 in the corresponding bit position indicates that there is no sub-function or the sub-function cannot be used; 1 indicates that the sub-function is available.
[0013] For example, the face recognition component has three enhanced functions: display face frame, multi-face recognition, and capture image during recognition, corresponding to Bit2, Bit3, and Bit4 respectively. Therefore: If the face recognition component is available and there is no enhancement function, the value is: 0x00000002 If the face frame display, multi-face recognition, and image capture during recognition functions are all available, the value is: 0x0000001E If the activation code and the device do not match, the component authentication fails, and the value is: 0x00000003; The function code is 4 bytes, with the default value of 0. When the component starts, the SA service interface is called first to register the component information with the SA service, and the function code parsed by the service is assigned to the function code inside the component. Finally, the component is enabled according to the function code.
[0014] For example, define the ID of the face authentication component as: #define FACEAUTH_COMP_ID 0x0000E0E1 The function code returned by the component identification service is the above mentioned: 0x0000001E, which means that the face authentication component supports face frame drawing, multi-face recognition, and image capture during recognition. When the component is activated, the initial available functions can be based on this function code.
[0015] 4) Component Activation: Each time a component is used, the component activation code needs to be verified; the component registration SA service provides a register interface for components to use, and also provides a component list query interface for other processes to use, and can provide c / c++ and NAPI interfaces. The component registration SA service is also compatible with component online activation and activation code updates.
Claims
1. Anti-piracy method based on offline components of OpenHarmony platform, Features The component management platform adopts the OpenHarmony architecture, and the method includes the following processes: 1) Generate activation code: The unique hardware code of the device is a combination of the motherboard serial number, CPU serial number and FlashID. In the component management platform, each component is bound to the unique hardware code of the device, and an activation code is generated based on the unique hardware code of the device. The activation code also includes: component ID, component version, running system version, component activation code type, validity period, function code, and the activation code is stored in text form; 2) Storing activation codes: Export activation code files in batches from the component management platform and pre-populate them in the specified partition of the system as the component activation code dictionary; 3) Component identification: The activation code is stored in the non-volatile memory of the device. The device sets up an SA service for component registration, activation code verification, and component statistics. The SA service has the authority to access the component activation code dictionary. When the component is enabled, the OpenHarmony system receives component registration information, activation code verification information, and component statistics. 4) Component activation: Each time a component is used, the component activation code needs to be verified; the component registration SA service provides a register registration interface for components to use, and also provides a component list query interface for other processes to use Specifically, in step 1) or step 2), the component activation code is transmitted and stored in encrypted form, and the device uses the same encryption and decryption algorithm and key.
2. The method for preventing piracy of offline components based on the OpenHarmony platform as claimed in claim 1, Features In step 3), the default function code is 0. When the component starts, the SA service interface is called first to register the component information to the SA service, and the function code parsed by the service is assigned to the function code inside the component.
3. The method for preventing piracy of offline components based on the OpenHarmony platform as claimed in claim 1, Features Step 4) Component activation, providing c / c++ and NAPI interfaces, and is compatible with component online activation and activation code update.
