Method for realizing device suite gray scale upgrading under uninterrupted service scene based on OpenHarmony system

By using the method of implementing the grayscale upgrade of the device suite in the OpenHarmony system without interruption service scenario, the problem of equipment restarting during the traditional OTA grayscale upgrade of Luhong OS suite services is solved, and the business during the equipment upgrade process is realized Continuity and data security to ensure service online.

CN118939296APending Publication Date: 2024-11-12INST OF COMM SCI YUNNAN PROV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411160317.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Luhong OS suite service needs to restart the device during the traditional OTA grayscale upgrade process, resulting in business interruption, data loss or service interruption.

Method used

Using the uninterrupted service scenario based on OpenHarmony system, the device suite grayscale upgrade method is implemented, and the encrypted suite information is issued in the cloud. The suite engine downloads version checksum upgrade packages, suspends business instructions, caches task queues, and ensures services during the upgrade process. Online status and encrypt data transmission using SM4 national secret algorithm.

Benefits of technology

It realizes zero-interruption upgrade of the device suite, ensures service continuity and data security, avoids business interruptions and data loss during the traditional upgrade process, and enhances resource management and data security during the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939296A_ABST
    Figure CN118939296A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Internet of Things, in particular to a method for realizing device suite gray scale upgrading under a non-interruption service scene based on an OpenHarmony system, each suite has the characteristics of independent compilation, high portability and low coupling, resources controlled by a suite engine are smoothly unloaded in the upgrading process and are reloaded after the upgrading is successful, so that the upgrading efficiency is improved. It is ensured that the service is always kept in an online state in the whole upgrading process, and the serious problems of interruption of other suite services, service restarting or process collapse and the like are effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a method for implementing grayscale upgrade of a device suite in an uninterrupted service scenario based on an OpenHarmony system. Background Art

[0002] Luhong OS is a full-scenario distributed operating system for highways developed by Yunnan Transportation Science Research Institute Co., Ltd. based on OpenHarmony. It is the first distribution based on the Hongmeng system in the domestic transportation industry. It has passed the compatibility evaluation of the Open Atom Open Source Foundation and obtained the corresponding compatibility certificate. Luhong OS suite services provide a unified interface for traffic cameras, lane antennas and other equipment, support cloud-based data monitoring and intelligent collaboration of Luhong equipment, and play a basic and key supporting role for the new generation of smart transportation products. Luhong OS suite services provide a unified interface for traffic cameras, lane antennas and other equipment, support cloud-based data monitoring and intelligent collaboration of Luhong equipment, and play a basic and key supporting role for the new generation of smart transportation products.

[0003] Considering the continuous evolution of Luhong OS suite services in practical applications, there will be upgrade needs in the future. The use of traditional OTA grayscale upgrades requires restarting the device. The reason is that in the OTA upgrade process, you first need to make an upgrade package, and then the server will configure and store these upgrade packages and related information, and match and verify the version information and device information internally to ensure the accuracy and applicability of the upgrade. Once the verification is passed, the client will start downloading the upgrade package, and then a dedicated package management module will parse and verify the package. The package management module will start burning the image to the device's storage space. This step usually causes the device to be temporarily unavailable. This will undoubtedly have a significant impact on ongoing business and may even cause data loss or service interruption. Summary of the invention

[0004] In view of the problem that the traditional OTA grayscale upgrade of the Luhong OS suite requires restarting the device, resulting in data loss or service interruption, the present invention proposes a method for realizing grayscale upgrade of device suites based on the OpenHarmony system without interrupting service, which effectively avoids serious problems such as interruption of other suite services, service restart or process crash.

[0005] The method for implementing grayscale upgrade of a device suite based on the OpenHarmony system without interrupting service in the present invention is characterized in that the device is upgraded through the following steps: Step 1: Send kit information from the cloud: The cloud uses the SM4 national encryption algorithm to encrypt the kit information, and then securely sends the encrypted kit upgrade information to the relevant devices through the MQTT protocol; Step 2: The suite engine performs version verification: After receiving the encrypted message sent by the cloud, the protocol suite uses the SM4 algorithm to decrypt the message and forward the decrypted information to the suite engine. The suite engine first obtains the current suite information from the database, obtains the current suite version, and then compares the version in the decrypted information to determine whether the current suite needs to be upgraded. If the suite version obtained by the suite engine is lower than the suite version sent by the cloud, the upgrade process will be carried out; if no upgrade is required, the result that no upgrade is required will be immediately fed back to the cloud: Step 3: Download the upgrade package: If the upgrade is confirmed, the package engine will notify the protocol suite to download the upgrade package through the HTTPS protocol. After the download is complete, the package engine will calculate the MD5 code of the upgrade package and verify the integrity and consistency of the file with the MD5 code in the decrypted information; Step 4: Prepare for upgrade: Once the upgrade package is downloaded and verified successfully, the protocol suite will notify the suite engine to prepare for the upgrade. Before the upgrade begins, the suite version in the upgrade package will be verified again. The current suite version will be obtained according to Step 3, and the MD5 of the upgrade package will be calculated. The suite version previously sent from the cloud and the MD5 code of the upgrade package will be compared to ensure the correctness and applicability of the version: Step 5: Cache the subsequent services of the current suite: The suite engine will suspend forwarding instructions from the cloud or other suites to the current suite. These suspended instructions will be safely cached in the task queue and released and executed in sequence after the current suite is successfully upgraded; Step 6: Wait or stop the business being processed by the current suite: If the current suite is executing a task before the upgrade, the suite engine will decide whether to wait for the task to complete or stop the business immediately based on the priority and strategy of the task. This decision-making process is designed to minimize the impact of the upgrade on business continuity. Step 7: Notify the engine of the processing result through callback: Depending on the task strategy level, the current suite may notify the suite engine after completing the current task, or immediately force the service to stop and notify the engine of task interruption; in the latter case, the interrupted task will be marked as needing to be executed again; Step 8: Upgrade execution: After receiving the processing result, if the suite engine determines that the service needs to be forcibly interrupted, it will insert the interrupted service into the head of the cache queue to ensure priority processing next time; after completing these preparations, the suite engine will execute the upgrade process of the current suite; Step 9: Continue to run the cache business: After the upgrade is completed, first report the upgrade results to the cloud platform, then the suite engine will continue to distribute the business queue of the current suite, and the current suite will continue to execute the business.

[0006] Furthermore, the package engine loads or unloads the package based on the json file configuration, provides default settings and remote configuration json file interface, covers package loading, version control, periodic operation and uninstall options, wherein: the loading method of the json file is configuration resident, timed startup or event-driven.

[0007] Furthermore, the suite exists in the form of a so library and a configuration file, and each suite runs in an independent thread to ensure that they do not interfere with each other.

[0008] The advantages of the present invention are as follows: 1) Suite independence and high integration: Each suite is independently compiled, highly portable, and low-coupling, which means that the upgrade of a single suite will not interfere with the normal operation of other suites, thus achieving perfect coordination between devices and suites; 2) Zero-interruption service upgrade: Thanks to the intelligent management of the suite engine, the resources required by the suite will be smoothly unloaded during the upgrade process and reloaded after the upgrade is successful, ensuring that the service remains online throughout the upgrade process.

[0009] 3) Confidential security: During the upgrade process, data security has been greatly enhanced. By using the SM4 national encryption algorithm, business messages and upgrade packages between the cloud and the device are encrypted, ensuring the security and privacy of data during transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 This is the grayscale upgrade flowchart. DETAILED DESCRIPTION

[0011] Embodiment 1: The present invention implements a grayscale upgrade method for a device suite in an uninterrupted service scenario based on the OpenHarmony system. The suite engine runs as a separate process and continues to run as a key system process. All tasks issued from the cloud are uniformly scheduled and managed by the suite engine. The suite engine distributes tasks according to the priority of the tasks registered when each suite is loaded. At the same time, the suite engine also makes a map of the task ID and the suite name, and then finds the corresponding suite by ID when distributing tasks, thereby ensuring the independence of each suite service. Start the suite service provided by Openharmony, and upload the upgrade package of the current suite in the cloud. The device is upgraded through the following steps: Step 1: Send kit information from the cloud. The cloud uses the SM4 national encryption algorithm to encrypt the kit information, and then securely sends the encrypted kit upgrade information to related devices through the MQTT protocol.

[0012] Step 2: The suite engine performs version verification. After receiving the encrypted message sent by the cloud, the protocol suite uses the SM4 algorithm to decrypt the message and forward the decrypted information to the suite engine. The suite engine first obtains the suite A information from the database, obtains the suite A version, and then compares the version in the decrypted information to determine whether the current suite needs to be upgraded. If no upgrade is required, the upgrade failure result is immediately fed back to the cloud.

[0013] Step 3: Download the upgrade package. If the upgrade is confirmed, the package engine will notify the protocol suite to download the upgrade package through the HTTPS protocol. After the download is complete, the package engine will calculate the MD5 code of the upgrade package and verify the integrity and consistency of the file with the MD5 code in the decrypted information.

[0014] Step 4: Prepare for the upgrade. Once the upgrade package is downloaded and verified successfully, the protocol suite will notify the suite engine to prepare for the upgrade. Before the upgrade begins, the suite version in the upgrade package will be verified again. The version of suite A will be obtained according to Step 3, and the MD5 of the upgrade package will be calculated. The version information previously sent by the cloud platform and the MD5 code of the upgrade package will be compared to ensure the correctness and applicability of the version.

[0015] Step 5: Cache the subsequent services of Suite A. To ensure the smooth progress of the upgrade process, the suite engine will suspend forwarding instructions from the cloud or other suites to Suite A. These suspended instructions will be safely cached in the task queue, waiting to be released and executed in sequence after Suite A is successfully upgraded. The cache strategy is to put the high-priority services at the head of the queue. After Suite A is successfully upgraded, the suite engine will first release the tasks at the head of the queue and then hand them over to Suite A for execution.

[0016] Step 6: Wait / stop the business being processed by Suite A. If Suite A is executing a task before the upgrade, the suite engine will decide whether to wait for the task to complete or stop the business immediately based on the priority and strategy of the task. This decision-making process is designed to minimize the impact of the upgrade on business continuity.

[0017] Step 7: Notify the suite engine of the processing result through callback. Depending on the task strategy level, suite A may notify the suite engine after completing the current task, or immediately force the service to stop and notify the suite engine of the task interruption. In the latter case, the interrupted task will be marked as needing to be executed again.

Claims

1. A method for implementing a grayscale upgrade of a device suite based on the OpenHarmony system without interrupting service, characterized in that The device is upgraded by following these steps: Step 1: Send kit information from the cloud: The cloud uses the SM4 national encryption algorithm to encrypt the kit information, and then securely sends the encrypted kit upgrade information to the relevant devices through the MQTT protocol; Step 2: The suite engine performs version verification: After receiving the encrypted message sent by the cloud, the protocol suite uses the SM4 algorithm to decrypt the message and forwards the decrypted information to the suite engine. The suite engine first obtains the current suite information from the database and the current suite version, and then compares the version in the decrypted information to determine whether the current suite needs to be upgraded; If the package version obtained by the package engine is lower than the package version sent by the cloud, the upgrade process will be carried out; If no upgrade is required, immediately report the result that no upgrade is required to the cloud: Step 3: Download the upgrade package: If the upgrade is confirmed, the package engine will notify the protocol suite to download the upgrade package through the HTTPS protocol. After the download is complete, the package engine will calculate the MD5 code of the upgrade package and verify the integrity and consistency of the file with the MD5 code in the decrypted information; Step 4: Prepare for upgrade: Once the upgrade package is downloaded and verified successfully, the protocol suite will notify the suite engine to prepare for the upgrade. Before the upgrade begins, the suite version in the upgrade package will be verified again. The current suite version will be obtained according to Step 3, and the MD5 of the upgrade package will be calculated. The suite version previously sent from the cloud and the MD5 code of the upgrade package will be compared to ensure the correctness and applicability of the version: Step 5: Cache the subsequent services of the current suite: the suite engine will stop forwarding instructions from the cloud or other suites to the current suite; These suspended instructions will be safely cached in the task queue and will be released and executed in sequence after the current suite is successfully upgraded; Step 6: Wait or stop the business being processed by the current suite: If the current suite is executing a task before the upgrade, the suite engine will decide whether to wait for the task to complete or stop the business immediately based on the priority and strategy of the task. This decision-making process is designed to minimize the impact of the upgrade on business continuity. Step 7: Notify the engine of the processing result through callback: Depending on the task strategy level, the current suite may notify the suite engine after completing the current task, or immediately force the service to stop and notify the engine of task interruption; in the latter case, the interrupted task will be marked as needing to be executed again; Step 8: Upgrade execution: After receiving the processing result, if the suite engine determines that the service needs to be forcibly interrupted, it will insert the interrupted service into the head of the cache queue to ensure priority processing next time; after completing these preparations, the suite engine will execute the upgrade process of the current suite; Step 9: Continue to run the cache business: After the upgrade is completed, first report the upgrade results to the cloud platform, then the suite engine will continue to distribute the business queue of the current suite, and the current suite will continue to execute the business.

2. The method for implementing a grayscale upgrade of a device suite based on an OpenHarmony system without interrupting service as claimed in claim 1, characterized in that The package engine loads or unloads packages based on json file configuration, provides default settings and remote configuration json file interface, covers package loading, version control, periodic operation and uninstall options, among which: the loading method of json file is configuration resident, timed launch or event driven.

3. The method for implementing a grayscale upgrade of a device suite based on an OpenHarmony system without interrupting service as claimed in claim 1, characterized in that The suite exists in the form of so libraries and configuration files. Each suite runs in an independent thread to ensure that they do not interfere with each other.