AI-based remote self-evolution upgrade method and system

By constructing a version evolution model and a key fragment mechanism, AI-based autonomous device upgrades are achieved, solving the problems of upgrade efficiency and reliability in extremely low bandwidth environments. This technology is applicable to IoT devices and large-scale distributed systems.

CN122132069AActive Publication Date: 2026-06-02GRADIENT CLOUD TECH (BEIJING) CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GRADIENT CLOUD TECH (BEIJING) CO LTD
Filing Date
2026-05-06
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In environments with extremely low bandwidth, network fluctuations, or high packet loss rates, existing equipment upgrade methods are inefficient and unreliable, especially in IoT devices and large-scale distributed nodes where it is difficult to build and upgrade new versions efficiently and reliably.

Method used

An AI-based remote self-evolution upgrade method is adopted. By constructing a version evolution model, the differences between the old and new versions that can be automatically upgraded are converted into upgrade instructions. The upgrade action is generated on the target device using this model. Sensitive differences are processed in conjunction with key segments to achieve autonomous upgrade.

Benefits of technology

Significantly reduces network bandwidth usage, improves upgrade success rate, avoids upgrade conflicts and failures, and ensures that the generated new version is complete and correct, suitable for IoT devices and large-scale distributed systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132069A_ABST
    Figure CN122132069A_ABST
Patent Text Reader

Abstract

This invention provides an AI-based remote self-evolutionary upgrade method and system. By constructing a version evolution model, the differences between the old and new versions are transformed into an upgrade instruction set. At the target device, the version evolution model is used to generate upgrade actions based on the upgrade instruction set, achieving autonomous upgrades to the old version. Compared to traditional full-package or differential upgrade methods, this invention eliminates the need to transmit complete upgrade packages or large differential files; only a small number of upgrade instructions are required to complete the version upgrade, significantly reducing network bandwidth consumption and improving the upgrade success rate in weak network environments. Furthermore, by introducing a critical segment mechanism during the upgrade process, upgrade failures or conflicts in sensitive areas can be avoided, ensuring the generated new version is complete and correct, improving the flexibility and reliability of system upgrades. This is particularly suitable for upgrade scenarios of IoT devices, remote terminals, and large-scale distributed systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer software, and in particular relates to an AI-based remote self-evolution upgrade method and system. Background Technology

[0002] With the rapid iteration of software and firmware versions, the need for device upgrades is becoming increasingly frequent. Existing upgrade methods mainly include two categories: full package upgrade, which directly downloads the complete upgrade package, but the file size is large, the transmission cost is high, and it is very easy to fail in weak network environments; differential upgrade, which generates a differential file by comparing the old and new versions and only transmits the differences, which saves bandwidth, but the differential file may still be large.

[0003] In complex network environments, such as IoT devices in remote areas, satellite communication environments, or large-scale distributed nodes, traditional upgrade methods remain inefficient and unreliable. Existing solutions generally rely on the server to generate accurate differential files, with the device passively receiving them, lacking autonomy and resulting in a redundant and vulnerable upgrade process.

[0004] Therefore, there is an urgent need for a more intelligent, efficient, and reliable upgrade method that can still complete the construction and upgrade of new versions under extremely low bandwidth, network fluctuations, or high packet loss environments. Summary of the Invention

[0005] The main problem addressed by this invention is how to build and upgrade a new version under extremely low bandwidth, network fluctuations, or high packet loss environments. It provides an AI-based remote self-evolution upgrade method and system.

[0006] To solve the above technical problems, the technical solution adopted is: An AI-based remote self-evolutionary upgrade method includes the following steps: Step 1: Obtain the historical version set of the application or firmware, construct a version evolution model based on the version iteration pattern, and send the version evolution model to the target device to be upgraded; Step 2: During the upgrade, the differences between the old and new versions that can be automatically upgraded are converted into upgrade instructions to form an upgrade instruction set. Sensitive differences between the old and new versions that are prone to conflict or failure during the upgrade process are formed into key segments. Step 3: Send the upgrade instruction set and key fragments to the target device; Step 4: On the target device, the upgrade instruction set is parsed using the version evolution model to generate an upgrade action, and the current old version is upgraded by combining key fragments.

[0007] Furthermore, the method for constructing a version evolution model is as follows: Step 1.1: Preprocess each release version; Step 1.2: Perform differential analysis on adjacent old and new version pairs, and form an upgrade instruction for each difference that can be automatically upgraded; Step 1.3: After differential analysis of multiple adjacent old and new versions, multiple upgrade instructions are obtained. Each upgrade instruction is used as an input feature, and the upgrade action that executes the upgrade instruction is used as a label to form a training dataset. The upgrade action adopts a fixed data format including action type, action content, and execution command. The action type includes code addition, code replacement, code deletion, file update, configuration modification, and dependency update. The action content is the difference data corresponding to the upgrade instruction, including code snippets, configuration parameters, resource files, or dependency files that need to be added, deleted, or replaced. The execution command refers to the command or script that actually performs the upgrade operation on the device. Step 1.4: Use machine learning methods to train the model using the training dataset to generate a version evolution model.

[0008] Furthermore, the method for upgrading the current old version by parsing the upgrade instruction set through the version evolution model on the target device and generating upgrade actions, and then combining key fragments, is as follows: The application upgrade instruction set is used. The target device parses the upgrade instructions in the upgrade instruction set one by one based on the local old version through the version evolution model and generates the corresponding upgrade action. The target device performs the corresponding update operation on the old version according to the execution command in the upgrade action to generate an intermediate upgrade version to complete the update of the difference part that can be automatically executed for upgrade operation. The key segment includes segment content and location information, and the location information includes at least one of the following: boundary location information, keyword location information, and file location information; The boundary positioning information is context boundary information used to determine the insertion position of the key segment; Based on the location information in the key segments, the target device determines the target location of the key segments in the intermediate upgrade version. When the target location is located, the original content at the target location is replaced with the content of the key segment; when the corresponding content is not located, the insertion position is determined according to the location information, and the key segment is inserted at the position to complete the update of the sensitive difference part. After completing the updates to the sensitive differences, an upgraded new version will be generated.

[0009] Furthermore, the method for preprocessing each release version is as follows: Each release version is parsed, including code file parsing, configuration file parsing, and dependency file parsing, to obtain the code structure information for each version.

[0010] Furthermore, in step 1.3, when each upgrade instruction is used as an input feature, the target code context information of the corresponding position in the file to which the upgrade instruction belongs is extracted based on the positioning information in the upgrade instruction. The target code context information is used as an auxiliary input feature, and the complete upgrade action is used as a training label to create training samples.

[0011] Furthermore, the version evolution model outputs a complete upgrade action based on the upgrade instructions and the target code context, and outputs specific code snippets to replace the target code in the old version.

[0012] Furthermore, when using the upgrade action as a training label, the upgrade action is converted into a structured action sequence, which is a serialized representation arranged according to the order of predefined fields, including an action type field, an action content field, and an execution command field; The structured action sequence adopts an encoding format that can be processed by the sequence generation model, so that the version evolution model can generate the corresponding structured action sequence based on the upgrade instructions and the target code context; During the version evolution model inference phase, the structured action sequence output by the model is parsed and restored into the standard upgrade action structure.

[0013] The present invention also provides an AI-based remote self-evolutionary upgrade system, which is implemented using an AI-based remote self-evolutionary upgrade method.

[0014] By adopting the above technical solution, the present invention has the following beneficial effects: This invention provides an AI-based remote self-evolutionary upgrade method and system. By constructing a version evolution model, it transforms each difference between the old and new versions that can be automatically upgraded into upgrade instructions. At the target device, the version evolution model is used to generate upgrade actions based on the upgrade instruction set, achieving autonomous upgrades to the old version. Compared to traditional full-package or differential upgrade methods, this invention eliminates the need to transmit complete upgrade packages or large differential files; only a small number of upgrade instructions are required to complete the version upgrade, significantly reducing network bandwidth consumption and improving the upgrade success rate in weak network environments. Furthermore, by introducing a critical segment mechanism during the upgrade process, it avoids upgrade failures or conflicts in sensitive areas, ensuring the generated new version is complete and correct, improving the flexibility and reliability of system upgrades. This makes it particularly suitable for upgrade scenarios involving IoT devices, remote terminals, and large-scale distributed systems. Attached Figure Description

[0015] Figure 1 This is a system flowchart of the present invention. Detailed Implementation

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

[0017] This invention proposes an AI-based remote self-evolutionary upgrade method, comprising the following steps: Step 1: Obtain the historical version set of the application or firmware, construct a version evolution model based on the version iteration pattern, and send the version evolution model to the target device to be upgraded; In this embodiment, a Python web service project is used as an example. This project needs to be upgraded from v1.0 to v2.0. The server first obtains a collection of historical versions from the code repository, for example: project_repo / ├── v1.0 ├── v1.1 ├── v1.2 └── v2.0 The aforementioned versions undergo preprocessing and differential analysis to extract the differences, creating upgrade instructions and actions, and constructing a training dataset. Subsequently, a version evolution model is trained using machine learning methods. This model is used to parse upgrade instructions and generate corresponding upgrade actions on the device. After model training is complete, the server sends the version evolution model to the target device via the network, enabling the target device to perform automatic upgrades locally.

[0018] Step 1.1: Preprocess each release. Preprocessing yields the code structure information for each release.

[0019] Each release version undergoes parsing, including code file parsing, configuration file parsing, and dependency file parsing, to extract code structure information. For example, the app.py file in version v1.0: def hello(): return "hello v1.0" The system generates structured data after parsing: { "file_name": "app.py", / / File name "file_type": "python", / / File type "functions": [ / / List of functions in the file] { "function_name": "hello", / / Function name "parameters": [], / / Parameter list "return_value": "hello v1.0" / / Returned content } ] } Simultaneously, the dependency file requirements.txt is parsed: flask==1.1.2 Structured data is generated after parsing: { "file_name": "requirements.txt", / / File name "dependencies": [ / / List of dependency libraries] { "name": "flask", / / Dependency library name "version": "1.1.2" / / Dependency version } ] } The above preprocessing can obtain code structure information for each version, providing basic data for subsequent differential analysis.

[0020] Step 1.2: Perform differential analysis on adjacent old and new version pairs, and form an upgrade instruction for each difference that can be automatically upgraded.

[0021] In this embodiment, a differential analysis is performed between versions v1.2 and v2.0. For example: v1.2 code: @app.route(" / hello") def hello(): return "hello v1.2" v2.0 code: @app.route(" / hello") def hello(): return {"msg":"hello v2.0"} A change in the returned structure was detected, therefore an upgrade instruction was generated. The upgrade instruction expresses the upgrade semantics, the file it belongs to, and the location context information. Its structure includes a semantic description, the file it belongs to, and location keywords: { "instruction_id": "INS_001", / / Unique identifier for upgrade instruction "instruction_text": "Modify the return structure of the hello interface to support JSON format return", / / Upgrade semantic description "file_name": "app.py", / / The file to which this file belongs "location_keyword": "hello", / / Locating the keyword } At the same time, a change in the version of the dependency library was detected: v1.2: flask==1.1.2 v2.0: flask==2.0.3 Generate upgrade instructions: { "instruction_id": "INS_002", "instruction_text": "Upgrade Flask dependency version", "file_name": "requirements.txt", "location_keyword": "flask", }

[0022] For code changes that may cause conflicts, the system extracts key segments, such as: { "fragment_id": "FRAG_001", / / Key fragment identifier "file_name": "app.py", / / The file to which this file belongs "location_keyword": "return", / / Locating keyword "fragment_content": "return {'msg':'hello v2.0'}" / / Key code snippet } Step 1.3: After differential analysis of multiple adjacent old and new versions, multiple upgrade instructions are obtained. Each upgrade instruction is used as an input feature, and the upgrade action that executes the upgrade instruction is used as a label to form a training dataset. The upgrade action adopts a fixed data format including action type, action content, and execution command. The action type includes code addition, code replacement, code deletion, file update, configuration modification, and dependency update. The action content is the difference data corresponding to the upgrade instruction, including code snippets, configuration parameters, resource files, or dependency files that need to be added, deleted, or replaced. The execution command refers to the command or script that actually performs the upgrade operation on the device. In this embodiment, the upgrade instruction includes a semantic description, the file to which it belongs, and location keywords. The upgrade instruction is used as an input feature, and its data structure is as follows: { "instruction_id": "INS_001", "instruction_text": "Modify the return structure of the hello API to support JSON format return", "file_name": "app.py", "location_keyword": "hello" } The upgrade action structure corresponding to this upgrade command is as follows: { "action_id": "ACT_001", / / Unique identifier for the upgrade action "action_type": "code_replace", / / Action type "action_content": { / / Action content (actual difference data) "target_file": "app.py", / / Target file "target_object": "function:hello", / / Target object "old_code": "return 'hello v1.2'", / / Original code snippet "new_code": "return {'msg':'hello v2.0'}" / / New code snippet }, "execute_command": "patch_python_code" / / The upgrade command executed on the device. } Where: action_type: the type of upgrade action, such as adding code, replacing code, deleting code, updating files, modifying configuration, or updating dependencies; action_content: the actual difference data, such as code snippets or configuration parameters; execute_command: the command or script that executes the upgrade operation on the device.

[0023] Further, target code context information is extracted as auxiliary input features. These auxiliary input features help the model improve its code generation ability during training. The `location_keyword` is used to locate the target code region in the corresponding file and extract the target code context.

[0024] In step 1.3, when each upgrade instruction is used as an input feature, the target code context information of the corresponding position in the file to which the upgrade instruction belongs is extracted based on the positioning information in the upgrade instruction. The target code context information is used as an auxiliary input feature, and the complete upgrade action is used as a training label to create training samples.

[0025] The system locates the keyword "hello" to search for matching code objects in the target file app.py and identifies the target function: def hello(): return "hello v1.2" Extract the function's code context information, such as the complete function code or a code snippet within a specified range. The extracted code context structure is as follows: { "context_file": "app.py", / / The file containing the context file "context_object": "function:hello", / / Context object (function hello) "context_code": "def hello():\nreturn 'hello v1.2'" / / Context code } When constructing the training data, the semantic description of the upgrade instruction is used as the input feature, the target code context information is used as the auxiliary input feature, and the complete upgrade action is used as the training label. For example, the training samples are as follows: { "instruction": { "instruction_text": "Modify the return structure of the hello API to support JSON format return", "file_name": "app.py", "location_keyword": "hello" }, "code_context": { "context_file": "app.py", / / Context file "context_object": "function:hello", / / Context object "context_code": "def hello():\nreturn 'hello v1.2'" / / Target function code }, "label_action": { "action_type": "code_replace", / / Action type "action_content": { "target_file": "app.py", / / Target file "target_object": "function:hello", / / Target object "old_code": "return 'hello v1.2'", / / Original code "new_code": "return {'msg':'hello v2.0'}" / / New code }, "execute_command": "patch_python_code" / / Execute command } } Training samples can also be built for dependency upgrades: { "instruction": { "instruction_text": "Upgrade Flask dependency version" }, "code_context": {}, "label_action": { "action_type": "dependency_update", "action_content": { "target_file": "requirements.txt", "dependency_name": "flask", "old_version": "1.1.2", "new_version": "2.0.3" }, "execute_command": "pip_install_dependency" } } By employing the above method, the training data simultaneously includes upgrade instructions, target code context, and upgrade action labels, enabling the model to learn the mapping relationship between upgrade instructions and upgrade actions. By aggregating upgrade data from multiple versions, a large number of training samples are formed, thus constructing a complete training dataset.

[0026] Step 1.4: Use machine learning methods to train the model using the training dataset to generate a version evolution model.

[0027] In this embodiment, a version evolution model based on the Transformer Encoder-Decoder structure is constructed using the PyTorch deep learning framework to learn the mapping relationship between upgrade instructions and upgrade actions.

[0028] The version evolution model receives upgrade instructions and target code context information as input during training. Its model input structure is input = upgrade instructions + code context. An example input is as follows: Upgrade instructions: { "instruction": { "instruction_text": "Modify the return structure of the hello API to support JSON format return", "file_name": "app.py", "location_keyword": "hello" } Code context: def hello(): return "hello v1.2" In this embodiment, the upgrade instruction structure is converted into the following upgrade instruction sequence: <instructionstart> InstructionText: Modify the return structure of the hello API to support JSON format. FileName: app.py LocationKeyword: hello <instructionend> The upgrade instruction sequence and the target code context are processed by word segmentation and vectorization respectively. The upgrade instruction sequence is segmented, for example: [InstructionText, Modify, hello interface, Return structure, JSON format, Return, FileName, app.py, LocationKeyword, hello], to obtain the corresponding token sequence representation.

[0029] Perform code tokenization on the target code context, for example: [def, hello, (, ), :, return,hello, v1.2], to obtain the corresponding token sequence representation.

[0030] The upgrade instruction sequence is concatenated or merged with the code context sequence to form a unified input sequence: InputSequence=Concat(InstructionTokenSequence,CodeTokenSequence) The input sequence is mapped using Embedding to obtain the input vector sequence InputEmbedding, where Embedding includes Token Embedding, Type Embedding, and Position Embedding, which are used to distinguish upgrade instructions from code context and represent sequence position information.

[0031] The input vector sequence is input into the Transformer Encoder-Decoder network structure for feature learning, where the Encoder is used to jointly encode the upgrade instruction information and code context information, and the Decoder is used to gradually generate the upgrade action sequence based on the encoding results.

[0032] In this embodiment, to enable the model to stably generate structured upgrade actions, this solution introduces a structured action sequence generation algorithm.

[0033] Specifically, the upgrade action is first defined in a structured manner. The upgrade action adopts a fixed data format, including: action type (action_type), action content (action_content), and execution command (execute_command). An example upgrade action structure is as follows: { "action_type": "code_replace", "action_content": { "target_file": "app.py", "target_object": "function:hello", "old_code": "return 'hello v1.2'", "new_code": "return {'msg':'hello v2.0'}" }, "execute_command": "patch_python_code" } To enable the Transformer model to generate the above structure, this embodiment converts the upgrade action structure into a structured action sequence that can be generated by the model, and encodes it according to a predefined field order. For example, the above JSON structure is converted into the following action sequence: <actionstart> ActionType: code_replace TargetFile: app.py TargetObject: function:hello OldCode: return 'hello v1.2' NewCode: return {'msg':'hello v2.0'} ExecuteCommand: patch_python_code <actionend> The above action sequence is segmented into words, for example: [ActionType,code_replace,TargetFile,app.py,TargetObject,function:hello,OldCode,return,hello,v1.2,NewCode,return,msg,hello,v2.0,ExecuteCommand,patch_python_code] The word segmentation results are then converted into vector representations, which serve as the training label sequence for the Transformer Decoder.

[0034] During model training, the Encoder takes semantic descriptions and code context as input, while the Decoder takes the contextual features output by the Encoder as conditional input and predicts each field in the action sequence step by step according to the sequence generation method. For example, the model outputs an action sequence: ActionType: code_replace TargetFile: app.py TargetObject: function:hello OldCode: return 'hello v1.2' NewCode: return {'msg':'hello v2.0'} ExecuteCommand: patch_python_code During the model inference phase, the version evolution model first generates an action sequence based on the semantic description of the upgrade instructions and the target code context. Then, the action sequence is restored to a standard upgrade action structure through the action structure parsing module, for example: { "action_type": "code_replace", "action_content": { "target_file": "app.py", "target_object": "function:hello", "old_code": "return 'hello v1.2'", "new_code": "return {'msg':'hello v2.0'}" }, "execute_command": "patch_python_code" } Among them, action_type is the type of upgrade action predicted by the model, action_content is the specific difference code snippet or configuration parameter generated by the model, and execute_command is the command generated by the model to execute the upgrade operation on the device.

[0035] Through the structured action sequence generation mechanism described above, the version evolution model can automatically generate a complete upgrade action based on an upgrade instruction and the target code context, and output the corresponding specific code snippet to replace the target code in the old version, thereby realizing the automatic upgrade of applications or firmware.

[0036] Step 2: During the upgrade, the differences between the old and new versions that can be automatically upgraded are converted into upgrade instructions to form an upgrade instruction set. Sensitive differences between the old and new versions that are prone to conflict or failure during the upgrade process are formed into key segments. In this embodiment, the server needs to upgrade a Python web service project from v1.2 to v2.0. The server first obtains the target version and the current version code from the code repository and performs differential analysis.

[0037] For example, the current version of the target device is: @app.route(" / hello") def hello(): return "hello v1.2" The upgrade version code is: @app.route(" / hello") def hello(): return {"msg":"hello v2.0"} The code difference algorithm identifies a change in the return structure of the function 'hello' and converts this difference into an upgrade instruction. Example of an upgrade instruction generated: { "instruction_id": "INS_001", "instruction_text": "Modify the return structure of the hello API to support JSON format return", "file_name": "app.py", "location_keyword": "hello" } If a dependency library version change is detected, for example, the old version is flask==1.1.2 and the new version is flask==2.0.3, an upgrade command will be generated: { "instruction_id": "INS_002", "instruction_text": "Upgrade Flask dependency version", "file_name": "requirements.txt", "location_keyword": "flask" } An upgrade instruction set consists of multiple upgrade instructions: { "instruction_set":[ { "instruction_id":"INS_001", "instruction_text":"Modify the return structure of the hello interface to support JSON format return", "file_name":"app.py", "location_keyword":"hello" }, { "instruction_id":"INS_002", "instruction_text":"Upgrade Flask dependency version", "file_name":"requirements.txt", "location_keyword":"flask" } ] } The system also identifies potentially conflicting code differences and extracts key segments. For example: { "fragment_id": "FRAG_001", "file_name": "app.py", "location_keyword": "return", "fragment_content": "return {'msg':'hello v2.0'}" } Key segments are used for sensitive difference updates on the device side.

[0038] Step 3: Send the upgrade instruction set and key fragments to the target device; In this embodiment, the upgrade instruction set and key fragment data are sent to the target device via the network. The data structure is as follows: { "instruction_set":[ { "instruction_id":"INS_001", "instruction_text":"Modify the return structure of the hello interface to support JSON format return", "file_name":"app.py", "location_keyword":"hello" }, { "instruction_id":"INS_002", "instruction_text":"Upgrade Flask dependency version", "file_name":"requirements.txt", "location_keyword":"flask" } ], "fragments":[ { "fragment_id":"FRAG_001", "file_name":"app.py", "location_keyword":"return", "fragment_content":"return {'msg':'hello v2.0'}" } ] } Step 4: On the target device, the upgrade instruction set is parsed using the version evolution model to generate an upgrade action, and the current old version is upgraded by combining key fragments; In this embodiment, the device reads each upgrade instruction, along with its corresponding file and location keywords. For example, to modify the return structure of the "hello" interface to support JSON format, the device locates the function in the file based on the file and location keywords to extract the code context. def hello(): return "hello v1.2" Model input construction: { "instruction": { "instruction_text": "Modify the return structure of the hello API to support JSON format return", "file_name": "app.py", "location_keyword": "hello" }, "code_context": { "context_file": "app.py", / / Context file "context_object": "function:hello", / / Context object "context_code": "def hello():\nreturn 'hello v1.2'" / / Target function code }, The above model is fed into the version evolution model. The Transformer Encoder encodes the input, and the Decoder generates a structured sequence of actions. <actionstart> ActionType: code_replace TargetFile: app.py TargetObject: function:hello OldCode: return 'hello v1.2' NewCode: return {'msg':'hello v2.0'} ExecuteCommand: patch_python_code <actionend> The device parses the action sequence into a standard upgrade action structure: { "action_type": "code_replace", "action_content": { "target_file": "app.py", "target_object": "function:hello", "old_code": "return 'hello v1.2'", "new_code": "return {'msg':'hello v2.0'}" }, "execute_command": "patch_python_code" } The device then executes the upgrade command: patch_python_code(action_content), which generates an intermediate upgrade version. Finally, critical snippets are applied to perform sensitive difference updates.

[0039] Based on key segments on the device side: { "file_name": "app.py", "location_keyword": "return", "fragment_content": "return {'msg':'hello v2.0'}" } The code is located as `return "hello v1.2"`. A replacement operation is performed to change it to `return {"msg":"hellov2.0"}`. After completing the sensitive difference update, the upgraded new version is generated.

[0040] The present invention also provides an AI-based remote self-evolutionary upgrade system, which is implemented using an AI-based remote self-evolutionary upgrade method.

[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.< / actionend> < / actionstart> < / actionend> < / actionstart> < / instructionend> < / instructionstart>

Claims

1. A remote self-evolutionary upgrade method based on AI, characterized in that, Includes the following steps: Step 1: Obtain the historical version set of the application or firmware, construct a version evolution model based on the version iteration pattern, and send the version evolution model to the target device to be upgraded; Step 2: During the upgrade, the differences between the old and new versions that can be automatically upgraded are converted into upgrade instructions to form an upgrade instruction set. Sensitive differences between the old and new versions that are prone to conflict or failure during the upgrade process are formed into key segments. Step 3: Send the upgrade instruction set and key fragments to the target device; Step 4: On the target device, the upgrade instruction set is parsed using the version evolution model to generate an upgrade action, and the current old version is upgraded by combining key fragments.

2. The AI-based remote self-evolutionary upgrade method according to claim 1, characterized in that, The method for constructing a version evolution model is: Step 1.1: Preprocess each release version; Step 1.2: Perform differential analysis on adjacent old and new version pairs, and form an upgrade instruction for each difference that can be automatically upgraded. The upgrade instruction includes an upgrade semantic description, the file to which it belongs, and location keywords. Step 1.3: After differential analysis of multiple adjacent old and new versions, multiple upgrade instructions are obtained. Each upgrade instruction is used as an input feature, and the upgrade action that executes the upgrade instruction is used as a label to form a training dataset. The upgrade action adopts a fixed data format, including action type, action content, and execution command. The action type includes code addition, code replacement, code deletion, file update, configuration modification, and dependency update. The action content is the difference data corresponding to the upgrade instruction, including code snippets, configuration parameters, resource files, or dependency files that need to be added, deleted, or replaced. The execution command refers to the command or script that actually performs the upgrade operation on the device. Step 1.4: Use machine learning methods to train the model using the training dataset to generate a version evolution model.

3. The AI-based remote self-evolutionary upgrade method according to claim 2, characterized in that, The method for upgrading the current old version by parsing the upgrade instruction set through the version evolution model on the target device and generating upgrade actions, and combining key fragments, is as follows: The application upgrade instruction set is used. The target device parses the upgrade instructions in the upgrade instruction set one by one based on the local old version through the version evolution model and generates the corresponding upgrade action. The target device performs the corresponding update operation on the old version according to the execution command in the upgrade action to generate an intermediate upgrade version to complete the update of the difference part that can be automatically executed for upgrade operation. The key segment includes segment content and location information, and the location information includes at least one of the following: boundary location information, keyword location information, and file location information; The boundary positioning information is context boundary information used to determine the insertion position of the key segment; Based on the location information in the key segments, the target device determines the target location of the key segments in the intermediate upgrade version. When the target location is located, the original content at the target location is replaced with the content of the key segment; When the corresponding content is not located, the insertion position is determined based on the location information, and the key segment is inserted at the position to complete the update of the sensitive difference part; After completing the updates to the sensitive differences, an upgraded new version will be generated.

4. The AI-based remote self-evolutionary upgrade method according to claim 3, characterized in that, The method for preprocessing each release version is as follows: Each release version is parsed, including code file parsing, configuration file parsing, and dependency file parsing, to obtain the code structure information for each version.

5. The AI-based remote self-evolutionary upgrade method according to claim 4, characterized in that, In step 1.3, when each upgrade instruction is used as an input feature, the target code context information of the corresponding position in the file to which the upgrade instruction belongs is extracted based on the positioning information in the upgrade instruction. The target code context information is used as an auxiliary input feature, and the complete upgrade action is used as a training label to create training samples.

6. The AI-based remote self-evolutionary upgrade method according to claim 5, characterized in that, The version evolution model outputs a complete upgrade action based on the upgrade instruction and the target code context, and outputs specific code snippets to replace the target code in the old version.

7. The AI-based remote self-evolutionary upgrade method according to claim 6, characterized in that: When using upgrade actions as training labels, the upgrade actions are converted into structured action sequences. The structured action sequences are serialized representations arranged in the order of predefined fields, including action type field, action content field, and execution command field. The structured action sequence adopts an encoding format that can be processed by the sequence generation model, so that the version evolution model can generate the corresponding structured action sequence based on the upgrade instructions and the target code context; During the version evolution model inference phase, the structured action sequence output by the model is parsed and restored into the standard upgrade action structure.

8. An AI-based remote self-evolutionary upgrade system, characterized in that, The steps of the AI-based remote self-evolution upgrade method according to any one of claims 1 to 7 are implemented.